summaryrefslogtreecommitdiff
path: root/libarchive/archive_util.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2010-02-20 00:53:11 -0500
committerTim Kientzle <kientzle@gmail.com>2010-02-20 00:53:11 -0500
commit911dc2bff3dc37fa499c17379dcf35f352f88c0b (patch)
treebe38d9958879cea30c63edc440c6e31e826c6625 /libarchive/archive_util.c
parent8f43f6931172a59c0e25647b35503a99d6f26fde (diff)
downloadlibarchive-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_util.c')
-rw-r--r--libarchive/archive_util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
index d00e0b6e..4cf4de6f 100644
--- a/libarchive/archive_util.c
+++ b/libarchive/archive_util.c
@@ -128,13 +128,13 @@ archive_format_name(struct archive *a)
int
archive_compression(struct archive *a)
{
- return (a->compression_code);
+ return archive_filter_code(a, 0);
}
const char *
archive_compression_name(struct archive *a)
{
- return (a->compression_name);
+ return archive_filter_name(a, 0);
}
@@ -144,7 +144,7 @@ archive_compression_name(struct archive *a)
int64_t
archive_position_compressed(struct archive *a)
{
- return (a->raw_position);
+ return archive_filter_bytes(a, -1);
}
/*
@@ -153,7 +153,7 @@ archive_position_compressed(struct archive *a)
int64_t
archive_position_uncompressed(struct archive *a)
{
- return (a->file_position);
+ return archive_filter_bytes(a, 0);
}
void