35 bool set_compress,
bool set_decompress)
37 bool is_percentage =
false;
40 const size_t len = strlen(
str);
53 value, set_compress, set_decompress, is_percentage);
62 if (
str[0] ==
'\0' ||
str[0] ==
',')
67 for (
size_t i = 0;
str[
i] !=
'\0'; ++
i)
83 char *
p = strchr(
str,
',');
103 "as the last element "
148 static const char short_opts[]
149 =
"cC:defF:hHlkM:qQrS:tT:vVz0123456789";
151 static const struct option long_opts[] = {
219 case '0':
case '1':
case '2':
case '3':
case '4':
220 case '5':
case '6':
case '7':
case '8':
case '9':
225 case OPT_MEM_COMPRESS:
227 "memlimit-compress%",
optarg,
232 case OPT_MEM_DECOMPRESS:
234 "memlimit-decompress%",
optarg,
281 case OPT_INFO_MEMORY:
329 setlocale(LC_NUMERIC,
"C");
390 static const struct {
416 static const struct {
444 case OPT_IGNORE_CHECK:
453 case OPT_BLOCK_LIST: {
458 case OPT_SINGLE_STREAM:
467 args->files_delim =
'\n';
474 "specified with `--files' "
479 args->files_file = stdin;
483 c == OPT_FILES ?
"r" :
"rb");
495 case OPT_FLUSH_TIMEOUT:
523 bool prev_was_space =
true;
524 for (
size_t i = 0;
env[
i] !=
'\0'; ++
i) {
533 prev_was_space =
true;
534 }
else if (prev_was_space) {
535 prev_was_space =
false;
542 "%s contains too many "
543 "arguments"), varname);
549 char **
argv =
xmalloc(((
size_t)(argc) + 1) *
sizeof(
char *));
556 prev_was_space =
true;
557 for (
size_t i = 0;
env[
i] !=
'\0'; ++
i) {
559 prev_was_space =
true;
561 }
else if (prev_was_space) {
562 prev_was_space =
false;
597 args->files_delim =
'\0';
602 const char *
name = strrchr(
argv[0],
'/');
614 if (strstr(
name,
"xzcat") !=
NULL) {
617 }
else if (strstr(
name,
"unxz") !=
NULL) {
619 }
else if (strstr(
name,
"lzcat") !=
NULL) {
623 }
else if (strstr(
name,
"unlzma") !=
NULL) {
626 }
else if (strstr(
name,
"lzma") !=
NULL) {
641 #ifndef HAVE_ENCODERS
646 #ifndef HAVE_DECODERS
679 static char *names_stdin[2] = { (
char *)
"-",
NULL };
680 args->arg_names = names_stdin;
lzma_check
Type of the integrity check (Check ID)
void args_parse(args_info *args, int argc, char **argv)
static void parse_memlimit(const char *name, const char *name_percentage, char *str, bool set_compress, bool set_decompress)
Parse and set the memory usage limit for compression and/or decompression.
static void parse_block_list(char *str)
const char stdin_filename[]
static void parse_real(args_info *args, int argc, char **argv)
static void parse_environment(args_info *args, char *argv0, const char *varname)
#define LZMA_FILTER_SPARC
#define LZMA_FILTER_ARMTHUMB
#define LZMA_FILTER_POWERPC
uint64_t * opt_block_list
void coder_set_check(lzma_check new_check)
Set the integrity check type used when compressing.
void coder_set_extreme(void)
Enable extreme mode.
void coder_set_compression_settings(void)
enum format_type opt_format
void coder_add_filter(lzma_vli id, void *options)
Add a filter to the custom filter chain.
bool opt_single_stream
If true, stop after decoding the first stream.
void coder_set_preset(uint32_t new_preset)
Set preset number.
enum operation_mode opt_mode
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
#define LZMA_FILTER_DELTA
Filter ID.
void io_no_sparse(void)
Disable creation of sparse files when decompressing.
void hardware_memlimit_set(uint64_t new_memlimit, bool set_compress, bool set_decompress, bool is_percentage)
void hardware_threads_set(uint32_t n)
Set the maximum number of worker threads.
void hardware_memlimit_show(void)
Display the amount of RAM and memory usage limits and exit.
RZ_API void Ht_() free(HtName_(Ht) *ht)
char * xstrdup(const char *) ATTRIBUTE_MALLOC
static static fork const void static count static fd const char const char static newpath char char argv
#define LZMA_FILTER_LZMA2
LZMA2 Filter ID.
#define LZMA_FILTER_LZMA1
LZMA1 Filter ID.
assert(limit<=UINT32_MAX/2)
void message_help(bool long_help)
Print the help message.
void message_verbosity_increase(void)
Increase verbosity level by one step unless it was at maximum.
void message_version(void)
Prints the version number to stdout and exits with exit status SUCCESS.
void message_verbosity_decrease(void)
Decrease verbosity level by one step unless it was at minimum.
void message_try_help(void)
Print a message that user should try –help.
void message_fatal(const char *fmt,...)
uint64_t opt_flush_timeout
Number of milliseconds to between LZMA_SYNC_FLUSHes.
lzma_options_lzma * options_lzma(const char *str)
Parser for LZMA options.
lzma_options_bcj * options_bcj(const char *str)
Parser for BCJ options.
lzma_options_delta * options_delta(const char *str)
Parser for Delta options.
insn_type_descr_t types[]
void set_exit_no_warn(void)
Common includes, definitions, and prototypes.
uint64_t str_to_uint64(const char *name, const char *value, uint64_t min, uint64_t max)
Fancy version of strtoull()
void suffix_set(const char *suffix)
Set a custom filename suffix.
#define LZMA_VLI_MAX
Maximum supported value of a variable-length integer.