pub(super) use crate::compat::host::printf;
pub(super) const BANNER: &str =
"*** lz4 v1.10.0 64-bit multithread (stuffr %s), by Yann Collet ***\n";
pub(super) const INCORRECT_PARAMETERS: &str = "Incorrect parameters\n";
pub(super) const USAGE: &str = concat!(
"Usage : \n",
" %s [arg] [input] [output] \n",
"\n",
"input : a filename \n",
" with no FILE, or when FILE is - or stdin, read standard input\n",
"Arguments : \n",
" -1 : fast compression (default) \n",
" -12 : slowest compression level \n",
" -T# : use # threads for compression (default:0==auto) \n",
" -d : decompression (default for .lz4 extension)\n",
" -f : overwrite output without prompting \n",
" -k : preserve source files(s) (default) \n",
"--rm : remove source file(s) after successful de/compression \n",
" -h/-H : display help/long help and exit \n",
);
pub(super) const HELP_REST: &str = concat!(
"\n",
"Advanced arguments :\n",
" -V : display Version number and exit \n",
" -v : verbose mode \n",
" -q : suppress warnings; specify twice to suppress errors too\n",
" -c : force write to standard output, even if it is the console\n",
" -t : test compressed file integrity\n",
" -m : multiple input files (implies automatic output filenames)\n",
" -r : operate recursively on directories (sets also -m) \n",
" -l : compress using Legacy format (Linux kernel compression)\n",
" -z : force compression \n",
" -D FILE: use FILE as dictionary (compression & decompression)\n",
" -B# : cut file into blocks of size # bytes [32+] \n",
" or predefined block size [4-7] (default: 7) \n",
" -BI : Block Independence (default) \n",
" -BD : Block dependency (improves compression ratio) \n",
" -BX : enable block checksum (default:disabled) \n",
"--no-frame-crc : disable stream checksum (default:enabled) \n",
"--content-size : compressed frame includes original size (default:not present)\n",
"--list FILE : lists information about .lz4 files (useful for files compressed with --content-size flag)\n",
"--[no-]sparse : sparse mode (default:enabled on file, disabled on stdout)\n",
"--favor-decSpeed: compressed files decompress faster, but are less compressed \n",
"--fast[=#]: switch to ultra fast compression level (default: 1)\n",
"--best : same as -12\n",
"Benchmark arguments : \n",
" -b# : benchmark file(s), using # compression level (default : 1) \n",
" -e# : test all compression levels from -bX to # (default : 1)\n",
" -i# : minimum evaluation time in seconds (default : 3s) \n",
);
pub(super) const HELP_LEGACY: &str = concat!(
"Legacy arguments : \n",
" -c0 : fast compression \n",
" -c1 : high compression \n",
" -c2,-hc: very high compression \n",
" -y : overwrite output without prompting \n",
);
pub(super) const LONG_HELP: &str = concat!(
"\n",
"****************************\n",
"***** Advanced comment *****\n",
"****************************\n",
"\n",
"Which values can [output] have ? \n",
"---------------------------------\n",
"[output] : a filename \n",
" 'stdout', or '-' for standard output (pipe mode)\n",
" 'null' to discard output (test mode) \n",
"[output] can be left empty. In this case, it receives the following value :\n",
" - if stdout is not the console, then [output] = stdout \n",
" - if stdout is console : \n",
" + for compression, output to filename.lz4 \n",
" + for decompression, output to filename without '.lz4'\n",
" > if input filename has no '.lz4' extension : error \n",
"\n",
"Compression levels : \n",
"---------------------\n",
"-0 ... -2 => Fast compression, all identical\n",
"-3 ... -12 => High compression; higher number == more compression but slower\n",
"\n",
"stdin, stdout and the console : \n",
"--------------------------------\n",
"To protect the console from binary flooding (bad argument mistake)\n",
"%s will refuse to read from console, or write to console \n",
"except if '-c' command is specified, to force output to console \n",
"\n",
"Simple example :\n",
"----------------\n",
"1 : compress 'filename' fast, using default output name 'filename.lz4'\n",
" %s filename\n",
"\n",
"Short arguments can be aggregated. For example :\n",
"----------------------------------\n",
"2 : compress 'filename' in high compression mode, overwrite output if exists\n",
" %s -9 -f filename \n",
" is equivalent to :\n",
" %s -9f filename \n",
"\n",
"%s can be used in 'pure pipe mode'. For example :\n",
"-------------------------------------\n",
"3 : compress data stream from 'generator', send result to 'consumer'\n",
" generator | %s | consumer \n",
);
pub(super) const LONG_HELP_LEGACY: &str = concat!(
"\n",
"***** Warning ***** \n",
"Legacy arguments take precedence. Therefore : \n",
"--------------------------------- \n",
" %s -hc filename \n",
"means 'compress filename in high compression mode' \n",
"It is not equivalent to : \n",
" %s -h -c filename \n",
"which displays help text and exits \n",
);
pub(super) const WONT_BE_USED: &str =
"Error : %s won't be used ! Do you want multiple input files (-m) ? \n";
pub(super) const MISSING_ARGUMENT: &str = "error: missing command argument \n";
pub(super) const SEPARATED_ARGUMENT: &str =
"error: command cannot be separated from its argument by another command \n";
pub(super) const NUMERIC_ONLY: &str =
"error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed \n";
pub(super) const ENV_IGNORED: &str =
"Ignore environment variable setting %s=%s: not a valid unsigned value \n";
pub(super) const BLOCKS_KB: &str = "using blocks of size %d KB \n";
pub(super) const BLOCKS_BYTES: &str = "using blocks of size %d bytes \n";
pub(super) const THREADS_REDUCED: &str =
"Requested %d threads too large => automatically reduced to %d \n";
pub(super) const CANNOT_DETERMINE: &str = "Cannot determine an output filename \n";
pub(super) const STDIN_CONSOLE: &str = "refusing to read from a console\n";
pub(super) const STDOUT_CONSOLE: &str = "refusing to write to console without -c \n";
pub(super) const EXTENSION_MISMATCH: &str =
"File extension doesn't match expected LZ4_EXTENSION (.lz4); will not process file: %s\n";
pub(super) const COMPRESSED_FILENAME: &str = "Compressed filename will be : %s \n";
pub(super) const DECODING_FILE: &str = "Decoding file %s \n";
pub(super) const OPEN_INPUT_FAILED: &str = "%s: %s \n";
pub(super) const OPEN_OUTPUT_FAILED: &str = "%s: %s\n";
pub(super) const IS_A_DIRECTORY: &str = "lz4: %s is a directory -- ignored \n";
pub(super) const OVERWRITE_PROMPT: &str = "%s already exists; do you want to overwrite (y/N) ? ";
pub(super) const NOT_OVERWRITTEN: &str = " not overwritten \n";
pub(super) const ALREADY_EXISTS: &str = "%s already exists; not overwritten \n";
pub(super) const SAME_FILE: &str = "%s is the input file; not overwritten (stuffr) \n";
pub(super) const READ_PROGRESS: &str = "\rRead : %d MiB ==> %s%% ";
pub(super) const DECODE_PROGRESS: &str = "\rDecompressed : %d MiB ";
pub(super) const CLEAR_LINE: &str = concat!(
"\r",
" ",
"\r"
);
pub(super) const COMPRESSED_SUMMARY: &str = "Compressed %d bytes into %d bytes ==> %s%%\n";
pub(super) const COMPRESSED_LEGACY_SUMMARY: &str = "Compressed %d bytes into %d bytes ==> %s%% \n";
pub(super) const DECODED_SUMMARY: &str = "%s : decoded %d bytes \n";
pub(super) const UNDECODABLE: &str = "Stream followed by undecodable data ";
pub(super) const AT_POSITION: &str = "at position %d ";
pub(super) const NEWLINE: &str = "\n";
pub(super) const E26_INCOMPLETE: &str =
"Error 26 : LZ4F frame decoding could not complete: invalid frame \n";
pub(super) const E27_DICTIONARY: &str =
"Error 27 : Dictionary error : could not open dictionary file \n";
pub(super) const E34_DECOMPRESSION: &str = "Error 34 : Decompression error : %s \n";
pub(super) const E38_WRITE_COMPRESSED: &str =
"Error 38 : Write error : cannot write compressed block \n";
pub(super) const E40_FIRST_CHUNK: &str =
"Error 40 : Error reading first chunk (%d bytes) of '%s' \n";
pub(super) const E40_MAGIC_UNREADABLE: &str =
"Error 40 : Unrecognized header : Magic Number unreadable \n";
pub(super) const E42_SKIPPABLE_SIZE: &str =
"Error 42 : Stream error : skippable size unreadable \n";
pub(super) const E43_SKIP: &str = "Error 43 : Stream error : cannot skip skippable area \n";
pub(super) const E44_UNRECOGNIZED: &str =
"Error 44 : Unrecognized header : file cannot be decoded \n";
pub(super) const E50_REMOVE: &str = "Error 50 : Remove error : %s: %s \n";
pub(super) const E61_LEGACY_SIZE: &str =
"Error 61 : Error: cannot read block size in Legacy format \n";
pub(super) const E63_LEGACY_BLOCK: &str =
"Error 63 : Read error : cannot access compressed block ! \n";
pub(super) const E64_LEGACY_DECODE: &str =
"Error 64 : Decoding Failed ! Corrupted input detected ! \n";
pub(super) const E69_FINAL_SKIP: &str = "Error 69 : Final skip error (sparse file)\n \n";
pub(super) const E70_WRITE_DECODED: &str = "Error 70 : Write error : cannot write decoded block \n";
pub(super) const E72_SPARSE_SKIP: &str =
"Error 72 : Sparse skip error(%d): %s ; try --no-sparse \n";
pub(super) const E74_SPARSE_TAIL_SKIP: &str = "Error 74 : Sparse skip error ; try --no-sparse \n";
pub(super) const LIST_HEADER: &str =
" Frames Type Block Compressed Uncompressed Ratio Filename\n";
pub(super) const LIST_ROW_KNOWN: &str = "%s %s %s %s %s %s%% %s \n";
pub(super) const LIST_ROW_UNKNOWN: &str = "%s %s %s %s %s %s %s\n";
pub(super) const LIST_FILE_VERBOSE: &str = "%s(%s/%s)\n";
pub(super) const LIST_HEADER_VERBOSE: &str = " Frame Type Block Checksum Compressed Uncompressed Ratio\n";
pub(super) const LIST_FRAME_KNOWN: &str = "%s %s %s %s %s %s %s%%\n";
pub(super) const LIST_FRAME_UNKNOWN: &str = "%s %s %s %s %s %s %s \n";
pub(super) const LIST_FRAME_OTHER: &str = "%s %s %s %s %s %s %s\n";
pub(super) const LIST_FILE_END: &str = "\n";
pub(super) const TYPE_FRAME: &str = "LZ4Frame";
pub(super) const TYPE_LEGACY: &str = "LegacyFrame";
pub(super) const TYPE_SKIPPABLE: &str = "SkippableFrame";
pub(super) const CELL_NONE: &str = "-";
pub(super) const CHECKSUM_XXH32: &str = "XXH32";
pub(super) const BLOCK_INDEPENDENT: &str = "I";
pub(super) const BLOCK_LINKED: &str = "D";
pub(super) const BLOCK_PREFIX: &str = "B";
pub(super) const LIST_NOT_RECOGNIZED: &str = "lz4: %s: File format not recognized \n";
pub(super) const LIST_NOT_REGULAR: &str = "lz4: %s is not a regular file \n";
pub(super) const LIST_CORRUPTED_LEGACY: &str = "Corrupted legacy frame \n";
pub(super) const E71_READING: &str = "Error 71 : Error reading %s \n";
pub(super) const E72_READING: &str = "Error 72 : Error reading %s \n";
pub(super) const POSIX_VERSION: &str =
"_POSIX_VERSION defined: %sL\nPLATFORM_POSIX_VERSION defined: %sL\n";
#[cfg(target_os = "linux")]
pub(super) const POSIX_C_SOURCE: &str = "_POSIX_C_SOURCE defined: 200809L\n";
pub(super) const PRESS_ENTER: &str = "Press enter to continue...\n";
pub(super) const BENCH_REFUSED: &str = "Benchmark mode is not available in this build (stuffr)\n";
pub(super) const USING_THREADS: &str = "Using %d threads for compression \n";
pub(super) const GENERATING_LEGACY: &str = "! Generating LZ4 Legacy format (deprecated) ! \n";
pub(super) const CONTENT_SIZE_UNKNOWN: &str = "Warning : cannot determine input content size \n";
pub(super) const USING_STDIN: &str = "Using stdin for input \n";
pub(super) const USING_STDOUT: &str = "Using stdout for output \n";
pub(super) const SPARSE_DISABLED: &str = "Sparse File Support automatically disabled on stdout ; to force-enable it, add --sparse command \n";
pub(super) const LIST_ENTRY: &str = "%d %s\n";
pub(super) const DONE_IN: &str = "Done in %s s ==> %s MiB/s (cpu load : %s%%)\n";
pub(super) const LEGACY_DETECTED: &str = "Detected : Legacy format \n";
pub(super) const SKIPPABLE_DETECTED: &str = "Skipping detected skippable area \n";