![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
Conversion of strings to filter chain and vice versa. More...
#include "filter_common.h"
Data Structures | |
struct | lzma_str |
struct | name_value_map |
struct | option_map |
Macros | |
#define | STR_ALLOC_SIZE 800 |
#define | NAME_LEN_MAX 11 |
#define | OPTMAP_USE_NAME_VALUE_MAP 0x01 |
#define | OPTMAP_USE_BYTE_SUFFIX 0x02 |
#define | OPTMAP_NO_STRFY_ZERO 0x04 |
#define | LZMA12_PRESET_STR "0-9[e]" |
Help string for presets. | |
#define | MY_IS_DIGIT(c) |
Enumerations | |
enum | { OPTMAP_TYPE_UINT32 , OPTMAP_TYPE_LZMA_MODE , OPTMAP_TYPE_LZMA_MATCH_FINDER , OPTMAP_TYPE_LZMA_PRESET } |
Functions | |
LZMA_API (const char *) | |
Run-time version as a string. | |
LZMA_API (lzma_ret) | |
Conversion of strings to filter chain and vice versa.
#define LZMA12_PRESET_STR "0-9[e]" |
Help string for presets.
#define NAME_LEN_MAX 11 |
Maximum length for filter and option names. 11 chars + terminating '\0' + sizeof(uint32_t) = 16 bytes
#define OPTMAP_NO_STRFY_ZERO 0x04 |
For option_map.flags: If the integer value is zero then this option won't be included in the stringified output. It's used e.g. for BCJ filter start offset which usually is zero.
#define OPTMAP_USE_BYTE_SUFFIX 0x02 |
For option_map.flags: Allow KiB/MiB/GiB in input string and use them in the stringified output if the value is an exact multiple of these. This is used e.g. for LZMA1/2 dictionary size.
#define OPTMAP_USE_NAME_VALUE_MAP 0x01 |
For option_map.flags: Use .u.map to do convert the input value to an integer. Without this flag, .u.range.{min,max} are used as the allowed range for the integer.
#define STR_ALLOC_SIZE 800 |
How much memory to allocate for strings. For now, no realloc is used so this needs to be big enough even though there of course is an overflow check still.
FIXME? Using a fixed size is wasteful if the application doesn't free the string fairly quickly but this can be improved later if needed.
anonymous enum |
Possible values for option_map.type. Since OPTMAP_TYPE_UINT32 is 0, it doesn't need to be specified in the initializers as it is the implicit value.
Enumerator | |
---|---|
OPTMAP_TYPE_UINT32 | |
OPTMAP_TYPE_LZMA_MODE | |
OPTMAP_TYPE_LZMA_MATCH_FINDER | |
OPTMAP_TYPE_LZMA_PRESET |
|
extern |
Run-time version as a string.
This function may be useful if you want to display which version of liblzma your application is currently using.
|
extern |
bool allow_null |
For lzma_str_from_filters: If true, lzma_filter.options is allowed to be NULL. In that case, only the filter name is printed without any options.
lzma_vli id |
Filter ID.
char name[NAME_LEN_MAX+1] |
Name of the filter.
const option_map* optmap |
For lzma_str_from_filters: If the flag LZMA_STR_ENCODER is used then the first strfy_encoder elements of optmap are stringified. With LZMA_STR_DECODER strfy_decoder is used. Currently encoders use all flags that decoders do but if that changes then this needs to be changed too, for example, add a new OPTMAP flag to skip printing some decoder-only flags.
uint32_t opts_size |
For lzma_str_to_filters: Size of the filter-specific options structure.
const char *(* parse) (const char **str, const char *str_end, void *filter_options) | ( | const char ** | str, |
const char * | str_end, | ||
void * | filter_options ) |
For lzma_str_to_filters: Function to parse the filter-specific options. The filter_options will already have been allocated using lzma_alloc_zero().
uint8_t strfy_decoder |
uint8_t strfy_encoder |