From f81da3e58463558f4efc2a76aac410e9fc03c096 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 3 Mar 2007 07:37:37 +0000 Subject: libarchive 2.0 * libarchive_test program exercises many of the core features * Refactored old "read_extract" into new "archive_write_disk", which uses archive_write methods to put entries onto disk. In particular, you can now use archive_write_disk to create objects on disk without having an archive available. * Pushed some security checks from bsdtar down into libarchive, where they can be better optimized. * Rearchitected the logic for creating objects on disk to reduce the number of system calls. Several common cases now use a minimum number of system calls. * Virtualized some internal interfaces to provide a clearer separation of read and write handling and make it simpler to override key methods. * New "empty" format reader. * Corrected return types (this ABI breakage required the "2.0" version bump) * Many bug fixes. --- lib/libarchive/archive_read_support_format_empty.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/libarchive/archive_read_support_format_empty.c') diff --git a/lib/libarchive/archive_read_support_format_empty.c b/lib/libarchive/archive_read_support_format_empty.c index 2df219467f392..f729ae6eb4ad2 100644 --- a/lib/libarchive/archive_read_support_format_empty.c +++ b/lib/libarchive/archive_read_support_format_empty.c @@ -29,15 +29,17 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_entry.h" #include "archive_private.h" +#include "archive_read_private.h" -static int archive_read_format_empty_bid(struct archive *); -static int archive_read_format_empty_read_data(struct archive *, +static int archive_read_format_empty_bid(struct archive_read *); +static int archive_read_format_empty_read_data(struct archive_read *, const void **, size_t *, off_t *); -static int archive_read_format_empty_read_header(struct archive *, +static int archive_read_format_empty_read_header(struct archive_read *, struct archive_entry *); int -archive_read_support_format_empty(struct archive *a) +archive_read_support_format_empty(struct archive *_a) { + struct archive_read *a = (struct archive_read *)_a; int r; r = __archive_read_register_format(a, @@ -53,7 +55,7 @@ archive_read_support_format_empty(struct archive *a) static int -archive_read_format_empty_bid(struct archive *a) +archive_read_format_empty_bid(struct archive_read *a) { int bytes_read; const void *h; @@ -65,20 +67,20 @@ archive_read_format_empty_bid(struct archive *a) } static int -archive_read_format_empty_read_header(struct archive *a, +archive_read_format_empty_read_header(struct archive_read *a, struct archive_entry *entry) { (void)a; /* UNUSED */ (void)entry; /* UNUSED */ - a->archive_format = ARCHIVE_FORMAT_EMPTY; - a->archive_format_name = "Empty file"; + a->archive.archive_format = ARCHIVE_FORMAT_EMPTY; + a->archive.archive_format_name = "Empty file"; return (ARCHIVE_EOF); } static int -archive_read_format_empty_read_data(struct archive *a, +archive_read_format_empty_read_data(struct archive_read *a, const void **buff, size_t *size, off_t *offset) { (void)a; /* UNUSED */ -- cgit v1.3