diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
commit | 013be331bc10706807599a452a143f4744398e9f (patch) | |
tree | 793787ab8615d768ba51341dfd934a5fb3039728 /lib/libarchive/archive_write_set_compression_gzip.c | |
parent | c611006e893ac2bf962cabe02743954e3b3c3314 (diff) | |
download | FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.zip FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.tar.gz |
libarchive 2.2.3
* "compression_program" support uses an external program
* Portability: no longer uses "struct stat" as a primary
data interchange structure internally
* Part of the above: refactor archive_entry to separate
out copy_stat() and stat() functions
* More complete tests for archive_entry
* Finish archive_entry_clone()
* Isolate major()/minor()/makedev() in archive_entry; remove
these from everywhere else.
* Bug fix: properly handle decompression look-ahead at end-of-data
* Bug fixes to 'ar' support
* Fix memory leak in ZIP reader
* Portability: better timegm() emulation in iso9660 reader
* New write_disk flags to suppress auto dir creation and not
overwrite newer files (for future cpio front-end)
* Simplify trailing-'/' fixup when writing tar and pax
* Test enhancements: fix various compiler warnings, improve
portability, add lots of new tests.
* Documentation: document new functions, first draft of
libarchive_internals.3
MFC after: 14 days
Thanks to: Joerg Sonnenberger (compression_program)
Thanks to: Kai Wang (ar)
Thanks to: Colin Percival (many small fixes)
Thanks to: Many others who sent me various patches and problem reports.
Diffstat (limited to 'lib/libarchive/archive_write_set_compression_gzip.c')
-rw-r--r-- | lib/libarchive/archive_write_set_compression_gzip.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/libarchive/archive_write_set_compression_gzip.c b/lib/libarchive/archive_write_set_compression_gzip.c index 38742f3..8c6d427 100644 --- a/lib/libarchive/archive_write_set_compression_gzip.c +++ b/lib/libarchive/archive_write_set_compression_gzip.c @@ -81,7 +81,7 @@ archive_write_set_compression_gzip(struct archive *_a) struct archive_write *a = (struct archive_write *)_a; __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, "archive_write_set_compression_gzip"); - a->compression_init = &archive_compressor_gzip_init; + a->compressor.init = &archive_compressor_gzip_init; a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP; a->archive.compression_name = "gzip"; return (ARCHIVE_OK); @@ -143,8 +143,8 @@ archive_compressor_gzip_init(struct archive_write *a) state->stream.next_out += 10; state->stream.avail_out -= 10; - a->compression_write = archive_compressor_gzip_write; - a->compression_finish = archive_compressor_gzip_finish; + a->compressor.write = archive_compressor_gzip_write; + a->compressor.finish = archive_compressor_gzip_finish; /* Initialize compression library. */ ret = deflateInit2(&(state->stream), @@ -155,7 +155,7 @@ archive_compressor_gzip_init(struct archive_write *a) Z_DEFAULT_STRATEGY); if (ret == Z_OK) { - a->compression_data = state; + a->compressor.data = state; return (0); } @@ -196,7 +196,7 @@ archive_compressor_gzip_write(struct archive_write *a, const void *buff, struct private_data *state; int ret; - state = (struct private_data *)a->compression_data; + state = (struct private_data *)a->compressor.data; if (a->client_writer == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, "No write callback is registered? " @@ -231,7 +231,7 @@ archive_compressor_gzip_finish(struct archive_write *a) unsigned tocopy; unsigned char trailer[8]; - state = (struct private_data *)a->compression_data; + state = (struct private_data *)a->compressor.data; ret = 0; if (a->client_writer == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, @@ -340,11 +340,6 @@ cleanup: } free(state->compressed); free(state); - - /* Close the output */ - if (a->client_closer != NULL) - (a->client_closer)(&a->archive, a->client_data); - return (ret); } |