pub(super) use crate::compat::host::printf;
pub(super) const VERSION_STRING: &str = "1.5.7";
pub(super) const WELCOME: &str =
"*** Zstandard CLI (stuffr %s; zstd 1.5.7 compatible) (64-bit) v1.5.7, by Yann Collet ***\n";
pub(super) const VERSION_ONLY: &str = "%s\n";
pub(super) const SUPPORTS: &str = "*** supports: zstd, zstd legacy v0.5+, gzip, lz4, lzma, xz \n";
pub(super) const POSIX_C_SOURCE: &str = "_POSIX_C_SOURCE defined: %dL\n";
pub(super) const POSIX_VERSION: &str = "_POSIX_VERSION defined: %dL \n";
pub(super) const PLATFORM_POSIX_VERSION: &str = "PLATFORM_POSIX_VERSION defined: %dL\n";
pub(super) const USAGE_HEAD: &str = concat!(
"Compress or decompress the INPUT file(s); reads from STDIN if INPUT is `-` or not provided.\n\n",
"Usage: %s [OPTIONS...] [INPUT... | -] [-o OUTPUT]\n\n",
"Options:\n",
" -o OUTPUT Write output to a single file, OUTPUT.\n",
" -k, --keep Preserve INPUT file(s). [Default] \n",
" --rm Remove INPUT file(s) after successful (de)compression.\n",
);
pub(super) const USAGE_GZ_NO_NAME: &str =
" -n, --no-name Do not store original filename when compressing.\n\n";
pub(super) const USAGE_TAIL: &str = concat!(
"\n",
" -# Desired compression level, where `#` is a number between 1 and %d;\n",
" lower numbers provide faster compression, higher numbers yield\n",
" better compression ratios. [Default: %d]\n\n",
" -d, --decompress Perform decompression.\n",
" -D DICT Use DICT as the dictionary for compression or decompression.\n\n",
" -f, --force Disable input and output checks. Allows overwriting existing files,\n",
" receiving input from the console, printing output to STDOUT, and\n",
" operating on links, block devices, etc. Unrecognized formats will be\n",
" passed-through through as-is.\n\n",
" -h Display short usage and exit.\n",
" -H, --help Display full help and exit.\n",
" -V, --version Display the program version and exit.\n",
"\n",
);
pub(super) const ADV_AFTER_BANNER: &str = "\n";
pub(super) const ADV_OPTIONS: &str = concat!(
"Advanced options:\n",
" -c, --stdout Write to STDOUT (even if it is a console) and keep the INPUT file(s).\n\n",
" -v, --verbose Enable verbose output; pass multiple times to increase verbosity.\n",
" -q, --quiet Suppress warnings; pass twice to suppress errors.\n",
"\n",
" --[no-]progress Forcibly show/hide the progress counter. NOTE: Any (de)compressed\n",
" output to terminal will mix with progress counter text.\n\n",
);
pub(super) const ADV_FILELIST: &str = concat!(
" -r Operate recursively on directories.\n",
" --filelist LIST Read a list of files to operate on from LIST.\n",
" --output-dir-flat DIR Store processed files in DIR.\n",
);
pub(super) const ADV_MIRROR: &str = " --output-dir-mirror DIR Store processed files in DIR, respecting original directory structure.\n";
pub(super) const ADV_ASYNCIO: &str =
" --[no-]asyncio Use asynchronous IO. [Default: Enabled]\n";
pub(super) const ADV_CHECK: &str = concat!(
"\n",
" --[no-]check Add XXH64 integrity checksums during compression. [Default: Add, Validate]\n",
" If `-d` is present, ignore/validate checksums during decompression.\n",
"\n",
" -- Treat remaining arguments after `--` as files.\n",
);
pub(super) const ADV_COMPRESSION: &str = concat!(
"\n",
"Advanced compression options:\n",
" --ultra Enable levels beyond %d, up to %d; requires more memory.\n",
" --fast[=#] Use to very fast compression levels. [Default: %d]\n",
);
pub(super) const ADV_GZ_BEST: &str =
" --best Compatibility alias for `-9`.\n";
pub(super) const ADV_COMPRESSION_REST: &str = concat!(
" --adapt Dynamically adapt compression level to I/O conditions.\n",
" --long[=#] Enable long distance matching with window log #. [Default: %d]\n",
" --patch-from=REF Use REF as the reference point for Zstandard's diff engine. \n\n",
" -T# Spawn # compression threads. [Default: 1; pass 0 for core count.]\n",
" --single-thread Share a single thread for I/O and compression (slightly different than `-T1`).\n",
" --auto-threads={physical|logical}\n",
" Use physical/logical cores when using `-T0`. [Default: Physical]\n\n",
" -B# Set job size to #. [Default: 0 (automatic)]\n",
" --rsyncable Compress using a rsync-friendly method (`-B` sets block size). \n",
"\n",
" --exclude-compressed Only compress files that are not already compressed.\n\n",
" --stream-size=# Specify size of streaming input from STDIN.\n",
" --size-hint=# Optimize compression parameters for streaming input of approximately size #.\n",
" --target-compressed-block-size=#\n",
" Generate compressed blocks of approximately # size.\n\n",
" --no-dictID Don't write `dictID` into the header (dictionary compression only).\n",
" --[no-]compress-literals Force (un)compressed literals.\n",
" --[no-]row-match-finder Explicitly enable/disable the fast, row-based matchfinder for\n",
" the 'greedy', 'lazy', and 'lazy2' strategies.\n",
"\n",
" --format=zstd Compress files to the `.zst` format. [Default]\n",
" --[no-]mmap-dict Memory-map dictionary file rather than mallocing and loading all at once\n",
" --format=gzip Compress files to the `.gz` format.\n",
" --format=xz Compress files to the `.xz` format.\n",
" --format=lzma Compress files to the `.lzma` format.\n",
" --format=lz4 Compress files to the `.lz4` format.\n",
);
pub(super) const ADV_DECOMPRESSION: &str = concat!(
"\n",
"Advanced decompression options:\n",
" -l Print information about Zstandard-compressed files.\n",
" --test Test compressed file integrity.\n",
" -M# Set the memory usage limit to # megabytes.\n",
);
pub(super) const ADV_SPARSE_ON: &str = " --[no-]sparse Enable sparse mode. [Default: Enabled for files, disabled for STDOUT.]\n";
pub(super) const ADV_SPARSE_OFF: &str =
" --[no-]sparse Enable sparse mode. [Default: Disabled]\n";
pub(super) const ADV_PASS_THROUGH: &str =
" --[no-]pass-through Pass through uncompressed files as-is. [Default: %s]\n";
pub(super) const ENABLED: &str = "Enabled";
pub(super) const DISABLED: &str = "Disabled";
pub(super) const ADV_DICTIONARY: &str = concat!(
"\n",
"Dictionary builder:\n",
" --train Create a dictionary from a training set of files.\n\n",
" --train-cover[=k=#,d=#,steps=#,split=#,shrink[=#]]\n",
" Use the cover algorithm (with optional arguments).\n",
" --train-fastcover[=k=#,d=#,f=#,steps=#,split=#,accel=#,shrink[=#]]\n",
" Use the fast cover algorithm (with optional arguments).\n\n",
" --train-legacy[=s=#] Use the legacy algorithm with selectivity #. [Default: %d]\n",
" -o NAME Use NAME as dictionary name. [Default: %s]\n",
" --maxdict=# Limit dictionary to specified size #. [Default: %d]\n",
" --dictID=# Force dictionary ID to #. [Default: Random]\n",
);
pub(super) const INCORRECT_PARAMETER: &str = "Incorrect parameter: %s \n";
pub(super) const ERROR_OUT: &str = "%s \n";
pub(super) const OVERFLOW_U32: &str = "error: numeric value overflows 32-bit unsigned int";
pub(super) const OVERFLOW_INT: &str = "error: numeric value overflows 32-bit int";
pub(super) const OVERFLOW_SIZE_T: &str = "error: numeric value overflows size_t";
pub(super) const ONLY_NUMERIC: &str =
"error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed";
pub(super) const MISSING_ARGUMENT: &str = "error: missing command argument \n";
pub(super) const SEPARATED: &str =
"error: command cannot be separated from its argument by another command \n";
pub(super) const EMPTY_OUTPUT_DIR: &str =
"error: output dir cannot be empty string (did you mean to pass '.' instead?)\n";
pub(super) const INVALID_CPARAM: &str = "invalid compression parameter \n";
pub(super) const INCOHERENT_ADAPT: &str = "incoherent adaptation limits \n";
pub(super) const COVER_PARAMS: &str = "cover: k=%d\nd=%d\nsteps=%d\nsplit=%d\nshrink%d\n";
pub(super) const FASTCOVER_PARAMS: &str =
"cover: k=%d\nd=%d\nf=%d\nsteps=%d\nsplit=%d\naccel=%d\nshrink=%d\n";
pub(super) const LEGACY_PARAMS: &str = "legacy: selectivity=%d\n";
pub(super) const ENV_TOO_LARGE: &str =
"Ignore environment variable setting %s=%s: numeric value too large \n";
pub(super) const ENV_NOT_INT: &str =
"Ignore environment variable setting %s=%s: not a valid integer value \n";
pub(super) const ENV_NOT_UNSIGNED: &str =
"Ignore environment variable setting %s=%s: not a valid unsigned value \n";
pub(super) const DECOMPRESS_NO_MT: &str =
"Warning : decompression does not support multi-threading\n";
pub(super) const LOGICAL_CORES: &str = "Note: %d logical core(s) detected \n";
pub(super) const PHYSICAL_CORES: &str = "Note: %d physical core(s) detected \n";
pub(super) const COMPRESSING_WITH: &str = "Compressing with %d worker threads \n";
pub(super) const SYMLINK_IGNORED: &str = "Warning : %s is a symbolic link, ignoring \n";
pub(super) const ERROR_READING: &str = "zstd: error reading %s \n";
pub(super) const NO_INPUT_LEFT: &str =
"please provide correct input file(s) or non-empty directories -- ignored \n";
pub(super) const STDIN_CONSOLE: &str = "stdin is a console, aborting\n";
pub(super) const STDOUT_CONSOLE: &str = "stdout is a console, aborting\n";
pub(super) const LEVEL_REDUCED: &str =
"Warning : compression level higher than max, reduced to %d \n";
pub(super) const CPARAMS_DECOMPRESS: &str =
"error : can't use --show-default-cparams in decompression mode \n";
pub(super) const DICT_AND_PATCH: &str =
"error : can't use -D and --patch-from=# at the same time \n";
pub(super) const PATCH_MULTIPLE: &str = "error : can't use --patch-from=# on multiple files \n";
pub(super) const SRC_KEPT_STDOUT: &str = "Note: src files are not removed when output is stdout \n";
pub(super) const PRESS_ENTER: &str = "Press enter to continue... \n";
pub(super) const CPARAMS_SIZE: &str = "%s (%d bytes)\n";
pub(super) const CPARAMS_UNKNOWN: &str = "%s (src size unknown)\n";
pub(super) const CPARAMS_LINES: &str = concat!(
" - windowLog : %d\n",
" - chainLog : %d\n",
" - hashLog : %d\n",
" - searchLog : %d\n",
" - minMatch : %d\n",
" - targetLength : %d\n",
" - strategy : %s (%d)\n",
);
pub(super) const STRATEGY_MAP: [&str; 10] = [
"",
"ZSTD_fast",
"ZSTD_dfast",
"ZSTD_greedy",
"ZSTD_lazy",
"ZSTD_lazy2",
"ZSTD_btlazy2",
"ZSTD_btopt",
"ZSTD_btultra",
"ZSTD_btultra2",
];
pub(super) const ACTUAL_CPARAMS: &str =
"--zstd=wlog=%d,clog=%d,hlog=%d,slog=%d,mml=%d,tlen=%d,strat=%d\n";
pub(super) const BLOCK_SIZE_USELESS: &str =
"Setting block size is useless in single-thread mode \n";
pub(super) const OVERLAP_LOG_USELESS: &str =
"Setting overlapLog is useless in single-thread mode \n";
pub(super) const ADAPT_SINGLE_THREAD: &str =
"Adaptive mode is not compatible with single thread mode \n";
pub(super) const RSYNCABLE_SINGLE_THREAD: &str =
"Rsyncable mode is not compatible with single thread mode \n";
pub(super) const DCP_FORMAT: &str = "--format=%s";
pub(super) const DCP_SPARSE: [&str; 3] = [" --no-sparse", "", " --sparse"];
pub(super) const DCP_NO_DICT_ID: &str = " --no-dictID";
pub(super) const DCP_CHECKSUM: [&str; 3] = [" --no-check", "", " --check"];
pub(super) const DCP_BLOCK_SIZE: &str = " --block-size=%d";
pub(super) const DCP_ADAPT: &str = " --adapt=min=%d,max=%d";
pub(super) const DCP_ROW_MATCH_FINDER: [&str; 3] =
["", " --no-row-match-finder", " --row-match-finder"];
pub(super) const DCP_RSYNCABLE: &str = " --rsyncable";
pub(super) const DCP_STREAM_SIZE: &str = " --stream-size=%d";
pub(super) const DCP_SIZE_HINT: &str = " --size-hint=%d";
pub(super) const DCP_TARGET_CBLOCK: &str = " --target-compressed-block-size=%d";
pub(super) const DCP_LITERALS: [&str; 3] = ["", " --compress-literals", " --no-compress-literals"];
pub(super) const DCP_MEMORY: &str = " --memory=%d";
pub(super) const DCP_THREADS: &str = " --threads=%d";
pub(super) const DCP_EXCLUDE: &str = " --exclude-compressed";
pub(super) const DCP_CONTENT_SIZE: &str = " --%scontent-size\n";
pub(super) const DCP_NO: &str = "no-";
pub(super) const FORMAT_OPTIONS: [&str; 5] = [".zst", ".gz", ".xz", ".lzma", ".lz4"];
pub(super) const EXM_PREFIX: &str = "zstd: ";
pub(super) const EXM_ERROR: &str = "error %d : ";
pub(super) const EXM_END: &str = " \n";
pub(super) const PERROR_READ_LINES: &str = "zstd:util:readLinesFromFile: %s\n";
pub(super) const CANNOT_OPEN_DIR: &str = "Cannot open directory '%s': %s\n";
pub(super) const READDIR_ERROR: &str = "readdir(%s) error: %s \n";
pub(super) const UTIL_SYMLINK_IGNORED: &str = "Warning : %s is a symbolic link, ignoring\n";
pub(super) const DIR_STAT_FAILED: &str = "zstd: failed to get DIR stats %s: %s\n";
pub(super) const EXPECTED_DIRECTORY: &str = "zstd: expected directory: %s\n";
pub(super) const MKDIR_FAILED: &str = "zstd: failed to create DIR %s: %s\n";
pub(super) const STDIN_IS_AN_INPUT: &str = "stdin is an input - not proceeding.\n";
pub(super) const CONFIRM_ABORT: &str = "%s \n";
pub(super) const REMOVE_STAT_FAILED: &str = "zstd: Failed to stat %s while trying to remove it\n";
pub(super) const REMOVE_NOT_REGULAR: &str = "zstd: Refusing to remove non-regular file %s\n";
pub(super) const USING_STDIN: &str = "Using stdin for input \n";
pub(super) const CANT_STAT: &str = "zstd: can't stat %s : %s -- ignored \n";
pub(super) const NOT_REGULAR: &str = "zstd: %s is not a regular file -- ignored \n";
pub(super) const NAME_ERRNO: &str = "zstd: %s: %s \n";
pub(super) const USING_STDOUT: &str = "Using stdout for output \n";
pub(super) const SPARSE_OFF_STDOUT: &str =
"Sparse File Support is automatically disabled on stdout ; try --sparse \n";
pub(super) const REFUSING_OVERWRITE_INPUT: &str =
"zstd: Refusing to open an output file which will overwrite the input file \n";
pub(super) const SPARSE_OFF_NOT_FILE: &str =
"Sparse File Support is disabled when output is not a file \n";
pub(super) const NUL_IS_REGULAR: &str = "%s is unexpectedly categorized as a regular file";
pub(super) const NOT_OVERWRITTEN: &str = "zstd: %s already exists; not overwritten \n";
pub(super) const ALREADY_EXISTS: &str = "zstd: %s already exists; ";
pub(super) const OVERWRITE_PROMPT: &str = "overwrite (y/n) ? ";
pub(super) const OVERWRITE_ABORT: &str = "Not overwritten \n";
pub(super) const OPEN_DST_FAILED: &str = "zstd: %s: %s\n";
pub(super) const DICT_STAT_FAILED: &str = "Stat failed on dictionary file %s: %s";
pub(super) const DICT_NOT_REGULAR: &str = "Dictionary %s must be a regular file.";
pub(super) const LOADING_DICT: &str = "Loading %s as dictionary \n";
pub(super) const DICT_OPEN_FAILED: &str = "Couldn't open dictionary %s: %s";
pub(super) const DICT_TOO_LARGE: &str = "Dictionary file %s is too large (> %d bytes)";
pub(super) const DICT_READ_FAILED: &str = "Error reading dictionary file %s : %s";
pub(super) const SAME_FILENAME: &str = "WARNING: Two files have same filename: %s\n";
pub(super) const PATCH_FROM_STDIN: &str = "Using --patch-from with stdin requires --stream-size";
pub(super) const PATCH_FROM_TOO_LARGE: &str = "Can't handle files larger than %d GB\n";
pub(super) const RM_TO_STDOUT: &str = concat!(
"It's not allowed to remove input files when processed output is piped to stdout. ",
"This scenario is not supposed to be possible. ",
"This is a programming error. File an issue for it to be fixed."
);
pub(super) const RM_IN_TEST: &str = concat!(
"Test mode shall not remove input files! ",
"This scenario is not supposed to be possible. ",
"This is a programming error. File an issue for it to be fixed."
);
pub(super) const CONCAT_STDOUT: &str =
"zstd: WARNING: all input files will be processed and concatenated into stdout. \n";
pub(super) const CONCAT_FILE: &str = "zstd: WARNING: all input files will be processed and concatenated into a single output file: %s \n";
pub(super) const CONCAT_NO_NAMES: &str =
"The concatenated output CANNOT regenerate original file names nor directory structure. \n";
pub(super) const CONCAT_NOT_REMOVED: &str =
"Since it's a destructive operation, input files will not be removed. \n";
pub(super) const CONCAT_LOSES_METADATA: &str =
"Concatenating multiple processed inputs into a single output loses file metadata. \n";
pub(super) const CONCAT_ABORTING: &str = "Aborting. \n";
pub(super) const PROCEED_PROMPT: &str = "Proceed? (y/n): ";
pub(super) const PROCEED_ABORT: &str = "Aborting...";
pub(super) const ERROR_NAME: &str = "%s";
pub(super) const PURE_NO_DICTIONARY: &str =
"dictionary compression is not available in this build (stuffr pure tier)";
pub(super) const MAX_WINDOW_LOG_EXCEEDED: &str =
"Max window log exceeded by file (compression ratio will suffer)\n";
pub(super) const LONG_MODE_TRIGGERED: &str = "long mode automatically triggered\n";
pub(super) const OPTIMAL_PARSER_NOTES: &str = concat!(
"[Optimal parser notes] Consider the following to improve patch size at the cost of speed:\n",
"- Set a larger targetLength (e.g. --zstd=targetLength=4096)\n",
"- Set a larger chainLog (e.g. --zstd=chainLog=%d)\n",
"- Set a larger LDM hashLog (e.g. --zstd=ldmHashLog=%d)\n",
"- Set a smaller LDM rateLog (e.g. --zstd=ldmHashRateLog=%d)\n",
"Also consider playing around with searchLog and hashLog\n",
);
pub(super) const CREATE_CRESOURCES: &str = "FIO_createCResources \n";
pub(super) const SET_NB_WORKERS: &str = "set nb workers = %d \n";
pub(super) const SET_OVERLAP_LOG: &str = "set overlapLog = %d \n";
pub(super) const USING_ZSTD_FORMAT: &str = "compression using zstd format \n";
pub(super) const DECOMPRESSION_MEMORY: &str = "Decompression will require %s of memory\n";
pub(super) const FREAD_BYTES: &str = "fread %d bytes from source \n";
pub(super) const COMPRESS_GENERIC: &str =
"ZSTD_compress_generic(end:%d) => input pos(%d)<=(%d)size ; output generated %d bytes \n";
pub(super) const ADAPT_ALL_BUFFERS_FULL: &str =
"all buffers full : compression stopped => slow down \n";
pub(super) const ADAPT_FASTER_THAN_FLUSH: &str = "compression faster than flush (%d > %d), and flushed was never slowed down by lack of production => slow down \n";
pub(super) const ADAPT_CHECK: &str = "compression level adaptation check \n";
pub(super) const ADAPT_INPUT_NEVER_BLOCKED: &str =
"input is never blocked => input is slower than ingestion \n";
pub(super) const ADAPT_INPUT_BLOCKED: &str =
"input blocked %d/%d(%d) - ingested:%d vs %d:consumed - flushed:%d vs %d:produced \n";
pub(super) const ADAPT_RECOMMEND_FASTER: &str =
"recommend faster as in(%d) >= (%d)comp(%d) <= out(%d) \n";
pub(super) const ADAPT_SLOWER: &str = "slower speed , higher compression \n";
pub(super) const ADAPT_FASTER: &str = "faster speed , lighter compression \n";
pub(super) const CLEAR_LINE: &str = "\r%s\r";
pub(super) const PROGRESS_VERBOSE: &str =
"(L%s) Buffered:%s - Consumed:%s - Compressed:%s => %s%% ";
pub(super) const PROGRESS_FILES_LONG: &str = "Compress: %s/%s files. Current: ...%s ";
pub(super) const PROGRESS_FILES: &str = "Compress: %s/%s files. Current: %s ";
pub(super) const PROGRESS_READ: &str = "Read:%s ";
pub(super) const PROGRESS_OF: &str = "/%s";
pub(super) const PROGRESS_RATIO: &str = " ==> %s%%";
pub(super) const INCOMPLETE_READ: &str = "Read error : Incomplete read : %d / %d B";
pub(super) const SRC_BYTES: &str = "%s: %d bytes \n";
pub(super) const SUMMARY_EMPTY: &str = "%s : (%s => %s, %s) \n";
pub(super) const SUMMARY: &str = "%s :%s%% (%s => %s, %s) \n";
pub(super) const COMPLETED: &str = "%s : Completed in %s sec (cpu load : %s%%)\n";
pub(super) const OPENING_DST: &str = "FIO_compressFilename_dstFile: opening dst: %s \n";
pub(super) const CLOSING_DST: &str = "FIO_compressFilename_dstFile: closing dst: %s \n";
pub(super) const COMPRESS_SRC_FILE: &str = "FIO_compressFilename_srcFile: %s \n";
pub(super) const IS_A_DIRECTORY: &str = "zstd: %s is a directory -- ignored \n";
pub(super) const INPUT_IS_DICTIONARY: &str =
"zstd: cannot use %s as an input file and dictionary \n";
pub(super) const ALREADY_COMPRESSED: &str = "File is already compressed : %s \n";
pub(super) const RM_FAILED: &str = "zstd: %s: %s";
pub(super) const MIRROR_CANNOT_COMPRESS: &str =
"zstd: --output-dir-mirror cannot compress '%s' into '%s' \n";
pub(super) const CLOSE_FAILED: &str = "Write error (%s) : cannot properly close %s";
pub(super) const FILES_COMPRESSED_EMPTY: &str = "%s files compressed : (%s => %s)\n";
pub(super) const FILES_COMPRESSED: &str = "%s files compressed : %s%% (%s => %s)\n";
pub(super) const COMPRESSED_EXTENSIONS: &[&str] = &[
".zst", ".tzst", ".gz", ".tgz", ".lzma", ".xz", ".txz", ".lz4", ".tlz4", ".7z", ".aa3", ".aac",
".aar", ".ace", ".alac", ".ape", ".apk", ".apng", ".arc", ".archive", ".arj", ".ark", ".asf",
".avi", ".avif", ".ba", ".br", ".bz2", ".cab", ".cdx", ".chm", ".cr2", ".divx", ".dmg", ".dng",
".docm", ".docx", ".dotm", ".dotx", ".dsft", ".ear", ".eftx", ".emz", ".eot", ".epub", ".f4v",
".flac", ".flv", ".gho", ".gif", ".gifv", ".gnp", ".iso", ".jar", ".jpeg", ".jpg", ".jxl",
".lz", ".lzh", ".m4a", ".m4v", ".mkv", ".mov", ".mp2", ".mp3", ".mp4", ".mpa", ".mpc", ".mpe",
".mpeg", ".mpg", ".mpl", ".mpv", ".msi", ".odp", ".ods", ".odt", ".ogg", ".ogv", ".otp",
".ots", ".ott", ".pea", ".png", ".pptx", ".qt", ".rar", ".s7z", ".sfx", ".sit", ".sitx",
".sqx", ".svgz", ".swf", ".tbz2", ".tib", ".tlz", ".vob", ".war", ".webm", ".webp", ".wma",
".wmv", ".woff", ".woff2", ".wvl", ".xlsx", ".xpi", ".xps", ".zip", ".zipx", ".zoo", ".zpaq",
];
pub(super) const WINDOW_TOO_LARGE: &str = "%s : Window size larger than maximum : %d > %d \n";
pub(super) const WINDOW_HINT: &str = "%s : Use --long=%d or --memory=%dMB \n";
pub(super) const WINDOW_LOG_TOO_LARGE: &str =
"%s : Window log larger than ZSTD_WINDOWLOG_MAX=%d; not supported \n";
pub(super) const DECODING_ERROR: &str = "%s : Decoding error (36) : %s \n";
pub(super) const PROGRESS_DECOMPRESS_FILES: &str =
"\rDecompress: %s/%s files. Current: %s : %s... ";
pub(super) const PROGRESS_DECOMPRESS: &str = "\r%s : %s... ";
pub(super) const PREMATURE_END: &str = "%s : Read error (39) : premature end \n";
pub(super) const UNEXPECTED_EOF: &str = "zstd: %s: unexpected end of file \n";
pub(super) const UNKNOWN_HEADER: &str = "zstd: %s: unknown header \n";
pub(super) const UNSUPPORTED_FORMAT: &str = "zstd: %s: unsupported format \n";
pub(super) const DECOMPRESSED_BYTES: &str = "%s: %d bytes \n";
pub(super) const UNKNOWN_SUFFIX: &str = "zstd: %s: unknown suffix (%s expected). Can't derive the output file name. Specify it with -o dstFileName. Ignoring.\n";
pub(super) const SUFFIX_LIST_STR: &str = ".zst/.tzst/.gz/.tgz/.lzma/.xz/.txz/.lz4/.tlz4";
pub(super) const SUFFIX_LIST: &[&str] = &[
".zst", ".tzst", ".zstd", ".gz", ".tgz", ".lzma", ".xz", ".txz", ".lz4", ".tlz4",
];
pub(super) const TAR_SUFFIX: &str = ".tar";
pub(super) const CANNOT_OPEN: &str = "cannot open %s";
pub(super) const CLOSE_OUTPUT_FAILED: &str = "Write error : %s : cannot properly close output file";
pub(super) const MIRROR_CANNOT_DECOMPRESS: &str =
"zstd: --output-dir-mirror cannot decompress '%s' into '%s'\n";
pub(super) const FILES_DECOMPRESSED: &str = "%s files decompressed : %s bytes total \n";
pub(super) const WRITE_BLOCK_FAILED: &str = "Write error : cannot write block : %s";
pub(super) const SKIP_1GB_FAILED: &str = "1 GB skip error (sparse file support)";
pub(super) const SPARSE_SKIP_FAILED: &str = "Sparse skip error ; try --no-sparse";
pub(super) const SPARSE_WRITE_FAILED: &str = "Write error : cannot write block : %s";
pub(super) const SPARSE_END_WRITE_FAILED: &str =
"Write error : cannot write end of decoded block : %s";
pub(super) const FINAL_SKIP_FAILED: &str = "Final skip error (sparse file support)";
pub(super) const LAST_ZERO_FAILED: &str = "Write error : cannot write last zero : %s";
pub(super) const READ_ERROR: &str = "Read error";
pub(super) const LIST_NO_STDIN: &str =
"zstd: --list does not support reading from standard input \n";
pub(super) const LIST_NO_FILES: &str = "No files given \n";
pub(super) const LIST_HEADER: &str =
"Frames Skips Compressed Uncompressed Ratio Check Filename\n";
pub(super) const LIST_ROW: &str = "%s %s %s%s %s%s %s %s %s\n";
pub(super) const LIST_ROW_NO_DECOMP: &str = "%s %s %s%s %s %s\n";
pub(super) const LIST_RULE: &str =
"----------------------------------------------------------------- \n";
pub(super) const LIST_TOTAL: &str = "%s %s %s%s %s%s %s %s %s files\n";
pub(super) const LIST_TOTAL_NO_DECOMP: &str = "%s %s %s%s %s %s files\n";
pub(super) const LIST_V_NAME: &str = "%s \n";
pub(super) const LIST_V_FRAMES: &str = "# Zstandard Frames: %s\n";
pub(super) const LIST_V_SKIPPABLE: &str = "# Skippable Frames: %s\n";
pub(super) const LIST_V_DICTID: &str = "DictID: %s\n";
pub(super) const LIST_V_WINDOW: &str = "Window Size: %s%s (%s B)\n";
pub(super) const LIST_V_COMPRESSED: &str = "Compressed Size: %s%s (%s B)\n";
pub(super) const LIST_V_DECOMPRESSED: &str = "Decompressed Size: %s%s (%s B)\n";
pub(super) const LIST_V_RATIO: &str = "Ratio: %s\n";
pub(super) const LIST_V_CHECK_VALUE: &str = "Check: %s %s\n";
pub(super) const LIST_V_CHECK: &str = "Check: %s\n";
pub(super) const LIST_V_END: &str = "\n";
pub(super) const LIST_DICTID_WARNING: &str = "WARNING: File contains multiple frames with different dictionary IDs. Showing dictID 0 instead";
pub(super) const LIST_PARSE_ERROR: &str = "Error while parsing \"%s\" \n";
pub(super) const LIST_NOT_ZSTD: &str = "File \"%s\" not compressed by zstd \n";
pub(super) const LIST_TRUNCATED: &str = "File \"%s\" is truncated \n";
pub(super) const LIST_NOT_A_FILE: &str = "Error : %s is not a file \n";
pub(super) const LIST_CANT_OPEN: &str = "Error: could not open source file %s \n";
pub(super) const LIST_BEYOND_END: &str =
"Error: seeked to position %s, which is beyond file size of %s\n \n";
pub(super) const LIST_INCOMPLETE: &str = "Error: reached end of file with incomplete frame \n";
pub(super) const LIST_OUT_OF_FRAMES: &str =
"Error: did not reach end of file but ran out of frames \n";
pub(super) const LIST_HEADER_UNDECODABLE: &str = "Error: could not decode frame header \n";
pub(super) const LIST_BLOCK_HEADER: &str = "Error while reading block header \n";
pub(super) const LIST_BLOCK_TYPE: &str = "Error: unsupported block type \n";
pub(super) const LIST_BLOCK_SKIP: &str = "Error: could not skip to end of block \n";
pub(super) const LIST_CHECKSUM: &str = "Error: could not read checksum \n";
pub(super) const LIST_SKIPPABLE_END: &str = "Error: could not find end of skippable frame \n";
pub(super) const GZ_DEFLATE_INIT: &str = "zstd: %s: deflateInit2 error %d \n";
pub(super) const GZ_DEFLATE_ERROR: &str = "zstd: %s: deflate error %d \n";
pub(super) const GZ_PROGRESS: &str = "\rRead : %s MB ==> %s%% ";
pub(super) const GZ_PROGRESS_OF: &str = "\rRead : %s / %s MB ==> %s%% ";
pub(super) const LZMA_ALONE_ENCODER_ERROR: &str = "zstd: %s: lzma_alone_encoder error %d";
pub(super) const LZMA_EASY_ENCODER_ERROR: &str = "zstd: %s: lzma_easy_encoder error %d";
pub(super) const LZMA_ENCODING_ERROR: &str = "zstd: %s: lzma_code encoding error %d";
pub(super) const READ_PROGRESS: &str = "\rRead : %s MB ==> %s%%";
pub(super) const READ_PROGRESS_OF: &str = "\rRead : %s / %s MB ==> %s%%";
pub(super) const LZ4_COMPRESS_FAILED: &str = "zstd: %s: lz4 compression failed : %s";
pub(super) const LZ4_END_FAILED: &str = "zstd: %s: lz4 end of file generation failed : %s";
pub(super) const GZ_PREMATURE: &str = "zstd: %s: premature gz end \n";
pub(super) const GZ_INFLATE_ERROR: &str = "zstd: %s: inflate error %d \n";
pub(super) const LZMA_DECODER_INIT_ERROR: &str = "zstd: %s: %s error %d \n";
pub(super) const LZMA_ALONE_DECODER: &str = "lzma_alone_decoder";
pub(super) const LZMA_STREAM_DECODER: &str = "lzma_stream_decoder";
pub(super) const LZMA_PREMATURE: &str = "zstd: %s: premature lzma end \n";
pub(super) const LZMA_DECODING_ERROR: &str = "zstd: %s: lzma_code decoding error %d \n";
pub(super) const LZ4_PROGRESS: &str = "\rDecompressed : %s ";
pub(super) const LZ4_DECOMPRESSION_ERROR: &str = "zstd: %s: lz4 decompression error : %s \n";
pub(super) const LZ4_UNFINISHED: &str = "zstd: %s: unfinished lz4 stream \n";
pub(super) const LZMA_PRESET_ERROR: &str = "zstd: %s: lzma_lzma_preset error";
pub(super) const NAN: &str = if cfg!(all(
target_os = "linux",
any(target_arch = "x86", target_arch = "x86_64")
)) {
"-nan"
} else {
"nan"
};
pub(super) const INF: &str = "inf";
pub(super) const LZ4F_GENERIC: &str = "ERROR_GENERIC";
pub(super) const LZ4F_RESERVED_FLAG_SET: &str = "ERROR_reservedFlag_set";
pub(super) const LZ4F_HEADER_VERSION_WRONG: &str = "ERROR_headerVersion_wrong";
pub(super) const LZ4F_MAX_BLOCK_SIZE_INVALID: &str = "ERROR_maxBlockSize_invalid";
pub(super) const LZ4F_HEADER_CHECKSUM_INVALID: &str = "ERROR_headerChecksum_invalid";
pub(super) const LZ4F_BLOCK_CHECKSUM_INVALID: &str = "ERROR_blockChecksum_invalid";
pub(super) const LZ4F_DECOMPRESSION_FAILED: &str = "ERROR_decompressionFailed";
pub(super) const LZ4F_FRAME_SIZE_WRONG: &str = "ERROR_frameSize_wrong";
pub(super) const LZ4F_CONTENT_CHECKSUM_INVALID: &str = "ERROR_contentChecksum_invalid";
pub(super) const TRAINING_NOT_AVAILABLE: &str = "training mode not available \n";
pub(super) const DIB_EXM_ERROR: &str = "Error %d : ";
pub(super) const DIB_EXM_END: &str = "\n";
pub(super) const DIB_SHUFFLING: &str = "Shuffling input files\n";
pub(super) const DIB_ZERO_SIZE: &str = "Sample file '%s' has zero size, skipping...\n";
pub(super) const DIB_TOO_LARGE_LIMITING: &str =
"Sample file '%s' is too large, limiting to %d KB\n";
pub(super) const DIB_FOUND: &str = "Found training data %d files, %d KB, %d samples\n";
pub(super) const DIB_MANUAL_MEMORY_LIMIT: &str =
"! Warning : setting manual memory limit for dictionary training data at %d MB \n";
pub(super) const DIB_NOT_ENOUGH_MEMORY: &str = "not enough memory for DiB_trainFiles";
pub(super) const DIB_VERY_LARGE: &str = concat!(
"! Warning : some sample(s) are very large \n",
"! Note that dictionary is only useful for small samples. \n",
"! As a consequence, only the first %d bytes of each sample are loaded \n",
);
pub(super) const DIB_TOO_FEW: &str = concat!(
"! Warning : nb of samples too low for proper processing ! \n",
"! Please provide _one file per sample_. \n",
"! Alternatively, split files into fixed-size blocks representative of samples, with -B# \n",
);
pub(super) const DIB_TOO_FEW_SAMPLES: &str = "nb of samples too low";
pub(super) const DIB_DATA_TOO_SMALL: &str = concat!(
"! Warning : data size of samples too small for target dictionary size \n",
"! Samples should be about 100x larger than target dictionary size \n",
);
pub(super) const DIB_SET_TOO_LARGE: &str =
"Training samples set too large (%d MB); training on %d MB only...\n";
pub(super) const DIB_LOADING: &str = "Loading %s... \r";
pub(super) const DIB_CLEAR: &str =
"\r \r";
pub(super) const DIB_LOADED: &str = "Loaded %d KB total training data, %d nb samples \n";
pub(super) const DIB_OPEN_FAILED: &str = "zstd: dictBuilder: %s %s ";
pub(super) const DIB_READ_FAILED: &str = "Pb reading %s";
pub(super) const DIB_COVER_CHOSEN: &str = "k=%d\nd=%d\nsteps=%d\nsplit=%d\n";
pub(super) const DIB_FASTCOVER_CHOSEN: &str = "k=%d\nd=%d\nf=%d\nsteps=%d\nsplit=%d\naccel=%d\n";
pub(super) const DIB_TRAINING_FAILED: &str = "dictionary training failed : %s \n";
pub(super) const DIB_SAVE: &str = "Save dictionary of size %d into file %s \n";
pub(super) const DIB_CANNOT_OPEN: &str = "cannot open %s ";
pub(super) const DIB_WRITE_ERROR: &str = "%s : write error";
pub(super) const DIB_FLUSH_ERROR: &str = "%s : flush error";