diff options
author | Tim Kientzle <kientzle@gmail.com> | 2010-02-20 00:53:11 -0500 |
---|---|---|
committer | Tim Kientzle <kientzle@gmail.com> | 2010-02-20 00:53:11 -0500 |
commit | 911dc2bff3dc37fa499c17379dcf35f352f88c0b (patch) | |
tree | be38d9958879cea30c63edc440c6e31e826c6625 /libarchive/archive_virtual.c | |
parent | 8f43f6931172a59c0e25647b35503a99d6f26fde (diff) | |
download | libarchive-911dc2bff3dc37fa499c17379dcf35f352f88c0b.tar.gz |
Stackable write filter support. This ended up touching an awful lot
of files. But, the old API is supported almost entirely unchanged, which
I wasn't certain would be possible.
Big changes:
* You can add more than one write filter by using
archive_write_add_filter_{bzip2,compress,gzip,lzma,xz}.
This will be more interesting when we have uuencode, RPM, encryption.
* The old archive_write_set_compression_XXXX are shorthands for
"remove all the current filters and add this one." They're
deprecated and scheduled to be removed in libarchive 4.0.
* The internal API and life cycle for write filters has been
rationalized: create, set options, open, write, close, free.
* New utility functions provide information about each filter
when there's more than one: code, name, and number of bytes processed
* Old archive_bytes_compressed(), etc, are implemented in terms of
the more generic new functions.
* The read side was generalized to also support the new utility
functions.
In particular, the write filters are much simpler since each
one doesn't have to deal with blocking. In this version, there's
still a "write_add_filter_none" that handles blocking, but I
think I'll soon fold that down into the client wrapper and
add_filter_none will become a no-op. I think this also gets
us a big step closer to multi-volume support on the write side.
SVN-Revision: 1920
Diffstat (limited to 'libarchive/archive_virtual.c')
-rw-r--r-- | libarchive/archive_virtual.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libarchive/archive_virtual.c b/libarchive/archive_virtual.c index 83688627..db50a244 100644 --- a/libarchive/archive_virtual.c +++ b/libarchive/archive_virtual.c @@ -31,6 +31,30 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_virtual.c 201098 2009-12-28 02:5 #include "archive_private.h" int +archive_filter_code(struct archive *a, int n) +{ + return ((a->vtable->archive_filter_code)(a, n)); +} + +int +archive_filter_count(struct archive *a) +{ + return ((a->vtable->archive_filter_count)(a)); +} + +const char * +archive_filter_name(struct archive *a, int n) +{ + return ((a->vtable->archive_filter_name)(a, n)); +} + +int64_t +archive_filter_bytes(struct archive *a, int n) +{ + return ((a->vtable->archive_filter_bytes)(a, n)); +} + +int archive_write_close(struct archive *a) { return ((a->vtable->archive_close)(a)); |