#include "filter_decoder.h"
#include "filter_common.h"
#include "lzma_decoder.h"
#include "lzma2_decoder.h"
#include "subblock_decoder.h"
#include "subblock_decoder_helper.h"
#include "simple_decoder.h"
#include "delta_decoder.h"
Data Structures | |
struct | lzma_filter_decoder |
Functions | |
static const lzma_filter_decoder * | decoder_find (lzma_vli id) |
lzma_bool | lzma_filter_decoder_is_supported (lzma_vli id) |
Test if the given Filter ID is supported for decoding. | |
lzma_ret | lzma_raw_decoder_init (lzma_next_coder *next, lzma_allocator *allocator, const lzma_filter *options) |
lzma_ret | lzma_raw_decoder (lzma_stream *strm, const lzma_filter *options) |
Initialize raw decoder. | |
uint64_t | lzma_raw_decoder_memusage (const lzma_filter *filters) |
Calculate rough memory requirements for raw decoder. | |
lzma_ret | lzma_properties_decode (lzma_filter *filter, lzma_allocator *allocator, const uint8_t *props, size_t props_size) |
Decode the Filter Properties field. | |
Variables | |
static const lzma_filter_decoder | decoders [] |
Test if the given Filter ID is supported for decoding.
Return true if the give Filter ID is supported for decoding by this liblzma build. Otherwise false is returned.
lzma_ret lzma_raw_decoder | ( | lzma_stream * | strm, | |
const lzma_filter * | filters | |||
) |
Initialize raw decoder.
The initialization of raw decoder goes similarly to raw encoder.
The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using LZMA_FINISH is not required, it is supported just for convenience.
References LZMA_FINISH, lzma_next_strm_init, LZMA_OK, and LZMA_RUN.
Referenced by coder_init().
uint64_t lzma_raw_decoder_memusage | ( | const lzma_filter * | filters | ) |
Calculate rough memory requirements for raw decoder.
Because the calculation is rough, this function can be used to calculate the memory requirements for Block and Stream decoders too.
filters | Array of filters terminated with .id == LZMA_VLI_UNKNOWN. |
Referenced by lzma_easy_decoder_memusage().
lzma_ret lzma_properties_decode | ( | lzma_filter * | filter, | |
lzma_allocator * | allocator, | |||
const uint8_t * | props, | |||
size_t | props_size | |||
) |
Decode the Filter Properties field.
filter | filter->id must have been set to the correct Filter ID. filter->options doesn't need to be initialized (it's not freed by this function). The decoded options will be stored to filter->options. filter->options is set to NULL if there are no properties or if an error occurs. | |
allocator | Custom memory allocator used to allocate the options. Set to NULL to use the default malloc(), and in case of an error, also free(). | |
props | Input buffer containing the properties. | |
props_size | Size of the properties. This must be the exact size; giving too much or too little input will return LZMA_OPTIONS_ERROR. |
References LZMA_OK, and LZMA_OPTIONS_ERROR.
Referenced by is_format_lzma(), lzma_filter_flags_decode(), and lzmainfo().