68 const size_t in_start = *
in_pos;
90 ret = lzma_vli_decode(&coder->
count, &coder->
pos,
101 if (lzma_index_memusage(1, coder->
count) > coder->
memlimit) {
112 ? SEQ_PADDING_INIT : SEQ_UNPADDED;
116 case SEQ_UNCOMPRESSED: {
121 ret = lzma_vli_decode(
size, &coder->
pos,
129 if (coder->
sequence == SEQ_UNPADDED) {
154 case SEQ_PADDING_INIT:
161 if (coder->
pos > 0) {
170 coder->
crc32 = lzma_crc32(
in + in_start,
182 if (((coder->
crc32 >> (coder->
pos * 8)) & 0xFF)
186 }
while (++coder->
pos < 4);
204 coder->
crc32 = lzma_crc32(
in + in_start,
227 *memusage = lzma_index_memusage(1, coder->
count);
230 if (new_memlimit != 0) {
231 if (new_memlimit < *memusage)
324 const size_t in_start = *
in_pos;
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
#define UNPADDED_SIZE_MAX
Maximum Unpadded Size.
#define UNPADDED_SIZE_MIN
Minimum Unpadded Size.
void lzma_index_prealloc(lzma_index *i, lzma_vli records)
uint32_t lzma_index_padding_size(const lzma_index *i)
static lzma_ret index_decoder_memconfig(void *coder_ptr, uint64_t *memusage, uint64_t *old_memlimit, uint64_t new_memlimit)
static lzma_ret index_decode(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 lzma_attribute((__unused__)), size_t *restrict out_pos lzma_attribute((__unused__)), size_t out_size lzma_attribute((__unused__)), lzma_action action lzma_attribute((__unused__)))
static lzma_ret index_decoder_reset(lzma_index_coder *coder, const lzma_allocator *allocator, lzma_index **i, uint64_t memlimit)
static void index_decoder_end(void *coder_ptr, const lzma_allocator *allocator)
static lzma_ret index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, lzma_index **i, uint64_t memlimit)
#define lzma_attribute(attr)
assert(limit<=UINT32_MAX/2)
Custom functions for memory handling.
uint64_t memlimit
Memory usage limit.
lzma_vli unpadded_size
The most recent Unpadded Size field.
lzma_vli count
Number of Records left to decode.
lzma_vli uncompressed_size
The most recent Uncompressed Size field.
lzma_index * index
Target Index.
enum lzma_index_coder::@649 sequence
size_t pos
Position in integers.
uint32_t crc32
CRC32 of the List of Records field.
bool supported_actions[LZMA_ACTION_MAX+1]
Indicates which lzma_action values are allowed by next.code.
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(* memconfig)(void *coder, uint64_t *memusage, uint64_t *old_memlimit, uint64_t new_memlimit)
Passing data to and from liblzma.
#define return_if_error(expr)
Return if expression doesn't evaluate to LZMA_OK.
#define lzma_next_coder_init(func, next, allocator)
#define lzma_next_strm_init(func, strm,...)
void * lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
Allocates memory.
uint64_t lzma_vli
Variable-length integer type.
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_PROG_ERROR
Programming error.
@ LZMA_DATA_ERROR
Data is corrupt.
@ LZMA_MEM_ERROR
Cannot allocate memory.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_OK
Operation completed successfully.
lzma_action
The ‘action’ argument for lzma_code()
@ LZMA_FINISH
Finish the coding operation.
@ LZMA_RUN
Continue coding.
void lzma_free(void *ptr, const lzma_allocator *allocator)
Frees memory.