![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
Definitions common to the whole liblzma library. More...
#include "sysdefs.h"
#include "mythread.h"
#include "tuklib_integer.h"
#include "lzma.h"
Go to the source code of this file.
Data Structures | |
struct | lzma_filter_info_s |
struct | lzma_next_coder_s |
Hold data and function pointers of the next filter in the chain. More... | |
struct | lzma_internal_s |
Macros | |
#define | LZMA_API_EXPORT |
#define | lzma_attr_visibility_hidden |
#define | LZMA_API(type) |
#define | lzma_has_attribute(attr) |
#define | lzma_always_inline inline |
#define | likely(expr) |
#define | unlikely(expr) |
#define | LZMA_BUFFER_SIZE 4096 |
Size of temporary buffers needed in some filters. | |
#define | LZMA_THREADS_MAX 16384 |
#define | LZMA_MEMUSAGE_BASE (UINT64_C(1) << 15) |
#define | LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62) |
#define | LZMA_SUPPORTED_FLAGS |
#define | LZMA_ACTION_MAX ((unsigned int)(LZMA_FULL_BARRIER)) |
Largest valid lzma_action value as unsigned integer. | |
#define | LZMA_TIMED_OUT LZMA_RET_INTERNAL1 |
#define | LZMA_INDEX_DETECTED LZMA_RET_INTERNAL2 |
#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. | |
#define | lzma_next_coder_init(func, next, allocator) |
#define | lzma_next_strm_init(func, strm, ...) |
Typedefs | |
typedef 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. | |
typedef 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) |
typedef void(* | lzma_end_function) (void *coder, const lzma_allocator *allocator) |
Type of a function to free the memory allocated for the coder. | |
Functions | |
lzma_attr_alloc_size (1) extern void *lzma_alloc(size_t size | |
Allocates memory. | |
void | lzma_free (void *ptr, const lzma_allocator *allocator) |
Frees memory. | |
lzma_ret | lzma_strm_init (lzma_stream *strm) |
lzma_ret | lzma_next_filter_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters) |
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) |
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) |
Variables | |
const lzma_allocator * | allocator |
Definitions common to the whole liblzma library.
#define likely | ( | expr | ) |
#define LZMA_ACTION_MAX ((unsigned int)(LZMA_FULL_BARRIER)) |
Largest valid lzma_action value as unsigned integer.
#define lzma_always_inline inline |
#define LZMA_API | ( | type | ) |
#define LZMA_API_EXPORT |
#define lzma_attr_visibility_hidden |
#define LZMA_BUFFER_SIZE 4096 |
Size of temporary buffers needed in some filters.
#define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62) |
Start of internal Filter ID space. These IDs must never be used in Streams.
#define lzma_has_attribute | ( | attr | ) |
#define LZMA_INDEX_DETECTED LZMA_RET_INTERNAL2 |
Special return value (lzma_ret) for use in stream_decoder_mt.c to indicate Index was detected instead of a Block Header.
#define LZMA_MEMUSAGE_BASE (UINT64_C(1) << 15) |
Starting value for memory usage estimates. Instead of calculating size of every structure and taking into account malloc() overhead etc., we add a base size to all memory usage estimates. It's not very accurate but should be easily good enough.
#define LZMA_NEXT_CODER_INIT |
Macro to initialize lzma_next_coder structure.
#define lzma_next_coder_init | ( | func, | |
next, | |||
allocator ) |
If next isn't already initialized, free the previous coder. Then mark that next is possibly initialized for the coder using this macro. "Possibly" means that if e.g. allocation of next->coder fails, the structure isn't actually initialized for this coder, but leaving next->init to func is still OK.
#define lzma_next_strm_init | ( | func, | |
strm, | |||
... ) |
Initializes lzma_strm and calls func() to initialize strm->internal->next. (The function being called will use lzma_next_coder_init()). If initialization fails, memory that wasn't freed by func() is freed along strm->internal.
#define LZMA_SUPPORTED_FLAGS |
Supported flags that can be passed to lzma_stream_decoder(), lzma_auto_decoder(), or lzma_stream_decoder_mt().
#define LZMA_THREADS_MAX 16384 |
Maximum number of worker threads within one multithreaded component. The limit exists solely to make it simpler to prevent integer overflows when allocating structures etc. This should be big enough for now... the code won't scale anywhere close to this number anyway.
#define LZMA_TIMED_OUT LZMA_RET_INTERNAL1 |
Special return value (lzma_ret) to indicate that a timeout was reached and lzma_code() must not return LZMA_BUF_ERROR. This is converted to LZMA_OK in lzma_code().
#define return_if_error | ( | expr | ) |
#define unlikely | ( | expr | ) |
typedef 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) |
Type of a function to do some kind of coding work (filters, Stream, Block encoders/decoders etc.). Some special coders use don't use both input and output buffers, but for simplicity they still use this same function prototype.
typedef void(* lzma_end_function) (void *coder, const lzma_allocator *allocator) |
Type of a function to free the memory allocated for the coder.
typedef 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.
lzma_attr_alloc_size | ( | 1 | ) |
Allocates memory.
Allocates memory and zeroes it (like calloc()). This can be faster than lzma_alloc() + memzero() while being backward compatible with custom allocators.
|
extern |
Copy as much data as possible from in[] to out[] and update *in_pos and *out_pos accordingly. Returns the number of bytes copied.
|
extern |
Frees memory.
|
extern |
Frees the memory allocated for next->coder either using next->end or, if next->end is NULL, using lzma_free.
|
extern |
Initializes the next filter in the chain, if any. This takes care of freeing the memory of previously initialized filter if it is different than the filter being initialized now. This way the actual filter initialization functions don't need to use lzma_next_coder_init macro.
|
extern |
Update the next filter in the chain, if any. This checks that the application is not trying to change the Filter IDs.
|
extern |
Allocates strm->internal if it is NULL, and initializes *strm and strm->internal. This function is only called via lzma_next_strm_init macro.
const lzma_allocator* allocator |