summaryrefslogtreecommitdiff
path: root/src/apk_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk_io.h')
-rw-r--r--src/apk_io.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index e943a8c..fb784c3 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -74,6 +74,8 @@ struct apk_istream {
const struct apk_istream_ops *ops;
};
+#define APK_IO_ALL ((size_t)-1)
+
struct apk_istream *apk_istream_from_file(int atfd, const char *file);
struct apk_istream *apk_istream_from_file_gz(int atfd, const char *file);
struct apk_istream *apk_istream_from_fd(int fd);
@@ -81,12 +83,13 @@ struct apk_istream *apk_istream_from_fd_url_if_modified(int atfd, const char *ur
struct apk_istream *apk_istream_from_url_gz(const char *url);
ssize_t apk_istream_read(struct apk_istream *is, void *ptr, size_t size);
apk_blob_t apk_istream_get(struct apk_istream *is, size_t len);
-apk_blob_t apk_istream_get_all(struct apk_istream *is);
+apk_blob_t apk_istream_get_max(struct apk_istream *is, size_t size);
apk_blob_t apk_istream_get_delim(struct apk_istream *is, apk_blob_t token);
-
-#define APK_SPLICE_ALL 0xffffffff
+static inline apk_blob_t apk_istream_get_all(struct apk_istream *is) { return apk_istream_get_max(is, APK_IO_ALL); }
ssize_t apk_istream_splice(struct apk_istream *is, int fd, size_t size,
apk_progress_cb cb, void *cb_ctx);
+ssize_t apk_stream_copy(struct apk_istream *is, struct apk_ostream *os, size_t size,
+ apk_progress_cb cb, void *cb_ctx, EVP_MD_CTX *mdctx);
static inline struct apk_istream *apk_istream_from_url(const char *url)
{