]> icculus.org git repositories - icculus/xz.git/commit
Fix a design error in liblzma API.
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 14 Nov 2009 16:59:19 +0000 (18:59 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Sat, 14 Nov 2009 16:59:19 +0000 (18:59 +0200)
commit418d64a32e8144210f98a810738fed5a897e8367
treee3dce06dfd250fd659d922aaed914f6cc93cd2c8
parentf0bf7634b77263a4dd02b20c71861ab67995da68
Fix a design error in liblzma API.

Originally the idea was that using LZMA_FULL_FLUSH
with Stream encoder would read the filter chain
from the same array that was used to intialize the
Stream encoder. Since most apps wouldn't use
LZMA_FULL_FLUSH, most apps wouldn't need to keep
the filter chain available after initializing the
Stream encoder. However, due to my mistake, it
actually required keeping the array always available.

Since setting the new filter chain via the array
used at initialization time is not a nice way to do
it for a couple of reasons, this commit ditches it
and introduces lzma_filters_update(). This new function
replaces also the "persistent" flag used by LZMA2
(and to-be-designed Subblock filter), which was also
an ugly thing to do.

Thanks to Alexey Tourbin for reminding me about the problem
that Stream encoder used to require keeping the filter
chain allocated.
20 files changed:
src/liblzma/api/lzma/filter.h
src/liblzma/api/lzma/lzma.h
src/liblzma/common/block_encoder.c
src/liblzma/common/common.c
src/liblzma/common/common.h
src/liblzma/common/easy_encoder.c
src/liblzma/common/filter_common.c
src/liblzma/common/filter_encoder.c
src/liblzma/common/filter_encoder.h
src/liblzma/common/stream_encoder.c
src/liblzma/delta/delta_common.c
src/liblzma/delta/delta_decoder.c
src/liblzma/delta/delta_encoder.c
src/liblzma/delta/delta_private.h
src/liblzma/lz/lz_encoder.c
src/liblzma/lz/lz_encoder.h
src/liblzma/lzma/lzma2_encoder.c
src/liblzma/lzma/lzma_encoder_presets.c
src/liblzma/simple/simple_coder.c
src/xz/options.c