diff options
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); } |