summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_read_private.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-26 20:08:54 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-31 12:19:13 (GMT)
commit102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6 (patch)
treedb05ed527f04506957049a7b087be6c038d98435 /Utilities/cmlibarchive/libarchive/archive_read_private.h
parent87402c995ed2460deb2f39e02acf77a0bb57f263 (diff)
parent35df7c8ba8854e97bd6994c4d1143f57535ed6f2 (diff)
downloadCMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.zip
CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.gz
CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.bz2
Merge branch 'libarchive-upstream' into update-libarchive
Conflicts: Utilities/cmlibarchive/CMakeLists.txt Utilities/cmlibarchive/libarchive/archive.h Utilities/cmlibarchive/libarchive/archive_entry.h Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c Utilities/cmlibarchive/libarchive/archive_windows.h Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_read_private.h')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_private.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_private.h b/Utilities/cmlibarchive/libarchive/archive_read_private.h
index 76d0b91..8a6c859 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_private.h
+++ b/Utilities/cmlibarchive/libarchive/archive_read_private.h
@@ -58,6 +58,8 @@ struct archive_read_filter;
struct archive_read_filter_bidder {
/* Configuration data for the bidder. */
void *data;
+ /* Name of the filter */
+ const char *name;
/* Taste the upstream filter to see if we handle this. */
int (*bid)(struct archive_read_filter_bidder *,
struct archive_read_filter *);
@@ -82,6 +84,8 @@ struct archive_read_filter {
struct archive_read_filter_bidder *bidder; /* My bidder. */
struct archive_read_filter *upstream; /* Who I read from. */
struct archive_read *archive; /* Associated archive. */
+ /* Open a block for reading */
+ int (*open)(struct archive_read_filter *self);
/* Return next block. */
ssize_t (*read)(struct archive_read_filter *, const void **);
/* Skip forward this many bytes. */
@@ -90,6 +94,8 @@ struct archive_read_filter {
int64_t (*seek)(struct archive_read_filter *self, int64_t offset, int whence);
/* Close (just this filter) and free(self). */
int (*close)(struct archive_read_filter *self);
+ /* Function that handles switching from reading one block to the next/prev */
+ int (*sswitch)(struct archive_read_filter *self, unsigned int iindex);
/* My private data. */
void *data;
@@ -118,13 +124,22 @@ struct archive_read_filter {
* transformation filters. This will probably break the API/ABI and
* so should be deferred at least until libarchive 3.0.
*/
+struct archive_read_data_node {
+ int64_t begin_position;
+ int64_t total_size;
+ void *data;
+};
struct archive_read_client {
archive_open_callback *opener;
archive_read_callback *reader;
archive_skip_callback *skipper;
archive_seek_callback *seeker;
archive_close_callback *closer;
- void *data;
+ archive_switch_callback *switcher;
+ unsigned int nodes;
+ unsigned int cursor;
+ int64_t position;
+ struct archive_read_data_node *dataset;
};
struct archive_read {
@@ -134,8 +149,8 @@ struct archive_read {
/* Dev/ino of the archive being read/written. */
int skip_file_set;
- dev_t skip_file_dev;
- ino_t skip_file_ino;
+ int64_t skip_file_dev;
+ int64_t skip_file_ino;
/*
* Used by archive_read_data() to track blocks and copy
@@ -146,18 +161,33 @@ struct archive_read {
int64_t read_data_output_offset;
size_t read_data_remaining;
- /* Callbacks to open/read/write/close client archive stream. */
+ /*
+ * Used by formats/filters to determine the amount of data
+ * requested from a call to archive_read_data(). This is only
+ * useful when the format/filter has seek support.
+ */
+ char read_data_is_posix_read;
+ size_t read_data_requested;
+
+ /* Callbacks to open/read/write/close client archive streams. */
struct archive_read_client client;
/* Registered filter bidders. */
- struct archive_read_filter_bidder bidders[9];
+ struct archive_read_filter_bidder bidders[14];
/* Last filter in chain */
struct archive_read_filter *filter;
+ /* Whether to bypass filter bidding process */
+ int bypass_filter_bidding;
+
/* File offset of beginning of most recently-read header. */
int64_t header_position;
+ /* Nodes and offsets of compressed data block */
+ unsigned int data_start_node;
+ unsigned int data_end_node;
+
/*
* Format detection is mostly the same as compression
* detection, with one significant difference: The bidders
@@ -175,6 +205,7 @@ struct archive_read {
int (*read_header)(struct archive_read *, struct archive_entry *);
int (*read_data)(struct archive_read *, const void **, size_t *, int64_t *);
int (*read_data_skip)(struct archive_read *);
+ int64_t (*seek_data)(struct archive_read *, int64_t, int);
int (*cleanup)(struct archive_read *);
} formats[16];
struct archive_format_descriptor *format; /* Active format. */
@@ -194,6 +225,7 @@ int __archive_read_register_format(struct archive_read *a,
int (*read_header)(struct archive_read *, struct archive_entry *),
int (*read_data)(struct archive_read *, const void **, size_t *, int64_t *),
int (*read_data_skip)(struct archive_read *),
+ int64_t (*seek_data)(struct archive_read *, int64_t, int),
int (*cleanup)(struct archive_read *));
int __archive_read_get_bidder(struct archive_read *a,
@@ -207,4 +239,6 @@ int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int);
int64_t __archive_read_consume(struct archive_read *, int64_t);
int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t);
int __archive_read_program(struct archive_read_filter *, const char *);
+void __archive_read_free_filters(struct archive_read *);
+int __archive_read_close_filters(struct archive_read *);
#endif