]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Rip out the rest of the legacy 1.x API.
authorTim Kientzle <kientzle@gmail.com>
Mon, 8 Feb 2010 02:45:06 +0000 (21:45 -0500)
committerTim Kientzle <kientzle@gmail.com>
Mon, 8 Feb 2010 02:45:06 +0000 (21:45 -0500)
SVN-Revision: 1890

libarchive/archive_read.3
libarchive/archive_read.c
libarchive/archive_read_extract.c
libarchive/archive_read_open_fd.c
libarchive/archive_read_open_file.c
libarchive/archive_read_open_filename.c
libarchive/archive_read_open_memory.c
libarchive/archive_virtual.c

index 43f3c76327ab1489c5a0f0a111e1d5dd4b5607e8..742bebfab7f6b1126716f4b41059e5d95f91b887 100644 (file)
@@ -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"
index f39f5cec29df978ae7edca46c5bcad423b1aaeba..abb419eea5c7fd02a6f0f532c4993534a0093593 100644 (file)
@@ -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;
index e1027995ec0cf12f4816c312add0a63918a4bf60..c2f40c54a5dad9d3062228d6eb71f42e2616615c 100644 (file)
@@ -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);
index 33b7cba1b9b5ce534cbd0baa8f053cb4df96acb8..6ebeb71f0d3f070ac37793c0296dfcbbda9a0ba0 100644 (file)
@@ -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;
index 095ae6eb5ce0ee3a69f81e44e1670efe73d95dcb..a0b519b87c1ce040e648782a3f5cf1c66a25ed95 100644 (file)
@@ -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;
 
index 607b80c56c7e76a761a2bc57592046ae2d33fe02..943d7799c8f85864edf9fd31bc88c1acf2318f41 100644 (file)
@@ -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;
index 61f574fa7705e5275c879ec754759978763845f9..b52d9be53df6980b1fa9843c20c49f8688de4a9a 100644 (file)
@@ -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;
 
index a5c0b39b9cc136d6fe402ed884d16edd7a3dbcaf..0bd2d5bc706ccba9a725b7d06d92e4dfd15218ff 100644 (file)
@@ -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));