Rizin
unix-like reverse engineering framework and cli tools
|
Parser for filter-specific options. More...
#include "private.h"
Go to the source code of this file.
Classes | |
struct | name_id_map |
struct | option_map |
Enumerations | |
enum | { OPT_DIST } |
enum | { OPT_START_OFFSET } |
enum | { OPT_PRESET , OPT_DICT , OPT_LC , OPT_LP , OPT_PB , OPT_MODE , OPT_NICE , OPT_MF , OPT_DEPTH } |
Functions | |
static void | parse_options (const char *str, const option_map *opts, void(*set)(void *filter_options, unsigned key, uint64_t value, const char *valuestr), void *filter_options) |
static void | set_delta (void *options, unsigned key, uint64_t value, const char *valuestr lzma_attribute((__unused__))) |
lzma_options_delta * | options_delta (const char *str) |
Parser for Delta options. More... | |
static void | set_bcj (void *options, unsigned key, uint64_t value, const char *valuestr lzma_attribute((__unused__))) |
lzma_options_bcj * | options_bcj (const char *str) |
Parser for BCJ options. More... | |
static void | lzma_attribute ((__noreturn__)) |
static void | set_lzma (void *options, unsigned key, uint64_t value, const char *valuestr) |
lzma_options_lzma * | options_lzma (const char *str) |
Parser for LZMA options. More... | |
Parser for filter-specific options.
Definition in file options.c.
anonymous enum |
|
static |
lzma_options_bcj* options_bcj | ( | const char * | str | ) |
Parser for BCJ options.
Definition at line 209 of file options.c.
References NULL, options, parse_options(), set_bcj(), cmd_descs_generate::str, UINT32_MAX, and xmalloc.
Referenced by parse_real().
lzma_options_delta* options_delta | ( | const char * | str | ) |
Parser for Delta options.
Definition at line 165 of file options.c.
References LZMA_DELTA_DIST_MAX, LZMA_DELTA_DIST_MIN, LZMA_DELTA_TYPE_BYTE, NULL, options, parse_options(), set_delta(), cmd_descs_generate::str, and xmalloc.
Referenced by parse_real().
lzma_options_lzma* options_lzma | ( | const char * | str | ) |
Parser for LZMA options.
Definition at line 317 of file options.c.
References _, LZMA_DICT_SIZE_MIN, LZMA_LCLP_MAX, LZMA_LCLP_MIN, LZMA_MF_BT2, LZMA_MF_BT3, LZMA_MF_BT4, LZMA_MF_HC3, LZMA_MF_HC4, LZMA_MODE_FAST, LZMA_MODE_NORMAL, LZMA_PB_MAX, LZMA_PB_MIN, LZMA_PRESET_DEFAULT, message_bug(), message_fatal(), NULL, options, parse_options(), PRIu32, set_lzma(), cmd_descs_generate::str, UINT32_C, UINT32_MAX, UINT64_MAX, and xmalloc.
Referenced by parse_real().
|
static |
Parses option=value pairs that are separated with commas: opt=val,opt=val,opt=val
Each option is a string, that is converted to an integer using the index where the option string is in the array.
Value can be
When parsing both option and value succeed, a filter-specific function is called, which should update the given value to filter-specific options structure.
str | String containing the options from the command line |
opts | Filter-specific option map |
set | Filter-specific function to update filter_options |
filter_options | Pointer to filter-specific options structure |
Definition at line 60 of file options.c.
References _, free(), i, option_map::map, map(), max, message_fatal(), min, name, name_id_map::name, NULL, s, cmd_descs_generate::str, str_to_uint64(), UINT64_MAX, v, value, and xstrdup().
Referenced by options_bcj(), options_delta(), and options_lzma().
|
static |
Definition at line 196 of file options.c.
References key, OPT_START_OFFSET, options, lzma_options_bcj::start_offset, and value.
Referenced by options_bcj().
|
static |
Definition at line 152 of file options.c.
References lzma_options_delta::dist, key, OPT_DIST, options, and value.
Referenced by options_delta().
Definition at line 252 of file options.c.
References lzma_options_lzma::depth, lzma_options_lzma::dict_size, key, lzma_options_lzma::lc, lzma_options_lzma::lp, LZMA_PRESET_EXTREME, lzma_options_lzma::mf, lzma_options_lzma::mode, lzma_options_lzma::nice_len, OPT_DEPTH, OPT_DICT, OPT_LC, OPT_LP, OPT_MF, OPT_MODE, OPT_NICE, OPT_PB, OPT_PRESET, options, lzma_options_lzma::pb, preset, and value.
Referenced by options_lzma().