19 #if defined(WORDS_BIGENDIAN) && !defined(HAVE_SMALL)
57 const size_t move_size = mf->
write_pos - move_offset;
61 memmove(mf->
buffer, mf->
buffer + move_offset, move_size);
99 &write_pos, coder->
mf.
size);
152 coder->
mf.
skip(&coder->
mf, pending);
302 const bool is_bt = (lz_options->
match_finder & 0x10) != 0;
305 if (hash_bytes == 2) {
359 if (mf->
depth == 0) {
401 #if UINT32_MAX >= SIZE_MAX / 4
513 if (coder->
lz.options_update ==
NULL)
517 coder->
lz.
coder, reversed_filters));
const lzma_allocator const uint8_t size_t uint8_t size_t * out_pos
const lzma_allocator const uint8_t size_t * in_pos
const lzma_allocator const uint8_t size_t in_size
const lzma_allocator * allocator
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
const lzma_filter * filters
void lzma_crc32_init(void)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static const char struct stat static buf struct stat static buf static vhangup int options
static void move_window(lzma_mf *mf)
Moves the data in the input window to free space for new data.
static lzma_ret lz_encoder_update(void *coder_ptr, const lzma_allocator *allocator, const lzma_filter *filters_null lzma_attribute((__unused__)), const lzma_filter *reversed_filters)
static lzma_ret lz_encode(void *coder_ptr, const lzma_allocator *allocator, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size, lzma_action action)
static void lz_encoder_end(void *coder_ptr, const lzma_allocator *allocator)
uint64_t lzma_lz_encoder_memusage(const lzma_lz_options *lz_options)
static bool lz_encoder_init(lzma_mf *mf, const lzma_allocator *allocator, const lzma_lz_options *lz_options)
static bool lz_encoder_prepare(lzma_mf *mf, const lzma_allocator *allocator, const lzma_lz_options *lz_options)
lzma_ret lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters, lzma_ret(*lz_init)(lzma_lz_encoder *lz, const lzma_allocator *allocator, const void *options, lzma_lz_options *lz_options))
static lzma_ret fill_window(lzma_coder *coder, const lzma_allocator *allocator, const uint8_t *in, size_t *in_pos, size_t in_size, lzma_action action)
Tries to fill the input window (mf->buffer)
LZ in window and match finder API.
void lzma_mf_hc4_skip(lzma_mf *dict, uint32_t amount)
uint32_t lzma_mf_hc3_find(lzma_mf *dict, lzma_match *matches)
uint32_t lzma_mf_bt2_find(lzma_mf *dict, lzma_match *matches)
uint32_t lzma_mf_bt3_find(lzma_mf *dict, lzma_match *matches)
uint32_t lzma_mf_bt4_find(lzma_mf *dict, lzma_match *matches)
void lzma_mf_bt2_skip(lzma_mf *dict, uint32_t amount)
void lzma_mf_bt3_skip(lzma_mf *dict, uint32_t amount)
void lzma_mf_hc3_skip(lzma_mf *dict, uint32_t amount)
void lzma_mf_bt4_skip(lzma_mf *dict, uint32_t amount)
uint32_t lzma_mf_hc4_find(lzma_mf *dict, lzma_match *matches)
Hash macros for match finders.
#define LZMA_DICT_SIZE_MIN
lzma_match_finder
Match finders.
@ LZMA_MF_HC4
Hash Chain with 2-, 3-, and 4-byte hashing.
@ LZMA_MF_BT4
Binary Tree with 2-, 3-, and 4-byte hashing.
@ LZMA_MF_HC3
Hash Chain with 2- and 3-byte hashing.
@ LZMA_MF_BT2
Binary Tree with 2-byte hashing.
@ LZMA_MF_BT3
Binary Tree with 2- and 3-byte hashing.
#define lzma_attribute(attr)
Optimized comparison of two buffers.
assert(limit<=UINT32_MAX/2)
#define LZMA_MEMCMPLEN_EXTRA
Custom functions for memory handling.
lzma_lz_encoder lz
LZ-based encoder e.g. LZMA.
lzma_next_coder next
Next coder in the chain.
lzma_lz_decoder lz
The actual LZ-based decoder e.g. LZMA.
lzma_mf mf
History buffer and match finder.
void * options
Pointer to filter-specific options structure.
void * coder
Data specific to the LZ-based decoder.
void(* end)(void *coder, const lzma_allocator *allocator)
Free allocated resources.
lzma_ret(* code)(void *coder, lzma_dict *restrict dict, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size)
Function to decode from in[] to *dict.
const uint8_t * preset_dict
TODO: Comment.
uint32_t depth
Maximum search depth.
size_t dict_size
Size of the history buffer.
lzma_match_finder match_finder
Type of the match finder to use.
uint32_t hash_count
Number of elements in hash[].
uint8_t * buffer
Pointer to buffer with data to be compressed.
uint32_t depth
Maximum number of loops in the match finder.
uint32_t(* find)(lzma_mf *mf, lzma_match *matches)
uint32_t nice_len
Maximum length of a match that the match finder will try to find.
uint32_t sons_count
Number of elements in son[].
void(* skip)(lzma_mf *mf, uint32_t num)
uint32_t keep_size_before
Hold data and function pointers of the next filter in the chain.
lzma_code_function code
Pointer to function to do the actual coding.
void * coder
Pointer to coder-specific data.
lzma_ret(* update)(void *coder, const lzma_allocator *allocator, const lzma_filter *filters, const lzma_filter *reversed_filters)
#define LZMA_NEXT_CODER_INIT
Macro to initialize lzma_next_coder structure.
#define return_if_error(expr)
Return if expression doesn't evaluate to LZMA_OK.
void * lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
Allocates memory.
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_PROG_ERROR
Programming error.
@ LZMA_MEM_ERROR
Cannot allocate memory.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
@ LZMA_OK
Operation completed successfully.
lzma_action
The ‘action’ argument for lzma_code()
@ LZMA_SYNC_FLUSH
Make all the input available at output.
@ LZMA_RUN
Continue coding.
unsigned char lzma_bool
Boolean.
lzma_ret lzma_next_filter_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
void lzma_free(void *ptr, const lzma_allocator *allocator)
Frees memory.
size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size)
lzma_ret lzma_next_filter_update(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *reversed_filters)
void lzma_next_end(lzma_next_coder *next, const lzma_allocator *allocator)