20 #if defined(_WIN32) || defined(__CYGWIN__)
22 # define LZMA_API_EXPORT __declspec(dllexport)
24 # define LZMA_API_EXPORT
28 # define LZMA_API_EXPORT __attribute__((__visibility__("default")))
30 # define LZMA_API_EXPORT
33 #define LZMA_API(type) LZMA_API_EXPORT type LZMA_API_CALL
40 # define likely(expr) __builtin_expect(expr, true)
41 # define unlikely(expr) __builtin_expect(expr, false)
43 # define likely(expr) (expr)
44 # define unlikely(expr) (expr)
49 #define LZMA_BUFFER_SIZE 4096
56 #define LZMA_THREADS_MAX 16384
63 #define LZMA_MEMUSAGE_BASE (UINT64_C(1) << 15)
67 #define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62)
72 #define LZMA_SUPPORTED_FLAGS \
73 ( LZMA_TELL_NO_CHECK \
74 | LZMA_TELL_UNSUPPORTED_CHECK \
75 | LZMA_TELL_ANY_CHECK \
81 #define LZMA_ACTION_MAX ((unsigned int)(LZMA_FULL_BARRIER))
88 #define LZMA_TIMED_OUT 32
180 #define LZMA_NEXT_CODER_INIT \
183 .init = (uintptr_t)(NULL), \
184 .id = LZMA_VLI_UNKNOWN, \
187 .get_progress = NULL, \
278 #define return_if_error(expr) \
280 const lzma_ret ret_ = (expr); \
281 if (ret_ != LZMA_OK) \
291 #define lzma_next_coder_init(func, next, allocator) \
293 if ((uintptr_t)(func) != (next)->init) \
294 lzma_next_end(next, allocator); \
295 (next)->init = (uintptr_t)(func); \
303 #define lzma_next_strm_init(func, strm, ...) \
305 return_if_error(lzma_strm_init(strm)); \
306 const lzma_ret ret_ = func(&(strm)->internal->next, \
307 (strm)->allocator, __VA_ARGS__); \
308 if (ret_ != LZMA_OK) { \
lzma_check
Type of the integrity check (Check ID)
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 const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
const lzma_filter * filters
The public API of liblzma data compression library.
Some threading related helper macros and functions.
_W64 unsigned int uintptr_t
Custom functions for memory handling.
void * options
Pointer to filter's options structure.
lzma_next_coder next
The actual coder that should do something useful.
bool supported_actions[LZMA_ACTION_MAX+1]
Indicates which lzma_action values are allowed by next.code.
enum lzma_internal_s::@645 sequence
Hold data and function pointers of the next filter in the chain.
void(* get_progress)(void *coder, uint64_t *progress_in, uint64_t *progress_out)
lzma_code_function code
Pointer to function to do the actual coding.
void * coder
Pointer to coder-specific data.
lzma_check(* get_check)(const void *coder)
lzma_ret(* update)(void *coder, const lzma_allocator *allocator, const lzma_filter *filters, const lzma_filter *reversed_filters)
lzma_ret(* memconfig)(void *coder, uint64_t *memusage, uint64_t *old_memlimit, uint64_t new_memlimit)
Passing data to and from liblzma.
lzma_ret lzma_next_filter_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1) lzma_alloc_zero(size_t size
void lzma_free(void *ptr, const lzma_allocator *allocator)
Frees memory.
#define LZMA_ACTION_MAX
Largest valid lzma_action value as unsigned integer.
lzma_ret(* lzma_code_function)(void *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)
lzma_ret lzma_strm_init(lzma_stream *strm)
lzma_ret(* lzma_init_function)(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
Type of a function used to initialize a filter encoder or decoder.
void * lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
Allocates 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_end_function)(void *coder, const lzma_allocator *allocator)
Type of a function to free the memory allocated for the coder.
void lzma_next_end(lzma_next_coder *next, const lzma_allocator *allocator)
void const lzma_allocator * allocator
Common includes, definitions, system-specific things etc.
#define lzma_attr_alloc_size(x)
Various integer and bit operations.
uint64_t lzma_vli
Variable-length integer type.
lzma_ret
Return values used by several functions in liblzma.
lzma_action
The ‘action’ argument for lzma_code()