diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2009-11-14 18:59:19 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2009-11-14 18:59:19 +0200 |
commit | 418d64a32e8144210f98a810738fed5a897e8367 (patch) | |
tree | e3dce06dfd250fd659d922aaed914f6cc93cd2c8 /src/liblzma/lz/lz_encoder.h | |
parent | Fix wrong function name in the previous commit. (diff) | |
download | xz-418d64a32e8144210f98a810738fed5a897e8367.tar.xz |
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.
Diffstat (limited to 'src/liblzma/lz/lz_encoder.h')
-rw-r--r-- | src/liblzma/lz/lz_encoder.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liblzma/lz/lz_encoder.h b/src/liblzma/lz/lz_encoder.h index e7d3f875..401185ef 100644 --- a/src/liblzma/lz/lz_encoder.h +++ b/src/liblzma/lz/lz_encoder.h @@ -201,6 +201,10 @@ typedef struct { /// Free allocated resources void (*end)(lzma_coder *coder, lzma_allocator *allocator); + /// Update the options in the middle of the encoding. + lzma_ret (*options_update)(lzma_coder *coder, + const lzma_filter *filter); + } lzma_lz_encoder; |