diff options
Diffstat (limited to 'src/liblzma/lz')
-rw-r--r-- | src/liblzma/lz/lz_encoder.c | 17 | ||||
-rw-r--r-- | src/liblzma/lz/lz_encoder.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c index 0e7b7d1d..bf6327d8 100644 --- a/src/liblzma/lz/lz_encoder.c +++ b/src/liblzma/lz/lz_encoder.c @@ -475,6 +475,22 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator) } +static lzma_ret +lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator, + const lzma_filter *filters_null lzma_attribute((unused)), + const lzma_filter *reversed_filters) +{ + if (coder->lz.options_update == NULL) + return LZMA_PROG_ERROR; + + return_if_error(coder->lz.options_update( + coder->lz.coder, reversed_filters)); + + return lzma_next_filter_update( + &coder->next, allocator, reversed_filters + 1); +} + + extern lzma_ret lzma_lz_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, const lzma_filter_info *filters, @@ -495,6 +511,7 @@ lzma_lz_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, next->code = &lz_encode; next->end = &lz_encoder_end; + next->update = &lz_encoder_update; next->coder->lz.coder = NULL; next->coder->lz.code = NULL; 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; |