diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-06-18 18:02:10 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-06-18 18:02:10 +0300 |
commit | 7d17818cec8597f847b0a2537fde991bbc3d9e96 (patch) | |
tree | 9c41502e3eb96f103fe98e13456b382fbba7a292 /debug | |
parent | Update the file format specification draft. The new one is (diff) | |
download | xz-7d17818cec8597f847b0a2537fde991bbc3d9e96.tar.xz |
Update the code to mostly match the new simpler file format
specification. Simplify things by removing most of the
support for known uncompressed size in most places.
There are some miscellaneous changes here and there too.
The API of liblzma has got many changes and still some
more will be done soon. While most of the code has been
updated, some things are not fixed (the command line tool
will choke with invalid filter chain, if nothing else).
Subblock filter is somewhat broken for now. It will be
updated once the encoded format of the Subblock filter
has been decided.
Diffstat (limited to 'debug')
-rw-r--r-- | debug/full_flush.c | 16 | ||||
-rw-r--r-- | debug/sync_flush.c | 15 |
2 files changed, 10 insertions, 21 deletions
diff --git a/debug/full_flush.c b/debug/full_flush.c index 697b4bb1..fd775ce3 100644 --- a/debug/full_flush.c +++ b/debug/full_flush.c @@ -73,19 +73,13 @@ main(int argc, char **argv) file_in = argc > 1 ? fopen(argv[1], "rb") : stdin; // Config - lzma_options_stream opt_stream = { - .check = LZMA_CHECK_CRC32, - .has_crc32 = true, - .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN, - .alignment = 0, - }; - opt_stream.filters[0].id = LZMA_VLI_VALUE_UNKNOWN; - opt_stream.metadata_filters[0].id = LZMA_VLI_VALUE_UNKNOWN; - opt_stream.header = NULL; - opt_stream.footer = NULL; + lzma_options_filter filters[LZMA_BLOCK_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_SUBBLOCK; + filters[0].options = NULL; + filters[1].id = LZMA_VLI_VALUE_UNKNOWN; // Init - if (lzma_stream_encoder_multi(&strm, &opt_stream) != LZMA_OK) { + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) { fprintf(stderr, "init failed\n"); exit(1); } diff --git a/debug/sync_flush.c b/debug/sync_flush.c index de54e883..03dfdd7d 100644 --- a/debug/sync_flush.c +++ b/debug/sync_flush.c @@ -101,18 +101,13 @@ main(int argc, char **argv) opt_subblock.subfilter_options.id = LZMA_FILTER_DELTA; opt_subblock.subfilter_options.options = &opt_delta; - lzma_options_stream opt_stream = { - .check = LZMA_CHECK_NONE, - .has_crc32 = false, - .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN, - .alignment = 0, - }; - opt_stream.filters[0].id = LZMA_FILTER_SUBBLOCK; - opt_stream.filters[0].options = &opt_subblock; - opt_stream.filters[1].id = LZMA_VLI_VALUE_UNKNOWN; + lzma_options_filter filters[LZMA_BLOCK_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_LZMA; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_VALUE_UNKNOWN; // Init - if (lzma_stream_encoder_single(&strm, &opt_stream) != LZMA_OK) { + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_NONE) != LZMA_OK) { fprintf(stderr, "init failed\n"); exit(1); } |