lzma2_encoder.c | lzma2_encoder.c | |||
---|---|---|---|---|
skipping to change at line 260 | skipping to change at line 260 | |||
return LZMA_OK; | return LZMA_OK; | |||
coder->sequence = SEQ_INIT; | coder->sequence = SEQ_INIT; | |||
break; | break; | |||
} | } | |||
return LZMA_OK; | return LZMA_OK; | |||
} | } | |||
static void | static void | |||
lzma2_encoder_end(lzma_coder *coder, lzma_allocator *allocator) | lzma2_encoder_end(lzma_coder *coder, const lzma_allocator *allocator) | |||
{ | { | |||
lzma_free(coder->lzma, allocator); | lzma_free(coder->lzma, allocator); | |||
lzma_free(coder, allocator); | lzma_free(coder, allocator); | |||
return; | return; | |||
} | } | |||
static lzma_ret | static lzma_ret | |||
lzma2_encoder_options_update(lzma_coder *coder, const lzma_filter *filter) | lzma2_encoder_options_update(lzma_coder *coder, const lzma_filter *filter) | |||
{ | { | |||
// New options can be set only when there is no incomplete chunk. | // New options can be set only when there is no incomplete chunk. | |||
skipping to change at line 300 | skipping to change at line 300 | |||
coder->opt_cur.lp = opt->lp; | coder->opt_cur.lp = opt->lp; | |||
coder->opt_cur.pb = opt->pb; | coder->opt_cur.pb = opt->pb; | |||
coder->need_properties = true; | coder->need_properties = true; | |||
coder->need_state_reset = true; | coder->need_state_reset = true; | |||
} | } | |||
return LZMA_OK; | return LZMA_OK; | |||
} | } | |||
static lzma_ret | static lzma_ret | |||
lzma2_encoder_init(lzma_lz_encoder *lz, lzma_allocator *allocator, | lzma2_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator, | |||
const void *options, lzma_lz_options *lz_options) | const void *options, lzma_lz_options *lz_options) | |||
{ | { | |||
if (options == NULL) | if (options == NULL) | |||
return LZMA_PROG_ERROR; | return LZMA_PROG_ERROR; | |||
if (lz->coder == NULL) { | if (lz->coder == NULL) { | |||
lz->coder = lzma_alloc(sizeof(lzma_coder), allocator); | lz->coder = lzma_alloc(sizeof(lzma_coder), allocator); | |||
if (lz->coder == NULL) | if (lz->coder == NULL) | |||
return LZMA_MEM_ERROR; | return LZMA_MEM_ERROR; | |||
skipping to change at line 344 | skipping to change at line 344 | |||
// size, so we need to have at least LZMA2_COMPRESSED_MAX bytes | // size, so we need to have at least LZMA2_COMPRESSED_MAX bytes | |||
// history available. | // history available. | |||
if (lz_options->before_size + lz_options->dict_size < LZMA2_CHUNK_MA X) | if (lz_options->before_size + lz_options->dict_size < LZMA2_CHUNK_MA X) | |||
lz_options->before_size | lz_options->before_size | |||
= LZMA2_CHUNK_MAX - lz_options->dict_size; | = LZMA2_CHUNK_MAX - lz_options->dict_size; | |||
return LZMA_OK; | return LZMA_OK; | |||
} | } | |||
extern lzma_ret | extern lzma_ret | |||
lzma_lzma2_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, | lzma_lzma2_encoder_init(lzma_next_coder *next, const lzma_allocator *alloca tor, | |||
const lzma_filter_info *filters) | const lzma_filter_info *filters) | |||
{ | { | |||
return lzma_lz_encoder_init( | return lzma_lz_encoder_init( | |||
next, allocator, filters, &lzma2_encoder_init); | next, allocator, filters, &lzma2_encoder_init); | |||
} | } | |||
extern uint64_t | extern uint64_t | |||
lzma_lzma2_encoder_memusage(const void *options) | lzma_lzma2_encoder_memusage(const void *options) | |||
{ | { | |||
const uint64_t lzma_mem = lzma_lzma_encoder_memusage(options); | const uint64_t lzma_mem = lzma_lzma_encoder_memusage(options); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |