mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-04 22:07:42 +00:00
Minor updates to man pages, lrzip.conf example file.
Update main help screen to include environment settings. Update to respect $TMP environment variable for TMP files. Updated control structure to include tmpdir pointer. Update lrzip.conf parser to respect -U -M options. Update lrzip.conf example to include new parameters. Reorder main Switch loop in main.c for readability. Have MAXRAM and control.window be exclusive. MAXRAM wins. Have UNLIMITED and control.window be exclusive. UNLIMITED wins. Have UNLIMITED and MAXRAM be exclusive. UNLIMITED wins. Corrects heuristic computation in rzip.c which would override MAXRAM or UNLIMITED if control.window set Show heuristically computed control.window when computed. Remove display compression level from control.window verbose output. Update print_verbose format for Testing for incompressible data in stream.c to omit extra \n. Changes by Peter Hyman <pete@peterhyman.com>
This commit is contained in:
parent
98d264fac8
commit
74df2b5973
8 changed files with 210 additions and 103 deletions
19
util.c
19
util.c
|
|
@ -124,15 +124,20 @@ void read_config( struct rzip_control *control )
|
|||
|
||||
if (!strcasecmp(parameter, "window"))
|
||||
control->window = atoi(parametervalue);
|
||||
else if (!strcasecmp(parameter, "compressionlevel")) {
|
||||
else if (!strcasecmp(parameter, "unlimited")) {
|
||||
if (!strcasecmp(parametervalue, "yes"))
|
||||
control->flags |= FLAG_UNLIMITED;
|
||||
} else if (!strcasecmp(parameter, "maxram")) {
|
||||
if (!strcasecmp(parametervalue, "yes"))
|
||||
control->flags |= FLAG_MAXRAM;
|
||||
} else if (!strcasecmp(parameter, "compressionlevel")) {
|
||||
control->compression_level = atoi(parametervalue);
|
||||
if ( control->compression_level < 1 || control->compression_level > 9 )
|
||||
fatal("CONF.FILE error. Compression Level must between 1 and 9");
|
||||
} else if (!strcasecmp(parameter, "compressionmethod")) {
|
||||
/* valid are rzip, gzip, bzip2, lzo, lzma (default) */
|
||||
/* valid are rzip, gzip, bzip2, lzo, lzma (default), and zpaq */
|
||||
if (control->flags & FLAG_NOT_LZMA)
|
||||
fatal("CONF.FILE error. Can only specify one compression method");
|
||||
|
||||
if (!strcasecmp(parametervalue, "bzip2"))
|
||||
control->flags |= FLAG_BZIP2_COMPRESS;
|
||||
else if (!strcasecmp(parametervalue, "gzip"))
|
||||
|
|
@ -181,7 +186,15 @@ void read_config( struct rzip_control *control )
|
|||
/* replace lrzip file must be case sensitive */
|
||||
if (!strcmp(parametervalue, "YES"))
|
||||
control->flags |= FLAG_FORCE_REPLACE;
|
||||
} else if (!strcasecmp(parameter, "tmpdir")) {
|
||||
control->tmpdir = realloc(NULL, strlen(parametervalue) + 2);
|
||||
if (!control->tmpdir)
|
||||
fatal("Fatal Memory Error in read_config");
|
||||
strcpy(control->tmpdir, parametervalue);
|
||||
if (strcmp(parametervalue + strlen(parametervalue) - 1, "/"))
|
||||
strcat(control->tmpdir, "/");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue