summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive.h.in
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-06-02 08:14:43 +0000
committerkientzle <kientzle@FreeBSD.org>2004-06-02 08:14:43 +0000
commitd5f7a83e1b2d795a41b6ee882323609891e65aeb (patch)
treeff12dd5c58d3d34186f2f2fd2f6c027221d2ebd8 /lib/libarchive/archive.h.in
parent80d36400edd04b536fd6cab0dae30c9e678e6598 (diff)
downloadFreeBSD-src-d5f7a83e1b2d795a41b6ee882323609891e65aeb.zip
FreeBSD-src-d5f7a83e1b2d795a41b6ee882323609891e65aeb.tar.gz
Refactor read_data:
* New read_data_block is both sparse-file aware and uses zero-copy semantics * Push read_data_block down into specific formats (opens door to various encoded entry bodies, such as zip or gtar -S) * Reimplement read_data, read_data_skip, read_data_into_fd in terms of new read_data_block. * Update documentation It's unfortunate that I couldn't just call the new interface archive_read_data, but didn't want to upset the API that much.
Diffstat (limited to 'lib/libarchive/archive.h.in')
-rw-r--r--lib/libarchive/archive.h.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in
index 4fc70cf..fed02c0 100644
--- a/lib/libarchive/archive.h.in
+++ b/lib/libarchive/archive.h.in
@@ -166,6 +166,14 @@ int64_t archive_read_header_position(struct archive *);
/* Read data from the body of an entry. Similar to read(2). */
ssize_t archive_read_data(struct archive *, void *, size_t);
+/*
+ * A zero-copy version of archive_read_data that also exposes the file offset
+ * of each returned block. Note that the client has no way to specify
+ * the desired size of the block. The API does gaurantee that offsets will
+ * be strictly increasing and that returned blocks will not overlap.
+ */
+int archive_read_data_block(struct archive *a,
+ const void **buff, size_t *size, off_t *offset);
/*-
* Some convenience functions that are built on archive_read_data:
OpenPOWER on IntegriCloud