diff options
Diffstat (limited to 'lib/libarchive/archive_read.c')
-rw-r--r-- | lib/libarchive/archive_read.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c index 8ef839a..1028c5d 100644 --- a/lib/libarchive/archive_read.c +++ b/lib/libarchive/archive_read.c @@ -741,3 +741,14 @@ __archive_read_register_compression(struct archive_read *a, __archive_errx(1, "Not enough slots for compression registration"); return (NULL); /* Never actually executed. */ } + +/* used internally to simplify read-ahead */ +const void * +__archive_read_ahead(struct archive_read *a, size_t len) +{ + const void *h; + + if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len) + return (NULL); + return (h); +} |