aboutsummaryrefslogtreecommitdiff
path: root/src/lzma/process.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-06-18 18:02:10 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-06-18 18:02:10 +0300
commit7d17818cec8597f847b0a2537fde991bbc3d9e96 (patch)
tree9c41502e3eb96f103fe98e13456b382fbba7a292 /src/lzma/process.c
parentUpdate the file format specification draft. The new one is (diff)
downloadxz-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 'src/lzma/process.c')
-rw-r--r--src/lzma/process.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/lzma/process.c b/src/lzma/process.c
index 56bcda9a..c180caf7 100644
--- a/src/lzma/process.c
+++ b/src/lzma/process.c
@@ -160,32 +160,16 @@ single_init(thread_data *t)
lzma_ret ret;
if (opt_mode == MODE_COMPRESS) {
- const lzma_vli uncompressed_size
- = t->pair->src_fd != STDIN_FILENO
- ? (lzma_vli)(t->pair->src_st.st_size)
- : LZMA_VLI_VALUE_UNKNOWN;
-
- // TODO Support Multi-Block Streams to store Extra.
if (opt_header == HEADER_ALONE) {
- lzma_options_alone alone;
- alone.uncompressed_size = uncompressed_size;
- memcpy(&alone.lzma, opt_filters[0].options,
- sizeof(alone.lzma));
- ret = lzma_alone_encoder(&t->strm, &alone);
+ ret = lzma_alone_encoder(&t->strm,
+ opt_filters[0].options);
} else {
- lzma_options_stream stream = {
- .check = opt_check,
- .has_crc32 = opt_check != LZMA_CHECK_NONE,
- .uncompressed_size = uncompressed_size,
- .alignment = 0,
- };
- memcpy(stream.filters, opt_filters,
- sizeof(stream.filters));
- ret = lzma_stream_encoder_single(&t->strm, &stream);
+ ret = lzma_stream_encoder(&t->strm,
+ opt_filters, opt_check);
}
} else {
// TODO Restrict file format if requested on the command line.
- ret = lzma_auto_decoder(&t->strm, NULL, NULL);
+ ret = lzma_auto_decoder(&t->strm);
}
if (ret != LZMA_OK) {