110 const size_t out_avail = out_size - *
out_pos;
111 const size_t buf_avail = coder->
size - coder->
pos;
112 if (out_avail > buf_avail || buf_avail == 0) {
115 const size_t out_start = *
out_pos;
147 const size_t unfiltered =
size - filtered;
148 assert(unfiltered <= coder->allocated / 2);
153 coder->
size = unfiltered;
160 }
else if (unfiltered > 0) {
166 }
else if (coder->
pos > 0) {
178 if (coder->
size > 0) {
239 size_t simple_size,
size_t unfiltered_max,
240 uint32_t alignment,
bool is_encoder)
264 if (simple_size > 0) {
276 if (coder->
now_pos & (alignment - 1))
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
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
#define lzma_attribute(attr)
assert(limit<=UINT32_MAX/2)
static bool filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
static lzma_ret simple_coder_update(void *coder_ptr, const lzma_allocator *allocator, const lzma_filter *filters_null lzma_attribute((__unused__)), const lzma_filter *reversed_filters)
static lzma_ret simple_code(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 size_t call_filter(lzma_simple_coder *coder, uint8_t *buffer, size_t size)
static lzma_ret copy_or_code(lzma_simple_coder *coder, 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)
Copied or encodes/decodes more data to out[].
static void simple_coder_end(void *coder_ptr, const lzma_allocator *allocator)
lzma_ret lzma_simple_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters, size_t(*filter)(void *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size), size_t simple_size, size_t unfiltered_max, uint32_t alignment, bool is_encoder)
Private definitions for so called simple filters.
Custom functions for memory handling.
void * options
Pointer to filter-specific options structure.
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)
uint32_t start_offset
Start offset for conversions.
uint8_t buffer[]
Temporary buffer.
size_t(* filter)(void *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)
size_t allocated
Size of the memory allocated for the buffer.
lzma_next_coder next
Next filter in the chain.
bool end_was_reached
True if the next coder in the chain has returned LZMA_STREAM_END.
#define LZMA_NEXT_CODER_INIT
Macro to initialize lzma_next_coder structure.
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_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_FINISH
Finish the coding operation.
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)