aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/auto_decoder.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/liblzma/common/auto_decoder.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/liblzma/common/auto_decoder.c')
-rw-r--r--src/liblzma/common/auto_decoder.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/liblzma/common/auto_decoder.c b/src/liblzma/common/auto_decoder.c
index 7e92df9a..765a27b1 100644
--- a/src/liblzma/common/auto_decoder.c
+++ b/src/liblzma/common/auto_decoder.c
@@ -17,15 +17,12 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include "common.h"
+#include "stream_decoder.h"
#include "alone_decoder.h"
struct lzma_coder_s {
lzma_next_coder next;
-
- lzma_extra **header;
- lzma_extra **footer;
bool initialized;
};
@@ -43,8 +40,8 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator,
lzma_ret ret;
if (in[*in_pos] == 0xFF)
- ret = lzma_stream_decoder_init(&coder->next, allocator,
- coder->header, coder->footer);
+ ret = lzma_stream_decoder_init(
+ &coder->next, allocator);
else
ret = lzma_alone_decoder_init(&coder->next, allocator);
@@ -69,8 +66,7 @@ auto_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
-auto_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
- lzma_extra **header, lzma_extra **footer)
+auto_decoder_init(lzma_next_coder *next, lzma_allocator *allocator)
{
if (next->coder == NULL) {
next->coder = lzma_alloc(sizeof(lzma_coder), allocator);
@@ -82,8 +78,6 @@ auto_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->next = LZMA_NEXT_CODER_INIT;
}
- next->coder->header = header;
- next->coder->footer = footer;
next->coder->initialized = false;
return LZMA_OK;
@@ -102,9 +96,9 @@ lzma_auto_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
extern LZMA_API lzma_ret
-lzma_auto_decoder(lzma_stream *strm, lzma_extra **header, lzma_extra **footer)
+lzma_auto_decoder(lzma_stream *strm)
{
- lzma_next_strm_init(strm, auto_decoder_init, header, footer);
+ lzma_next_strm_init0(strm, auto_decoder_init);
strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;