From: Tim Kientzle Date: Mon, 8 Feb 2010 02:45:06 +0000 (-0500) Subject: Rip out the rest of the legacy 1.x API. X-Git-Tag: v3.0.0a~1269 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed4245cb9927b24413b1b96016e6e7635b31ac13;p=thirdparty%2Flibarchive.git Rip out the rest of the legacy 1.x API. SVN-Revision: 1890 --- diff --git a/libarchive/archive_read.3 b/libarchive/archive_read.3 index 43f3c7632..742bebfab 100644 --- a/libarchive/archive_read.3 +++ b/libarchive/archive_read.3 @@ -495,21 +495,12 @@ The callback functions must match the following prototypes: .Fa "const void **buffer" .Fc .It -.\" #if ARCHIVE_API_VERSION < 2 -.Ft typedef int +.Ft typedef off_t .Fo archive_skip_callback .Fa "struct archive *" .Fa "void *client_data" -.Fa "size_t request" +.Fa "off_t request" .Fc -.\" #else -.\" .Ft typedef off_t -.\" .Fo archive_skip_callback -.\" .Fa "struct archive *" -.\" .Fa "void *client_data" -.\" .Fa "off_t request" -.\" .Fc -.\" #endif .It .Ft typedef int .Fn archive_open_callback "struct archive *" "void *client_data" diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index f39f5cec2..abb419eea 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -804,9 +804,7 @@ _archive_read_finish(struct archive *_a) archive_entry_free(a->entry); a->archive.magic = 0; free(a); -#if ARCHIVE_API_VERSION > 1 return (r); -#endif } /* @@ -1209,11 +1207,7 @@ __archive_read_filter_skip(struct archive_read_filter *filter, int64_t request) /* * If a client_skipper was provided, try that first. */ -#if ARCHIVE_API_VERSION < 2 - if ((filter->skip != NULL) && (request < SSIZE_MAX)) { -#else if (filter->skip != NULL) { -#endif bytes_skipped = (filter->skip)(filter, request); if (bytes_skipped < 0) { /* error */ filter->client_total = filter->client_avail = 0; diff --git a/libarchive/archive_read_extract.c b/libarchive/archive_read_extract.c index e1027995e..c2f40c54a 100644 --- a/libarchive/archive_read_extract.c +++ b/libarchive/archive_read_extract.c @@ -172,10 +172,7 @@ archive_read_extract_cleanup(struct archive_read *a) { int ret = ARCHIVE_OK; -#if ARCHIVE_API_VERSION > 1 - ret = -#endif - archive_write_finish(a->extract->ad); + ret = archive_write_finish(a->extract->ad); free(a->extract); a->extract = NULL; return (ret); diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c index 33b7cba1b..6ebeb71f0 100644 --- a/libarchive/archive_read_open_fd.c +++ b/libarchive/archive_read_open_fd.c @@ -59,11 +59,7 @@ struct read_fd_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); -#if ARCHIVE_API_VERSION < 2 -static ssize_t file_skip(struct archive *, void *, size_t request); -#else static off_t file_skip(struct archive *, void *, off_t request); -#endif int archive_read_open_fd(struct archive *a, int fd, size_t block_size) @@ -123,13 +119,8 @@ file_read(struct archive *a, void *client_data, const void **buff) return (bytes_read); } -#if ARCHIVE_API_VERSION < 2 -static ssize_t -file_skip(struct archive *a, void *client_data, size_t request) -#else static off_t file_skip(struct archive *a, void *client_data, off_t request) -#endif { struct read_fd_data *mine = (struct read_fd_data *)client_data; off_t old_offset, new_offset; diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c index 095ae6eb5..a0b519b87 100644 --- a/libarchive/archive_read_open_file.c +++ b/libarchive/archive_read_open_file.c @@ -59,11 +59,7 @@ struct read_FILE_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); -#if ARCHIVE_API_VERSION < 2 -static ssize_t file_skip(struct archive *, void *, size_t request); -#else static off_t file_skip(struct archive *, void *, off_t request); -#endif int archive_read_open_FILE(struct archive *a, FILE *f) @@ -119,13 +115,8 @@ file_read(struct archive *a, void *client_data, const void **buff) return (bytes_read); } -#if ARCHIVE_API_VERSION < 2 -static ssize_t -file_skip(struct archive *a, void *client_data, size_t request) -#else static off_t file_skip(struct archive *a, void *client_data, off_t request) -#endif { struct read_FILE_data *mine = (struct read_FILE_data *)client_data; diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c index 607b80c56..943d7799c 100644 --- a/libarchive/archive_read_open_filename.c +++ b/libarchive/archive_read_open_filename.c @@ -65,11 +65,7 @@ struct read_file_data { static int file_close(struct archive *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); -#if ARCHIVE_API_VERSION < 2 -static ssize_t file_skip(struct archive *, void *, size_t request); -#else static off_t file_skip(struct archive *, void *, off_t request); -#endif int archive_read_open_file(struct archive *a, const char *filename, @@ -171,13 +167,8 @@ file_read(struct archive *a, void *client_data, const void **buff) return (bytes_read); } -#if ARCHIVE_API_VERSION < 2 -static ssize_t -file_skip(struct archive *a, void *client_data, size_t request) -#else static off_t file_skip(struct archive *a, void *client_data, off_t request) -#endif { struct read_file_data *mine = (struct read_file_data *)client_data; off_t old_offset, new_offset; diff --git a/libarchive/archive_read_open_memory.c b/libarchive/archive_read_open_memory.c index 61f574fa7..b52d9be53 100644 --- a/libarchive/archive_read_open_memory.c +++ b/libarchive/archive_read_open_memory.c @@ -48,11 +48,7 @@ struct read_memory_data { static int memory_read_close(struct archive *, void *); static int memory_read_open(struct archive *, void *); -#if ARCHIVE_API_VERSION < 2 -static ssize_t memory_read_skip(struct archive *, void *, size_t request); -#else static off_t memory_read_skip(struct archive *, void *, off_t request); -#endif static ssize_t memory_read(struct archive *, void *, const void **buff); int @@ -123,13 +119,8 @@ memory_read(struct archive *a, void *client_data, const void **buff) * necessary in order to better exercise internal code when used * as a test harness. */ -#if ARCHIVE_API_VERSION < 2 -static ssize_t -memory_read_skip(struct archive *a, void *client_data, size_t skip) -#else static off_t memory_read_skip(struct archive *a, void *client_data, off_t skip) -#endif { struct read_memory_data *mine = (struct read_memory_data *)client_data; diff --git a/libarchive/archive_virtual.c b/libarchive/archive_virtual.c index a5c0b39b9..0bd2d5bc7 100644 --- a/libarchive/archive_virtual.c +++ b/libarchive/archive_virtual.c @@ -42,20 +42,11 @@ archive_read_close(struct archive *a) return ((a->vtable->archive_close)(a)); } -#if ARCHIVE_API_VERSION > 1 int archive_write_finish(struct archive *a) { return ((a->vtable->archive_finish)(a)); } -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ -void -archive_write_finish(struct archive *a) -{ - (void)(a->vtable->archive_finish)(a); -} -#endif int archive_read_finish(struct archive *a) @@ -76,12 +67,7 @@ archive_write_finish_entry(struct archive *a) return ((a->vtable->archive_write_finish_entry)(a)); } -#if ARCHIVE_API_VERSION > 1 ssize_t -#else -/* Temporarily allow library to compile with either 1.x or 2.0 API. */ -int -#endif archive_write_data(struct archive *a, const void *buff, size_t s) { return ((a->vtable->archive_write_data)(a, buff, s));