.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"
archive_entry_free(a->entry);
a->archive.magic = 0;
free(a);
-#if ARCHIVE_API_VERSION > 1
return (r);
-#endif
}
/*
/*
* 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;
{
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);
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)
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;
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)
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;
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,
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;
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
* 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;
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)
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));