commit 45d7729b48f73d483844a6cb51f3a242b519bd3a Author: Reece Wilson Date: Wed Jan 25 21:03:07 2023 +0000 [+] Initial commit [+] Win32 patches [+] liblzma build json [+] .gitignore [-] Non-public domain code diff --git a/ABOUT-NLS b/ABOUT-NLS new file mode 100644 index 0000000..0a9d56d --- /dev/null +++ b/ABOUT-NLS @@ -0,0 +1 @@ + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..69bbfc3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,39 @@ + +Authors of XZ Utils +=================== + + XZ Utils is developed and maintained by Lasse Collin + and Jia Tan . + + Major parts of liblzma are based on code written by Igor Pavlov, + specifically the LZMA SDK . Without + this code, XZ Utils wouldn't exist. + + The SHA-256 implementation in liblzma is based on the code found from + 7-Zip , which has a modified version of the SHA-256 + code found from Crypto++ . The SHA-256 code + in Crypto++ was written by Kevin Springle and Wei Dai. + + Some scripts have been adapted from gzip. The original versions + were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. + Andrew Dudman helped adapting the scripts and their man pages for + XZ Utils. + + The initial version of the threaded .xz decompressor was written + by Sebastian Andrzej Siewior. + + The initial version of the .lz (lzip) decoder was written + by Michał Górny. + + CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. + + Other authors: + - Jonathan Nieder + - Joachim Henke + + The GNU Autotools-based build system contains files from many authors, + which I'm not trying to list here. + + Several people have contributed fixes or reported bugs. Most of them + are mentioned in the file THANKS. + diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a141f57 --- /dev/null +++ b/COPYING @@ -0,0 +1,49 @@ + +XZ Utils Licensing +================== + + Different licenses apply to different files in this package. Here + is a rough summary of which licenses apply to which parts of this + package (but check the individual files to be sure!): + + - liblzma is in the public domain. + + + - All the documentation in the doc directory and most of the + XZ Utils specific documentation files in other directories + are in the public domain. + + - Translated messages are in the public domain. + + - Test files and test code in the tests directory, and debugging + utilities in the debug directory are in the public domain. + + - The extra directory may contain public domain files, and files + that are under various free software licenses. + + You can do whatever you want with the files that have been put into + the public domain. If you find public domain legally problematic, + take the previous sentence as a license grant. If you still find + the lack of copyright legally problematic, you have too many + lawyers. + + As usual, this software is provided "as is", without any warranty. + + If you copy significant amounts of public domain code from XZ Utils + into your project, acknowledging this somewhere in your software is + polite (especially if it is proprietary, non-free software), but + naturally it is not legally required. Here is an example of a good + notice to put into "about box" or into documentation: + + This software includes code from XZ Utils . + + + Note that the toolchain (compiler, linker etc.) may add some code + pieces that are copyrighted. Thus, it is possible that e.g. liblzma + binary wouldn't actually be in the public domain in its entirety + even though it contains no copyrighted code from the XZ Utils source + package. + + If you have questions, don't hesitate to ask the author(s) for more + information. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..c068ad3 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,8654 @@ +commit 18b845e69752c975dfeda418ec00eda22605c2ee +Author: Lasse Collin +Date: 2023-01-11 18:52:54 +0200 + + Bump version and soname for 5.4.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 4080bbb844fb36701ffb978f0c41ea2c2c9f8960 +Author: Jia Tan +Date: 2023-01-11 23:58:16 +0800 + + Add NEWS for 5.4.1. + + NEWS | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 70 insertions(+) + +commit 674c89fdb8c457ebc3a0652e235d8b6cd7b7dee2 +Author: Lasse Collin +Date: 2023-01-10 11:56:11 +0200 + + sysdefs.h: Don't include strings.h anymore. + + On some platforms src/xz/suffix.c may need for + strcasecmp() but suffix.c includes the header when it needs it. + + Unless there is an old system that otherwise supports enough C99 + to build XZ Utils but doesn't have C89/C90-compatible , + there should be no need to include in sysdefs.h. + + src/common/sysdefs.h | 6 ------ + 1 file changed, 6 deletions(-) + +commit 2a6b938084fac9ddb39cd69c9beeed15c3b6f6f6 +Author: Lasse Collin +Date: 2023-01-10 11:23:41 +0200 + + xz: Include in suffix.c if needed for strcasecmp(). + + SUSv2 and POSIX.1‐2017 declare only a few functions in . + Of these, strcasecmp() is used on some platforms in suffix.c. + Nothing else in the project needs (at least if + building on a modern system). + + sysdefs.h currently includes if HAVE_STRINGS_H is + defined and suffix.c relied on this. + + Note that dos/config.h doesn't #define HAVE_STRINGS_H even though + DJGPP does have strings.h. It isn't needed with DJGPP as strcasecmp() + is also in in DJGPP. + + src/xz/suffix.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit aea639e81beb548e3114c74b6d9a894d6e036189 +Author: Jia Tan +Date: 2023-01-11 22:46:48 +0800 + + xz: Fix warning -Wformat-nonliteral on clang in message.c. + + clang and gcc differ in how they handle -Wformat-nonliteral. gcc will + allow a non-literal format string as long as the function takes its + format arguments as a va_list. + + src/xz/message.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit e3b42bfcb0f67988beee7c7022fed0361282be45 +Author: Jia Tan +Date: 2023-01-11 20:58:31 +0800 + + Tests: Fix test_filter_flags copy/paste error. + + tests/test_filter_flags.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 21625b7e11d004788e40eb5eb88d9d89f65fe347 +Author: Jia Tan +Date: 2023-01-11 20:42:29 +0800 + + Tests: Fix type-limits warning in test_filter_flags. + + This only occurs in test_filter_flags when the BCJ filters are not + configured and built. In this case, ARRAY_SIZE() returns 0 and causes a + type-limits warning with the loop variable since an unsigned number will + always be >= 0. + + tests/test_filter_flags.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +commit c337983e928682d56ce3470b286a8d5b8646e0ad +Author: Lasse Collin +Date: 2023-01-10 22:14:03 +0200 + + liblzma: CLMUL CRC64: Work around a bug in MSVC, second attempt. + + This affects only 32-bit x86 builds. x86-64 is OK as is. + + I still cannot easily test this myself. The reporter has tested + this and it passes the tests included in the CMake build and + performance is good: raw CRC64 is 2-3 times faster than the + C version of the slice-by-four method. (Note that liblzma doesn't + include a MSVC-compatible version of the 32-bit x86 assembly code + for the slice-by-four method.) + + Thanks to Iouri Kharon for figuring out a fix, testing, and + benchmarking. + + src/liblzma/check/crc64_fast.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit b7fb438ea0e3ee02e3a164f3b72fae456cbe34d7 +Author: Jia Tan +Date: 2023-01-11 01:18:50 +0800 + + Tests: Fix unused function warning in test_block_header. + + One of the global arrays of filters was only used in a test that + required both encoders and decoders to be configured in the build. + + tests/test_block_header.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 68e9ef036d18d7c3952bff0b391d5989b86934da +Author: Jia Tan +Date: 2023-01-11 01:08:03 +0800 + + Tests: Fix unused function warning in test_index_hash. + + test_index_hash does not use fill_index_hash() unless both encoders + and decoders are configured in the build. + + tests/test_index_hash.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit a387707cd8cdefbffb5b7429bda4b7fcc192954a +Author: Lasse Collin +Date: 2023-01-10 00:33:14 +0200 + + Windows: Update INSTALL-MSVC.txt to recommend CMake over project files. + + windows/INSTALL-MSVC.txt | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +commit 52902ad69518255a14b0144f0a2379e06fde5b6e +Author: Lasse Collin +Date: 2023-01-10 12:47:16 +0200 + + Revert "liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022)." + + This reverts commit 36edc65ab4cf10a131f239acbd423b4510ba52d5. + + It was reported that it wasn't a good enough fix and MSVC + still produced (different kind of) bad code when building + for 32-bit x86 if optimizations are enabled. + + Thanks to Iouri Kharon. + + src/liblzma/check/crc64_fast.c | 6 ------ + 1 file changed, 6 deletions(-) + +commit e81b9fc48ca70f9228308d3f1871cd81f9a5a496 +Author: Lasse Collin +Date: 2023-01-10 10:05:13 +0200 + + sysdefs.h: Fix a comment. + + src/common/sysdefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6e89ab58b031aa046308a0b3504ff0a5be042571 +Author: Lasse Collin +Date: 2023-01-10 10:04:06 +0200 + + sysdefs.h: Don't include memory.h anymore even if it were available. + + It quite probably was never needed, that is, any system where memory.h + was required likely couldn't compile XZ Utils for other reasons anyway. + + XZ Utils 5.2.6 and later source packages were generated using + Autoconf 2.71 which no longer defines HAVE_MEMORY_H. So the code + being removed is no longer used anyway. + + src/common/sysdefs.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit 65c59ad429aa59f9df0326d9fc82931ba4a9d123 +Author: Lasse Collin +Date: 2023-01-10 08:50:26 +0200 + + CMake/Windows: Add a workaround for windres from GNU binutils. + + This is combined from the following commits in the master branch: + 443dfebced041adc88f10d824188eeef5b5821a9 + 6b117d3b1fe91eb26d533ab16a2e552f84148d47 + 5e34774c31d1b7509b5cb77a3be9973adec59ea0 + + Thanks to Iouri Kharon for the bug report, the original patch, + and testing. + + CMakeLists.txt | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +commit 43521e77acc907863fa4f94aae276366172cb9ee +Author: Lasse Collin +Date: 2023-01-06 22:53:38 +0200 + + Tests: test_filter_flags: Clean up minor issues. + + Here are the list of the most significant issues addressed: + - Avoid using internal common.h header. It's not good to copy the + constants like this but common.h cannot be included for use outside + of liblzma. This is the quickest thing to do that could be fixed later. + + - Omit the INIT_FILTER macro. Initialization should be done with just + regular designated initializers. + + - Use start_offset = 257 for BCJ tests. It demonstrates that Filter + Flags encoder and decoder don't validate the options thoroughly. + 257 is valid only for the x86 filter. This is a bit silly but + not a significant problem in practice because the encoder and + decoder initialization functions will catch bad alignment still. + Perhaps this should be fixed but it's not urgent and doesn't need + to be in 5.4.x. + + - Various tweaks to comments such as filter id -> Filter ID + + tests/test_filter_flags.c | 153 +++++++++++++++++++++++----------------------- + 1 file changed, 78 insertions(+), 75 deletions(-) + +commit 6b44cead95d767414272dc3a67898a36bfdf95b3 +Author: Jia Tan +Date: 2022-12-29 23:33:33 +0800 + + Tests: Refactors existing filter flags tests. + + Converts the existing filter flags tests into tuktests. + + tests/test_filter_flags.c | 655 ++++++++++++++++++++++++++++++++-------------- + 1 file changed, 457 insertions(+), 198 deletions(-) + +commit 1bbefa9659b202ba31bd244a9d0e4f0d37ff3ed7 +Author: Lasse Collin +Date: 2023-01-08 00:32:29 +0200 + + Tests: tuktest.h: Support tuktest_malloc(0). + + It's not needed in XZ Utils at least for now. It's good to support + it still because if such use is needed later, it wouldn't be + caught on GNU/Linux since malloc(0) from glibc returns non-NULL. + + tests/tuktest.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit ce3a3fbc7c2c399aeed644d54f3bd56ac914dfee +Author: Lasse Collin +Date: 2023-01-07 21:57:11 +0200 + + CMake: Update cmake_minimum_required from 3.13...3.16 to 3.13...3.25. + + The changes listed on cmake-policies(7) for versions 3.17 to 3.25 + shouldn't affect this project. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 99fcd57f2ea35eaa94e09f674d5364329c880fa2 +Author: Lasse Collin +Date: 2023-01-08 00:24:23 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit c0c13d9d82eb8a4302c8bbb8b4c5178d285fe9ab +Author: Lasse Collin +Date: 2023-01-07 19:50:35 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3d45987451b1c3bb42697b29341824c0e5484cba +Author: Lasse Collin +Date: 2023-01-09 11:27:24 +0200 + + CMake: Fix a copypaste error in xzdec Windows resource file handling. + + It was my mistake. Thanks to Iouri Kharon for the bug report. + + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 706bce5018d7cf83094e13454a0731169ec119b5 +Author: Lasse Collin +Date: 2023-01-07 19:50:03 +0200 + + CMake/Windows: Add resource files to xz.exe and xzdec.exe. + + The command line tools cannot be built with MSVC for now but + they can be built with MinGW-w64. + + Thanks to Iouri Kharon for the bug report and the original patch. + + CMakeLists.txt | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +commit e96dee55df04113c33b387ccdb6cb70935422d91 +Author: Lasse Collin +Date: 2023-01-09 12:22:05 +0200 + + liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022). + + I haven't tested with MSVC myself and there doesn't seem to be + information about the problem online, so I'm relying on the bug report. + + Thanks to Iouri Kharon for the bug report and the patch. + + src/liblzma/check/crc64_fast.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 52bc1ee34dda9bb6fb40175e5952863066681b77 +Author: Lasse Collin +Date: 2023-01-07 19:31:15 +0200 + + Build: Require that _mm_set_epi64x() is usable to enable CLMUL support. + + VS2013 doesn't have _mm_set_epi64x() so this way CLMUL gets + disabled with VS2013. + + Thanks to Iouri Kharon for the bug report. + + CMakeLists.txt | 3 ++- + configure.ac | 8 ++++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +commit bad44cfe19e8be8ae76755369be2a34abcd2b4fa +Author: Jia Tan +Date: 2022-12-29 00:25:18 +0800 + + Tests: Creates test_index_hash.c + + Tests all API functions exported from index_hash.h. Does not have a + dedicated test for lzma_index_hash_end. + + [Minor edits were made by Lasse Collin.] + + .gitignore | 1 + + CMakeLists.txt | 2 + + tests/Makefile.am | 3 + + tests/test_index_hash.c | 388 ++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 394 insertions(+) + +commit 692ccdf5516dfe55fb6e9c5cdfb31f4c02c1ecd1 +Author: Jia Tan +Date: 2023-01-05 20:57:25 +0800 + + liblzma: Remove common.h include from common/index.h. + + common/index.h is needed by liblzma internally and tests. common.h will + include and define many things that are not needed by the tests. + + Also, this prevents include order problems because both common.h and + lzma.h define LZMA_API. On most platforms it results only in a warning + but on Windows it would break the build as the definition in common.h + must be used only for building liblzma itself. + + src/liblzma/common/index.c | 1 + + src/liblzma/common/index.h | 9 +++++++-- + src/liblzma/common/index_decoder.h | 1 + + src/liblzma/common/stream_buffer_encoder.c | 1 + + 4 files changed, 10 insertions(+), 2 deletions(-) + +commit 2ac7bafc8f07c1edefe96a4a7a040ddfff0eb5bb +Author: Jia Tan +Date: 2022-08-17 20:20:16 +0800 + + liblzma: Add NULL check to lzma_index_hash_append. + + This is for consistency with lzma_index_append. + + src/liblzma/common/index_hash.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit db714d30e0c74d1dd4af1a23ed62b44e0e8e4efc +Author: Jia Tan +Date: 2022-08-17 17:59:51 +0800 + + liblzma: Replaced hardcoded 0x0 index indicator byte with macro + + src/liblzma/common/index.h | 3 +++ + src/liblzma/common/index_decoder.c | 2 +- + src/liblzma/common/index_encoder.c | 2 +- + src/liblzma/common/index_hash.c | 2 +- + src/liblzma/common/stream_decoder.c | 3 ++- + src/liblzma/common/stream_decoder_mt.c | 2 +- + 6 files changed, 9 insertions(+), 5 deletions(-) + +commit 39d2585dcd3e827cfc3c46025ab6708c4aeb36c6 +Author: Jia Tan +Date: 2023-01-06 20:43:31 +0800 + + Style: Change #if !defined() to #ifndef in mythread.h. + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3f0130aa288e4ed57ace609517db9700a41223af +Author: Jia Tan +Date: 2023-01-06 20:35:55 +0800 + + Build: Add missing stream_decoder_mt.c to .vcxproj files. + + The line in the .vcxproj files for building with was missing in 5.4.0. + Thank to Hajin Jang for reporting the issue. + + windows/vs2013/liblzma.vcxproj | 1 + + windows/vs2013/liblzma_dll.vcxproj | 1 + + windows/vs2017/liblzma.vcxproj | 1 + + windows/vs2017/liblzma_dll.vcxproj | 1 + + windows/vs2019/liblzma.vcxproj | 1 + + windows/vs2019/liblzma_dll.vcxproj | 1 + + 6 files changed, 6 insertions(+) + +commit f204d1050a515d17851eed9049862ce5a9c729c1 +Author: Lasse Collin +Date: 2023-01-04 22:40:54 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 34a9c2d650d6c30bd88e1b21910dd863209aa884 +Author: Lasse Collin +Date: 2023-01-04 18:40:28 +0200 + + Tests: Adjust style in test_compress.sh. + + tests/test_compress.sh | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit 761c208d58e0c3daa0f46e68b406adfc318d2a46 +Author: Jia Tan +Date: 2023-01-04 23:58:58 +0800 + + Tests: Replace non portable shell parameter expansion + + The shell parameter expansion using # and ## is not supported in + Solaris 10 Bourne shell (/bin/sh). Even though this is POSIX, it is not fully + portable, so we should avoid it. + + tests/create_compress_files.c | 2 +- + tests/test_compress.sh | 20 +++++++++++++------- + tests/test_compress_prepared_bcj_sparc | 2 +- + tests/test_compress_prepared_bcj_x86 | 2 +- + 4 files changed, 16 insertions(+), 10 deletions(-) + +commit 8a7cbc074547e55e57f4f3696f69bedeb05e14c4 +Author: Jia Tan +Date: 2023-01-03 21:02:38 +0800 + + Translations: Add Korean translation of man pages. + + Thanks to Seong-ho Cho + + po4a/ko.po | 5552 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 5553 insertions(+), 1 deletion(-) + +commit ca2af49bb8be5995eb0e6a3abf457622626d49a7 +Author: Jia Tan +Date: 2023-01-03 20:47:27 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 620 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 332 insertions(+), 288 deletions(-) + +commit bfba3394aed03311fe9a746d3141b2e16d8b9325 +Author: Lasse Collin +Date: 2023-01-02 17:05:07 +0200 + + Build: Fix config.h comments. + + configure.ac | 2 +- + m4/tuklib_progname.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 507648ad114c2ae0cd6d181063e1ac07e8106718 +Author: Jia Tan +Date: 2023-01-02 22:33:48 +0800 + + Build: Only define HAVE_PROGRAM_INVOCATION_NAME if it is set to 1. + + HAVE_DECL_PROGRAM_INVOCATION_NAME is renamed to + HAVE_PROGRAM_INVOCATION_NAME. Previously, + HAVE_DECL_PROGRAM_INVOCATION_NAME was always set when + building with autotools. CMake would only set this when it was 1, and the + dos/config.h did not define it. The new macro definition is consistent + across build systems. + + cmake/tuklib_progname.cmake | 5 ++--- + m4/tuklib_progname.m4 | 5 ++++- + src/common/tuklib_progname.c | 2 +- + src/common/tuklib_progname.h | 2 +- + 4 files changed, 8 insertions(+), 6 deletions(-) + +commit ab5229d32adfec1f3fbc95228d9dd6f560732ab5 +Author: Lasse Collin +Date: 2022-12-30 20:10:08 +0200 + + Tests: test_check: Test corner cases of CLMUL CRC64. + + tests/test_check.c | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 8791826f31733fda0a13b411c2ed930faaeb25aa +Author: Lasse Collin +Date: 2022-12-30 19:36:49 +0200 + + Tests: Clarify a comment in test_lzip_decoder.c. + + tests/test_lzip_decoder.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit c410d812ea12bfc74f6b727c1a799478c79f19ca +Author: Jia Tan +Date: 2022-12-29 01:55:19 +0800 + + xz: Includes and conditionally in mytime.c. + + Previously, mytime.c depended on mythread.h for to be included. + + src/xz/mytime.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 501c6013d4a59fae5d4368e9657c4885493db809 +Author: Jia Tan +Date: 2022-12-29 01:15:27 +0800 + + liblzma: Includes sys/time.h conditionally in mythread + + Previously, was always included, even if mythread only used + clock_gettime. is still needed even if clock_gettime is not used + though because struct timespec is needed for mythread_condtime. + + src/common/mythread.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 9e3cb514b5b95bd235dcdff3db4436f57444ee4f +Author: Jia Tan +Date: 2022-12-29 01:10:53 +0800 + + Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set. + + Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always + be set to 0 or 1. However, this macro was needed in xz so if xz was not + built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but + HAVE_CLOCK_GETTIME was, it caused a warning during build. Now, + HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and + will only be set if it is 1. + + CMakeLists.txt | 8 +++----- + configure.ac | 5 ++++- + src/common/mythread.h | 4 ++-- + src/xz/mytime.c | 5 ++--- + 4 files changed, 11 insertions(+), 11 deletions(-) + +commit 6fc3e5467911572fa9af4021ea46396261aae796 +Author: Jia Tan +Date: 2022-12-28 01:14:07 +0800 + + Translations: Add Ukrainian translations of man pages. + + Thanks to Yuri Chornoivan + + po4a/po4a.conf | 2 +- + po4a/uk.po | 3676 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 3677 insertions(+), 1 deletion(-) + +commit e84f2ab7f8bc38cd8f8befa0bb398656c3c11f8e +Author: Jia Tan +Date: 2022-12-22 23:14:53 +0800 + + liblzma: Update documentation for lzma_filter_encoder. + + src/liblzma/common/filter_encoder.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit b14b8dbba9a3b232787ae218b46430b9246383dd +Author: Jia Tan +Date: 2022-12-21 21:12:03 +0800 + + Tests: Adds lzip decoder tests + + .gitignore | 1 + + tests/Makefile.am | 2 + + tests/test_lzip_decoder.c | 471 ++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 474 insertions(+) + +commit 09a114805e1d4f9a02a06cee7dbf2f5014d1f710 +Author: Jia Cheong Tan +Date: 2022-12-20 22:05:21 +0800 + + Doxygen: Update .gitignore for generating docs for in source build. + + In source builds are not recommended, but we should still ignore + the generated artifacts. + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit d3e6fe44196bf9478ad193522e2b48febf2eca6b +Author: Jia Tan +Date: 2022-12-20 20:46:44 +0800 + + liblzma: Fix lzma_microlzma_encoder() return value. + + Using return_if_error on lzma_lzma_lclppb_encode was improper because + return_if_error is expecting an lzma_ret value, but + lzma_lzma_lclppb_encode returns a boolean. This could result in + lzma_microlzma_encoder, which would be misleading for applications. + + src/liblzma/common/microlzma_encoder.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit b55a27b46f52524a4a8d9cdef03e6689cefc1375 +Author: Lasse Collin +Date: 2022-12-16 18:30:02 +0200 + + liblzma: Update authors list in arm64.c. + + src/liblzma/simple/arm64.c | 1 + + 1 file changed, 1 insertion(+) + +commit 2fd28d2b7cec3468324a6f15eff7e73c285b1d7d +Author: Jia Tan +Date: 2022-12-16 20:58:55 +0800 + + CMake: Update .gitignore for CMake artifacts from in source build. + + In source builds are not recommended, but we can make it easier + by ignoring the generated artifacts from CMake. + + .gitignore | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit b69da6d4bb6bb11fc0cf066920791990d2b22a06 +Author: Lasse Collin +Date: 2022-12-13 20:37:17 +0200 + + Bump version to 5.4.0 and soname to 5.4.0. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma_generic.map | 2 +- + src/liblzma/liblzma_linux.map | 2 +- + 4 files changed, 6 insertions(+), 6 deletions(-) + +commit 20869eb3fb280ff4f271ef527b12b6bf68b05e19 +Author: Lasse Collin +Date: 2022-12-13 20:29:39 +0200 + + Update INSTALL: CMake on Windows isn't experimental anymore. + + Using CMake to build liblzma should work on a few other OSes + but building the command line tools is still subtly broken. + + It is known that shared library versioning may differ between + CMake and Libtool builds on some OSes, most notably Darwin. + + INSTALL | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +commit cbbd84451944e3e8c63acfaa3c923f6d8aff7852 +Author: Lasse Collin +Date: 2022-12-13 19:47:53 +0200 + + Add NEWS for 5.4.0. + + NEWS | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 202 insertions(+) + +commit c3e94d37e8d10a3e96019864b6f5d7b578db2c14 +Author: Lasse Collin +Date: 2022-12-13 17:41:20 +0200 + + Fix a typo in NEWS. + + NEWS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 0d2a2e0a545c3da2b3e9500f1e531eb903087245 +Author: Lasse Collin +Date: 2022-12-13 17:41:03 +0200 + + Add NEWS for 5.2.10. + + NEWS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 177ece1c8eb007188fb1b04eff09ca2193fbdea6 +Author: Lasse Collin +Date: 2022-12-13 12:30:45 +0200 + + Tests: Fix a typo in tests/files/README. + + tests/files/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 60f45bdbaa6b07558b3f4baac285739b0c6342f5 +Author: Lasse Collin +Date: 2022-12-13 12:30:09 +0200 + + Tests: Add two ARM64 test files. + + tests/files/README | 7 +++++++ + tests/files/good-1-arm64-lzma2-1.xz | Bin 0 -> 512 bytes + tests/files/good-1-arm64-lzma2-2.xz | Bin 0 -> 488 bytes + tests/test_files.sh | 5 +++++ + 4 files changed, 12 insertions(+) + +commit f5e419550619c548c7c35d7e367cf00580a56521 +Author: Lasse Collin +Date: 2022-12-12 22:44:21 +0200 + + Translations: Update the Catalan translation. + + po/ca.po | 657 +++++++++++++++++++++++++++++---------------------------------- + 1 file changed, 306 insertions(+), 351 deletions(-) + +commit 0fb9d355da3789b1757040af475b4e6bbc8b8af8 +Author: Lasse Collin +Date: 2022-12-12 19:18:12 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit e5b6c161c61a37c54dcb76a99bbb83ac4abe02dc +Author: Lasse Collin +Date: 2022-12-12 19:07:58 +0200 + + Update AUTHORS. + + AUTHORS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit f2d98e691099d82054d5f3071ef6f5e809932e44 +Author: Lasse Collin +Date: 2022-12-12 15:31:14 +0200 + + Docs: Omit multi-threaded decompress from TODO. + + The TODO file outdated still. + + TODO | 2 -- + 1 file changed, 2 deletions(-) + +commit b42908c42a4cc091db45a7e5ba0e0ecceaa3f6da +Author: Lasse Collin +Date: 2022-12-11 21:16:09 +0200 + + Docs: Update xz-file-format.txt to 1.1.0 for ARM64 filter. + + doc/xz-file-format.txt | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +commit 854f2f5946b353cb0963fd6dfd54d363adc89b9f +Author: Lasse Collin +Date: 2022-12-11 21:13:57 +0200 + + xz: Rename --experimental-arm64 to --arm64. + + src/xz/args.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 31dbd1e5fb65831915a7bbb531c3f19aea8d57a5 +Author: Lasse Collin +Date: 2022-12-11 21:13:06 +0200 + + liblzma: Change LZMA_FILTER_ARM64 to the official Filter ID 0x0A. + + src/liblzma/api/lzma/bcj.h | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +commit 01b3549e523edac899ec4925b282ceddd20da116 +Author: Lasse Collin +Date: 2022-12-08 19:24:22 +0200 + + xz: Make args_info.files_name a const pointer. + + src/xz/args.c | 2 +- + src/xz/args.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit bc665b84ea6bf7946394a08122177efe41b26a5f +Author: Lasse Collin +Date: 2022-12-08 19:18:16 +0200 + + xz: Don't modify argv[]. + + The code that parses --memlimit options and --block-list modified + the argv[] when parsing the option string from optarg. This was + visible in "ps auxf" and such and could be confusing. I didn't + understand it back in the day when I wrote that code. Now a copy + is allocated when modifiable strings are needed. + + src/xz/args.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +commit a13064e1c290de7933db72b6dffbd65cfce59c9f +Author: Lasse Collin +Date: 2022-12-08 18:18:57 +0200 + + Translations: Update the German man page translations. + + po4a/de.po | 4570 ++++++++++++++++++------------------------------------------ + 1 file changed, 1374 insertions(+), 3196 deletions(-) + +commit 8bdbe42a8d0d75dff70206b923fc4bce5c69a40a +Author: Jia Tan +Date: 2022-12-06 23:05:56 +0800 + + Translations: Update the German translation. + + po/de.po | 586 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 315 insertions(+), 271 deletions(-) + +commit 5c304b57c24ef40ff57f864301065f0244c05bde +Author: Jia Tan +Date: 2022-12-06 23:04:25 +0800 + + Translations: Update the Turkish translation. + + po/tr.po | 221 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 108 insertions(+), 113 deletions(-) + +commit 6d86781fdb937970486500447ebb49b98244235b +Author: Jia Tan +Date: 2022-12-06 23:02:11 +0800 + + Translations: Update the Croatian translation. + + po/hr.po | 228 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 113 insertions(+), 115 deletions(-) + +commit 7a5b4b8075eb36026b1796f04ffed5830c42396a +Author: Jia Tan +Date: 2022-12-06 22:56:30 +0800 + + Translations: Add Romanian translation of man pages. + + Thanks to Remus-Gabriel Chelu. + + po4a/po4a.conf | 2 +- + po4a/ro.po | 3692 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 3693 insertions(+), 1 deletion(-) + +commit c6977e7400088177556e8771bcb839eb7d90caa3 +Author: Jia Tan +Date: 2022-12-06 22:52:13 +0800 + + Translations: Update the Romanian translation. + + po/ro.po | 294 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 147 insertions(+), 147 deletions(-) + +commit ac2a747e939c2cbccff7a49c399769af5e02d2ab +Author: Lasse Collin +Date: 2022-12-08 17:30:09 +0200 + + liblzma: Check for unexpected NULL pointers in block_header_decode(). + + The API docs gave an impression that such checks are done + but they actually weren't done. In practice it made little + difference since the calling code has a bug if these are NULL. + + Thanks to Jia Tan for the original patch that checked for + block->filters == NULL. + + src/liblzma/common/block_header_decoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 24790f49ae66938c1c7574315e1c0aba1ed5ed25 +Author: Lasse Collin +Date: 2022-12-01 20:59:32 +0200 + + Bump version number for 5.3.5beta. + + This also sorts the symbol names alphabetically in liblzma_*.map. + + src/liblzma/api/lzma/version.h | 4 ++-- + src/liblzma/liblzma_generic.map | 10 +++++----- + src/liblzma/liblzma_linux.map | 10 +++++----- + 3 files changed, 12 insertions(+), 12 deletions(-) + +commit 7e53c5bcb3c2c17f47c096c06ff6b1481e6ecafa +Author: Lasse Collin +Date: 2022-12-01 20:57:26 +0200 + + Add NEWS for 5.3.5beta. + + NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit 5865f2aaac326fcbd9f8a7d62defa230e4cb644e +Author: Lasse Collin +Date: 2022-12-01 20:57:09 +0200 + + Update THANKS. + + THANKS | 3 +++ + 1 file changed, 3 insertions(+) + +commit 62b270988ec67314d69976df484d2974c6eacfda +Author: Lasse Collin +Date: 2022-12-01 20:04:17 +0200 + + liblzma: Use __has_attribute(__symver__) to fix Clang detection. + + If someone sets up Clang to define __GNUC__ to 10 or greater + then symvers broke. __has_attribute is supported by such GCC + and Clang versions that don't support __symver__ so this should + be much better and simpler way to detect if __symver__ is + actually supported. + + Thanks to Tomasz Gajc for the bug report. + + src/liblzma/common/common.h | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit f9ca7d45162664ddd9fb70e19335c2426e5d75bb +Author: Lasse Collin +Date: 2022-12-01 18:51:52 +0200 + + liblzma: Omit zero-skipping from ARM64 filter. + + It has some complicated downsides and its usefulness is more limited + than I originally thought. So this change is bad for certain very + specific situations but a generic solution that works for other + filters (and is otherwise better too) is planned anyway. And this + way 7-Zip can use the same compatible filter for the .7z format. + + This is still marked as experimental with a new temporary Filter ID. + + src/liblzma/api/lzma/bcj.h | 2 +- + src/liblzma/simple/arm64.c | 81 +++++++++++++--------------------------------- + 2 files changed, 24 insertions(+), 59 deletions(-) + +commit 5baec3f0a9c85e6abf45c0f652f699b074129a8b +Author: Lasse Collin +Date: 2022-12-01 18:13:27 +0200 + + xz: Omit the special notes about ARM64 filter on the man page. + + src/xz/xz.1 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 0c3627b51862eb0dcdd4fc283d046250571991c6 +Author: Lasse Collin +Date: 2022-12-01 18:12:03 +0200 + + liblzma: Don't be over-specific in lzma_str_to_filters API doc. + + src/liblzma/api/lzma/filter.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 94adf057f27b1970f493dc99cd166407d7255639 +Author: Lasse Collin +Date: 2022-12-01 17:54:23 +0200 + + liblzma: Silence unused variable warning when BCJ filters are disabled. + + Thanks to Jia Tan for the original patch. + + src/liblzma/common/string_conversion.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +commit c68af4441744e5ffc41a472e1be9c9d53a1d9780 +Author: Lasse Collin +Date: 2022-12-01 17:38:03 +0200 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 608 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 348 insertions(+), 260 deletions(-) + +commit 3be6942e5c27d29995d41da52fbe274e4ce4a537 +Author: Lasse Collin +Date: 2022-11-30 18:55:03 +0200 + + Add NEWS for 5.2.9. + + NEWS | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 7c16e312cb2f40b81154c0e5be13a3c6b8da485d +Author: Jia Tan +Date: 2022-11-30 23:33:08 +0800 + + xz: Remove message_filters_to_str function prototype from message.h. + + This was forgotten from 7484744af6cbabe81e92af7d9e061dfd597fff7b. + + src/xz/message.h | 16 ---------------- + 1 file changed, 16 deletions(-) + +commit 764955e2d4f2a5e8d6d6fec63af694f799e050e7 +Author: Lasse Collin +Date: 2022-11-30 18:08:34 +0200 + + Change the bug report address. + + It forwards to me and Jia Tan. + + Also update the IRC reference in README as #tukaani was moved + to Libera Chat long ago. + + CMakeLists.txt | 2 +- + README | 11 +++++------ + configure.ac | 2 +- + dos/config.h | 2 +- + windows/README-Windows.txt | 2 +- + 5 files changed, 9 insertions(+), 10 deletions(-) + +commit c21983c76031e01da01ad3c6cc716fe4b8a75070 +Author: Lasse Collin +Date: 2022-11-30 17:50:17 +0200 + + Build: Add string_conversion.c to CMake, DOS, and VS files. + + CMakeLists.txt | 1 + + dos/Makefile | 1 + + windows/vs2013/liblzma.vcxproj | 1 + + windows/vs2013/liblzma_dll.vcxproj | 1 + + windows/vs2017/liblzma.vcxproj | 1 + + windows/vs2017/liblzma_dll.vcxproj | 1 + + windows/vs2019/liblzma.vcxproj | 1 + + windows/vs2019/liblzma_dll.vcxproj | 1 + + 8 files changed, 8 insertions(+) + +commit 30be0c35d24eb5175459d69dbf7d92e2b087ef82 +Author: Lasse Collin +Date: 2022-11-30 17:38:32 +0200 + + Update to HTTPS URLs in AUTHORS. + + AUTHORS | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 0a72b9ca2fe20082da9b7128fe0d908af947a851 +Author: Jia Tan +Date: 2022-11-30 00:52:06 +0800 + + liblzma: Improve documentation for string to filter functions. + + src/liblzma/api/lzma/filter.h | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit a6e21fcede3b196160a52dd294d965c508a4bb33 +Author: Lasse Collin +Date: 2022-11-29 22:27:42 +0200 + + liblzma: Two fixes to lzma_str_list_filters() API docs. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/filter.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 7484744af6cbabe81e92af7d9e061dfd597fff7b +Author: Lasse Collin +Date: 2022-11-28 21:57:47 +0200 + + xz: Use lzma_str_from_filters(). + + Two uses: Displaying encoder filter chain when compressing with -vv, + and displaying the decoder filter chain in --list -vv. + + src/xz/list.c | 28 ++++++--- + src/xz/message.c | 175 +++---------------------------------------------------- + 2 files changed, 28 insertions(+), 175 deletions(-) + +commit cedeeca2ea6ada5b0411b2ae10d7a859e837f203 +Author: Lasse Collin +Date: 2022-11-28 21:37:48 +0200 + + liblzma: Add lzma_str_to_filters, _from_filters, and _list_filters. + + lzma_str_to_filters() uses static error messages which makes + them not very precise. It tells the position in the string + where an error occurred though which helps quite a bit if + applications take advantage of it. Dynamic error messages can + be added later with a new flag if it seems important enough. + + src/liblzma/api/lzma/filter.h | 258 +++++++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/string_conversion.c | 1302 ++++++++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 3 + + src/liblzma/liblzma_linux.map | 3 + + 5 files changed, 1567 insertions(+) + +commit 072ebf7b1335421193ffa9d4a70d5533786b8995 +Author: Lasse Collin +Date: 2022-11-28 21:02:19 +0200 + + liblzma: Make lzma_validate_chain() available outside filter_common.c. + + src/liblzma/common/filter_common.c | 8 ++++---- + src/liblzma/common/filter_common.h | 3 +++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit 5f22bd2d37e3bd01a5d701b51750eb51f09c11bf +Author: Lasse Collin +Date: 2022-11-28 10:51:03 +0200 + + liblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused. + + src/liblzma/lz/lz_decoder.c | 14 -------------- + src/liblzma/lz/lz_decoder.h | 3 --- + 2 files changed, 17 deletions(-) + +commit cee83206465b95729ab649aa2f57fdbde8dcaf89 +Author: Lasse Collin +Date: 2022-11-28 10:48:53 +0200 + + liblzma: Use LZMA1EXT feature in lzma_microlzma_decoder(). + + Here too this avoids the slightly ugly method to set + the uncompressed size. + + Also moved the setting of dict_size to the struct initializer. + + src/liblzma/common/microlzma_decoder.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit e310e8b6a490dfb468f4ed68feff246d776b323c +Author: Lasse Collin +Date: 2022-11-28 10:28:20 +0200 + + liblzma: Use LZMA1EXT feature in lzma_alone_decoder(). + + This avoids the need to use the slightly ugly method to + set the uncompressed size. + + src/liblzma/common/alone_decoder.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit 33b8a24b6646a9dbfd8358405aec466b13078559 +Author: Lasse Collin +Date: 2022-11-27 23:16:21 +0200 + + liblzma: Add LZMA_FILTER_LZMA1EXT to support LZMA1 without end marker. + + Some file formats need support for LZMA1 streams that don't use + the end of payload marker (EOPM) alias end of stream (EOS) marker. + So far liblzma API has supported decompressing such streams via + lzma_alone_decoder() when .lzma header specifies a known + uncompressed size. Encoding support hasn't been available in the API. + + Instead of adding a new LZMA1-only API for this purpose, this commit + adds a new filter ID for use with raw encoder and decoder. The main + benefit of this approach is that then also filter chains are possible, + for example, if someone wants to implement support for .7z files that + use the x86 BCJ filter with LZMA1 (not BCJ2 as that isn't supported + in liblzma). + + src/liblzma/api/lzma/lzma12.h | 123 ++++++++++++++++++++++++++++++-- + src/liblzma/common/filter_common.c | 7 ++ + src/liblzma/common/filter_decoder.c | 6 ++ + src/liblzma/common/filter_encoder.c | 9 +++ + src/liblzma/lzma/lzma2_encoder.c | 2 +- + src/liblzma/lzma/lzma_decoder.c | 26 ++++++- + src/liblzma/lzma/lzma_encoder.c | 40 +++++++++-- + src/liblzma/lzma/lzma_encoder.h | 3 +- + src/liblzma/lzma/lzma_encoder_private.h | 3 + + 9 files changed, 204 insertions(+), 15 deletions(-) + +commit 9a304bf1e45b3ddf61aaeaa7c764915b34618ede +Author: Lasse Collin +Date: 2022-11-27 18:43:07 +0200 + + liblzma: Avoid unneeded use of void pointer in LZMA decoder. + + src/liblzma/lzma/lzma_decoder.c | 3 +-- + src/liblzma/lzma/lzma_decoder.h | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +commit 218394958c7683f892275bb40eae880620feebcc +Author: Lasse Collin +Date: 2022-11-27 18:20:33 +0200 + + liblzma: Pass the Filter ID to LZ encoder and decoder. + + This allows using two Filter IDs with the same + initialization function and data structures. + + src/liblzma/common/alone_decoder.c | 1 + + src/liblzma/common/alone_encoder.c | 1 + + src/liblzma/common/common.h | 7 +++++-- + src/liblzma/common/lzip_decoder.c | 1 + + src/liblzma/common/microlzma_decoder.c | 1 + + src/liblzma/common/microlzma_encoder.c | 1 + + src/liblzma/lz/lz_decoder.c | 5 +++-- + src/liblzma/lz/lz_decoder.h | 3 ++- + src/liblzma/lz/lz_encoder.c | 5 +++-- + src/liblzma/lz/lz_encoder.h | 3 ++- + src/liblzma/lzma/lzma2_decoder.c | 3 ++- + src/liblzma/lzma/lzma2_encoder.c | 3 ++- + src/liblzma/lzma/lzma_decoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 14 files changed, 26 insertions(+), 12 deletions(-) + +commit 1663c7676b76f4c514031797f3db1896e8100f7f +Author: Lasse Collin +Date: 2022-11-27 01:03:16 +0200 + + liblzma: Remove two FIXME comments. + + src/liblzma/common/filter_encoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 11fe708db783ac36ebeeb85da164e29e8c300910 +Author: Lasse Collin +Date: 2022-11-26 22:25:30 +0200 + + xz: Use lzma_filters_free(). + + src/xz/list.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit e782af9110d8499c7ac2929bc871540eefea5ea1 +Author: Lasse Collin +Date: 2022-11-26 22:21:13 +0200 + + liblzma: Use lzma_filters_free() in more places. + + src/liblzma/common/block_header_decoder.c | 20 ++------------------ + src/liblzma/common/stream_decoder.c | 4 +--- + src/liblzma/common/stream_decoder_mt.c | 22 +++++----------------- + 3 files changed, 8 insertions(+), 38 deletions(-) + +commit 90caaded2dc6db1d6a55b01160d7e87f4a423628 +Author: Lasse Collin +Date: 2022-11-25 18:04:37 +0200 + + liblzma: Omit simple coder init functions if they are disabled. + + src/liblzma/simple/arm.c | 4 ++++ + src/liblzma/simple/armthumb.c | 4 ++++ + src/liblzma/simple/ia64.c | 4 ++++ + src/liblzma/simple/powerpc.c | 4 ++++ + src/liblzma/simple/sparc.c | 4 ++++ + src/liblzma/simple/x86.c | 4 ++++ + 6 files changed, 24 insertions(+) + +commit 5cd9f0df78cc4f8a7807bf6104adea13034fbb45 +Author: Lasse Collin +Date: 2022-11-24 23:24:59 +0200 + + xz: Allow nice_len 2 and 3 even if match finder requires 3 or 4. + + Now that liblzma accepts these, we avoid the extra check and + there's one message less for translators too. + + src/xz/options.c | 5 ----- + 1 file changed, 5 deletions(-) + +commit 3be88ae071371caa279b44e13f4836fb178fe4ae +Author: Lasse Collin +Date: 2022-11-24 23:23:55 +0200 + + liblzma: Allow nice_len 2 and 3 even if match finder requires 3 or 4. + + That is, if the specified nice_len is smaller than the minimum + of the match finder, silently use the match finder's minimum value + instead of reporting an error. The old behavior is annoying to users + and it complicates xz options handling too. + + src/liblzma/lz/lz_encoder.c | 14 +++++++++----- + src/liblzma/lz/lz_encoder.h | 9 +++++++++ + src/liblzma/lzma/lzma_encoder.c | 11 ++++++++--- + 3 files changed, 26 insertions(+), 8 deletions(-) + +commit 93439cfafe1768b3b18d67d2356ef7e7559bba59 +Author: Lasse Collin +Date: 2022-11-24 16:25:10 +0200 + + liblzma: Add lzma_filters_update() support to the multi-threaded encoder. + + A tiny downside of this is that now a 1-4 tiny allocations are made + for every Block because each worker thread needs its own copy of + the filter chain. + + src/liblzma/api/lzma/filter.h | 36 +++++++------ + src/liblzma/common/stream_encoder_mt.c | 96 +++++++++++++++++++++++++++++++--- + 2 files changed, 109 insertions(+), 23 deletions(-) + +commit 17ac51e689794eb41cab3e80946fec689caea2d2 +Author: Lasse Collin +Date: 2022-11-24 14:53:22 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 06824396b2b6c84f3a235cb7c19c2a9701167797 +Author: Lasse Collin +Date: 2022-11-24 14:52:44 +0200 + + Build: Don't put GNU/Linux-specific symbol versions into static liblzma. + + It not only makes no sense to put symbol versions into a static library + but it can also cause breakage. + + By default Libtool #defines PIC if building a shared library and + doesn't define it for static libraries. This is documented in the + Libtool manual. It can be overriden using --with-pic or --without-pic. + configure.ac detects if --with-pic or --without-pic is used and then + gives an error if neither --disable-shared nor --disable-static was + used at the same time. Thus, in normal situations it works to build + both shared and static library at the same time on GNU/Linux, + only --with-pic or --without-pic requires that only one type of + library is built. + + Thanks to John Paul Adrian Glaubitz from Debian for reporting + the problem that occurred on ia64: + https://www.mail-archive.com/xz-devel@tukaani.org/msg00610.html + + CMakeLists.txt | 5 +- + configure.ac | 143 +++++++++++++++++++++++++++++--------------- + src/liblzma/common/common.h | 12 ++++ + 3 files changed, 111 insertions(+), 49 deletions(-) + +commit e1acf7107291f8b3d6d609a7133331ff36d35d14 +Author: Lasse Collin +Date: 2022-11-24 01:32:16 +0200 + + liblzma: Refactor to use lzma_filters_free(). + + lzma_filters_free() sets the options to NULL and ids to + LZMA_VLI_UNKNOWN so there is no need to do it by caller; + the filter arrays will always be left in a safe state. + + Also use memcpy() instead of a loop to copy a filter chain + when it is known to be safe to copy LZMA_FILTERS_MAX + 1 + (even if the elements past the terminator might be uninitialized). + + src/liblzma/common/stream_encoder.c | 16 ++++------------ + src/liblzma/common/stream_encoder_mt.c | 11 ++--------- + 2 files changed, 6 insertions(+), 21 deletions(-) + +commit cb05dbcf8b868441ec805016222f3fd77f1c5caa +Author: Lasse Collin +Date: 2022-11-24 01:26:37 +0200 + + liblzma: Fix another invalid free() after memory allocation failure. + + This time it can happen when lzma_stream_encoder_mt() is used + to reinitialize an existing multi-threaded Stream encoder + and one of 1-4 tiny allocations in lzma_filters_copy() fail. + + It's very similar to the previous bug + 10430fbf3820dafd4eafd38ec8be161a6978ed2b, happening with + an array of lzma_filter structures whose old options are freed + but the replacement never arrives due to a memory allocation + failure in lzma_filters_copy(). + + src/liblzma/common/stream_encoder_mt.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 75f1a6c26df4ce329da0882786403e3ccf5cd898 +Author: Jia Tan +Date: 2022-05-05 20:53:42 +0800 + + liblzma: Add support for LZMA_SYNC_FLUSH in the Block encoder. + + The documentation mentions that lzma_block_encoder() supports + LZMA_SYNC_FLUSH but it was never added to supported_actions[] + in the internal structure. Because of this, LZMA_SYNC_FLUSH could + not be used with the Block encoder unless it was the next coder + after something like stream_encoder() or stream_encoder_mt(). + + src/liblzma/common/block_encoder.c | 1 + + 1 file changed, 1 insertion(+) + +commit d0901645170b638c517f5c50866b6ef48f491c65 +Author: Lasse Collin +Date: 2022-11-24 01:02:50 +0200 + + liblzma: Add new API function lzma_filters_free(). + + This is small but convenient and should have been added + a long time ago. + + src/liblzma/api/lzma/filter.h | 21 +++++++++++++++++++++ + src/liblzma/common/filter_common.c | 26 ++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 1 + + src/liblzma/liblzma_linux.map | 1 + + 4 files changed, 49 insertions(+) + +commit ae1f8a723dcde2f2c5cf444bcbb5fc5026b3c3c5 +Author: Lasse Collin +Date: 2022-11-24 00:02:31 +0200 + + CMake: Don't use symbol versioning with static library. + + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 48c1b99dc537a27e1ca929d8837e778e5ba32191 +Author: Lasse Collin +Date: 2022-11-23 21:55:22 +0200 + + liblzma: Add lzma_attr_warn_unused_result to lzma_filters_copy(). + + src/liblzma/api/lzma/filter.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 10430fbf3820dafd4eafd38ec8be161a6978ed2b +Author: Lasse Collin +Date: 2022-11-23 21:26:21 +0200 + + liblzma: Fix invalid free() after memory allocation failure. + + The bug was in the single-threaded .xz Stream encoder + in the code that is used for both re-initialization and for + lzma_filters_update(). To trigger it, an application had + to either re-initialize an existing encoder instance with + lzma_stream_encoder() or use lzma_filters_update(), and + then one of the 1-4 tiny allocations in lzma_filters_copy() + (called from stream_encoder_update()) must fail. An error + was correctly reported but the encoder state was corrupted. + + This is related to the recent fix in + f8ee61e74eb40600445fdb601c374d582e1e9c8a which is good but + it wasn't enough to fix the main problem in stream_encoder.c. + + src/liblzma/common/stream_encoder.c | 39 +++++++++++++++++++++++++++++-------- + 1 file changed, 31 insertions(+), 8 deletions(-) + +commit cafd6dc397ca8b5b5f7775e8d6876b8fe70f8e70 +Author: Lasse Collin +Date: 2022-11-22 16:37:15 +0200 + + liblzma: Fix language in a comment. + + src/liblzma/common/stream_encoder.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c392bf8ccba857baaf50399c4b460119befacd54 +Author: Lasse Collin +Date: 2022-11-22 11:20:17 +0200 + + liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB. + + The encoder doesn't support dictionary sizes larger than 1536 MiB. + This is validated, for example, when calculating the memory usage + via lzma_raw_encoder_memusage(). It is also enforced by the LZ + part of the encoder initialization. However, LZMA encoder with + LZMA_MODE_NORMAL did an unsafe calculation with dict_size before + such validation and that results in an infinite loop if dict_size + was 2 << 30 or greater. + + src/liblzma/lzma/lzma_encoder.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit f50534c973a591ccf65485adfc827a8a7126ca6c +Author: Lasse Collin +Date: 2022-11-21 13:02:33 +0200 + + liblzma: Fix two Doxygen commands in the API headers. + + These were caught by clang -Wdocumentation. + + src/liblzma/api/lzma/hardware.h | 2 +- + src/liblzma/api/lzma/index_hash.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 649d4872ed2f55196114a061d45b416fc4353569 +Author: Lasse Collin +Date: 2022-11-19 19:09:55 +0200 + + xz: Refactor duplicate code from hardware_memlimit_mtenc_get(). + + src/xz/hardware.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d327743bb547a53364e5951a16e5f1663fe4b9ff +Author: Lasse Collin +Date: 2022-11-19 19:06:13 +0200 + + xz: Add support --threads=+N so that -T+1 gives threaded mode. + + src/xz/args.c | 18 +++++++++++++++--- + src/xz/hardware.c | 17 +++++++++++++++-- + src/xz/hardware.h | 1 + + src/xz/xz.1 | 21 ++++++++++++++++++++- + 4 files changed, 51 insertions(+), 6 deletions(-) + +commit a11a2b8b5e830ba682c1d81aaa7078842b296995 +Author: Jia Tan +Date: 2022-11-19 23:18:04 +0800 + + CMake: Adds test_memlimit to CMake tests + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 2af8d9e9b3f44f62d19e7c39297ec63af2e8c64f +Author: Lasse Collin +Date: 2022-11-15 19:10:21 +0200 + + Translations: Update the Korean translation. + + po/ko.po | 652 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 371 insertions(+), 281 deletions(-) + +commit 16ac05677292f7e21a4feaddcfb2ab062ea5f385 +Author: Lasse Collin +Date: 2022-11-15 19:09:28 +0200 + + Translations: Update the Turkish translation. + + po/tr.po | 568 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 310 insertions(+), 258 deletions(-) + +commit b9a67d9a5fa207062d4aa8a01639234609315d31 +Author: Lasse Collin +Date: 2022-11-15 10:58:39 +0200 + + Bump version number for 5.3.4alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma_generic.map | 2 +- + src/liblzma/liblzma_linux.map | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit 5b999ba289b3280457b7386b9ac65dbbdf1575a5 +Author: Lasse Collin +Date: 2022-11-15 10:54:40 +0200 + + Add NEWS for 5.3.4alpha. + + NEWS | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 96 insertions(+) + +commit ce8db9e37da4f6c87691c5066f51f91f2411c44a +Author: Lasse Collin +Date: 2022-11-15 10:54:08 +0200 + + Add NEWS for 5.2.8. + + NEWS | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 79 insertions(+) + +commit b56bc8251d2736224af6bdaaae734ceb8926a879 +Author: Lasse Collin +Date: 2022-11-14 23:19:57 +0200 + + Revert "liblzma: Simple/BCJ filters: Allow disabling generic BCJ options." + + This reverts commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8 + and also does equivalent change to arm64.c. + + Now that ARM64 filter will use lzma_options_bcj, this change + is not needed anymore. + + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/arm64.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 4 ++-- + src/liblzma/simple/simple_private.h | 2 +- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 3 +-- + 9 files changed, 10 insertions(+), 11 deletions(-) + +commit 8370ec8edf9ddf8d1d9fef03d8d1027503ec4c35 +Author: Lasse Collin +Date: 2022-11-14 23:14:41 +0200 + + Replace the experimental ARM64 filter with a new experimental version. + + This is incompatible with the previous version. + + This has space/tab fixes in filter_*.c and bcj.h too. + + src/liblzma/api/lzma/bcj.h | 41 +----- + src/liblzma/common/filter_common.c | 14 +- + src/liblzma/common/filter_decoder.c | 12 +- + src/liblzma/common/filter_encoder.c | 17 +-- + src/liblzma/simple/arm64.c | 283 ++++++++++++++---------------------- + src/liblzma/simple/simple_decoder.h | 4 - + src/liblzma/simple/simple_encoder.h | 2 - + src/xz/args.c | 2 +- + src/xz/message.c | 13 +- + src/xz/options.c | 39 ----- + src/xz/options.h | 7 - + 11 files changed, 147 insertions(+), 287 deletions(-) + +commit f644473a211394447824ea00518d0a214ff3f7f2 +Author: Lasse Collin +Date: 2022-11-14 21:34:57 +0200 + + liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL. + + It also works on E2K as it supports these intrinsics. + + On x86-64 runtime detection is used so the code keeps working on + older processors too. A CLMUL-only build can be done by using + -msse4.1 -mpclmul in CFLAGS and this will reduce the library + size since the generic implementation and its 8 KiB lookup table + will be omitted. + + On 32-bit x86 this isn't used by default for now because by default + on 32-bit x86 the separate assembly file crc64_x86.S is used. + If --disable-assembler is used then this new CLMUL code is used + the same way as on 64-bit x86. However, a CLMUL-only build + (-msse4.1 -mpclmul) won't omit the 8 KiB lookup table on + 32-bit x86 due to a currently-missing check for disabled + assembler usage. + + The configure.ac check should be such that the code won't be + built if something in the toolchain doesn't support it but + --disable-clmul-crc option can be used to unconditionally + disable this feature. + + CLMUL speeds up decompression of files that have compressed very + well (assuming CRC64 is used as a check type). It is know that + the CLMUL code is significantly slower than the generic code for + tiny inputs (especially 1-8 bytes but up to 16 bytes). If that + is a real-world problem then there is already a commented-out + variant that uses the generic version for small inputs. + + Thanks to Ilya Kurdyukov for the original patch which was + derived from a white paper from Intel [1] (published in 2009) + and public domain code from [2] (released in 2016). + + [1] https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf + [2] https://github.com/rawrunprotected/crc + + CMakeLists.txt | 26 ++- + INSTALL | 12 ++ + configure.ac | 59 +++++- + src/liblzma/check/crc64_fast.c | 449 +++++++++++++++++++++++++++++++++++++++- + src/liblzma/check/crc64_table.c | 21 +- + 5 files changed, 554 insertions(+), 13 deletions(-) + +commit 3b466bc79672bb2b06d1245a500588e6026e0ba0 +Author: Lasse Collin +Date: 2022-11-14 20:14:34 +0200 + + Translations: Update the Swedish translation one more time. + + po/sv.po | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit e963379a8622ebdff6ce78e76b803bcd1e1d16d6 +Author: Lasse Collin +Date: 2022-11-14 19:34:15 +0200 + + Translations: Update the Swedish translation again. + + po/sv.po | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit a4bc689a823a2254f29ac9d233170add5121b307 +Author: Lasse Collin +Date: 2022-11-14 19:07:45 +0200 + + Translations: Update the Swedish translation. + + po/sv.po | 671 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 382 insertions(+), 289 deletions(-) + +commit bbf2073d824ab4ba33bed4b77f467435abd333a5 +Author: Lasse Collin +Date: 2022-11-14 18:58:09 +0200 + + Translations: Update the Ukrainian translation. + + po/uk.po | 618 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 354 insertions(+), 264 deletions(-) + +commit ac10b1b3622e70881595586edfb8a3ebdcd76bb6 +Author: Lasse Collin +Date: 2022-11-14 17:58:07 +0200 + + Build: Omit x86_64 from --enable-assembler. + + It didn't do anything. There are only 32-bit x86 assembly files + and it feels likely that new files won't be added as intrinsics + in C are more portable across toolchains and OSes. + + configure.ac | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit eb0f1450ad9f23dac03050d9c8375980240aee21 +Author: Lasse Collin +Date: 2022-11-14 16:00:52 +0200 + + liblzma: Use __attribute__((__constructor__)) if available. + + This uses it for CRC table initializations when using --disable-small. + It avoids mythread_once() overhead. It also means that then + --disable-small --disable-threads is thread-safe if this attribute + is supported. + + CMakeLists.txt | 15 +++++++++++++++ + INSTALL | 4 +++- + configure.ac | 31 ++++++++++++++++++++++++++++--- + src/liblzma/check/crc32_small.c | 7 +++++++ + src/liblzma/check/crc64_small.c | 5 +++++ + src/liblzma/lz/lz_encoder.c | 2 +- + 6 files changed, 59 insertions(+), 5 deletions(-) + +commit 6553f49b11dafad35c73b05f12e14865ea1fd8a1 +Author: Lasse Collin +Date: 2022-11-12 21:19:52 +0200 + + Translations: Update the Romanian translation. + + po/ro.po | 651 +++++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 380 insertions(+), 271 deletions(-) + +commit db97e69e12393becc29f8febd53133d0d36989bd +Author: Lasse Collin +Date: 2022-11-12 21:17:45 +0200 + + Translations: Update the Hungarian translation. + + po/hu.po | 625 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 357 insertions(+), 268 deletions(-) + +commit 2bbb9c0f3829a8b121b36998d273a6c6f92000f4 +Author: Lasse Collin +Date: 2022-11-11 17:58:57 +0200 + + Translations: Update the Finnish translation. + + po/fi.po | 610 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 348 insertions(+), 262 deletions(-) + +commit 3c8cbb8137b6f8ed9416c1209d73cdbcb015251f +Author: Lasse Collin +Date: 2022-11-11 17:58:18 +0200 + + Translations: Update the Croatian translation. + + po/hr.po | 680 +++++++++++++++++++++++++++++++++++---------------------------- + 1 file changed, 381 insertions(+), 299 deletions(-) + +commit 26c3359eac0988d6f3986735cd1363bec1678e8e +Author: Lasse Collin +Date: 2022-11-11 17:57:18 +0200 + + Translations: Update the Polish translation. + + po/pl.po | 569 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 309 insertions(+), 260 deletions(-) + +commit 577e467b137c735afb8de6ae71ac7a73c2960cc4 +Author: Lasse Collin +Date: 2022-11-11 17:56:44 +0200 + + Translations: Update the Spanish translation. + + po/es.po | 598 ++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 344 insertions(+), 254 deletions(-) + +commit f9b4ff6e9a0f1678650775582d3e4fe782abce97 +Author: Lasse Collin +Date: 2022-11-11 17:16:03 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a39961ef211e1bf030b17edeea3cff29fe263b67 +Author: Lasse Collin +Date: 2022-11-11 17:15:25 +0200 + + liblzma: Fix building with Intel ICC (the classic compiler). + + It claims __GNUC__ >= 10 but doesn't support __symver__ attribute. + + Thanks to Stephen Sachs. + + src/liblzma/common/common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c715f683dcb1a817d565da292cddfbceda643e12 +Author: Lasse Collin +Date: 2022-11-11 14:35:58 +0200 + + liblzma: Fix incorrect #ifdef for x86 SSE2 support. + + __SSE2__ is the correct macro for SSE2 support with GCC, Clang, + and ICC. __SSE2_MATH__ means doing floating point math with SSE2 + instead of 387. Often the latter macro is defined if the first + one is but it was still a bug. + + src/liblzma/common/memcmplen.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit bd334ae56afe7f642ad4d0f1ac19e74e82daa1ce +Author: Lasse Collin +Date: 2022-11-11 13:27:06 +0200 + + Add NEWS for 5.2.7 (forgotten cherry-pick from v5.2). + + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit 3c7860cf49de6f81046b3a4034a89f3a4803a576 +Author: Lasse Collin +Date: 2022-11-11 13:16:21 +0200 + + xzdiff: Add support for .lz files. + + The other scripts don't need changes for .lz support because + in those scripts it is enough that xz supports .lz. + + src/scripts/xzdiff.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit d76c752a6d77052e5ad57ade555082585f7ac5d8 +Author: Lasse Collin +Date: 2022-11-11 12:23:58 +0200 + + Scripts: Ignore warnings from xz. + + In practice this means making the scripts work when + the input files have an unsupported check type which + isn't a problem in practice unless support for + some check types has been disabled at build time. + + src/scripts/xzdiff.in | 5 +++-- + src/scripts/xzgrep.in | 2 +- + src/scripts/xzless.in | 4 ++-- + src/scripts/xzmore.in | 4 ++-- + 4 files changed, 8 insertions(+), 7 deletions(-) + +commit 6552535afd1fe29d726ab6e68cf14ce3624fd48c +Author: Lasse Collin +Date: 2022-11-10 12:34:43 +0200 + + Translations: Rename poa4/fr_FR.po to po4a/fr.po. + + That's how it is preferred at the Translation Project. + On my system /usr/share/man/fr_FR doesn't contain any + other man pages than XZ Utils while /usr/share/man/fr + has quite a few, so this will fix that too. + + Thanks to Benno Schulenberg from the Translation Project. + + po4a/{fr_FR.po => fr.po} | 0 + po4a/po4a.conf | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + +commit 0918159ce4c75bfb60aff0193b559f8a9f41d25a +Author: Lasse Collin +Date: 2022-11-09 18:48:50 +0200 + + xz: Update the man page about BCJ filters, including upcoming --arm64. + + The --arm64 isn't actually implemented yet in the form + described in this commit. + + Thanks to Jia Tan. + + src/xz/xz.1 | 66 +++++++++++++++++++++++++++---------------------------------- + 1 file changed, 29 insertions(+), 37 deletions(-) + +commit ba2ae3596f6be1587495f33b367488f6e00e56f1 +Author: Lasse Collin +Date: 2022-11-09 18:14:14 +0200 + + xz: Add --arm64 to --long-help and omit endianness from ARM(-Thumb). + + Modern 32-bit ARM in big endian mode use little endian for + instruction encoding still, so the filters work on such + executables too. It's likely less confusing for users this way. + + The --arm64 option hasn't been implemented yet (there is + --experimental-arm64 but it's different). The --arm64 option + is added now anyway because this is the likely result and the + strings need to be ready for translators. + + Thanks to Jia Tan. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 802d57d9215d9c81dbee86edb43c9e93a7f7ec55 +Author: Lasse Collin +Date: 2022-11-09 15:12:13 +0200 + + Windows: Update the VS project files for ARM64 and .lz support. + + windows/vs2013/config.h | 9 +++++++++ + windows/vs2013/liblzma.vcxproj | 5 ++++- + windows/vs2013/liblzma_dll.vcxproj | 5 ++++- + windows/vs2017/config.h | 9 +++++++++ + windows/vs2017/liblzma.vcxproj | 3 +++ + windows/vs2017/liblzma_dll.vcxproj | 3 +++ + windows/vs2019/config.h | 9 +++++++++ + windows/vs2019/liblzma.vcxproj | 5 ++++- + windows/vs2019/liblzma_dll.vcxproj | 5 ++++- + 9 files changed, 49 insertions(+), 4 deletions(-) + +commit 5846aeda05972bc803c6094821ae836229ebe691 +Author: Lasse Collin +Date: 2022-11-09 14:57:48 +0200 + + DOS: Update Makefile and config.h to include ARM64 and .lz support. + + dos/Makefile | 2 ++ + dos/config.h | 9 +++++++++ + 2 files changed, 11 insertions(+) + +commit 781da8d6c44de6aa278c916375250668a0b107f2 +Author: Lasse Collin +Date: 2022-11-09 14:45:05 +0200 + + CMake: Add lzip decoder files and #define to the build. + + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit df8ad4af65a9c4846b108550d0083770a69dee64 +Author: Lasse Collin +Date: 2022-11-09 14:41:56 +0200 + + Docs: Update INSTALL and also add new prohibited options to PACKAGERS. + + INSTALL | 49 +++++++++++++++++++++++++++++++++++++++++-------- + PACKAGERS | 2 ++ + 2 files changed, 43 insertions(+), 8 deletions(-) + +commit c8ef089c149afaab413c3a51be827dd1d11afe0e +Author: Lasse Collin +Date: 2022-10-20 17:39:06 +0300 + + Tests: Test the .lz files in test_files.sh. + + tests/test_files.sh | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit c8f70ebb4628ceb6cb29cc9195d9deadf69d2bd7 +Author: Lasse Collin +Date: 2022-10-20 15:35:59 +0300 + + Tests: Add .lz (lzip) test files. + + tests/files/README | 109 +++++++++++++++++++++++++++++---- + tests/files/bad-1-v0-uncomp-size.lz | Bin 0 -> 42 bytes + tests/files/bad-1-v1-crc32.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-dict-1.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-dict-2.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-magic-1.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-magic-2.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-member-size.lz | Bin 0 -> 50 bytes + tests/files/bad-1-v1-trailing-magic.lz | Bin 0 -> 54 bytes + tests/files/bad-1-v1-uncomp-size.lz | Bin 0 -> 50 bytes + tests/files/good-1-v0-trailing-1.lz | Bin 0 -> 59 bytes + tests/files/good-1-v0.lz | Bin 0 -> 42 bytes + tests/files/good-1-v1-trailing-1.lz | Bin 0 -> 67 bytes + tests/files/good-1-v1-trailing-2.lz | Bin 0 -> 70 bytes + tests/files/good-1-v1.lz | Bin 0 -> 50 bytes + tests/files/good-2-v0-v1.lz | Bin 0 -> 78 bytes + tests/files/good-2-v1-v0.lz | Bin 0 -> 78 bytes + tests/files/good-2-v1-v1.lz | Bin 0 -> 86 bytes + tests/files/unsupported-1-v234.lz | Bin 0 -> 50 bytes + 19 files changed, 98 insertions(+), 11 deletions(-) + +commit 731db13e6fa3ad3e3fc786c0ccf6eac4cce6865f +Author: Lasse Collin +Date: 2022-10-19 22:32:51 +0300 + + xz: Remove the commented-out FORMAT_GZIP, gzip, .gz, and .tgz. + + src/xz/args.c | 2 -- + src/xz/coder.h | 1 - + src/xz/suffix.c | 9 --------- + 3 files changed, 12 deletions(-) + +commit 3176f992c55b8d788c4633809aaf9447376a5a12 +Author: Lasse Collin +Date: 2022-10-08 21:28:15 +0300 + + xz: Add .lz (lzip) decompression support. + + If configured with --disable-lzip-decoder then --long-help will + still list `lzip' in --format but I left it like that since + due to translations it would be messy to have two help strings. + Features are disabled only in special situations so wrong help + in such a situation shouldn't matter much. + + Thanks to Michał Górny for the original patch. + + src/xz/args.c | 9 ++++++++ + src/xz/coder.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- + src/xz/coder.h | 3 +++ + src/xz/message.c | 2 +- + src/xz/suffix.c | 26 ++++++++++++++++++---- + src/xz/xz.1 | 46 +++++++++++++++++++++++++++++++++----- + 6 files changed, 141 insertions(+), 13 deletions(-) + +commit 034086e1ae1459210837a24e04878435c86dc41b +Author: Lasse Collin +Date: 2022-10-08 00:29:20 +0300 + + liblzma: Add .lz support to lzma_auto_decoder(). + + Thanks to Michał Górny for the original patch. + + src/liblzma/api/lzma/container.h | 10 ++++++---- + src/liblzma/common/Makefile.inc | 3 ++- + src/liblzma/common/auto_decoder.c | 23 +++++++++++++++++------ + src/liblzma/common/lzip_decoder.h | 22 ++++++++++++++++++++++ + 4 files changed, 47 insertions(+), 11 deletions(-) + +commit 0538db038f3cdc352007dacb42454aa1806b8e40 +Author: Lasse Collin +Date: 2022-10-06 15:50:20 +0300 + + liblzma: Add .lz (lzip) decompression support (format versions 0 and 1). + + Support for format version 0 was removed from lzip 1.18 for some + reason. .lz format version 0 files are rare (and old) but some + source packages were released in this format, and some people might + have personal files in this format too. It's very little extra code + to support it along side format version 1 so this commits adds + support for both. + + The Sync Flush marker extentension to the original .lz format + version 1 isn't supported. It would require changes to the + LZMA decoder itself. Such files are very rare anyway. + + See the API doc for lzma_lzip_decoder() for more details about + the .lz format support. + + Thanks to Michał Górny for the original patch. + + configure.ac | 21 ++ + src/liblzma/api/lzma/container.h | 62 +++++- + src/liblzma/common/Makefile.inc | 5 + + src/liblzma/common/lzip_decoder.c | 413 ++++++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma_generic.map | 1 + + src/liblzma/liblzma_linux.map | 1 + + 6 files changed, 501 insertions(+), 2 deletions(-) + +commit 633d48a075b9ce4b9c08a7a56a7eb4cabc18100c +Author: Lasse Collin +Date: 2022-11-09 14:17:23 +0200 + + liblzma: Add the missing Makefile.inc change for --disable-microlzma. + + This was forgotten from commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8. + + src/liblzma/common/Makefile.inc | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit 724285dadbdc88765c8fb83eab9816575a260966 +Author: Lasse Collin +Date: 2022-11-09 14:10:52 +0200 + + xz: Add comments about stdin and src_st.st_size. + + "xz -v < regular_file > out.xz" doesn't display the percentage + and estimated remaining time because it doesn't even try to + check the input file size when input is read from stdin. + This could be improved but for now there's just a comment + to remind about it. + + src/xz/coder.c | 9 +++++++++ + src/xz/file_io.c | 4 ++++ + 2 files changed, 13 insertions(+) + +commit f723eec68b0e44234910f669a29119de33018967 +Author: Lasse Collin +Date: 2022-11-09 12:48:22 +0200 + + xz: Fix displaying of file sizes in progress indicator in passthru mode. + + It worked for one input file since the counters are zero when + xz starts but they weren't reset when starting a new file in + passthru mode. For example, if files A, B, and C are one byte each, + then "xz -dcvf A B C" would show file sizes as 1, 2, and 3 bytes + instead of 1, 1, and 1 byte. + + src/xz/coder.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 69265d0f223ddf1d66f799b8b047df22923e376f +Author: Lasse Collin +Date: 2022-11-09 11:27:20 +0200 + + xz: Add a comment why --to-stdout is not in --help. + + It is on the man page still. + + src/xz/message.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit fe6b8852a3c6a0eb5a3c33512e0a69af257d3bc7 +Author: Lasse Collin +Date: 2022-11-08 23:05:37 +0200 + + xz: Make xz -lvv show that the upcoming --arm64 needs 5.4.0 to decompress. + + src/xz/list.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +commit fb3f05ac9f2b4b0e3643401960fbeab31997ac7a +Author: Lasse Collin +Date: 2022-11-08 22:26:54 +0200 + + Docs: Update faq.txt a little. + + doc/faq.txt | 66 ++++++++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 43 insertions(+), 23 deletions(-) + +commit 05331f091ec3b68eccbfb2a9a7a576072768fb4b +Author: Lasse Collin +Date: 2022-11-08 16:57:17 +0200 + + Translations: Update Turkish translation. + + po/tr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ed3a4822963b4940d84e6f44d47277c394fc046d +Author: Lasse Collin +Date: 2022-11-08 14:55:32 +0200 + + Translations: Update Croatian translation. + + po/hr.po | 190 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 96 insertions(+), 94 deletions(-) + +commit 4746f5ec721316bc4c6fec9905b2902e0360e0af +Author: Lasse Collin +Date: 2022-11-08 14:13:03 +0200 + + liblzma: Update API docs about decoder flags. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +commit 8779a9db5d0cec00c9dc9e9965dd2dda04f9d80d +Author: Lasse Collin +Date: 2022-11-08 14:01:50 +0200 + + liblzma: Use the return_if_error() macro in alone_decoder.c. + + src/liblzma/common/alone_decoder.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit 3f4990b6822961e75cd9b4e2e82b1df63f6f8fcc +Author: Lasse Collin +Date: 2022-11-08 14:00:58 +0200 + + liblzma: Fix a comment in auto_decoder.c. + + src/liblzma/common/auto_decoder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 026a5897c72a2041ae08ceec54ce8b1cdeb51334 +Author: Lasse Collin +Date: 2022-11-08 13:43:19 +0200 + + xz: Initialize the pledge(2) sandbox at the very beginning of main(). + + It feels better that the initializations are sandboxed too. + They don't do anything that the pledge() call wouldn't allow. + + src/xz/main.c | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +commit 49a59f6ca001c3ce9affa2c162b437aad021b4d5 +Author: Lasse Collin +Date: 2022-11-07 22:51:16 +0200 + + xz: Extend --robot --info-memory output. + + Now it includes everything that the human-readable --info-memory shows. + + src/xz/hardware.c | 24 +++++++++++++++--------- + src/xz/xz.1 | 47 +++++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 56 insertions(+), 15 deletions(-) + +commit 5e2450c75cbac966c62cf2231c824f2cc91ddba8 +Author: Lasse Collin +Date: 2022-11-07 17:22:04 +0200 + + liblzma: Include cached memory in reported memusage in threaded decoder. + + This affects lzma_memusage() and lzma_memlimit_set() when used + with the threaded decompressor. Now all allocations are reported + by lzma_memusage() (so it's not misleading) and lzma_memlimit_set() + cannot lower the limit below that value. + + The alternative would have been to allow lowering the limit if + doing so is possible by freeing the cached memory but since + the primary use case of lzma_memlimit_set() is to increase + memlimit after LZMA_MEMLIMIT_ERROR this simple approach + was selected. + + The cached memory was always included when enforcing + the memory usage limit while decoding. + + Thanks to Jia Tan. + + src/liblzma/common/stream_decoder_mt.c | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +commit 1fc6e7dd1fabdb60124d449b99273330ccab3ff1 +Author: Jia Tan +Date: 2022-11-07 16:24:14 +0200 + + xz: Avoid a compiler warning in progress_speed() in message.c. + + This should be smaller too since it avoids the string constants. + + src/xz/message.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +commit cf118c014683069b5dbe91898acdc40f2f0a1f5d +Author: Lasse Collin +Date: 2022-10-31 16:26:05 +0200 + + Build: Clarify comment in configure.ac about SSE2. + + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit aad3c609ffb72f581a7a2b67be3ad70b2b327840 +Author: Lasse Collin +Date: 2022-10-31 16:16:37 +0200 + + Build: Remove obsolete commented-out lines from configure.ac. + + configure.ac | 4 ---- + 1 file changed, 4 deletions(-) + +commit e53e0e2186c6b8ce866bd19aec52f1c318ed31ba +Author: Lasse Collin +Date: 2022-10-31 13:31:58 +0200 + + Windows: Fix mythread_once() macro with Vista threads. + + Don't call InitOnceComplete() if initialization was already done. + + So far mythread_once() has been needed only when building + with --enable-small. windows/build.bash does this together + with --disable-threads so the Vista-specific mythread_once() + is never needed by those builds. VS project files or + CMake-builds don't support HAVE_SMALL builds at all. + + src/common/mythread.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 48dde3bab9dc04081acb5aa7cf7c5044b8a49f58 +Author: Lasse Collin +Date: 2022-10-31 11:54:44 +0200 + + liblzma: Silence -Wconversion warning from crc64_fast.c. + + src/liblzma/check/crc64_fast.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit a243c617ff249d915ac123de4f536b80322c1fdb +Author: Lasse Collin +Date: 2022-10-31 11:49:47 +0200 + + CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4. + + This was forgotten from commit 2611c4d90535652d3eb7ef4a026a6691276fab43. + + cmake/tuklib_cpucores.cmake | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 05c72de06fcaaedc78f8abba7d5ec568ddcf1e75 +Author: Lasse Collin +Date: 2022-10-27 15:49:18 +0300 + + Tests: test_files.sh: Make it not fail if features were disabled at build. + + It now tries to test as many files as easily possible. + The exit status indicates skipping if any of the files were + skipped. This way it is easy to notice if something is being + skipped when it isn't expected. + + tests/test_files.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 46 insertions(+), 4 deletions(-) + +commit b3459327a51f4b8239d19e6c34b4e0c6bc2d81de +Author: Lasse Collin +Date: 2022-10-27 15:30:13 +0300 + + Tests: test_files.sh: Suppress an expected warning from the log. + + xz (but not xzdec) will normally warn about unsupported check + but since we are testing specifically such a file, it's better + to silence that warning so that it doesn't look suspicious in + test_files.sh.log. + + The use of -q and -Q in xzdec is just for consistency and + doesn't affect the result at least for now. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 798c86e4231e0835ab76ccd0810c8ea30833b2ce +Author: Lasse Collin +Date: 2022-10-27 15:27:50 +0300 + + Tests: test_files.sh: Print the reason for skipping if xz & xzdec missing. + + tests/test_files.sh | 1 + + 1 file changed, 1 insertion(+) + +commit c1dd8524e1af07f16b790463899de06a6a5fcc08 +Author: Lasse Collin +Date: 2022-10-27 01:12:40 +0300 + + Tests: Keep test_compress_* working when some filters are unavailable. + + tests/test_compress.sh | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +commit ce30ada91951d0746879ae438da11f1ee8a90aa0 +Author: Jia Tan +Date: 2022-10-23 21:01:08 +0800 + + Tests: test_bcj_exact_size skips properly now if PowerPC filter disabled. + + tests/test_bcj_exact_size.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 89c5cfcacaca7130509fac836e2f30c46b824502 +Author: Lasse Collin +Date: 2022-10-26 00:05:57 +0300 + + Tests: Test also unsupported-*.xz. + + tests/test_files.sh | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +commit a4b214b93ac741edef9c41e55865b0b867ca2587 +Author: Lasse Collin +Date: 2022-10-25 23:45:03 +0300 + + Build: Use AC_CONFIG_HEADERS instead of the ancient AC_CONFIG_HEADER. + + We require Autoconf >= 2.69 and that has AC_CONFIG_HEADERS. + + There is a warning about AC_PROG_CC_C99 being obsolete but + it cannot be removed because it is needed with Autoconf 2.69. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 04f299b64e73f50afc188c2590ebebc6b73ed744 +Author: Lasse Collin +Date: 2022-10-25 23:31:44 +0300 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8 +Author: Lasse Collin +Date: 2022-10-25 23:28:34 +0300 + + Build: Add configure option --disable-microlzma. + + MicroLZMA was made for EROFS and used by erofs-utils. + It might be used by something else in the future but + those wanting a smaller build for specific situations + can now disable this rarely-needed feature. + + configure.ac | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +commit 054ccd6d14b2cc6eddc56897af280d3221414150 +Author: Lasse Collin +Date: 2022-10-25 23:09:11 +0300 + + xz: Fix --single-stream with an empty .xz Stream. + + Example: + + $ xz -dc --single-stream good-0-empty.xz + xz: good-0-empty.xz: Internal error (bug) + + The code, that is tries to catch some input file issues early, + didn't anticipate LZMA_STREAM_END which is possible in that + code only when --single-stream is used. + + src/xz/coder.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 563288ea705e83ff5cb292adf794650c263bca1d +Author: Lasse Collin +Date: 2022-10-25 21:11:58 +0300 + + xz: Add support for OpenBSD's pledge() sandbox. + + configure.ac | 12 +++++++++--- + src/xz/file_io.c | 11 +++++++++++ + src/xz/main.c | 13 +++++++++++++ + src/xz/private.h | 2 +- + 4 files changed, 34 insertions(+), 4 deletions(-) + +commit f9913e8ee2ba0b1e4ff4d0aa4c001aae305ed944 +Author: Lasse Collin +Date: 2022-10-25 19:07:17 +0300 + + xz: Fix decompressor behavior if input uses an unsupported check type. + + Now files with unsupported check will make xz display + a warning, set the exit status to 2 (unless --no-warn is used), + and then decompress the file normally. This is how it was + supposed to work since the beginning but this was broken by + the commit 231c3c7098f1099a56abb8afece76fc9b8699f05, that is, + a little before 5.0.0 was released. The buggy behavior displayed + a message, set exit status 1 (error), and xz didn't attempt to + to decompress the file. + + This doesn't matter today except for special builds that disable + CRC64 or SHA-256 at build time (but such builds should be used + in special situations only). The bug matters if new check type + is added in the future and an old xz version is used to decompress + such a file; however, it's likely that such files would use a new + filter too and an old xz wouldn't be able to decompress the file + anyway. + + The first hunk in the commit is the actual fix. The second hunk + is a cleanup since LZMA_TELL_ANY_CHECK isn't used in xz. + + There is a test file for unsupported check type but it wasn't + used by test_files.sh, perhaps due to different behavior between + xz and the simpler xzdec. + + src/xz/coder.c | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +commit aa4fe145b9486adc454f44fd3e09be9add808a0f +Author: Lasse Collin +Date: 2022-10-25 18:36:19 +0300 + + xz: Clarify the man page: input file isn't removed if an error occurs. + + src/xz/xz.1 | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 8b46ae8cdeddfd7dc01fec92971b8696e9a96c5d +Author: Lasse Collin +Date: 2022-10-25 18:30:55 +0300 + + xz: Refactor to remove is_empty_filename(). + + Long ago it was used in list.c too but nowadays it's needed + only in io_open_src() so it's nicer to avoid a separate function. + + src/xz/file_io.c | 4 +++- + src/xz/util.c | 12 ------------ + src/xz/util.h | 4 ---- + 3 files changed, 3 insertions(+), 17 deletions(-) + +commit 85624015978b0de294cff3df79006df987c552b1 +Author: Lasse Collin +Date: 2022-10-25 18:23:54 +0300 + + xz: If input file cannot be removed, treat it as a warning, not error. + + Treating it as a warning (message + exit status 2) matches gzip + and it seems more logical as at that point the output file has + already been successfully closed. When it's a warning it is + possible to suppress it with --no-warn. + + src/xz/file_io.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit fda9f85f52c546f7ca0313cf89481da4707fecb3 +Author: Lasse Collin +Date: 2022-10-24 16:25:09 +0300 + + liblzma: Threaded decoder: Stop the worker threads on errors. + + It's waste of CPU time and electricity to leave the unfinished + worker threads running when it is known that their output will + get ignored. + + src/liblzma/common/stream_decoder_mt.c | 33 ++++++++++++++++++++++++++------- + 1 file changed, 26 insertions(+), 7 deletions(-) + +commit 2611c4d90535652d3eb7ef4a026a6691276fab43 +Author: Lasse Collin +Date: 2022-10-20 20:22:50 +0300 + + tuklib_cpucores: Use HW_NCPUONLINE on OpenBSD. + + On OpenBSD the number of cores online is often less + than what HW_NCPU would return because OpenBSD disables + simultaneous multi-threading (SMT) by default. + + Thanks to Christian Weisgerber. + + m4/tuklib_cpucores.m4 | 5 +++++ + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 14 insertions(+) + +commit 424ac91c7e0419393ff2bde4f62e21fa611c776d +Author: Lasse Collin +Date: 2022-10-19 19:39:35 +0300 + + Tests: Skip tests in test_*.sh if encoders and/or decoders are disabled. + + This isn't perfect as the scripts can still fail if only + certain filters are disabled. This is still an improvement + as now "make check" has better behavior when all encoders + or decoders are disabled. + + Grepping ../config.h is simple and fairly clean but it only + works if config.h was created. CMake builds don't create + config.h but they don't use these test scripts either. + + Thanks to Sebastian Andrzej Siewior for reporting the problem. + Thanks to Jia Tan for the original patch which grepped xz + error messages instead of config.h. + + tests/test_compress.sh | 12 ++++++++++++ + tests/test_files.sh | 11 +++++++++++ + tests/test_scripts.sh | 11 +++++++++++ + 3 files changed, 34 insertions(+) + +commit ca8bf9d7c5a30be8ba1eeb106fd892f19e83ed09 +Author: Lasse Collin +Date: 2022-10-19 18:54:34 +0300 + + Test: Remove the (exit 1) lines. + + I suspect that I used these in the original version because + Autoconf's manual describes that such a trick is needed in + some specific situations for portability reasons. None of those + situations listed on Autoconf 2.71 manual apply to these test + scripts though so this cleans them up. + + tests/test_compress.sh | 10 ---------- + tests/test_files.sh | 9 --------- + tests/test_scripts.sh | 6 ------ + 3 files changed, 25 deletions(-) + +commit 82fcb7cfc17ce62f79ebc7ca2374e1daca5e4d5e +Author: Lasse Collin +Date: 2022-10-19 17:14:57 +0300 + + Tests: Fix a warning in test_memlimit.c when decoders are disabled. + + tests/test_memlimit.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit b5f8271b45b9b0e59485ffba3640ca3418835ec4 +Author: Lasse Collin +Date: 2022-10-19 17:11:46 +0300 + + Tests: Add test_memlimit to .gitignore. + + Thanks to Jia Tan. + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit 6a86e81cab202d0a812a7b2e9efacaf70c58ba38 +Author: Jia Tan +Date: 2022-10-06 21:53:09 +0300 + + Tests: Refactor test_stream_flags.c. + + Converts test_stream_flags to tuktest. Also the test will now + compile and skip properly if encoders or decoders are disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_stream_flags.c | 533 ++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 416 insertions(+), 117 deletions(-) + +commit 827ac5b4821491fd3afe0d0e1ddac326253aeb66 +Author: Jia Tan +Date: 2022-10-06 17:00:38 +0800 + + Tests: Refactor test_block_header.c. + + test_block_header now achieves higher test coverage. Also the + test will now compile and skip properly if encoders or decoders + are disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_block_header.c | 486 +++++++++++++++++++++++++++++++++++----------- + 1 file changed, 370 insertions(+), 116 deletions(-) + +commit 84963318952064a93bfc52edd6b0ef70593384ee +Author: Jia Tan +Date: 2022-10-05 23:54:12 +0800 + + Tests: Fix compilation issues. + + test_bcj_exact_size, test_check, test_hardware, and test_index will + all now compile and skip properly if encoders or decoders are disabled. + + Also fixed a small typo (disabed -> disabled). + + Thanks to Sebastian Andrzej Siewior. + + tests/test_bcj_exact_size.c | 20 ++++++++++++++------ + tests/test_check.c | 8 +++++++- + tests/test_hardware.c | 2 +- + tests/test_index.c | 6 ++++++ + tests/test_memlimit.c | 16 +++++++++++++++- + tests/test_vli.c | 13 +++++++++++++ + 6 files changed, 56 insertions(+), 9 deletions(-) + +commit 7dcabeec63d46b436fa5f043c3d1f09d0e15be16 +Author: Lasse Collin +Date: 2022-10-05 16:20:47 +0300 + + Tests: Include mythread.h in the tests that use MYTHREAD_ENABLED. + + tests/test_check.c | 1 + + tests/test_hardware.c | 1 + + tests/test_memlimit.c | 1 + + 3 files changed, 3 insertions(+) + +commit 14af758a770c7781af18fb66d6d21ee5b1c27f04 +Author: Jia Tan +Date: 2022-10-05 20:57:16 +0800 + + liblzma: Fix a compilation issue when encoders are disabled. + + When encoders were disabled and threading enabled, outqueue.c and + outqueue.h were not compiled. The multi threaded decoder required + these files, so compilation failed. + + src/liblzma/common/Makefile.inc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 6ca5c354bd4620aa7f81da68870eef1b1f26288f +Author: Jia Tan +Date: 2022-10-05 16:41:38 +0800 + + Tests: Fix compilation error when threading support has been disabled. + + Now tests that require threading are skipped when threading + support has been disabled. + + Thanks to Sebastian Andrzej Siewior. + + tests/test_check.c | 4 ++++ + tests/test_hardware.c | 4 ++++ + tests/test_memlimit.c | 4 ++++ + 3 files changed, 12 insertions(+) + +commit fae37ad2affd8fe8871f4ff93d5cab5ec14d5e58 +Author: Lasse Collin +Date: 2022-10-05 14:26:00 +0300 + + tuklib_integer: Add 64-bit endianness-converting reads and writes. + + Also update the comment in liblzma's memcmplen.h. + + Thanks to Michał Górny for the original patch for the reads. + + m4/tuklib_integer.m4 | 8 ++++---- + src/common/tuklib_integer.h | 46 ++++++++++++++++++++++++++++++++++++++++-- + src/liblzma/common/memcmplen.h | 9 +++------ + 3 files changed, 51 insertions(+), 12 deletions(-) + +commit 508a44372c5b0dede8863fd0d358d4a9d8645c95 +Author: Lasse Collin +Date: 2022-09-30 12:06:13 +0300 + + liblzma: Add API doc note about the .xz decoder LZMA_MEMLIMIT_ERROR bug. + + The bug was fixed in 660739f99ab211edec4071de98889fb32ed04e98. + + src/liblzma/api/lzma/base.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 8cc9874a7974cd575aee44f218836f7acdbeb0ed +Author: Jia Tan +Date: 2022-09-21 16:15:50 +0800 + + liblzma: Add dest and src NULL checks to lzma_index_cat. + + The documentation states LZMA_PROG_ERROR can be returned from + lzma_index_cat. Previously, lzma_index_cat could not return + LZMA_PROG_ERROR. Now, the validation is similar to + lzma_index_append, which does a NULL check on the index + parameter. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit afd5a8bf5374eba82804a999e1ea7af680784086 +Author: Jia Tan +Date: 2022-09-21 20:29:28 +0800 + + Tests: Create a test for the lzma_index_cat bug. + + tests/test_index.c | 43 ++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +commit 3d5a99ca373a4e86faf671226ca6487febb9eeac +Author: Jia Tan +Date: 2022-09-21 19:28:53 +0800 + + liblzma: Fix copying of check type statistics in lzma_index_cat(). + + The check type of the last Stream in dest was never copied to + dest->checks (the code tried to copy it but it was done too late). + This meant that the value returned by lzma_index_checks() would + only include the check type of the last Stream when multiple + lzma_indexes had been concatenated. + + In xz --list this meant that the summary would only list the + check type of the last Stream, so in this sense this was only + a visual bug. However, it's possible that some applications + use this information for purposes other than merely showing + it to the users in an informational message. I'm not aware of + such applications though and it's quite possible that such + applications don't exist. + + Regular streamed decompression in xz or any other application + doesn't use lzma_index_cat() and so this bug cannot affect them. + + src/liblzma/common/index.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit a61d32172789735350a941e23baf6b587c49e5d9 +Author: Lasse Collin +Date: 2022-09-28 12:20:41 +0300 + + tuklib_physmem: Fix Unicode builds on Windows. + + Thanks to ArSaCiA Game. + + src/common/tuklib_physmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5a4d3548ab214fdca364d5c734baf1d1fab47308 +Author: Lasse Collin +Date: 2022-09-28 11:12:07 +0300 + + Tests: Add test_memlimit.c to test restarting after LZMA_MEMLIMIT_ERROR. + + tests/Makefile.am | 2 + + tests/test_memlimit.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 153 insertions(+) + +commit 660739f99ab211edec4071de98889fb32ed04e98 +Author: Lasse Collin +Date: 2022-09-28 11:05:15 +0300 + + liblzma: Stream decoder: Fix restarting after LZMA_MEMLIMIT_ERROR. + + If lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible + to use lzma_memlimit_set() to increase the limit and continue + decoding. This was supposed to work from the beginning but + there was a bug. With other decoders (.lzma or threaded .xz) + this already worked correctly. + + src/liblzma/common/stream_decoder.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +commit 7e68fda58c74ad9e5b876cc22fcbe80fc0e4747b +Author: Lasse Collin +Date: 2022-09-28 11:00:23 +0300 + + liblzma: Stream decoder: Fix comments. + + src/liblzma/common/stream_decoder.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +commit f664cb25841fc1c478b819034a224a558e2ac6e7 +Author: Lasse Collin +Date: 2022-09-20 16:58:22 +0300 + + liblzma: ARM64: Add comments. + + src/liblzma/simple/arm64.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit b557b4a0eea05470fae8ba5ef4ad5a6dfb36ac41 +Author: Lasse Collin +Date: 2022-09-20 16:27:50 +0300 + + liblzma: ARM64: Fix wrong comment in API doc. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/bcj.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d5b0906fa55157f48c200188a3951d80df9cb308 +Author: Lasse Collin +Date: 2022-09-19 20:24:26 +0300 + + xz: Add --experimental-arm64[=width=WIDTH]. + + It will be renamed to --arm64 once it is stable. + + Man page or --long-help weren't updated yet. + + src/xz/args.c | 7 +++++++ + src/xz/message.c | 7 +++++++ + src/xz/options.c | 39 +++++++++++++++++++++++++++++++++++++++ + src/xz/options.h | 7 +++++++ + 4 files changed, 60 insertions(+) + +commit ecb966de308c255bb4735a7307ef9901c643a9de +Author: Lasse Collin +Date: 2022-09-19 19:34:56 +0300 + + liblzma: Add experimental ARM64 BCJ filter with a temporary Filter ID. + + That is, the Filter ID will be changed once the design is final. + The current version will be removed. So files created with the + tempoary Filter ID won't be supported in the future. + + CMakeLists.txt | 3 + + configure.ac | 4 +- + src/liblzma/api/lzma/bcj.h | 35 +++++- + src/liblzma/common/filter_common.c | 9 ++ + src/liblzma/common/filter_decoder.c | 8 ++ + src/liblzma/common/filter_encoder.c | 11 ++ + src/liblzma/simple/Makefile.inc | 4 + + src/liblzma/simple/arm64.c | 227 ++++++++++++++++++++++++++++++++++++ + src/liblzma/simple/simple_coder.h | 9 ++ + src/liblzma/simple/simple_decoder.h | 4 + + src/liblzma/simple/simple_encoder.h | 2 + + 11 files changed, 313 insertions(+), 3 deletions(-) + +commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8 +Author: Lasse Collin +Date: 2022-09-17 22:42:18 +0300 + + liblzma: Simple/BCJ filters: Allow disabling generic BCJ options. + + This will be needed for the ARM64 BCJ filter as it will use + its own options struct. + + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 4 ++-- + src/liblzma/simple/simple_private.h | 2 +- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 3 ++- + 8 files changed, 10 insertions(+), 9 deletions(-) + +commit c3592d0a55114144686ecf960cb516d6b31c98e9 +Author: Lasse Collin +Date: 2022-09-16 17:08:53 +0300 + + Tests: Add a test file for lzma_index_append() integer overflow bug. + + This test fails before commit 18d7facd3802b55c287581405c4d49c98708c136. + + test_files.sh now runs xz -l for bad-3-index-uncomp-overflow.xz + because only then the previously-buggy code path gets tested. + Normal decompression doesn't use lzma_index_append() at all. + Instead, lzma_index_hash functions are used and those already + did the overflow check. + + tests/files/README | 10 ++++++++++ + tests/files/bad-3-index-uncomp-overflow.xz | Bin 0 -> 132 bytes + tests/test_files.sh | 8 ++++++++ + 3 files changed, 18 insertions(+) + +commit 982b29f828079a2a26253a40e975127a40a7d2bd +Author: Lasse Collin +Date: 2022-09-16 15:10:07 +0300 + + Translations: Add Turkish translation. + + po/LINGUAS | 1 + + po/tr.po | 977 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 978 insertions(+) + +commit 1fc088d9f6d1697924aaeac8cd1fb9918d1532e2 +Author: Lasse Collin +Date: 2022-09-16 14:09:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 097c7b67ce86ff16a7cef7631b39e5ca4ee3d420 +Author: Lasse Collin +Date: 2022-09-16 14:07:03 +0300 + + xzgrep: Fix compatibility with old shells. + + Running the current xzgrep on Slackware 10.1 with GNU bash 3.00.15: + + xzgrep: line 231: syntax error near unexpected token `;;' + + On SCO OpenServer 5.0.7 with Korn Shell 93r: + + syntax error at line 231 : `;;' unexpected + + Turns out that some old shells don't like apostrophes (') inside + command substitutions. For example, the following fails: + + x=$(echo foo + # asdf'zxcv + echo bar) + printf '%s\n' "$x" + + The problem was introduced by commits + 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 (2022-03-29), + bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5 (2022-07-18), and + a648978b20495b7aa4a8b029c5a810b5ad9d08ff (2022-07-19). + 5.2.6 is the only stable release that included + this problem. + + Thanks to Kevin R. Bulgrien for reporting the problem + on SCO OpenServer 5.0.7 and for providing the fix. + + src/scripts/xzgrep.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit f2d084fe3f0d6d71488bfc6987f26542f67bfd99 +Author: Lasse Collin +Date: 2022-09-09 14:12:30 +0300 + + Tests: Silence warnings about unused functions from tuktest.h. + + Warnings about unused tuktest_run_test conveniently tell which + test programs haven't been converted to tuktest.h yet but I + silenced that warning too for now anyway. + + It is fine to use __attribute__((__unused__)) even when the + function is actually used because the attribute only means + that the function might be unused. + + tests/tuktest.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit f8ee61e74eb40600445fdb601c374d582e1e9c8a +Author: Lasse Collin +Date: 2022-09-09 13:51:57 +0300 + + liblzma: lzma_filters_copy: Keep dest[] unmodified if an error occurs. + + lzma_stream_encoder() and lzma_stream_encoder_mt() always assumed + this. Before this patch, failing lzma_filters_copy() could result + in free(invalid_pointer) or invalid memory reads in stream_encoder.c + or stream_encoder_mt.c. + + To trigger this, allocating memory for a filter options structure + has to fail. These are tiny allocations so in practice they very + rarely fail. + + Certain badness in the filter chain array could also make + lzma_filters_copy() fail but both stream_encoder.c and + stream_encoder_mt.c validate the filter chain before + trying to copy it, so the crash cannot occur this way. + + src/liblzma/api/lzma/filter.h | 4 +++- + src/liblzma/common/filter_common.c | 18 ++++++++++++------ + 2 files changed, 15 insertions(+), 7 deletions(-) + +commit 18d7facd3802b55c287581405c4d49c98708c136 +Author: Jia Tan +Date: 2022-09-02 20:18:55 +0800 + + liblzma: lzma_index_append: Add missing integer overflow check. + + The documentation in src/liblzma/api/lzma/index.h suggests that + both the unpadded (compressed) size and the uncompressed size + are checked for overflow, but only the unpadded size was checked. + The uncompressed check is done first since that is more likely to + occur than the unpadded or index field size overflows. + + src/liblzma/common/index.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 9ac06cb5b85274d18f9f70d82cf2d8c9c1151bd4 +Author: Lasse Collin +Date: 2022-09-08 15:11:08 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit ba3e4ba2de034ae93a513f9c3a0823b80cdb66dc +Author: Jia Tan +Date: 2022-09-08 15:07:00 +0300 + + CMake: Clarify a comment about Windows symlinks without file extension. + + CMakeLists.txt | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 17485e884ce5c74315f29a8a1507bc706cd5cd1d +Author: Lasse Collin +Date: 2022-09-08 15:02:41 +0300 + + CMake: Update for liblzma_*.map files and fix wrong common_w32res.rc dep. + + The previous commit split liblzma.map into liblzma_linux.map and + liblzma_generic.map. This commit updates the CMake build for those. + + common_w32res.rc dependency was listed under Linux/FreeBSD while + obviously it belongs to Windows when building a DLL. + + CMakeLists.txt | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +commit 913ddc5572b9455fa0cf299be2e35c708840e922 +Author: Lasse Collin +Date: 2022-09-04 23:23:00 +0300 + + liblzma: Vaccinate against an ill patch from RHEL/CentOS 7. + + RHEL/CentOS 7 shipped with 5.1.2alpha, including the threaded + encoder that is behind #ifdef LZMA_UNSTABLE in the API headers. + In 5.1.2alpha these symbols are under XZ_5.1.2alpha in liblzma.map. + API/ABI compatibility tracking isn't done between development + releases so newer releases didn't have XZ_5.1.2alpha anymore. + + Later RHEL/CentOS 7 updated xz to 5.2.2 but they wanted to keep + the exported symbols compatible with 5.1.2alpha. After checking + the ABI changes it turned out that >= 5.2.0 ABI is backward + compatible with the threaded encoder functions from 5.1.2alpha + (but not vice versa as fixes and extensions to these functions + were made between 5.1.2alpha and 5.2.0). + + In RHEL/CentOS 7, XZ Utils 5.2.2 was patched with + xz-5.2.2-compat-libs.patch to modify liblzma.map: + + - XZ_5.1.2alpha was added with lzma_stream_encoder_mt and + lzma_stream_encoder_mt_memusage. This matched XZ Utils 5.1.2alpha. + + - XZ_5.2 was replaced with XZ_5.2.2. It is clear that this was + an error; the intention was to keep using XZ_5.2 (XZ_5.2.2 + has never been used in XZ Utils). So XZ_5.2.2 lists all + symbols that were listed under XZ_5.2 before the patch. + lzma_stream_encoder_mt and _mt_memusage are included too so + they are listed both here and under XZ_5.1.2alpha. + + The patch didn't add any __asm__(".symver ...") lines to the .c + files. Thus the resulting liblzma.so exports the threaded encoder + functions under XZ_5.1.2alpha only. Listing the two functions + also under XZ_5.2.2 in liblzma.map has no effect without + matching .symver lines. + + The lack of XZ_5.2 in RHEL/CentOS 7 means that binaries linked + against unpatched XZ Utils 5.2.x won't run on RHEL/CentOS 7. + This is unfortunate but this alone isn't too bad as the problem + is contained within RHEL/CentOS 7 and doesn't affect users + of other distributions. It could also be fixed internally in + RHEL/CentOS 7. + + The second problem is more serious: In XZ Utils 5.2.2 the API + headers don't have #ifdef LZMA_UNSTABLE for obvious reasons. + This is true in RHEL/CentOS 7 version too. Thus now programs + using new APIs can be compiled without an extra #define. However, + the programs end up depending on symbol version XZ_5.1.2alpha + (and possibly also XZ_5.2.2) instead of XZ_5.2 as they would + with an unpatched XZ Utils 5.2.2. This means that such binaries + won't run on other distributions shipping XZ Utils >= 5.2.0 as + they don't provide XZ_5.1.2alpha or XZ_5.2.2; they only provide + XZ_5.2 (and XZ_5.0). (This includes RHEL/CentOS 8 as the patch + luckily isn't included there anymore with XZ Utils 5.2.4.) + + Binaries built by RHEL/CentOS 7 users get distributed and then + people wonder why they don't run on some other distribution. + Seems that people have found out about the patch and been copying + it to some build scripts, seemingly curing the symptoms but + actually spreading the illness further and outside RHEL/CentOS 7. + + The ill patch seems to be from late 2016 (RHEL 7.3) and in 2017 it + had spread at least to EasyBuild. I heard about the events only + recently. :-( + + This commit splits liblzma.map into two versions: one for + GNU/Linux and another for other OSes that can use symbol versioning + (FreeBSD, Solaris, maybe others). The Linux-specific file and the + matching additions to .c files add full compatibility with binaries + that have been built against a RHEL/CentOS-patched liblzma. Builds + for OSes other than GNU/Linux won't get the vaccine as they should + be immune to the problem (I really hope that no build script uses + the RHEL/CentOS 7 patch outside GNU/Linux). + + The RHEL/CentOS compatibility symbols XZ_5.1.2alpha and XZ_5.2.2 + are intentionally put *after* XZ_5.2 in liblzma_linux.map. This way + if one forgets to #define HAVE_SYMBOL_VERSIONS_LINUX when building, + the resulting liblzma.so.5 will have lzma_stream_encoder_mt@@XZ_5.2 + since XZ_5.2 {...} is the first one that lists that function. + Without HAVE_SYMBOL_VERSIONS_LINUX @XZ_5.1.2alpha and @XZ_5.2.2 + will be missing but that's still a minor problem compared to + only having lzma_stream_encoder_mt@@XZ_5.1.2alpha! + + The "local: *;" line was moved to XZ_5.0 so that it doesn't need + to be moved around. It doesn't matter where it is put. + + Having two similar liblzma_*.map files is a bit silly as it is, + at least for now, easily possible to generate the generic one + from the Linux-specific file. But that adds extra steps and + increases the risk of mistakes when supporting more than one + build system. So I rather maintain two files in parallel and let + validate_map.sh check that they are in sync when "make mydist" + is run. + + This adds .symver lines for lzma_stream_encoder_mt@XZ_5.2.2 and + lzma_stream_encoder_mt_memusage@XZ_5.2.2 even though these + weren't exported by RHEL/CentOS 7 (only @@XZ_5.1.2alpha was + for these two). I added these anyway because someone might + misunderstand the RHEL/CentOS 7 patch and think that @XZ_5.2.2 + (@@XZ_5.2.2) versions were exported too. + + At glance one could suggest using __typeof__ to copy the function + prototypes when making aliases. However, this doesn't work trivially + because __typeof__ won't copy attributes (lzma_nothrow, lzma_pure) + and it won't change symbol visibility from hidden to default (done + by LZMA_API()). Attributes could be copied with __copy__ attribute + but that needs GCC 9 and a fallback method would be needed anyway. + + This uses __symver__ attribute with GCC >= 10 and + __asm__(".symver ...") with everything else. The attribute method + is required for LTO (-flto) support with GCC. Using -flto with + GCC older than 10 is now broken on GNU/Linux and will not be fixed + (can silently result in a broken liblzma build that has dangerously + incorrect symbol versions). LTO builds with Clang seem to work + with the traditional __asm__(".symver ...") method. + + Thanks to Boud Roukema for reporting the problem and discussing + the details and testing the fix. + + configure.ac | 23 +++- + src/liblzma/Makefile.am | 10 +- + src/liblzma/common/block_buffer_encoder.c | 18 ++++ + src/liblzma/common/common.c | 14 +++ + src/liblzma/common/common.h | 28 +++++ + src/liblzma/common/hardware_cputhreads.c | 12 +++ + src/liblzma/common/stream_encoder_mt.c | 42 ++++++++ + src/liblzma/{liblzma.map => liblzma_generic.map} | 6 +- + src/liblzma/liblzma_linux.map | 131 +++++++++++++++++++++++ + src/liblzma/validate_map.sh | 113 +++++++++++++++++-- + 10 files changed, 382 insertions(+), 15 deletions(-) + +commit 80a1a8bb838842a2be343bd88ad1462c21c5e2c9 +Author: Lasse Collin +Date: 2022-08-31 16:42:04 +0300 + + CMake: Add xz symlinks. + + These are a minor thing especially since the xz build has + some real problems still like lack of large file support + on 32-bit systems but I'll commit this since the code exists. + + Thanks to Jia Tan. + + CMakeLists.txt | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +commit a4193bb6d85d7765b1b87faeab3e50106d3ab2e9 +Author: Lasse Collin +Date: 2022-08-31 16:29:38 +0300 + + CMake: Put xz man page install under if(UNIX) like is for xzdec. + + Thanks to Jia Tan. + + CMakeLists.txt | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit c1555b1a221a1427d4d650647531016d754bc4da +Author: Lasse Collin +Date: 2022-08-22 18:16:40 +0300 + + Bump version number for 5.3.3alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 44fedddc11c3f6ec2f7fe35a3e38f15ca93f90eb +Author: Lasse Collin +Date: 2022-08-22 18:13:56 +0300 + + Add NEWS for 5.3.3alpha. + + NEWS | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 119 insertions(+) + +commit a93e235d7ca764cc19f8f9f9063b40ff361c3cfa +Author: Lasse Collin +Date: 2022-07-12 17:59:41 +0300 + + Translations: Add Portuguese translation. + + Jia Tan made white-space changes and also changed "Language: pt_BR\n" + to pt. The translator wasn't reached so I'm hoping these changes + are OK and will commit it without translator's approval. + + Thanks to Pedro Albuquerque and Jia Tan. + + po/LINGUAS | 1 + + po/pt.po | 1001 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1002 insertions(+) + +commit e7cf5a946f25e40d77f45e41f0dee7d42a04e9ae +Author: Lasse Collin +Date: 2022-07-10 21:16:40 +0300 + + Translations: Add Serbian translation. + + Quite a few white-space changes were made by Jia Tan to make + this look good. Contacting the translator didn't succeed so + I'm committing this without getting translator's approval. + + Thanks to Мирослав Николић (Miroslav Nikolic) and Jia Tan. + + po/LINGUAS | 1 + + po/sr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 988 insertions(+) + +commit cc8617ab53b1f2a4da212fa76c92fe538269c5de +Author: Lasse Collin +Date: 2022-07-04 23:51:36 +0300 + + Translations: Add Swedish translation. + + Thanks to Sebastian Rasmussen and Jia Tan. + + po/LINGUAS | 1 + + po/sv.po | 983 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 984 insertions(+) + +commit c613598c358b640682d0ca2aed38fa7df763e8c7 +Author: Lasse Collin +Date: 2022-07-04 23:40:27 +0300 + + Translations: Add Esperanto translation. + + Thanks to Keith Bowes and Jia Tan. + + po/LINGUAS | 1 + + po/eo.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 985 insertions(+) + +commit 659a587d678f21e98e91d2751c31d4ce050c081a +Author: Lasse Collin +Date: 2022-07-01 00:22:33 +0300 + + Translations: Add Catalan translation. + + Thanks to Jordi Mas and Jia Tan. + + po/LINGUAS | 1 + + po/ca.po | 1076 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1077 insertions(+) + +commit 739fd8c9bdf1d85f57d56642aad87148d4779530 +Author: Lasse Collin +Date: 2022-06-30 17:47:08 +0300 + + Translations: Add Ukrainian translation. + + Thanks to Yuri Chornoivan and Jia Tan. + + po/LINGUAS | 1 + + po/uk.po | 996 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 997 insertions(+) + +commit 73280550b111930c62a667e56add8fd574f80bc8 +Author: Lasse Collin +Date: 2022-06-30 17:45:26 +0300 + + Translators: Add Romanian translation. + + Thanks to Remus-Gabriel Chelu and Jia Tan. + + po/LINGUAS | 1 + + po/ro.po | 1016 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1017 insertions(+) + +commit 2465f5b825152714b2c357d96c2422c31109d320 +Author: Lasse Collin +Date: 2022-06-29 18:33:32 +0300 + + Translations: Update Brazilian Portuguese translation. + + One msgstr was changed. The diff is long due to changes + in the source code line numbers in the comments. + + Thanks to Rafael Fontenelle. + + po/pt_BR.po | 186 ++++++++++++++++++++++++++++++------------------------------ + 1 file changed, 92 insertions(+), 94 deletions(-) + +commit 434e1ffd3e62719d509da10b646216f5ef53fe4d +Author: Lasse Collin +Date: 2022-06-29 18:04:44 +0300 + + Translations: Add Croatian translation. + + Thanks to Božidar Putanec and Jia Tan. + + po/LINGUAS | 1 + + po/hr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 988 insertions(+) + +commit 0732d0f7065c9bd48bfe4f5983144ae970c4a499 +Author: Lasse Collin +Date: 2022-06-29 17:58:48 +0300 + + Translations: Add Spanish translation. + + Thanks to Cristian Othón Martínez Vera and Jia Tan. + + po/LINGUAS | 1 + + po/es.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 985 insertions(+) + +commit 9899b0f82bc130998d1f1f618a6ab805b73f2696 +Author: Lasse Collin +Date: 2022-06-29 17:49:43 +0300 + + Translations: Add Korean translation. + + Thanks to Seong-ho Cho and Jia Tan. + + po/LINGUAS | 1 + + po/ko.po | 972 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 973 insertions(+) + +commit 65217eaf6bd195f3ef027d4ac55d57b7d133d69f +Author: Lasse Collin +Date: 2020-03-16 21:57:21 +0200 + + Translations: Rebuild cs.po to avoid incorrect fuzzy strings. + + "make dist" updates the .po files and the fuzzy strings would + result in multiple very wrong translations. + + po/cs.po | 592 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 322 insertions(+), 270 deletions(-) + +commit e56ff423ee7af9e648e16b132f0d835d2cb4db26 +Author: Lasse Collin +Date: 2020-03-16 17:30:39 +0200 + + Translations: Add partial Danish translation. + + I made a few minor white space changes without getting them + approved by the Danish translation team. + + po/LINGUAS | 1 + + po/da.po | 896 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 897 insertions(+) + +commit 43e09c62e77cb8807d932c81de4decbdb956e184 +Author: Lasse Collin +Date: 2020-03-11 22:37:54 +0200 + + Translations: Add hu, zh_CN, and zh_TW. + + I made a few white space changes to these without getting them + approved by the translation teams. (I tried to contact the hu and + zh_TW teams but didn't succeed. I didn't contact the zh_CN team.) + + po/LINGUAS | 3 + + po/hu.po | 985 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/zh_CN.po | 963 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/zh_TW.po | 956 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 2907 insertions(+) + +commit 982b6b198ae1ffe6093236dd8a3d03d1415b912b +Author: Lasse Collin +Date: 2020-03-11 14:33:30 +0200 + + Translations: Update vi.po to match the file from the TP. + + The translated strings haven't been updated but word wrapping + is different. + + po/vi.po | 407 ++++++++++++++++++++++++++++----------------------------------- + 1 file changed, 179 insertions(+), 228 deletions(-) + +commit 801f39691fc4abc6dd33d7653d498781b593f3eb +Author: Lasse Collin +Date: 2020-03-11 14:18:03 +0200 + + Translations: Add fi and pt_BR, and update de, fr, it, and pl. + + The German translation isn't identical to the file in + the Translation Project but the changes (white space changes + only) were approved by the translator Mario Blättermann. + + po/LINGUAS | 2 + + po/de.po | 476 ++++++++++++++-------------- + po/fi.po | 974 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po/fr.po | 272 ++++++++-------- + po/it.po | 479 ++++++++++++---------------- + po/pl.po | 239 +++++++------- + po/pt_BR.po | 1001 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 7 files changed, 2697 insertions(+), 746 deletions(-) + +commit 311e4f85ede5d2f0bb71f3ad70b5b7db1b5adf33 +Author: Lasse Collin +Date: 2022-08-22 17:27:19 +0300 + + xz: Try to clarify --memlimit-mt-decompress vs. --memlimit-compress. + + src/xz/xz.1 | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +commit df23c31000283c00e5ef1ca32a0bc3bb757bd707 +Author: Lasse Collin +Date: 2022-08-22 16:46:18 +0300 + + CMake: Add liblzma tests. + + Thanks to Jia Tan for the patch. + + CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 52 insertions(+), 1 deletion(-) + +commit 02a777f9c422d3b5ec895078530bb1a2b6f7bdf5 +Author: Lasse Collin +Date: 2022-08-19 23:32:22 +0300 + + xz: Revise --info-memory output. + + The strings could be more descriptive but it's good + to have some version of this committed now. + + --robot mode wasn't changed yet. + + src/xz/hardware.c | 32 ++++++++++++++++++++++++++------ + src/xz/xz.1 | 1 + + 2 files changed, 27 insertions(+), 6 deletions(-) + +commit f864f6d42eab57ea8ed82cc2dd19a03b51377442 +Author: Lasse Collin +Date: 2022-08-19 23:12:02 +0300 + + xz: Update the man page for threaded decompression and memlimits. + + This documents the changes made in commits + 6c6da57ae2aa962aabde6892442227063d87e88c, + cad299008cf73ec566f0662a9cf2b94f86a99659, and + 898faa97287a756231c663a3ed5165672b417207. + + The --info-memory bit hasn't been finished yet + even though it's already mentioned in this commit + under --memlimit-mt-decompress and --threads. + + src/xz/xz.1 | 148 +++++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 121 insertions(+), 27 deletions(-) + +commit d13bfcc0056617dd648f655a01653932fad7067f +Author: Lasse Collin +Date: 2022-08-18 17:49:16 +0300 + + Build: Include the CMake files in the distribution. + + This was supposed to be done in 2020 with 5.2.5 release + already but it was noticed only today. 5.2.5 and 5.2.6 + even mention experiemental CMake support in the NEWS entries. + + Thanks to Olivier B. for reporting the problem. + + Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +commit e66787bcfefdb93f19c974f895f65969a77937b0 +Author: Lasse Collin +Date: 2022-08-18 17:38:05 +0300 + + Windows: Fix broken liblzma.dll build with Visual Studio project files. + + The bug was introduced in 352ba2d69af2136bc814aa1df1a132559d445616 + "Windows: Fix building of resource files when config.h isn't used." + + That commit fixed liblzma.dll build with CMake while keeping it + working with Autotools on Windows but the VS project files were + forgotten. + + I haven't tested these changes. + + Thanks to Olivier B. for reporting the bug and for the initial patch. + + windows/vs2013/liblzma_dll.vcxproj | 6 ++++++ + windows/vs2017/liblzma_dll.vcxproj | 6 ++++++ + windows/vs2019/liblzma_dll.vcxproj | 6 ++++++ + 3 files changed, 18 insertions(+) + +commit c4e8e5fb311225b8b48d34157891a640b2535e0c +Author: Lasse Collin +Date: 2022-08-18 17:16:49 +0300 + + liblzma: Threaded decoder: Improve LZMA_FAIL_FAST when LZMA_FINISH is used. + + It will now return LZMA_DATA_ERROR (not LZMA_OK or LZMA_BUF_ERROR) + if LZMA_FINISH is used and there isn't enough input to finish + decoding the Block Header or the Block. The use of LZMA_DATA_ERROR + is simpler and the less risky than LZMA_BUF_ERROR but this might + be changed before 5.4.0. + + src/liblzma/api/lzma/container.h | 6 +++++ + src/liblzma/common/stream_decoder_mt.c | 42 ++++++++++++++++++++++++++++++++++ + 2 files changed, 48 insertions(+) + +commit 6dcf606e7efa2b259f0262f9e2f61e00116842d3 +Author: Lasse Collin +Date: 2022-08-12 18:31:47 +0300 + + Add NEWS for 5.2.6. + + NEWS | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 121 insertions(+) + +commit 413b86fcf8934fae5a004f378a9483d37d8fcaab +Author: Lasse Collin +Date: 2022-08-12 14:28:41 +0300 + + Add Jia Tan to AUTHORS. + + AUTHORS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 352672732c346c546ff3c26d0605bc0ed1c8b7c7 +Author: Lasse Collin +Date: 2022-07-25 19:28:26 +0300 + + Build: Start the generated ChangeLog from around 5.2.0 instead of 5.0.0. + + This makes ChangeLog smaller. + + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6f6d11225d6016be2bbb55d845b66f6b04d048df +Author: Lasse Collin +Date: 2022-07-25 19:11:05 +0300 + + Translations: Change the copyright comment string to use with po4a. + + This affects the second line in po4a/xz-man.pot. The man pages of + xzdiff, xzgrep, and xzmore are from GNU gzip and under GNU GPLv2+ + while the rest of the man pages are in the public domain. + + po4a/update-po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 61f8ec804abdb4c5dac01e8ae9b90c7be58a5c24 +Author: Jia Tan +Date: 2022-07-25 18:30:05 +0300 + + liblzma: Refactor lzma_mf_is_supported() to use a switch-statement. + + src/liblzma/lz/lz_encoder.c | 32 ++++++++++++++------------------ + 1 file changed, 14 insertions(+), 18 deletions(-) + +commit 4d80b463a1251aa22eabc87d2732fec13b1adda6 +Author: Jia Tan +Date: 2022-07-25 18:20:01 +0300 + + Build: Don't allow empty LIST in --enable-match-finders=LIST. + + It's enforced only when a match finder is needed, that is, + when LZMA1 or LZMA2 encoder is enabled. + + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 9cc721af5436908f2d5a828aebbc4050a32a3487 +Author: Lasse Collin +Date: 2022-07-24 13:27:48 +0300 + + xz: Update the man page that change to --keep will be in 5.2.6. + + src/xz/xz.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit b81bf0c7d1873e52a4086a9abb494471d652cb55 +Author: Lasse Collin +Date: 2022-07-19 23:23:54 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 340cf1ec3927767046b8293a49da3db4e393f426 +Author: Nicholas Jackson +Date: 2022-07-17 17:39:23 -0700 + + CMake: Add missing source file to liblzma build + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit d796b6d7fdb8b7238b277056cf9146cce25db604 +Author: Lasse Collin +Date: 2022-07-19 23:19:49 +0300 + + xzgrep man page: Document exit statuses. + + src/scripts/xzgrep.1 | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +commit 923bf96b55e5216a6c8df9d8331934f54784390e +Author: Lasse Collin +Date: 2022-07-19 23:13:24 +0300 + + xzgrep: Improve error handling, especially signals. + + xzgrep wouldn't exit on SIGPIPE or SIGQUIT when it clearly + should have. It's quite possible that it's not perfect still + but at least it's much better. + + If multiple exit statuses compete, now it tries to pick + the largest of value. + + Some comments were added. + + The exit status handling of signals is still broken if the shell + uses values larger than 255 in $? to indicate that a process + died due to a signal ***and*** their "exit" command doesn't take + this into account. This seems to work well with the ksh and yash + versions I tried. However, there is a report in gzip/zgrep that + OpenSolaris 5.11 (not 5.10) has a problem with "exit" truncating + the argument to 8 bits: + + https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22900#25 + + Such a bug would break xzgrep but I didn't add a workaround + at least for now. 5.11 is old and I don't know if the problem + exists in modern descendants, or if the problem exists in other + ksh implementations in use. + + src/scripts/xzgrep.in | 72 +++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 53 insertions(+), 19 deletions(-) + +commit a648978b20495b7aa4a8b029c5a810b5ad9d08ff +Author: Lasse Collin +Date: 2022-07-19 00:10:55 +0300 + + xzgrep: Make the fix for ZDI-CAN-16587 more robust. + + I don't know if this can make a difference in the real world + but it looked kind of suspicious (what happens with sed + implementations that cannot process very long lines?). + At least this commit shouldn't make it worse. + + src/scripts/xzgrep.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5 +Author: Lasse Collin +Date: 2022-07-18 21:52:31 +0300 + + xzgrep: Use grep -H --label when available (GNU, *BSDs). + + It avoids the use of sed for prefixing filenames to output lines. + Using sed for that is slower and prone to security bugs so now + the sed method is only used as a fallback. + + This also fixes an actual bug: When grepping a binary file, + GNU grep nowadays prints its diagnostics to stderr instead of + stdout and thus the sed-method for prefixing the filename doesn't + work. So with this commit grepping binary files gives reasonable + output with GNU grep now. + + This was inspired by zgrep but the implementation is different. + + src/scripts/xzgrep.in | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit b56729af9f1a596e57aeefd7570d8d7dce5c9f52 +Author: Lasse Collin +Date: 2022-07-18 21:10:25 +0300 + + xzgrep: Use -e to specify the pattern to grep. + + Now we don't need the separate test for adding the -q option + as it can be added directly in the two places where it's needed. + + src/scripts/xzgrep.in | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +commit bad61b5997e6647911974022bfb72f3d4818a594 +Author: Lasse Collin +Date: 2022-07-18 19:18:48 +0300 + + Scripts: Use printf instead of echo in a few places. + + It's a good habbit as echo has some portability corner cases + when the string contents can be anything. + + src/scripts/xzdiff.in | 6 +++--- + src/scripts/xzgrep.in | 4 ++-- + src/scripts/xzless.in | 4 ++-- + src/scripts/xzmore.in | 8 ++++---- + 4 files changed, 11 insertions(+), 11 deletions(-) + +commit 6a4a4a7d2667837dc824c26fcb19ed6ca5aff645 +Author: Lasse Collin +Date: 2022-07-17 21:36:25 +0300 + + xzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters. + + Also replace one use of expr with printf. + + The rationale for LC_ALL=C was already mentioned in + 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 that fixed a security + issue. However, unrelated uses weren't changed in that commit yet. + + POSIX says that with sed and such tools one should use LC_ALL=C + to ensure predictable behavior when strings contain byte sequences + that aren't valid multibyte characters in the current locale. See + under "Application usage" in here: + + https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html + + With GNU sed invalid multibyte strings would work without this; + it's documented in its Texinfo manual. Some other implementations + aren't so forgiving. + + src/scripts/xzgrep.in | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +commit b48f9d615f2c2e8d2f6e253d0e48ee66d0652b68 +Author: Lasse Collin +Date: 2022-07-17 20:55:16 +0300 + + xzgrep: Fix parsing of certain options. + + Fix handling of "xzgrep -25 foo" (in GNU grep "grep -25 foo" is + an alias for "grep -C25 foo"). xzgrep would treat "foo" as filename + instead of as a pattern. This bug was fixed in zgrep in gzip in 2012. + + Add -E, -F, -G, and -P to the "no argument required" list. + + Add -X to "argument required" list. It is an + intentionally-undocumented GNU grep option so this isn't + an important option for xzgrep but it seems that other grep + implementations (well, those that I checked) don't support -X + so I hope this change is an improvement still. + + grep -d (grep --directories=ACTION) requires an argument. In + contrast to zgrep, I kept -d in the "no argument required" list + because it's not supported in xzgrep (or zgrep). This way + "xzgrep -d" gives an error about option being unsupported instead + of telling that it requires an argument. Both zgrep and xzgrep + tell that it's unsupported if an argument is specified. + + Add comments. + + src/scripts/xzgrep.in | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +commit 2d2201bc6315deda4d43625aa510972467bd51d4 +Author: Lasse Collin +Date: 2022-07-14 20:33:05 +0300 + + Tests: Add the .lzma files to test_files.sh. + + tests/test_files.sh | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +commit ce5549a591bf126300618879f5b24023351baff6 +Author: Lasse Collin +Date: 2022-07-14 19:37:42 +0300 + + Tests: Add .lzma test files. + + tests/files/README | 63 ++++++++++++++++----- + tests/files/bad-too_big_size-with_eopm.lzma | Bin 0 -> 37 bytes + tests/files/bad-too_small_size-without_eopm-1.lzma | Bin 0 -> 31 bytes + tests/files/bad-too_small_size-without_eopm-2.lzma | Bin 0 -> 31 bytes + tests/files/bad-too_small_size-without_eopm-3.lzma | Bin 0 -> 36 bytes + tests/files/bad-unknown_size-without_eopm.lzma | Bin 0 -> 31 bytes + tests/files/good-known_size-with_eopm.lzma | Bin 0 -> 37 bytes + tests/files/good-known_size-without_eopm.lzma | Bin 0 -> 31 bytes + tests/files/good-unknown_size-with_eopm.lzma | Bin 0 -> 37 bytes + 9 files changed, 50 insertions(+), 13 deletions(-) + +commit 107c93ee5cad51a6ea0cee471209bfe8d76deaa3 +Author: Lasse Collin +Date: 2022-07-14 18:12:38 +0300 + + liblzma: Rename a variable and improve a comment. + + src/liblzma/lzma/lzma_decoder.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +commit 511feb5eadb988d641b025d597f4fac7502003b8 +Author: Lasse Collin +Date: 2022-07-13 22:24:41 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 9595a3119b9faf0ce01375329cad8bbf85c35ea2 +Author: Lasse Collin +Date: 2022-07-13 22:24:07 +0300 + + liblzma: Add optional autodetection of LZMA end marker. + + Turns out that this is needed for .lzma files as the spec in + LZMA SDK says that end marker may be present even if the size + is stored in the header. Such files are rare but exist in the + real world. The code in liblzma is so old that the spec didn't + exist in LZMA SDK back then and I had understood that such + files weren't possible (the lzma tool in LZMA SDK didn't + create such files). + + This modifies the internal API so that LZMA decoder can be told + if EOPM is allowed even when the uncompressed size is known. + It's allowed with .lzma and not with other uses. + + Thanks to Karl Beldan for reporting the problem. + + doc/lzma-file-format.txt | 11 +++- + src/liblzma/common/alone_decoder.c | 2 +- + src/liblzma/common/microlzma_decoder.c | 2 +- + src/liblzma/lz/lz_decoder.c | 10 +++- + src/liblzma/lz/lz_decoder.h | 8 +-- + src/liblzma/lzma/lzma2_decoder.c | 2 +- + src/liblzma/lzma/lzma_decoder.c | 99 ++++++++++++++++++++++++---------- + 7 files changed, 95 insertions(+), 39 deletions(-) + +commit 0c0f8e9761eb6eaf199082cf144db7ac5f9d8cb2 +Author: Lasse Collin +Date: 2022-07-12 18:53:04 +0300 + + xz: Document the special memlimit case of 2000 MiB on MIPS32. + + See commit fc3d3a7296ef58bb799a73943636b8bfd95339f7. + + src/xz/xz.1 | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit d1bfa3dc703325ecd974167e864a8712fdfe936e +Author: Jia Tan +Date: 2022-07-01 21:19:26 +0800 + + Created script to generate code coverage reports. + + The script uses lcov and genhtml after running the tests + to show the code coverage statistics. The script will create + a coverage directory where it is run. It can be run both in + and out of the source directory. + + .gitignore | 4 +++ + tests/code_coverage.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+) + +commit 86a30b0255d8064169fabfd213d907016d2f9f2a +Author: Jia Tan +Date: 2022-06-16 17:32:19 +0300 + + Tests: Add more tests into test_check. + + tests/test_check.c | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++-- + tests/tests.h | 23 +++++ + 2 files changed, 295 insertions(+), 7 deletions(-) + +commit 82e30fed66a89706388a8c15dc954d84e63f38fa +Author: Lasse Collin +Date: 2022-06-16 15:02:57 +0300 + + Tests: Use char[][24] array for enum_strings_lzma_ret. + + Array of pointers to short strings is a bit pointless here + and now it's fully const. + + tests/tests.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5ba9459e6c4a29f6870ca78ce8ac6e519d59c41e +Author: Lasse Collin +Date: 2022-06-16 14:12:14 +0300 + + Tests: tuktest.h: Add tuktest_error_impl to help with error conditions. + + tests/tuktest.h | 72 +++++++++++++++++++++++++-------------------------------- + 1 file changed, 32 insertions(+), 40 deletions(-) + +commit b339892668da20aea22a93668c82b87a38e4a97f +Author: Lasse Collin +Date: 2022-06-16 13:29:59 +0300 + + Tests: tuktest.h: Rename file_from_* and use tuktest_malloc there. + + tests/test_bcj_exact_size.c | 4 +--- + tests/tuktest.h | 52 +++++++++++++++++++++------------------------ + 2 files changed, 25 insertions(+), 31 deletions(-) + +commit d8b63a0ad68d1c461eb373466679ebc41fbc207d +Author: Lasse Collin +Date: 2022-06-16 13:08:19 +0300 + + Tests: tuktest.h: Add malloc wrapper with automatic freeing. + + tests/tuktest.h | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 124 insertions(+) + +commit 1d51536a4b19a8fae768f8eb462fc2238cb36d53 +Author: Lasse Collin +Date: 2022-06-16 11:47:37 +0300 + + Tests: tuktest.h: Move a function. + + tests/tuktest.h | 44 ++++++++++++++++++++++---------------------- + 1 file changed, 22 insertions(+), 22 deletions(-) + +commit 70c7555f6403553ee35539e869de0025592d8564 +Author: Lasse Collin +Date: 2022-06-14 22:21:15 +0300 + + Tests: test_vli: Remove an invalid test-assertion. + + lzma_vli is unsigned so trying a signed value results in + a compiler warning from -Wsign-conversion. (lzma_vli)-1 + equals to LZMA_VLI_UNKNOWN anyway which is the next assertion. + + tests/test_vli.c | 2 -- + 1 file changed, 2 deletions(-) + +commit 154b73c5a1092c3f785e01666b564ad7ff1be555 +Author: Lasse Collin +Date: 2022-06-14 22:10:10 +0300 + + Tests: test_vli: Add const where appropriate. + + tests/test_vli.c | 53 ++++++++++++++++++++++++++++------------------------- + 1 file changed, 28 insertions(+), 25 deletions(-) + +commit 0354d6cce3ff98ea6f927107baf216253f6ce2bb +Author: Jia Tan +Date: 2022-06-13 20:27:03 +0800 + + Added vli tests to .gitignore + + .gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit a08f5ccf6bdc20ef70e41f6f3321618ef146f96e +Author: Jia Tan +Date: 2022-06-12 11:31:40 +0800 + + Created tests for all functions exported in vli.h + + Achieved 100% code coverage vli_encoder.c, vli_decoder.c, and vli_size.c + + tests/Makefile.am | 4 +- + tests/test_vli.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 311 insertions(+), 1 deletion(-) + +commit 1e3eb61815a91c0a1bfbb802e2d95593f523491f +Author: jiat75 +Date: 2022-06-03 21:24:54 +0800 + + Added parallel test artifacts to .gitignore + + .gitignore | 2 ++ + 1 file changed, 2 insertions(+) + +commit 00e3613f1212eaa84e721585fdb4de6967cf2476 +Author: Lasse Collin +Date: 2022-06-14 21:29:21 +0300 + + Tests: Use good-1-empty-bcj-lzma2.xz in test_bcj_exact_size. + + It's much nicer this way so that the test data isn't a hardcoded + table inside the C file. + + tests/test_bcj_exact_size.c | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +commit 86bab755be252bfd3e0a9aee8e7b83a9bbb23ed0 +Author: Lasse Collin +Date: 2022-06-14 21:26:13 +0300 + + Tests: Add file reading helpers to tuktest.h. + + tests/tuktest.h | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 176 insertions(+), 7 deletions(-) + +commit 83d2337b72dbf391c6f3b41889eea99e51679105 +Author: Lasse Collin +Date: 2022-06-14 18:21:57 +0300 + + Tests: tuktest.h: Move a printf from a macro to a helper function. + + tests/tuktest.h | 26 ++++++++++++++++++-------- + 1 file changed, 18 insertions(+), 8 deletions(-) + +commit f9e8176ea7d520797a2db2d49a5a632c285674a8 +Author: Lasse Collin +Date: 2022-06-14 17:20:49 +0300 + + Tests: Add test file good-1-empty-bcj-lzma2.xz. + + This is from test_bcj_exact_size.c. + It's good to have it as a standalone file. + + tests/files/README | 5 +++++ + tests/files/good-1-empty-bcj-lzma2.xz | Bin 0 -> 52 bytes + 2 files changed, 5 insertions(+) + +commit aa75c5563a760aea3aa23d997d519e702e82726b +Author: Jia Tan +Date: 2022-06-10 21:35:18 +0800 + + Tests: Created tests for hardware functions. + + Created tests for all API functions exported in + src/liblzma/api/lzma/hardware.h. The tests are fairly trivial + but are helpful because they will inform users if their machines + cannot support these functions. They also improve the code + coverage metrics. + + .gitignore | 1 + + tests/Makefile.am | 2 ++ + tests/test_hardware.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 48 insertions(+) + +commit 5c8ffdca20813939818843476fb212dfae8838a3 +Author: Lasse Collin +Date: 2022-06-02 21:01:45 +0300 + + Tests: Convert test_check to tuktest. + + Thanks to Jia Tan for help with all the tests. + + tests/test_check.c | 67 +++++++++++++++++++++++++++--------------------------- + 1 file changed, 33 insertions(+), 34 deletions(-) + +commit faf5ff8899d539b4dcd2a7e5280cb820a4746c86 +Author: Lasse Collin +Date: 2022-06-02 20:31:03 +0300 + + Tests: Convert test_block_header to tuktest. + + tests/test_block_header.c | 89 +++++++++++++++++++++++++++-------------------- + 1 file changed, 52 insertions(+), 37 deletions(-) + +commit 754d39fbebee3782258d42f154a223d3c5770ec7 +Author: Lasse Collin +Date: 2022-06-02 20:28:23 +0300 + + Tests: Convert test_bcj_exact_size to tuktest. + + The compress() and decompress() functions were merged because + the later depends on the former so they need to be a single + test case. + + tests/test_bcj_exact_size.c | 75 +++++++++++++++++++++++++-------------------- + 1 file changed, 41 insertions(+), 34 deletions(-) + +commit 96da21470f9570cd08286906a050a7c22631775b +Author: Lasse Collin +Date: 2022-06-02 20:27:00 +0300 + + Tests: Include tuktest.h in tests.h. + + This breaks -Werror because none of the tests so far use + tuktest.h and thus there are warnings about unused variables + and functions. + + tests/tests.h | 47 +++++++++++++++++++++++------------------------ + 1 file changed, 23 insertions(+), 24 deletions(-) + +commit df71ba1c991f60c3269aaadd398247e632714626 +Author: Lasse Collin +Date: 2022-06-02 20:25:21 +0300 + + Tests: Add tuktest.h mini-test-framework. + + tests/Makefile.am | 1 + + tests/tuktest.h | 752 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 753 insertions(+) + +commit 4773608554d1b684a05ff9c1d879cf5c42266d33 +Author: Lasse Collin +Date: 2022-05-23 21:31:36 +0300 + + Build: Enable Automake's parallel test harness. + + It has been the default for quite some time already and + the old serial harness isn't discouraged. The downside is + that with parallel tests one cannot print progress info or + other diagnostics to the terminal; all output from the tests + will be in the log files only. But now that the compression + tests are separated the parallel tests will speed things up. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 9a6dd6d46f7f256a5573e5d874c1052033ed7b05 +Author: Lasse Collin +Date: 2022-05-23 21:17:47 +0300 + + Tests: Split test_compress.sh into separate test unit for each file. + + test_compress.sh now takes one command line argument: + a filename to be tested. If it begins with "compress_generated_" + the file will be created with create_compress_files. + + This will allow parallel execution of the slow tests. + + tests/Makefile.am | 11 +++- + tests/test_compress.sh | 91 +++++++++++++++++++--------------- + tests/test_compress_generated_abc | 3 ++ + tests/test_compress_generated_random | 3 ++ + tests/test_compress_generated_text | 3 ++ + tests/test_compress_prepared_bcj_sparc | 3 ++ + tests/test_compress_prepared_bcj_x86 | 3 ++ + 7 files changed, 77 insertions(+), 40 deletions(-) + +commit c7758ac9c734707514dd34f254173ebac5eea7f8 +Author: Lasse Collin +Date: 2022-05-23 20:32:49 +0300 + + Test: Make create_compress_files.c a little more flexible. + + If a command line argument is given, then only the test file + of that type is created. It's quite dumb in sense that unknown + names don't give an error but it's good enough here. + + Also use EXIT_FAILURE instead of 1 as exit status for errors. + + tests/create_compress_files.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +commit 4a8e4a7b0ad4b03c0ac6862716c3457452cdaf8c +Author: Lasse Collin +Date: 2022-05-23 20:17:42 +0300 + + Tests: Remove unneeded commented lines from test_compress.sh. + + tests/test_compress.sh | 13 ------------- + 1 file changed, 13 deletions(-) + +commit 2ee50d150ee009f36135540b459e6ff328549725 +Author: Lasse Collin +Date: 2022-05-23 20:16:00 +0300 + + Tests: Remove progress indicator from test_compress.sh. + + It will be useless with Automake's parallel tests. + + tests/test_compress.sh | 9 --------- + 1 file changed, 9 deletions(-) + +commit 2ce4f36f179a81d0c6e182a409f363df759d1ad0 +Author: Lasse Collin +Date: 2022-05-23 19:37:18 +0300 + + liblzma: Silence a warning. + + The actual initialization is done via mythread_sync and seems + that GCC doesn't necessarily see that it gets initialized there. + + src/liblzma/common/stream_decoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5d8f3764ef43c35910e6d7003c0900a961ef6544 +Author: Lasse Collin +Date: 2022-04-14 20:53:16 +0300 + + xz: Fix build with --disable-threads. + + src/xz/hardware.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1d592897278b172d8549aa29c3a1f3a4f432a9b9 +Author: Lasse Collin +Date: 2022-04-14 14:50:17 +0300 + + xz: Change the cap of the default -T0 memlimit for 32-bit xz. + + The SIZE_MAX / 3 was 1365 MiB. 1400 MiB gives little more room + and it looks like a round (artificial) number in --info-memory + once --info-memory is made to display it. + + Also, using #if avoids useless code on 64-bit builds. + + src/xz/hardware.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit c77fe55ddb7752ed0fec46967c5ec9a72632ea0c +Author: Lasse Collin +Date: 2022-04-14 14:20:46 +0300 + + xz: Add a default soft memory usage limit for --threads=0. + + This is a soft limit in sense that it only affects the number of + threads. It never makes xz fail and it never makes xz change + settings that would affect the compressed output. + + The idea is to make -T0 have more reasonable behavior when + the system has very many cores or when a memory-hungry + compression options are used. This also helps with 32-bit xz, + preventing it from running out of address space. + + The downside of this commit is that now the number of threads + might become too low compared to what the user expected. I + hope this to be an acceptable compromise as the old behavior + has been a source of well-argued complaints for a long time. + + src/xz/coder.c | 28 ++++++++++++++++++++++++++-- + src/xz/hardware.c | 38 +++++++++++++++++++++++++++++--------- + src/xz/hardware.h | 27 +++++++++++++++++++++++++++ + 3 files changed, 82 insertions(+), 11 deletions(-) + +commit 0adc13bfe32c14f3e4c6ce9f2d4fdf4112ab53f4 +Author: Lasse Collin +Date: 2022-04-14 12:59:09 +0300 + + xz: Make -T0 use multithreaded mode on single-core systems. + + The main problem withi the old behavior is that the compressed + output is different on single-core systems vs. multicore systems. + This commit fixes it by making -T0 one thread in multithreaded mode + on single-core systems. + + The downside of this is that it uses more memory. However, if + --memlimit-compress is used, xz can (thanks to the previous commit) + drop to the single-threaded mode still. + + src/xz/coder.c | 18 +++++++++--------- + src/xz/hardware.c | 14 ++++++++++++++ + src/xz/hardware.h | 4 ++++ + 3 files changed, 27 insertions(+), 9 deletions(-) + +commit 898faa97287a756231c663a3ed5165672b417207 +Author: Lasse Collin +Date: 2022-04-14 12:38:00 +0300 + + xz: Changes to --memlimit-compress and --no-adjust. + + In single-threaded mode, --memlimit-compress can make xz scale down + the LZMA2 dictionary size to meet the memory usage limit. This + obviously affects the compressed output. However, if xz was in + threaded mode, --memlimit-compress could make xz reduce the number + of threads but it wouldn't make xz switch from multithreaded mode + to single-threaded mode or scale down the LZMA2 dictionary size. + This seemed illogical and there was even a "FIXME?" about it. + + Now --memlimit-compress can make xz switch to single-threaded + mode if one thread in multithreaded mode uses too much memory. + If memory usage is still too high, then the LZMA2 dictionary + size can be scaled down too. + + The option --no-adjust was also changed so that it no longer + prevents xz from scaling down the number of threads as that + doesn't affect compressed output (only performance). After + this commit --no-adjust only prevents adjustments that affect + compressed output, that is, with --no-adjust xz won't switch + from multithreaded mode to single-threaded mode and won't + scale down the LZMA2 dictionary size. + + The man page wasn't updated yet. + + src/xz/coder.c | 63 +++++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 43 insertions(+), 20 deletions(-) + +commit cad299008cf73ec566f0662a9cf2b94f86a99659 +Author: Lasse Collin +Date: 2022-04-11 22:20:49 +0300 + + xz: Add --memlimit-mt-decompress along with a default limit value. + + --memlimit-mt-decompress allows specifying the limit for + multithreaded decompression. This matches memlimit_threading in + liblzma. This limit can only affect the number of threads being + used; it will never prevent xz from decompressing a file. The + old --memlimit-decompress option is still used at the same time. + + If the value of --memlimit-decompress (the default value or + one specified by the user) is less than the value of + --memlimit-mt-decompress , then --memlimit-mt-decompress is + reduced to match --memlimit-decompress. + + Man page wasn't updated yet. + + src/xz/args.c | 24 +++++++++++++++------- + src/xz/coder.c | 34 ++++++++++--------------------- + src/xz/hardware.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++----- + src/xz/hardware.h | 17 ++++++++++------ + src/xz/message.c | 4 +++- + 5 files changed, 97 insertions(+), 42 deletions(-) + +commit fe87b4cd5364f5bbb6a75a0299f1500c852d7c9a +Author: Lasse Collin +Date: 2022-04-06 23:11:59 +0300 + + liblzma: Threaded decoder: Improve setting of pending_error. + + It doesn't need to be done conditionally. The comments try + to explain it. + + src/liblzma/common/stream_decoder_mt.c | 51 +++++++++++++++++++++++----------- + 1 file changed, 35 insertions(+), 16 deletions(-) + +commit 90621da7f6e1bfd6d91d60415eae04b2bca274c2 +Author: Lasse Collin +Date: 2022-04-06 12:39:49 +0300 + + liblzma: Add a new flag LZMA_FAIL_FAST for threaded decoder. + + In most cases if the input file is corrupt the application won't + care about the uncompressed content at all. With this new flag + the threaded decoder will return an error as soon as any thread + has detected an error; it won't wait to copy out the data before + the location of the error. + + I don't plan to use this in xz to keep the behavior consistent + between single-threaded and multi-threaded modes. + + src/liblzma/api/lzma/container.h | 25 ++++++++++++++++- + src/liblzma/common/common.h | 7 +++-- + src/liblzma/common/stream_decoder_mt.c | 50 +++++++++++++++++++--------------- + 3 files changed, 56 insertions(+), 26 deletions(-) + +commit 64b6d496dc815a176d8307f418f6834a26783484 +Author: Lasse Collin +Date: 2022-04-05 12:24:57 +0300 + + liblzma: Threaded decoder: Always wait for output if LZMA_FINISH is used. + + This makes the behavior consistent with the single-threaded + decoder when handling truncated .xz files. + + Thanks to Jia Tan for finding this issue. + + src/liblzma/common/stream_decoder_mt.c | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +commit e671bc8828b9c0c5406c3a22c541301d0eb54518 +Author: Lasse Collin +Date: 2022-04-02 21:49:59 +0300 + + liblzma: Threaded decoder: Support zpipe.c-style decoding loop. + + This makes it possible to call lzma_code() in a loop that only + reads new input when lzma_code() didn't fill the output buffer + completely. That isn't the calling style suggested by the + liblzma example program 02_decompress.c so perhaps the usefulness + of this feature is limited. + + Also, it is possible to write such a loop so that it works + with the single-threaded decoder but not with the threaded + decoder even after this commit, or so that it works only if + lzma_mt.timeout = 0. + + The zlib tutorial is a well-known + example of a loop where more input is read only when output isn't + full. Porting this as is to liblzma would work with the + single-threaded decoder (if LZMA_CONCATENATED isn't used) but it + wouldn't work with threaded decoder even after this commit because + the loop assumes that no more output is possible when it cannot + read more input ("if (strm.avail_in == 0) break;"). This cannot + be fixed at liblzma side; the loop has to be modified at least + a little. + + I'm adding this in any case because the actual code is simple + and short and should have no harmful side-effects in other + situations. + + src/liblzma/common/stream_decoder_mt.c | 77 +++++++++++++++++++++++++++++----- + 1 file changed, 67 insertions(+), 10 deletions(-) + +commit 2ba8173e27be4793edb46497e499ac2ae753a316 +Author: Lasse Collin +Date: 2022-03-31 00:05:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 +Author: Lasse Collin +Date: 2022-03-29 19:19:12 +0300 + + xzgrep: Fix escaping of malicious filenames (ZDI-CAN-16587). + + Malicious filenames can make xzgrep to write to arbitrary files + or (with a GNU sed extension) lead to arbitrary code execution. + + xzgrep from XZ Utils versions up to and including 5.2.5 are + affected. 5.3.1alpha and 5.3.2alpha are affected as well. + This patch works for all of them. + + This bug was inherited from gzip's zgrep. gzip 1.12 includes + a fix for zgrep. + + The issue with the old sed script is that with multiple newlines, + the N-command will read the second line of input, then the + s-commands will be skipped because it's not the end of the + file yet, then a new sed cycle starts and the pattern space + is printed and emptied. So only the last line or two get escaped. + + One way to fix this would be to read all lines into the pattern + space first. However, the included fix is even simpler: All lines + except the last line get a backslash appended at the end. To ensure + that shell command substitution doesn't eat a possible trailing + newline, a colon is appended to the filename before escaping. + The colon is later used to separate the filename from the grep + output so it is fine to add it here instead of a few lines later. + + The old code also wasn't POSIX compliant as it used \n in the + replacement section of the s-command. Using \ is the + POSIX compatible method. + + LC_ALL=C was added to the two critical sed commands. POSIX sed + manual recommends it when using sed to manipulate pathnames + because in other locales invalid multibyte sequences might + cause issues with some sed implementations. In case of GNU sed, + these particular sed scripts wouldn't have such problems but some + other scripts could have, see: + + info '(sed)Locale Considerations' + + This vulnerability was discovered by: + cleemy desu wayo working with Trend Micro Zero Day Initiative + + Thanks to Jim Meyering and Paul Eggert discussing the different + ways to fix this and for coordinating the patch release schedule + with gzip. + + src/scripts/xzgrep.in | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +commit bd93b776c1bd15e90661033c918cdeb354dbcc38 +Author: Lasse Collin +Date: 2022-03-26 01:02:44 +0200 + + liblzma: Fix a deadlock in threaded decoder. + + If a worker thread has consumed all input so far and it's + waiting on thr->cond and then the main thread enables + partial update for that thread, the code used to deadlock. + This commit allows one dummy decoding pass to occur in this + situation which then also does the partial update. + + As part of the fix, this moves thr->progress_* updates to + avoid the second thr->mutex locking. + + Thanks to Jia Tan for finding, debugging, and reporting the bug. + + src/liblzma/common/stream_decoder_mt.c | 71 +++++++++++++++++++++++++--------- + 1 file changed, 52 insertions(+), 19 deletions(-) + +commit e0394e94230f208682ac1e1f4c41f22f9ad79916 +Author: Lasse Collin +Date: 2022-03-23 16:34:00 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 487c77d48760564b1949c5067630b675b87be4de +Author: Lasse Collin +Date: 2022-03-23 16:28:55 +0200 + + liblzma: Threaded decoder: Don't stop threads on LZMA_TIMED_OUT. + + LZMA_TIMED_OUT is not an error and thus stopping threads on + LZMA_TIMED_OUT breaks the decoder badly. + + Thanks to Jia Tan for finding the bug and for the patch. + + src/liblzma/common/stream_decoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6c6da57ae2aa962aabde6892442227063d87e88c +Author: Lasse Collin +Date: 2022-03-07 00:36:16 +0200 + + xz: Add initial support for threaded decompression. + + If threading support is enabled at build time, this will + use lzma_stream_decoder_mt() even for single-threaded mode. + With memlimit_threading=0 the behavior should be identical. + + This needs some work like adding --memlimit-threading=LIMIT. + + The original patch from Sebastian Andrzej Siewior included + a method to get currently available RAM on Linux. It might + be one way to go but as it is Linux-only, the available-RAM + approach needs work for portability or using a fallback method + on other OSes. + + The man page wasn't updated yet. + + src/xz/coder.c | 36 +++++++++++++++++++++++++++++++++++- + 1 file changed, 35 insertions(+), 1 deletion(-) + +commit 4cce3e27f529af33e0e7749a8cbcec59954946b5 +Author: Lasse Collin +Date: 2022-03-06 23:36:20 +0200 + + liblzma: Add threaded .xz decompressor. + + I realize that this is about a decade late. + + Big thanks to Sebastian Andrzej Siewior for the original patch. + I made a bunch of smaller changes but after a while quite a few + things got rewritten. So any bugs in the commit were created by me. + + src/liblzma/api/lzma/container.h | 90 +- + src/liblzma/common/Makefile.inc | 5 + + src/liblzma/common/common.h | 4 + + src/liblzma/common/stream_decoder_mt.c | 1814 ++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 1 + + 5 files changed, 1907 insertions(+), 7 deletions(-) + +commit 717631b9788dc9c100ee0c87d3c14a2782638ff4 +Author: Lasse Collin +Date: 2022-03-06 16:54:23 +0200 + + liblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK. + + If Check is unsupported, it will be silently ignored. + It's the caller's job to handle it. + + src/liblzma/api/lzma/block.h | 3 --- + 1 file changed, 3 deletions(-) + +commit 1a4bb97a00936535e30ac61945aeee38882b5d1a +Author: Lasse Collin +Date: 2022-03-06 16:41:19 +0200 + + liblzma: Add new output queue (lzma_outq) features. + + Add lzma_outq_clear_cache2() which may leave one buffer allocated + in the cache. + + Add lzma_outq_outbuf_memusage() to get the memory needed for + a single lzma_outbuf. This is now used internally in outqueue.c too. + + Track both the total amount of memory allocated and the amount of + memory that is in active use (not in cache). + + In lzma_outbuf, allow storing the current input position that + matches the current output position. This way the main thread + can notice when no more output is possible without first providing + more input. + + Allow specifying return code for lzma_outq_read() in a finished + lzma_outbuf. + + src/liblzma/common/outqueue.c | 43 +++++++++++++++++++++++++++++++++++------- + src/liblzma/common/outqueue.h | 44 ++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 79 insertions(+), 8 deletions(-) + +commit ddbc6f58c2de388eed24cd7ea91b523d397da5f4 +Author: Lasse Collin +Date: 2022-03-06 15:18:58 +0200 + + liblzma: Index hash: Change return value type of hash_append() to void. + + src/liblzma/common/index_hash.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +commit 20e7a33e2d59c6a814447d3991f21e2702174b20 +Author: Lasse Collin +Date: 2022-02-22 03:42:57 +0200 + + liblzma: Minor addition to lzma_vli_size() API doc. + + Thanks to Jia Tan. + + src/liblzma/api/lzma/vli.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 4f78f5fcf63592f2d77e921cfe0d5de300867374 +Author: Lasse Collin +Date: 2022-02-22 02:04:18 +0200 + + liblzma: Check the return value of lzma_index_append() in threaded encoder. + + If lzma_index_append() failed (most likely memory allocation failure) + it could have gone unnoticed and the resulting .xz file would have + an incorrect Index. Decompressing such a file would produce the + correct uncompressed data but then an error would occur when + verifying the Index field. + + src/liblzma/common/stream_encoder_mt.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit 5313ad66b40aab822ddca3e9905254cb99a4080d +Author: Lasse Collin +Date: 2022-02-22 01:37:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 865e0a3689a25a7ee8eecae1a34c1775e3aa676e +Author: Ed Maste +Date: 2022-02-11 15:25:46 +0000 + + liblzma: Use non-executable stack on FreeBSD as on Linux + + src/liblzma/check/crc32_x86.S | 4 ++-- + src/liblzma/check/crc64_x86.S | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit 1c9a5786d206b4abc8e427326651c8174baea753 +Author: Lasse Collin +Date: 2022-02-20 20:36:27 +0200 + + liblzma: Make Block decoder catch certain types of errors better. + + Now it limits the input and output buffer sizes that are + passed to a raw decoder. This way there's no need to check + if the sizes can grow too big or overflow when updating + Compressed Size and Uncompressed Size counts. This also means + that a corrupt file cannot cause the raw decoder to process + useless extra input or output that would exceed the size info + in Block Header (and thus cause LZMA_DATA_ERROR anyway). + + More importantly, now the size information is verified more + carefully in case raw decoder returns LZMA_OK. This doesn't + really matter with the current single-threaded .xz decoder + as the errors would be detected slightly later anyway. But + this helps avoiding corner cases in the upcoming threaded + decompressor, and it might help other Block decoder uses + outside liblzma too. + + The test files bad-1-lzma2-{9,10,11}.xz test these conditions. + With the single-threaded .xz decoder the only difference is + that LZMA_DATA_ERROR is detected in a difference place now. + + src/liblzma/common/block_decoder.c | 79 ++++++++++++++++++++++++++------------ + 1 file changed, 54 insertions(+), 25 deletions(-) + +commit 555de11873eb00c9b94a8be70645db502e5a9dbd +Author: Lasse Collin +Date: 2022-02-20 19:38:55 +0200 + + Tests: Add bad-1-lzma2-11.xz. + + tests/files/README | 5 +++++ + tests/files/bad-1-lzma2-11.xz | Bin 0 -> 64 bytes + 2 files changed, 5 insertions(+) + +commit f0da507f22e7f4e3edb75b45b74d344244ca03fb +Author: Lasse Collin +Date: 2022-02-18 18:51:10 +0200 + + Translations: Fix po4a failure with the French man page translations. + + Thanks to Mario Blättermann for the patch. + + po4a/fr_FR.po | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit f7711d228c3c32395460c82498c60a9f730d0239 +Author: Lasse Collin +Date: 2022-02-07 01:14:37 +0200 + + Translations: Add French translation of man pages. + + This matches xz-utils 5.2.5-2 in Debian. + + The translation was done by "bubu", proofread by the debian-l10n-french + mailing list contributors, and submitted to me on the xz-devel mailing + list by Jean-Pierre Giraud. Thanks to everyone! + + po4a/fr_FR.po | 3541 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 3542 insertions(+), 1 deletion(-) + +commit 6468f7e41a8e9c611e4ba8d34e2175c5dacdbeb4 +Author: jiat75 +Date: 2022-01-28 20:47:55 +0800 + + liblzma: Add NULL checks to LZMA and LZMA2 properties encoders. + + Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode() + assumed that the options pointers must be non-NULL because the + with these filters the API says it must never be NULL. It is + good to do these checks anyway. + + src/liblzma/lzma/lzma2_encoder.c | 3 +++ + src/liblzma/lzma/lzma_encoder.c | 3 +++ + 2 files changed, 6 insertions(+) + +commit 2523c30705f49eabd27b854aa656ae87cc224808 +Author: Lasse Collin +Date: 2022-02-06 23:19:32 +0200 + + liblzma: Fix uint64_t vs. size_t confusion. + + This broke 32-bit builds due to a pointer type mismatch. + + This bug was introduced with the output-size-limited encoding + in 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c. + + Thanks to huangqinjin for the bug report. + + src/liblzma/rangecoder/range_encoder.h | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +commit 2bd36c91d03e03b31a4f12fd0afc100ae32d66e2 +Author: huangqinjin +Date: 2021-12-13 20:49:21 +0800 + + CMake: Keep compatible with Windows 95 for 32-bit build. + + CMakeLists.txt | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +commit 2024fbf2794885277d05378d40b2b8015a7c3b40 +Author: Lasse Collin +Date: 2021-11-13 21:04:05 +0200 + + xzgrep: Update man page timestamp. + + src/scripts/xzgrep.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 400e7a239a53282cedaad927a41f3463d7f542e5 +Author: Lasse Collin +Date: 2021-11-13 18:23:24 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3a512c7787b2642ca946f4adc6e9a0a5d9b0d5a0 +Author: Ville Skyttä +Date: 2021-11-13 10:11:57 +0200 + + xzgrep: use `grep -E/-F` instead of `egrep` and `fgrep` + + `egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in + current post 3.7 Git they have been made to emit obsolescence warnings: + https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 + + src/scripts/xzgrep.1 | 8 ++++---- + src/scripts/xzgrep.in | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +commit edf525e2b1840dcaf377df472c67d8f11f8ace1b +Author: Lasse Collin +Date: 2021-10-28 23:02:11 +0300 + + Bump the version number for 5.3.2alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ea8c948655a86290524efe59cff067e06a886709 +Author: Lasse Collin +Date: 2021-10-28 22:59:52 +0300 + + Add NEWS for 5.3.2alpha. + + NEWS | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 52435f302f4724157ec50b4210cbe42b285c3cbc +Author: Lasse Collin +Date: 2021-10-27 23:27:48 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit f2aea1d5a504b2021bf47a238390e4f12bdd518d +Author: Lasse Collin +Date: 2021-10-27 23:23:11 +0300 + + xz: Change the coding style of the previous commit. + + It isn't any better now but it's consistent with + the rest of the code base. + + src/xz/file_io.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 892b16cc282f5b4e1c49871b326f4db25c5b4d81 +Author: Alexander Bluhm +Date: 2021-10-05 23:33:16 +0200 + + xz: Avoid fchown(2) failure. + + OpenBSD does not allow to change the group of a file if the user + does not belong to this group. In contrast to Linux, OpenBSD also + fails if the new group is the same as the old one. Do not call + fchown(2) in this case, it would change nothing anyway. + + This fixes an issue with Perl Alien::Build module. + https://github.com/PerlAlien/Alien-Build/issues/62 + + src/xz/file_io.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 2b509c868cae3988bf21cd693fbf9021cdc85628 +Author: Lasse Collin +Date: 2021-09-17 17:31:11 +0300 + + liblzma: Fix liblzma.map for the lzma_microlzma_* symbols. + + This should have been part of d267d109c370a40b502e73f8664b154b15e4f253. + + Thanks to Gao Xiang. + + src/liblzma/liblzma.map | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit cacb06a954b58255dfc084a0bc9708f43a0fd6d6 +Author: Lasse Collin +Date: 2021-09-09 22:21:07 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6928aac9da6ba612780b9f72ba1d6ecbe1e8b54e +Author: Lasse Collin +Date: 2021-09-09 21:41:51 +0300 + + liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC. + + By default, MSVC always sets __cplusplus to 199711L. The real + C++ standard version is available in _MSVC_LANG (or one could + use /Zc:__cplusplus to set __cplusplus correctly). + + Fixes . + + Thanks to Dan Weiss. + + src/liblzma/api/lzma.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit d267d109c370a40b502e73f8664b154b15e4f253 +Author: Lasse Collin +Date: 2021-09-05 20:38:12 +0300 + + liblzma: Rename EROFS LZMA to MicroLZMA. + + It still exists primarily for EROFS but MicroLZMA is + a more generic name (that hopefully doesn't clash with + something that already exists). + + src/liblzma/api/lzma/container.h | 33 +++++++++++++--------- + src/liblzma/common/Makefile.inc | 4 +-- + .../{erofs_decoder.c => microlzma_decoder.c} | 32 ++++++++++----------- + .../{erofs_encoder.c => microlzma_encoder.c} | 30 ++++++++++---------- + 4 files changed, 52 insertions(+), 47 deletions(-) + +commit 3247e95115acb95bc27f41e8cf4501db5b0b4309 +Author: Lasse Collin +Date: 2021-06-04 19:02:38 +0300 + + xzdiff: Update the man page about the exit status. + + This was forgotten from 194029ffaf74282a81f0c299c07f73caca3232ca. + + src/scripts/xzdiff.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 96f5a28a46fc93ac4e296808ac0f8631d05498bc +Author: Lasse Collin +Date: 2021-06-04 18:52:48 +0300 + + xzless: Fix less(1) version detection when it contains a dot. + + Sometimes the version number from "less -V" contains a dot, + sometimes not. xzless failed detect the version number when + it does contain a dot. This fixes it. + + Thanks to nick87720z for reporting this. Apparently it had been + reported here in 2013. + + src/scripts/xzless.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 5fb5212d816addbc523d0798cb482fdd0484f8fa +Author: Lasse Collin +Date: 2021-04-11 19:58:10 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit fc3d3a7296ef58bb799a73943636b8bfd95339f7 +Author: Ivan A. Melnikov +Date: 2021-04-09 11:45:10 +0300 + + Reduce maximum possible memory limit on MIPS32 + + Due to architectural limitations, address space available to a single + userspace process on MIPS32 is limited to 2 GiB, not 4, even on systems + that have more physical RAM -- e.g. 64-bit systems with 32-bit + userspace, or systems that use XPA (an extension similar to x86's PAE). + + So, for MIPS32, we have to impose stronger memory limits. I've chosen + 2000MiB to give the process some headroom. + + src/xz/hardware.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e7da44d5151e21f153925781ad29334ae0786101 +Author: Lasse Collin +Date: 2021-02-13 23:31:27 +0200 + + CMake: Use interface library for better FindLibLZMA compatibility. + + https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html + + Thanks to Markus Rickert. + + CMakeLists.txt | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit a61dd82ada39030f41b4ffca9ea551714908bedc +Author: Lasse Collin +Date: 2021-01-30 18:36:04 +0200 + + CMake: Try to improve compatibility with the FindLibLZMA module. + + The naming conflict with FindLibLZMA module gets worse. + Not avoiding it in the first place was stupid. + + Normally find_package(LibLZMA) will use the module and + find_package(liblzma 5.2.5 REQUIRED CONFIG) will use the config + file even with a case insensitive file system. However, if + CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE and the file system + is case insensitive, find_package(LibLZMA) will find our liblzma + config file instead of using FindLibLZMA module. + + One big problem with this is that FindLibLZMA uses + LibLZMA::LibLZMA and we use liblzma::liblzma as the target + name. With target names CMake happens to be case sensitive. + To workaround this, this commit adds + + add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma) + + to the config file. Then both spellings work. + + To make the behavior consistent between case sensitive and + insensitive file systems, the config and related files are + renamed from liblzmaConfig.cmake to liblzma-config.cmake style. + With this style CMake looks for lowercase version of the package + name so find_package(LiBLzmA 5.2.5 REQUIRED CONFIG) will work + to find our config file. + + There are other differences between our config file and + FindLibLZMA so it's still possible that things break for + reasons other than the spelling of the target name. Hopefully + those situations aren't too common. + + When the config file is available, it should always give as good or + better results as FindLibLZMA so this commit doesn't affect the + recommendation to use find_package(liblzma 5.2.5 REQUIRED CONFIG) + which explicitly avoids FindLibLZMA. + + Thanks to Markus Rickert. + + CMakeLists.txt | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit 5b7bc1b8ae766a76710ca1b99f909cf52c697f05 +Author: Lasse Collin +Date: 2021-01-29 21:19:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6c6f0db340dcb8bb424411cedba713405d55f6b8 +Author: Lasse Collin +Date: 2021-01-29 21:19:08 +0200 + + liblzma: Fix unitialized variable. + + This was introduced two weeks ago in the commit + 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c. + + Thanks to Nathan Moinvaziri. + + src/liblzma/lzma/lzma_encoder.c | 1 + + 1 file changed, 1 insertion(+) + +commit bb1d5c1fdd30550d4221ecd336e0be1206132a5c +Author: Lasse Collin +Date: 2021-01-24 22:32:41 +0200 + + Tests: Add bad-1-lzma2-10.xz and also modify -9.xz. + + tests/files/README | 11 +++++++++-- + tests/files/bad-1-lzma2-10.xz | Bin 0 -> 60 bytes + tests/files/bad-1-lzma2-9.xz | Bin 72 -> 72 bytes + 3 files changed, 9 insertions(+), 2 deletions(-) + +commit 6b8abc84a5469792e0355d0bfc0784d41cfdfef7 +Author: Lasse Collin +Date: 2021-01-24 19:22:35 +0200 + + liblzma: Fix a wrong comment in stream_encoder_mt.c. + + src/liblzma/common/stream_encoder_mt.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 939fc5ed654aac25fe0c8684b2df8dbeadb2de1e +Author: Lasse Collin +Date: 2021-01-24 18:51:51 +0200 + + Tests: Add bad-1-lzma2-9.xz. + + tests/files/README | 4 ++++ + tests/files/bad-1-lzma2-9.xz | Bin 0 -> 72 bytes + 2 files changed, 4 insertions(+) + +commit fdd30032f8531ac89519b48c21d810ecf06825f6 +Author: Lasse Collin +Date: 2021-01-24 17:02:00 +0200 + + Tests: Add bad-1-check-crc32-2.xz. + + tests/files/README | 7 +++++++ + tests/files/bad-1-check-crc32-2.xz | Bin 0 -> 72 bytes + 2 files changed, 7 insertions(+) + +commit db465419ae26ec7fb9b9472183911ff521620c77 +Author: Lasse Collin +Date: 2021-01-17 19:20:50 +0200 + + liblzma: In EROFS LZMA decoder, verify that comp_size matches at the end. + + When the uncompressed size is known to be exact, after decompressing + the stream exactly comp_size bytes of input must have been consumed. + This is a minor improvement to error detection. + + src/liblzma/common/erofs_decoder.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 774cc0118ba2496581cb2621505a04bb6598cc75 +Author: Lasse Collin +Date: 2021-01-17 18:53:34 +0200 + + liblzma: Make EROFS LZMA decoder work when exact uncomp_size isn't known. + + The caller must still not specify an uncompressed size bigger + than the actual uncompressed size. + + As a downside, this now needs the exact compressed size. + + src/liblzma/api/lzma/container.h | 23 ++++++++--- + src/liblzma/common/erofs_decoder.c | 80 ++++++++++++++++++++++++++++++++++---- + 2 files changed, 91 insertions(+), 12 deletions(-) + +commit 421b0aa352da244075db10205cf33712f91b9835 +Author: Lasse Collin +Date: 2021-01-14 20:57:11 +0200 + + liblzma: Fix missing normalization in rc_encode_dummy(). + + Without this fix it could attempt to create too much output. + + src/liblzma/rangecoder/range_encoder.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 601ec0311e769fc704daaaa7dac0ca840aff080e +Author: Lasse Collin +Date: 2021-01-14 20:07:01 +0200 + + liblzma: Add EROFS LZMA encoder and decoder. + + Right now this is just a planned extra-compact format for use + in the EROFS file system in Linux. At this point it's possible + that the format will either change or be abandoned and removed + completely. + + The special thing about the encoder is that it uses the + output-size-limited encoding added in the previous commit. + EROFS uses fixed-sized blocks (e.g. 4 KiB) to hold compressed + data so the compressors must be able to create valid streams + that fill the given block size. + + src/liblzma/api/lzma/container.h | 76 +++++++++++++++++++ + src/liblzma/common/Makefile.inc | 2 + + src/liblzma/common/erofs_decoder.c | 148 +++++++++++++++++++++++++++++++++++++ + src/liblzma/common/erofs_encoder.c | 139 ++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 2 + + 5 files changed, 367 insertions(+) + +commit 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c +Author: Lasse Collin +Date: 2021-01-13 19:16:32 +0200 + + liblzma: Add rough support for output-size-limited encoding in LZMA1. + + With this it is possible to encode LZMA1 data without EOPM so that + the encoder will encode as much input as it can without exceeding + the specified output size limit. The resulting LZMA1 stream will + be a normal LZMA1 stream without EOPM. The actual uncompressed size + will be available to the caller via the uncomp_size pointer. + + One missing thing is that the LZMA layer doesn't inform the LZ layer + when the encoding is finished and thus the LZ may read more input + when it won't be used. However, this doesn't matter if encoding is + done with a single call (which is the planned use case for now). + For proper multi-call encoding this should be improved. + + This commit only adds the functionality for internal use. + Nothing uses it yet. + + src/liblzma/common/common.h | 11 +++ + src/liblzma/lz/lz_encoder.c | 16 ++++ + src/liblzma/lz/lz_encoder.h | 4 + + src/liblzma/lzma/lzma_encoder.c | 127 +++++++++++++++++++++++--------- + src/liblzma/lzma/lzma_encoder_private.h | 12 +++ + src/liblzma/rangecoder/range_encoder.h | 111 ++++++++++++++++++++++++++++ + 6 files changed, 246 insertions(+), 35 deletions(-) + +commit 9cdabbeea891e8f1e7741b076f7db6ac05ae392a +Author: Lasse Collin +Date: 2021-01-11 23:57:11 +0200 + + Scripts: Add zstd support to xzdiff. + + src/scripts/xzdiff.1 | 6 ++++-- + src/scripts/xzdiff.in | 16 +++++++++++----- + 2 files changed, 15 insertions(+), 7 deletions(-) + +commit d9ec3add97cf4c999a7f594c6529680227b6c274 +Author: Lasse Collin +Date: 2021-01-11 23:41:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 074259f4f3966aeac6edb205fecbc1a8d2b58bb2 +Author: Lasse Collin +Date: 2021-01-11 23:41:16 +0200 + + xz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky. + + Previously this required using --force but that has other + effects too which might be undesirable. Changing the behavior + of --keep has a small risk of breaking existing scripts but + since this is a fairly special corner case I expect the + likehood of breakage to be low enough. + + I think the new behavior is more logical. The only reason for + the old behavior was to be consistent with gzip and bzip2. + + Thanks to Vincent Lefevre and Sebastian Andrzej Siewior. + + src/xz/file_io.c | 9 +++++---- + src/xz/xz.1 | 16 +++++++++++++++- + 2 files changed, 20 insertions(+), 5 deletions(-) + +commit 73c555b3077c19dda29b6f4592ced2af876f8333 +Author: Lasse Collin +Date: 2021-01-11 23:28:52 +0200 + + Scripts: Fix exit status of xzgrep. + + Omit the -q option from xz, gzip, and bzip2. With xz this shouldn't + matter. With gzip it's important because -q makes gzip replace SIGPIPE + with exit status 2. With bzip2 it's important because with -q bzip2 + is completely silent if input is corrupt while other decompressors + still give an error message. + + Avoiding exit status 2 from gzip is important because bzip2 uses + exit status 2 to indicate corrupt input. Before this commit xzgrep + didn't recognize corrupt .bz2 files because xzgrep was treating + exit status 2 as SIGPIPE for gzip compatibility. + + zstd still needs -q because otherwise it is noisy in normal + operation. + + The code to detect real SIGPIPE didn't check if the exit status + was due to a signal (>= 128) and so could ignore some other exit + status too. + + src/scripts/xzgrep.in | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +commit 194029ffaf74282a81f0c299c07f73caca3232ca +Author: Lasse Collin +Date: 2021-01-11 22:01:51 +0200 + + Scripts: Fix exit status of xzdiff/xzcmp. + + This is a minor fix since this affects only the situation when + the files differ and the exit status is something else than 0. + In such case there could be SIGPIPE from a decompression tool + and that would result in exit status of 2 from xzdiff/xzcmp + while the correct behavior would be to return 1 or whatever + else diff or cmp may have returned. + + This commit omits the -q option from xz/gzip/bzip2/lzop arguments. + I'm not sure why the -q was used in the first place, perhaps it + hides warnings in some situation that I cannot see at the moment. + Hopefully the removal won't introduce a new bug. + + With gzip the -q option was harmful because it made gzip return 2 + instead of >= 128 with SIGPIPE. Ignoring exit status 2 (warning + from gzip) isn't practical because bzip2 uses exit status 2 to + indicate corrupt input file. It's better if SIGPIPE results in + exit status >= 128. + + With bzip2 the removal of -q seems to be good because with -q + it prints nothing if input is corrupt. The other tools aren't + silent in this situation even with -q. On the other hand, if + zstd support is added, it will need -q since otherwise it's + noisy in normal situations. + + Thanks to Étienne Mollier and Sebastian Andrzej Siewior. + + src/scripts/xzdiff.in | 35 +++++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 14 deletions(-) + +commit f7fa309e1f7178d04c7bedc03b73077639371e97 +Author: Lasse Collin +Date: 2021-01-09 21:14:36 +0200 + + liblzma: Make lzma_outq usable for threaded decompression too. + + Before this commit all output queue buffers were allocated as + a single big allocation. Now each buffer is allocated separately + when needed. Used buffers are cached to avoid reallocation + overhead but the cache will keep only one buffer size at a time. + This should make things work OK in the decompression where most + of the time the buffer sizes will be the same but with some less + common files the buffer sizes may vary. + + While this should work fine, it's still a bit preliminary + and may even get reverted if it turns out to be useless for + decompression. + + src/liblzma/common/outqueue.c | 268 +++++++++++++++++++++------------ + src/liblzma/common/outqueue.h | 138 ++++++++++++----- + src/liblzma/common/stream_encoder_mt.c | 52 ++++--- + 3 files changed, 301 insertions(+), 157 deletions(-) + +commit a35a69d693ce37d4ba7c1855bda7d9cfa13d1778 +Author: Lasse Collin +Date: 2020-12-23 17:15:49 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4fd79b90c52396d70e0b1206ceb1a873a0ad2589 +Author: H.J. Lu +Date: 2020-12-23 06:49:04 -0800 + + liblzma: Enable Intel CET in x86 CRC assembly codes + + When Intel CET is enabled, we need to include in assembly codes + to mark Intel CET support and add _CET_ENDBR to indirect jump targets. + + Tested on Intel Tiger Lake under CET enabled Linux. + + src/liblzma/check/crc32_x86.S | 9 +++++++++ + src/liblzma/check/crc64_x86.S | 9 +++++++++ + 2 files changed, 18 insertions(+) + +commit bb3b8c6a23e25db79f862b1de325c56052e0354b +Author: Lasse Collin +Date: 2020-12-16 18:33:29 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 21588ca34af98738954fc12ded1b89d7294ef646 +Author: Lasse Collin +Date: 2020-12-16 18:30:14 +0200 + + Build: Don't build bundles on Apple OSes. + + Thanks to Daniel Packard. + + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +commit d05b0c42dd8b38d8c6b8193c8af50e9bd3d16f28 +Author: Lasse Collin +Date: 2020-12-05 22:44:03 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1890351f3423627ba5c4c495402f32d7e9ed90b7 +Author: Adam Borowski +Date: 2020-09-25 03:35:18 +0200 + + Scripts: Add zstd support to xzgrep. + + Thanks to Adam Borowski. + + src/scripts/xzgrep.1 | 9 ++++++--- + src/scripts/xzgrep.in | 1 + + 2 files changed, 7 insertions(+), 3 deletions(-) + +commit 2f108abb3d82e4e2313b438dae9c0c7c7a6366f2 +Author: Lasse Collin +Date: 2020-11-17 20:51:48 +0200 + + CMake: Fix compatibility with CMake 3.13. + + The syntax "if(DEFINED CACHE{FOO})" requires CMake 3.14. + In some other places the code treats the cache variables + like normal variables already (${FOO} or if(FOO) is used, + not ${CACHE{FOO}). + + Thanks to ygrek for reporting the bug on IRC. + + CMakeLists.txt | 2 +- + cmake/tuklib_cpucores.cmake | 4 ++-- + cmake/tuklib_physmem.cmake | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 5af726a79273fafa5de5745b117e567f21c90e49 +Author: Lasse Collin +Date: 2020-11-01 22:56:43 +0200 + + Update THANKS. + + THANKS | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit 4575d9d365c756ec189899f9f743e0b3515ce72d +Author: Lasse Collin +Date: 2020-11-01 22:34:25 +0200 + + xz: Avoid unneeded \f escapes on the man page. + + I don't want to use \c in macro arguments but groff_man(7) + suggests that \f has better portability. \f would be needed + for the .TP strings for portability reasons anyway. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 31 ++++++++++++++++++++++--------- + 1 file changed, 22 insertions(+), 9 deletions(-) + +commit 620b32f5339f86710cb4435e01ecdac972ccac73 +Author: Lasse Collin +Date: 2020-11-01 19:09:53 +0200 + + xz: Use non-breaking spaces when intentionally using more than one space. + + This silences some style checker warnings. Seems that spaces + in the beginning of a line don't need this treatment. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cb1f34988c8a4130485091b2f8b641303d8f701b +Author: Lasse Collin +Date: 2020-11-01 18:49:37 +0200 + + xz: Protect the ellipsis (...) on the man page with \&. + + This does it only when ... appears outside macro calls. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 5d224da3da87400f2fab313abbd7c710e7169ef9 +Author: Lasse Collin +Date: 2020-11-01 18:41:21 +0200 + + xz: Avoid the abbreviation "e.g." on the man page. + + A few are simply omitted, most are converted to "for example" + and surrounded with commas. Sounds like that this is better + style, for example, man-pages(7) recommends avoiding such + abbreviations except in parenthesis. + + Thanks to Bjarni Ingi Gislason. + + src/xz/xz.1 | 66 ++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 33 insertions(+), 33 deletions(-) + +commit 90457dbe3e5717660f5b81f8c604860fc5137c0c +Author: Lasse Collin +Date: 2020-07-12 23:10:03 +0300 + + xz man page: Change \- (minus) to \(en (en-dash) for a numeric range. + + Docs of ancient troff/nroff mention \(em (em-dash) but not \(en + and \- was used for both minus and en-dash. I don't know how + portable \(en is nowadays but it can be changed back if someone + complains. At least GNU groff and OpenBSD's mandoc support it. + + Thanks to Bjarni Ingi Gislason for the patch. + + src/xz/xz.1 | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 352ba2d69af2136bc814aa1df1a132559d445616 +Author: Lasse Collin +Date: 2020-07-12 20:46:24 +0300 + + Windows: Fix building of resource files when config.h isn't used. + + Now CMake + Visual Studio works for building liblzma.dll. + + Thanks to Markus Rickert. + + src/common/common_w32res.rc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a9e2a87f1d61dcf684d809bf08c8ebea93f8a480 +Author: Lasse Collin +Date: 2020-04-06 19:31:50 +0300 + + src/scripts/xzgrep.1: Filenames to xzgrep are optional. + + xzgrep --help was correct already. + + src/scripts/xzgrep.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a7ba275d9b855d186abb29eb7a4f4cb6d9ca6fe0 +Author: Bjarni Ingi Gislason +Date: 2020-03-26 22:17:31 +0000 + + src/script/xzgrep.1: Remove superfluous '.RB' + + Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z + + [ "test-groff" is a developmental version of "groff" ] + + Input file is ./src/scripts/xzgrep.1 + + :20 (macro RB): only 1 argument, but more are expected + :23 (macro RB): only 1 argument, but more are expected + :26 (macro RB): only 1 argument, but more are expected + :29 (macro RB): only 1 argument, but more are expected + :32 (macro RB): only 1 argument, but more are expected + + "abc..." does not mean the same as "abc ...". + + The output from nroff and troff is unchanged except for the space + between "file" and "...". + + Signed-off-by: Bjarni Ingi Gislason + + src/scripts/xzgrep.1 | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 133d498db0f4b14f066d192d64dbcade45deae6b +Author: Bjarni Ingi Gislason +Date: 2020-03-30 21:56:36 +0000 + + xzgrep.1: Delete superfluous '.PP' + + Summary: + + mandoc -T lint xzgrep.1 : + mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty + + There is no change in the output of "nroff" and "troff". + + Signed-off-by: Bjarni Ingi Gislason + + src/scripts/xzgrep.1 | 1 - + 1 file changed, 1 deletion(-) + +commit 057839ca982f886387b66746bffe749cb14fd8cd +Author: Bjarni Ingi Gislason +Date: 2020-03-26 21:16:18 +0000 + + src/xz/xz.1: Correct misused two-fonts macros + + Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z + + [ "test-groff" is a developmental version of "groff" ] + + Input file is ./src/xz/xz.1 + + :408 (macro BR): only 1 argument, but more are expected + :1009 (macro BR): only 1 argument, but more are expected + :1743 (macro BR): only 1 argument, but more are expected + :1920 (macro BR): only 1 argument, but more are expected + :2213 (macro BR): only 1 argument, but more are expected + + Output from nroff and troff is unchanged, except for a font change of a + full stop (.). + + Signed-off-by: Bjarni Ingi Gislason + + src/xz/xz.1 | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit b8e12f5ab4c9fd3cb09a4330b2861f6b979ababd +Author: Lasse Collin +Date: 2020-03-23 18:07:50 +0200 + + Typo fixes from fossies.org. + + https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html + + Makefile.am | 2 +- + doc/examples/01_compress_easy.c | 2 +- + src/liblzma/api/lzma/base.h | 2 +- + src/liblzma/check/crc32_x86.S | 2 +- + src/liblzma/common/index.c | 2 +- + src/xz/xz.1 | 4 ++-- + 6 files changed, 7 insertions(+), 7 deletions(-) + +commit 869b9d1b4edd6df07f819d360d306251f8147353 +Author: Lasse Collin +Date: 2020-03-17 16:24:28 +0200 + + Update NEWS for 5.2.5. + + NEWS | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 105 insertions(+) + +commit a048e3a92d238c65f050a765174d9c75417231d4 +Author: Lasse Collin +Date: 2020-03-16 20:01:37 +0200 + + README: Update outdated sections. + + README | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +commit 29aed815ad4f98f3e4d355faa76a244ecd8ce716 +Author: Lasse Collin +Date: 2020-03-16 19:39:45 +0200 + + README: Mention that man pages can be translated. + + README | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 7fa7653940cc9dcfcbce2fbc5166ea343ad4e3c1 +Author: Lasse Collin +Date: 2020-03-16 16:43:29 +0200 + + Update INSTALL.generic from Automake 1.16.1. + + INSTALL.generic | 321 ++++++++++++++++++++++++++++---------------------------- + 1 file changed, 162 insertions(+), 159 deletions(-) + +commit 9bd317ef03ab9b3e6a927c27c2e9c4ac041182f0 +Author: Lasse Collin +Date: 2020-03-15 15:27:22 +0200 + + Update INSTALL for Windows and DOS and add preliminary info for z/OS. + + INSTALL | 51 +++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 41 insertions(+), 10 deletions(-) + +commit a3148c0446dc7fa96363752df414d22539c9007b +Author: Lasse Collin +Date: 2020-03-15 15:26:20 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive (again). + + m4/ax_pthread.m4 | 219 +++++++++++++++++++++++++++++-------------------------- + 1 file changed, 117 insertions(+), 102 deletions(-) + +commit 7812002dd3ed319e42a14662a8531802cca8ca67 +Author: Lasse Collin +Date: 2020-03-11 21:15:35 +0200 + + xz: Never use thousand separators in DJGPP builds. + + DJGPP 2.05 added support for thousands separators but it's + broken at least under WinXP with Finnish locale that uses + a non-breaking space as the thousands separator. Workaround + by disabling thousands separators for DJGPP builds. + + src/xz/util.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +commit 7c8f688bf7fccd65d396e0130cbf4ea5dff5c56f +Author: Lasse Collin +Date: 2020-03-11 19:38:08 +0200 + + DOS: Update dos/Makefile for DJGPP 2.05. + + It doesn't need -fgnu89-inline like 2.04beta did. + + dos/Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 319ca928d73de87940c54e30bffe69f9fa65efdf +Author: Lasse Collin +Date: 2020-03-11 19:36:07 +0200 + + DOS: Update instructions in dos/INSTALL.txt. + + dos/INSTALL.txt | 59 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 29 insertions(+), 30 deletions(-) + +commit cb6b227ce39932824812ccd8a0647bd968de27d2 +Author: Lasse Collin +Date: 2020-03-11 17:58:51 +0200 + + DOS: Update config.h. + + The added defines assume GCC >= 4.8. + + dos/config.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit 4572d53e16e87eee375bc5624de2fd59bb0ae9cd +Author: Lasse Collin +Date: 2020-03-02 13:54:33 +0200 + + liblzma: Fix a comment and RC_SYMBOLS_MAX. + + The comment didn't match the value of RC_SYMBOLS_MAX and the value + itself was slightly larger than actually needed. The only harm + about this was that memory usage was a few bytes larger. + + src/liblzma/rangecoder/range_encoder.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 265daa873c0d871f5f23f9b56e133a6f20045a0a +Author: Lasse Collin +Date: 2020-02-27 20:58:52 +0200 + + Build: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails. + + CMakeLists.txt | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 7c8b904527cdbe61248c80edcc2e20d840c4fef9 +Author: Lasse Collin +Date: 2020-02-27 20:24:27 +0200 + + Build: Add support for --no-po4a option to autogen.sh. + + Normally, if po4a isn't available, autogen.sh will return + with non-zero exit status. The option --no-po4a can be useful + when one knows that po4a isn't available but wants autogen.sh + to still return with zero exit status. + + autogen.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +commit 292a5c0f9c9b3a66f5a5c652dc46381836d4537f +Author: Lasse Collin +Date: 2020-02-25 21:35:14 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 474320e9908786ba2021035f9013191e16cde08a +Author: Lasse Collin +Date: 2020-02-25 20:42:31 +0200 + + Build: Fix bugs in the CMake files. + + Seems that the phrase "add more quotes" from sh/bash scripting + applies to CMake as well. E.g. passing an unquoted list ${FOO} + to a function that expects one argument results in only the + first element of the list being passed as an argument and + the rest get ignored. Adding quotes helps ("${FOO}"). + + list(INSERT ...) is weird. Inserting an empty string to an empty + variable results in empty list, but inserting it to a non-empty + variable does insert an empty element to the list. + + Since INSERT requires at least one element, + "${CMAKE_THREAD_LIBS_INIT}" needs to be quoted in CMakeLists.txt. + It might result in an empty element in the list. It seems to not + matter as empty elements consistently get ignored in that variable. + In fact, calling cmake_check_push_state() and cmake_check_pop_state() + will strip the empty elements from CMAKE_REQUIRED_LIBRARIES! + + In addition to quoting fixes, this fixes checks for the cache + variables in tuklib_cpucores.cmake and tuklib_physmem.cmake. + + Thanks to Martin Matuška for testing and reporting the problems. + These fixes aren't tested yet but hopefully they soon will be. + + CMakeLists.txt | 52 ++++++++++++++++++++++----------------------- + cmake/tuklib_common.cmake | 8 ++++--- + cmake/tuklib_cpucores.cmake | 30 ++++++++++++++------------ + cmake/tuklib_integer.cmake | 34 +++++++++++++++-------------- + cmake/tuklib_mbstr.cmake | 6 +++--- + cmake/tuklib_physmem.cmake | 29 +++++++++++++------------ + cmake/tuklib_progname.cmake | 4 ++-- + 7 files changed, 85 insertions(+), 78 deletions(-) + +commit 7e3493d40eac0c3fa3d5124097745a70e15c41f6 +Author: Lasse Collin +Date: 2020-02-24 23:38:16 +0200 + + Build: Add very limited experimental CMake support. + + This does *NOT* replace the Autotools-based build system in + the foreseeable future. See the comment in the beginning + of CMakeLists.txt. + + So far this has been tested only on GNU/Linux but I commit + it anyway to make it easier for others to test. Since I + haven't played much with CMake before, it's likely that + there are things that have been done in a silly or wrong + way and need to be fixed. + + CMakeLists.txt | 643 ++++++++++++++++++++++++++++++++++++++++++++ + cmake/tuklib_common.cmake | 47 ++++ + cmake/tuklib_cpucores.cmake | 173 ++++++++++++ + cmake/tuklib_integer.cmake | 100 +++++++ + cmake/tuklib_mbstr.cmake | 20 ++ + cmake/tuklib_physmem.cmake | 149 ++++++++++ + cmake/tuklib_progname.cmake | 19 ++ + 7 files changed, 1151 insertions(+) + +commit 21bd4701fca3e9002ce78bc135debca369ed8545 +Author: Lasse Collin +Date: 2020-02-24 23:37:07 +0200 + + Update m4/.gitignore. + + m4/.gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit e094d1d0f196a91ec703e8d0055948feef349ae8 +Author: Lasse Collin +Date: 2020-02-24 23:29:35 +0200 + + tuklib: Omit an unneeded from a tests. + + tuklib_cpucores.c and tuklib_physmem.c don't include + even via other files in this package, so clearly that header isn't + needed in the tests either (no one has reported build problems due + to a missing header in a .c file). + + m4/tuklib_cpucores.m4 | 1 - + m4/tuklib_physmem.m4 | 1 - + 2 files changed, 2 deletions(-) + +commit b3ed19a55fe99a45bd77614e149d39d18498075c +Author: Lasse Collin +Date: 2020-02-24 23:01:00 +0200 + + liblzma: Remove unneeded from fastpos_tablegen.c. + + This file only generates fastpos_table.c. + It isn't built as a part of liblzma. + + src/liblzma/lzma/fastpos_tablegen.c | 1 - + 1 file changed, 1 deletion(-) + +commit 7b8982b29179b3c586e0456dc9ecbd4f58dcea59 +Author: Lasse Collin +Date: 2020-02-22 14:15:07 +0200 + + Use defined(__GNUC__) before __GNUC__ in preprocessor lines. + + This should silence the equivalent of -Wundef in compilers that + don't define __GNUC__. + + src/common/sysdefs.h | 3 ++- + src/liblzma/api/lzma.h | 5 +++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +commit 43dfe04e6209c691cf4fbe3072d4ee91271748f1 +Author: Lasse Collin +Date: 2020-02-21 17:40:02 +0200 + + liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA. + + This gives a tiny encoder speed improvement. This could have been done + in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but + it was forgotten. + + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 59e6eb4840b9f52fa3a61544974017279b448216 +Author: Lasse Collin +Date: 2020-02-21 17:01:15 +0200 + + Build: Add visibility.m4 from gnulib. + + Appears that this file used to get included as a side effect of + gettext. After the change to gettext version requirements this file + no longer got copied to the package and so the build was broken. + + m4/.gitignore | 1 - + m4/visibility.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 77 insertions(+), 1 deletion(-) + +commit 7fe3ef2eaa53d439cec043727ea1998f4ff0e22a +Author: Lasse Collin +Date: 2020-02-21 16:10:44 +0200 + + xz: Silence a warning when sig_atomic_t is long int. + + It can be true at least on z/OS. + + src/xz/signals.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit b0a2a77d10940c42b449d47a005bfc2e50ab5db8 +Author: Lasse Collin +Date: 2020-02-21 15:59:26 +0200 + + xz: Avoid unneeded access of a volatile variable. + + src/xz/signals.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 524c2f12c762032b819757aeda8af7c47c4cabce +Author: Lasse Collin +Date: 2020-02-21 01:24:18 +0200 + + tuklib_integer.m4: Optimize the check order. + + The __builtin byteswapping is the preferred one so check for it first. + + m4/tuklib_integer.m4 | 56 +++++++++++++++++++++++++++------------------------- + 1 file changed, 29 insertions(+), 27 deletions(-) + +commit 57360bb4fd79b358b36d2877db26ac828d1fdfcb +Author: Lasse Collin +Date: 2020-02-20 18:54:04 +0200 + + tuklib_exit: Add missing header. + + strerror() needs which happened to be included via + tuklib_common.h -> tuklib_config.h -> sysdefs.h if HAVE_CONFIG_H + was defined. This wasn't tested without config.h before so it + had worked fine. + + src/common/tuklib_exit.c | 1 + + 1 file changed, 1 insertion(+) + +commit fddd31175e74a538997a939d930462fde17d2dd4 +Author: Lasse Collin +Date: 2020-02-18 19:12:35 +0200 + + Revert the previous commit and add a comment. + + The previous commit broke crc32_tablegen.c. + + If the whole package is built without config.h (with defines + set on the compiler command line) this should still work fine + as long as these headers conform to C99 well enough. + + src/common/tuklib_config.h | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +commit 4e4e9fbb7e66d45319525ac224bff48fbdd0cf6e +Author: Lasse Collin +Date: 2020-02-17 23:37:20 +0200 + + Do not check for HAVE_CONFIG_H in tuklib_config.h. + + In XZ Utils sysdefs.h takes care of it and the required headers. + + src/common/tuklib_config.h | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +commit 2d4cef954feba82073951358466a1d614141cf33 +Author: Lasse Collin +Date: 2020-02-16 11:18:28 +0200 + + sysdefs.h: Omit the conditionals around string.h and limits.h. + + string.h is used unconditionally elsewhere in the project and + configure has always stopped if limits.h is missing, so these + headers must have been always available even on the weirdest + systems. + + src/common/sysdefs.h | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +commit feb9c1969bc3eb33d4ecb72cfa897f92dae84939 +Author: Lasse Collin +Date: 2020-02-15 15:07:11 +0200 + + Build: Bump Autoconf and Libtool version requirements. + + There is no specific reason for this other than blocking + the most ancient versions. These are still old: + + Autoconf 2.69 (2012) + Automake 1.12 (2012) + gettext 0.19.6 (2015) + Libtool 2.4 (2010) + + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 3d576cf92158d62790017ad7f2dd6dc1dd6b42bb +Author: Lasse Collin +Date: 2020-02-15 03:08:32 +0200 + + Build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6. + + This bumps the version requirement from 0.19 (from 2014) to + 0.19.6 (2015). + + Using only the old AM_GNU_GETTEXT_VERSION results in old + gettext infrastructure being placed in the package. By using + both macros we get the latest gettext files while the other + programs in the Autotools family can still see the old macro. + + configure.ac | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit fa792b8befaf7cb3960b655e0a9410da866d756f +Author: Lasse Collin +Date: 2020-02-14 20:42:06 +0200 + + Translations: Add German translation of the man pages. + + Thanks to Mario Blättermann. + + po4a/de.po | 5532 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + po4a/po4a.conf | 2 +- + 2 files changed, 5533 insertions(+), 1 deletion(-) + +commit 6f7211b6bb47a895b47f533282dba9ee9a1b0c8b +Author: Lasse Collin +Date: 2020-02-07 15:32:21 +0200 + + Build: Add support for translated man pages using po4a. + + The dependency on po4a is optional. It's never required to install + the translated man pages when xz is built from a release tarball. + If po4a is missing when building from xz.git, the translated man + pages won't be generated but otherwise the build will work normally. + + The translations are only updated automatically by autogen.sh and + by "make mydist". This makes it easy to keep po4a as an optional + dependency and ensures that I won't forget to put updated + translations to a release tarball. + + The translated man pages aren't installed if --disable-nls is used. + + The installation of translated man pages abuses Automake internals + by calling "install-man" with redefined dist_man_MANS and man_MANS. + This makes the hairy script code slightly less hairy. If it breaks + some day, this code needs to be fixed; don't blame Automake developers. + + Also, this adds more quotes to the existing shell script code in + the Makefile.am "-hook"s. + + Makefile.am | 4 ++++ + autogen.sh | 8 ++++--- + po4a/.gitignore | 2 ++ + po4a/po4a.conf | 14 +++++++++++ + po4a/update-po | 45 ++++++++++++++++++++++++++++++++++ + src/scripts/Makefile.am | 64 +++++++++++++++++++++++++++++++++++++------------ + src/xz/Makefile.am | 50 +++++++++++++++++++++++++++----------- + src/xzdec/Makefile.am | 55 ++++++++++++++++++++++++++++++++---------- + 8 files changed, 197 insertions(+), 45 deletions(-) + +commit 426f9e5819ff7710a5ff573a96c02940be65d52f +Author: Lasse Collin +Date: 2020-02-06 17:31:38 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit e3a4481d020e4de89efa037f335cf50f3ca55592 +Author: Lasse Collin +Date: 2020-02-05 22:35:06 +0200 + + Update tests/.gitignore. + + .gitignore | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 07208de92f2d5bca764f6d0ebe9d9866051dc4ef +Author: Lasse Collin +Date: 2020-02-05 22:28:51 +0200 + + Update m4/.gitignore. + + m4/.gitignore | 1 + + 1 file changed, 1 insertion(+) + +commit c91fbf223db46c3b3cb9df769863a1a60cd9c908 +Author: Lasse Collin +Date: 2020-02-05 20:47:38 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 15a133b6d1a3eab4faf6eb52a71fdc56bd65846f +Author: Lasse Collin +Date: 2020-02-05 20:40:14 +0200 + + xz: Make it a fatal error if enabling the sandbox fails. + + Perhaps it's too drastic but on the other hand it will let me + learn about possible problems if people report the errors. + This won't be backported to the v5.2 branch. + + src/xz/file_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit af0fb386ef55db66654ae39e2deec6e04190c4ff +Author: Lasse Collin +Date: 2020-02-05 20:33:50 +0200 + + xz: Comment out annoying sandboxing messages. + + src/xz/file_io.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 986d8c9b52b824474088e5bb3b6940651660f0e2 +Author: Lasse Collin +Date: 2020-02-05 19:33:37 +0200 + + Build: Workaround a POSIX shell detection problem on Solaris. + + I don't know if the problem is in gnulib's gl_POSIX_SHELL macro + or if xzgrep does something that isn't in POSIX. The workaround + adds a special case for Solaris: if /usr/xpg4/bin/sh exists and + gl_cv_posix_shell wasn't overriden on the configure command line, + use that shell for xzgrep and other scripts. That shell is known + to work and exists on most Solaris systems. + + configure.ac | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad +Author: Lasse Collin +Date: 2020-02-03 22:03:50 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 398 ++++++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 279 insertions(+), 119 deletions(-) + +commit 353970510895f6a80adfe60cf71b70a95adfa8bc +Author: Lasse Collin +Date: 2020-02-01 19:56:18 +0200 + + xz: Limit --memlimit-compress to at most 4020 MiB for 32-bit xz. + + See the code comment for reasoning. It's far from perfect but + hopefully good enough for certain cases while hopefully doing + nothing bad in other situations. + + At presets -5 ... -9, 4020 MiB vs. 4096 MiB makes no difference + on how xz scales down the number of threads. + + The limit has to be a few MiB below 4096 MiB because otherwise + things like "xz --lzma2=dict=500MiB" won't scale down the dict + size enough and xz cannot allocate enough memory. With + "ulimit -v $((4096 * 1024))" on x86-64, the limit in xz had + to be no more than 4085 MiB. Some safety margin is good though. + + This is hack but it should be useful when running 32-bit xz on + a 64-bit kernel that gives full 4 GiB address space to xz. + Hopefully this is enough to solve this: + + https://bugzilla.redhat.com/show_bug.cgi?id=1196786 + + FreeBSD has a patch that limits the result in tuklib_physmem() + to SIZE_MAX on 32-bit systems. While I think it's not the way + to do it, the results on --memlimit-compress have been good. This + commit should achieve practically identical results for compression + while leaving decompression and tuklib_physmem() and thus + lzma_physmem() unaffected. + + src/xz/hardware.c | 32 +++++++++++++++++++++++++++++++- + src/xz/xz.1 | 21 ++++++++++++++++++++- + 2 files changed, 51 insertions(+), 2 deletions(-) + +commit ba76d67585f88677af9f48b48e7bdc3bb7687def +Author: Lasse Collin +Date: 2020-01-26 20:53:25 +0200 + + xz: Set the --flush-timeout deadline when the first input byte arrives. + + xz --flush-timeout=2000, old version: + + 1. xz is started. The next flush will happen after two seconds. + 2. No input for one second. + 3. A burst of a few kilobytes of input. + 4. No input for one second. + 5. Two seconds have passed and flushing starts. + + The first second counted towards the flush-timeout even though + there was no pending data. This can cause flushing to occur more + often than needed. + + xz --flush-timeout=2000, after this commit: + + 1. xz is started. + 2. No input for one second. + 3. A burst of a few kilobytes of input. The next flush will + happen after two seconds counted from the time when the + first bytes of the burst were read. + 4. No input for one second. + 5. No input for another second. + 6. Two seconds have passed and flushing starts. + + src/xz/coder.c | 6 +----- + src/xz/file_io.c | 6 +++++- + src/xz/mytime.c | 1 - + 3 files changed, 6 insertions(+), 7 deletions(-) + +commit fd47fd62bbb1bfd13ab63869137971d8b390025f +Author: Lasse Collin +Date: 2020-01-26 20:19:19 +0200 + + xz: Move flush_needed from mytime.h to file_pair struct in file_io.h. + + src/xz/coder.c | 3 ++- + src/xz/file_io.c | 3 ++- + src/xz/file_io.h | 3 +++ + src/xz/mytime.c | 3 --- + src/xz/mytime.h | 4 ---- + 5 files changed, 7 insertions(+), 9 deletions(-) + +commit 815035681063d5774d3640fc20b8ede783dd574e +Author: Lasse Collin +Date: 2020-01-26 14:49:22 +0200 + + xz: coder.c: Make writing output a separate function. + + The same code sequence repeats so it's nicer as a separate function. + Note that in one case there was no test for opt_mode != MODE_TEST, + but that was only because that condition would always be true, so + this commit doesn't change the behavior there. + + src/xz/coder.c | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +commit 5a49e081a098455bcdbd95cefb90e9b18780fe58 +Author: Lasse Collin +Date: 2020-01-26 14:13:42 +0200 + + xz: Fix semi-busy-waiting in xz --flush-timeout. + + When input blocked, xz --flush-timeout=1 would wake up every + millisecond and initiate flushing which would have nothing to + flush and thus would just waste CPU time. The fix disables the + timeout when no input has been seen since the previous flush. + + src/xz/coder.c | 4 ++++ + src/xz/file_io.c | 15 +++++++++++---- + src/xz/file_io.h | 4 ++++ + 3 files changed, 19 insertions(+), 4 deletions(-) + +commit dcca70fe9fa3c4bec56cf9c79e966166c9a9cf6a +Author: Lasse Collin +Date: 2020-01-26 13:47:31 +0200 + + xz: Refactor io_read() a bit. + + src/xz/file_io.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +commit 4ae9ab70cd3214395756435d13d8d000368ca2cb +Author: Lasse Collin +Date: 2020-01-26 13:37:08 +0200 + + xz: Update a comment in file_io.h. + + src/xz/file_io.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 3333ba4a6795a55cf0375329ba08152bd7fcbd46 +Author: Lasse Collin +Date: 2020-01-26 13:27:51 +0200 + + xz: Move the setting of flush_needed in file_io.c to a nicer location. + + src/xz/file_io.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit cf2df0f05ac98c1158c6e48145900b773223605d +Author: Lasse Collin +Date: 2020-01-19 21:54:33 +0200 + + Use $(LIB_FUZZING_ENGINE) in tests/ossfuzz/Makefile. + + https://github.com/google/oss-fuzz/pull/3219#issuecomment-573751048 + + Thanks to Bhargava Shastry for sending the patch. + + tests/ossfuzz/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7136f1735c60ac6967c4b8e277fcde53d485234f +Author: Lasse Collin +Date: 2019-12-31 00:41:28 +0200 + + Rename unaligned_read32ne to read32ne, and similarly for the others. + + src/common/tuklib_integer.h | 64 +++++++++++++++---------------- + src/liblzma/common/alone_encoder.c | 2 +- + src/liblzma/common/block_header_decoder.c | 2 +- + src/liblzma/common/block_header_encoder.c | 2 +- + src/liblzma/common/memcmplen.h | 9 ++--- + src/liblzma/common/stream_flags_decoder.c | 6 +-- + src/liblzma/common/stream_flags_encoder.c | 8 ++-- + src/liblzma/lz/lz_encoder_hash.h | 2 +- + src/liblzma/lzma/lzma_decoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder_private.h | 3 +- + src/liblzma/simple/simple_decoder.c | 2 +- + src/liblzma/simple/simple_encoder.c | 2 +- + tests/test_block_header.c | 4 +- + tests/test_stream_flags.c | 6 +-- + 15 files changed, 54 insertions(+), 62 deletions(-) + +commit 5e78fcbf2eb21936022c9c5c3625d4da76f4b241 +Author: Lasse Collin +Date: 2019-12-31 00:29:48 +0200 + + Rename read32ne to aligned_read32ne, and similarly for the others. + + Using the aligned methods requires more care to ensure that + the address really is aligned, so it's nicer if the aligned + methods are prefixed. The next commit will remove the unaligned_ + prefix from the unaligned methods which in liblzma are used in + more places than the aligned ones. + + src/common/tuklib_integer.h | 56 +++++++++++++++++++++--------------------- + src/liblzma/check/crc32_fast.c | 4 +-- + src/liblzma/check/crc64_fast.c | 4 +-- + 3 files changed, 32 insertions(+), 32 deletions(-) + +commit 77bc5bc6dd67056cfd5888520ac930cfc57b4516 +Author: Lasse Collin +Date: 2019-12-31 00:18:24 +0200 + + Revise tuklib_integer.h and .m4. + + Add a configure option --enable-unsafe-type-punning to get the + old non-conforming memory access methods. It can be useful with + old compilers or in some other less typical situations but + shouldn't normally be used. + + Omit the packed struct trick for unaligned access. While it's + best in some cases, this is simpler. If the memcpy trick doesn't + work, one can request unsafe type punning from configure. + + Because CRC32/CRC64 code needs fast aligned reads, if no very + safe way to do it is found, type punning is used as a fallback. + This sucks but since it currently works in practice, it seems to + be the least bad option. It's never needed with GCC >= 4.7 or + Clang >= 3.6 since these support __builtin_assume_aligned and + thus fast aligned access can be done with the memcpy trick. + + Other things: + - Support GCC/Clang __builtin_bswapXX + - Cleaner bswap fallback macros + - Minor cleanups + + m4/tuklib_integer.m4 | 46 ++++- + src/common/tuklib_integer.h | 488 ++++++++++++++++++++++++-------------------- + 2 files changed, 316 insertions(+), 218 deletions(-) + +commit 8b72950a6b2e2a36c2d8fdc8857564b57191b088 +Author: Lasse Collin +Date: 2019-12-29 22:51:58 +0200 + + Tests: Hopefully fix test_check.c to work on EBCDIC systems. + + Thanks to Daniel Richard G. + + tests/test_check.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 43ce4ea7c762238d3df9717b34126d3e0d7cd51c +Author: Lasse Collin +Date: 2019-09-24 23:02:40 +0300 + + Scripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris. + + This adds a configure option --enable-path-for-scripts=PREFIX + which defaults to empty except on Solaris it is /usr/xpg4/bin + to make POSIX grep and others available. The Solaris case had + been documented in INSTALL with a manual fix but it's better + to do this automatically since it is needed on most Solaris + systems anyway. + + Thanks to Daniel Richard G. + + INSTALL | 43 +++++++++++++++++++++++++++++++++++-------- + configure.ac | 26 ++++++++++++++++++++++++++ + src/scripts/xzdiff.in | 1 + + src/scripts/xzgrep.in | 1 + + src/scripts/xzless.in | 1 + + src/scripts/xzmore.in | 1 + + 6 files changed, 65 insertions(+), 8 deletions(-) + +commit 6a89e656ebedd53a10cd1a063a32a9e4ade0da1f +Author: Lasse Collin +Date: 2019-07-12 18:57:43 +0300 + + Fix comment typos in tuklib_mbstr* files. + + src/common/tuklib_mbstr.h | 2 +- + src/common/tuklib_mbstr_fw.c | 2 +- + src/common/tuklib_mbstr_width.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +commit ac0b4212656a48ef0c187c0c941d40ac9489ae36 +Author: Lasse Collin +Date: 2019-07-12 18:30:46 +0300 + + Add missing include to tuklib_mbstr_width.c. + + It didn't matter in XZ Utils because sysdefs.h + includes string.h anyway. + + src/common/tuklib_mbstr_width.c | 1 + + 1 file changed, 1 insertion(+) + +commit 72a443281fb0b91aebf8cdff2ab1f7c07b081240 +Author: Lasse Collin +Date: 2019-07-12 18:10:57 +0300 + + Update tuklib base headers to include stdbool.h. + + src/common/tuklib_common.h | 2 +- + src/common/tuklib_config.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +commit de1f47b2b40e960b7bc3acba754f66dd19705921 +Author: Lasse Collin +Date: 2019-06-28 00:54:31 +0300 + + xz: Automatically align the strings in --info-memory. + + This makes it easier to translate the strings. + + Also, the string for amount of RAM was shortened. + + src/xz/hardware.c | 45 ++++++++++++++++++++++++++++++++++----------- + 1 file changed, 34 insertions(+), 11 deletions(-) + +commit 8ce679125dbd0e2058d8f886e738d7f19a45cab5 +Author: Lasse Collin +Date: 2019-06-25 23:15:21 +0300 + + liblzma: Fix a buggy comment. + + src/liblzma/lz/lz_encoder_mf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fc77929e92e869f6869bf88931066103fd75f376 +Author: Lasse Collin +Date: 2019-06-25 00:16:06 +0300 + + configure.ac: Fix a typo in a comment. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e873902641794210ad7db59743f98e3e1cd6139f +Author: Lasse Collin +Date: 2019-06-25 00:08:13 +0300 + + Tests: Silence warnings from clang -Wassign-enum. + + Also changed 999 to 99 so it fits even if lzma_check happened + to be 8 bits wide. + + tests/test_block_header.c | 3 ++- + tests/test_stream_flags.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit d499e467d99efeaae688564eedc4548837c1416a +Author: Lasse Collin +Date: 2019-06-24 23:52:17 +0300 + + liblzma: Add a comment. + + src/liblzma/common/stream_encoder_mt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a12b13c5f0d54c684fa8446f93fdac08ab2a716b +Author: Lasse Collin +Date: 2019-06-24 23:45:21 +0300 + + liblzma: Silence clang -Wmissing-variable-declarations. + + src/liblzma/check/crc32_table.c | 3 +++ + src/liblzma/check/crc64_table.c | 3 +++ + 2 files changed, 6 insertions(+) + +commit 1b4675cebf7471f7cc9b7072c950e3de97147063 +Author: Lasse Collin +Date: 2019-06-24 23:25:41 +0300 + + Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT. + + LZMA_TIMED_OUT is *internally* used as a value for lzma_ret + enumeration. Previously it was #defined to 32 and cast to lzma_ret. + That way it wasn't visible in the public API, but this was hackish. + + Now the public API has eight LZMA_RET_INTERNALx members and + LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way + the code is cleaner overall although the public API has a few + extra mysterious enum members. + + src/liblzma/api/lzma/base.h | 15 ++++++++++++++- + src/liblzma/common/common.c | 4 +--- + src/liblzma/common/common.h | 5 ++--- + src/xz/message.c | 8 ++++++++ + 4 files changed, 25 insertions(+), 7 deletions(-) + +commit 159c43875eb25deea626ed651274464bae3e32ef +Author: Lasse Collin +Date: 2019-06-24 22:57:43 +0300 + + xz: Silence a warning from clang -Wsign-conversion in main.c. + + src/xz/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 466cfcd3e52f6750ce28a635997f3dd84fb18515 +Author: Lasse Collin +Date: 2019-06-24 22:52:20 +0300 + + xz: Make "headings" static in list.c. + + Caught by clang -Wmissing-variable-declarations. + + src/xz/list.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 608517b9b76c41fac6613dbda1193d6f41338e19 +Author: Lasse Collin +Date: 2019-06-24 22:47:39 +0300 + + liblzma: Remove incorrect uses of lzma_attribute((__unused__)). + + Caught by clang -Wused-but-marked-unused. + + src/liblzma/common/alone_decoder.c | 3 +-- + src/liblzma/common/alone_encoder.c | 3 +-- + src/liblzma/lz/lz_decoder.c | 3 +-- + 3 files changed, 3 insertions(+), 6 deletions(-) + +commit c2d2ab6a9d41a2b55d047c5b710aacf80d219255 +Author: Lasse Collin +Date: 2019-06-24 20:53:55 +0300 + + Tests: Silence a warning from -Wsign-conversion. + + tests/create_compress_files.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 2402f7873dcae719d0ebddd23bb579074519ac52 +Author: Lasse Collin +Date: 2019-06-24 20:45:49 +0300 + + xz: Fix an integer overflow with 32-bit off_t. + + Or any off_t which isn't very big (like signed 64 bit integer + that most system have). A small off_t could overflow if the + file being decompressed had long enough run of zero bytes, + which would result in corrupt output. + + src/xz/file_io.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +commit 4fd3a8dd0b60f029e1c66a0ee634f9e9fda3caa9 +Author: Lasse Collin +Date: 2019-06-24 01:24:17 +0300 + + xz: Cleanup io_seek_src() a bit. + + lseek() returns -1 on error and checking for -1 is nicer. + + src/xz/file_io.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit dfda7cf6afa486e10df035327d68753896dfb48a +Author: Lasse Collin +Date: 2019-06-24 00:57:23 +0300 + + Tests: Remove a duplicate branch from tests/tests.h. + + The duplication was introduced about eleven years ago and + should have been cleaned up back then already. + + This was caught by -Wduplicated-branches. + + tests/tests.h | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +commit 1d4a904d8fb634bd5a04f7fbdd17d3739f3d8866 +Author: Lasse Collin +Date: 2019-06-24 00:40:45 +0300 + + xz: Change io_seek_src and io_pread arguments from off_t to uint64_t. + + This helps fixing warnings from -Wsign-conversion and makes the + code look better too. + + src/xz/file_io.c | 16 ++++++++++++---- + src/xz/file_io.h | 4 ++-- + src/xz/list.c | 9 ++++----- + 3 files changed, 18 insertions(+), 11 deletions(-) + +commit 50120deb0159fcb53ee1a6caffb2bb81a1ecd990 +Author: Lasse Collin +Date: 2019-06-24 00:12:38 +0300 + + xz: list.c: Fix some warnings from -Wsign-conversion. + + src/xz/list.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit d0a78751eb54fb1572002746c533936a118e4e42 +Author: Lasse Collin +Date: 2019-06-23 23:22:45 +0300 + + tuklib_mbstr_width: Fix a warning from -Wsign-conversion. + + src/common/tuklib_mbstr_width.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7883d73530b4b2a701ddd7d50c35676cbc158039 +Author: Lasse Collin +Date: 2019-06-23 23:19:34 +0300 + + xz: Fix some of the warnings from -Wsign-conversion. + + src/xz/args.c | 4 ++-- + src/xz/coder.c | 4 ++-- + src/xz/file_io.c | 5 +++-- + src/xz/message.c | 4 ++-- + src/xz/mytime.c | 4 ++-- + src/xz/options.c | 2 +- + src/xz/util.c | 4 ++-- + 7 files changed, 14 insertions(+), 13 deletions(-) + +commit c2b994fe3d35e9e575c28869a2f7f534f2495d05 +Author: Lasse Collin +Date: 2019-06-23 22:27:45 +0300 + + tuklib_cpucores: Silence warnings from -Wsign-conversion. + + src/common/tuklib_cpucores.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 07c4fa9e1a195e0543f271380c8de22a3ab145ff +Author: Lasse Collin +Date: 2019-06-23 21:40:47 +0300 + + xzdec: Fix warnings from -Wsign-conversion. + + src/xzdec/xzdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf +Author: Lasse Collin +Date: 2019-06-23 21:38:56 +0300 + + liblzma: Fix warnings from -Wsign-conversion. + + Also, more parentheses were added to the literal_subcoder + macro in lzma_comon.h (better style but no functional change + in the current usage). + + src/liblzma/common/block_header_decoder.c | 2 +- + src/liblzma/delta/delta_decoder.c | 2 +- + src/liblzma/lzma/fastpos.h | 2 +- + src/liblzma/lzma/lzma2_decoder.c | 8 ++++---- + src/liblzma/lzma/lzma_common.h | 3 ++- + src/liblzma/lzma/lzma_decoder.c | 16 ++++++++-------- + src/liblzma/simple/arm.c | 6 +++--- + src/liblzma/simple/armthumb.c | 8 ++++---- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 9 +++++---- + src/liblzma/simple/x86.c | 2 +- + 11 files changed, 31 insertions(+), 29 deletions(-) + +commit 41838dcc26375f6aa393a63e4d81e2f4d223de07 +Author: Lasse Collin +Date: 2019-06-23 19:33:55 +0300 + + tuklib_integer: Silence warnings from -Wsign-conversion. + + src/common/tuklib_integer.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 3ce05d235f736d392347a05086b8033416874b87 +Author: Lasse Collin +Date: 2019-06-20 19:40:30 +0300 + + tuklib_integer: Fix usage of conv macros. + + Use a temporary variable instead of e.g. + conv32le(unaligned_read32ne(buf)) because the macro can + evaluate its argument multiple times. + + src/common/tuklib_integer.h | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit b525b0c0ef40cd89b69294c9b8d57f4a8db58e1f +Author: Lasse Collin +Date: 2019-06-03 20:44:19 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 039a168e8cf201d5104a25ec41f0cf25eda6cc53 +Author: Lasse Collin +Date: 2019-06-03 20:41:54 +0300 + + liblzma: Fix comments. + + Thanks to Bruce Stark. + + src/liblzma/common/alone_encoder.c | 4 ++-- + src/liblzma/common/block_util.c | 2 +- + src/liblzma/common/common.c | 2 +- + src/liblzma/common/filter_common.h | 2 +- + src/liblzma/common/filter_decoder.h | 2 +- + src/liblzma/common/filter_flags_encoder.c | 2 +- + 6 files changed, 7 insertions(+), 7 deletions(-) + +commit c460f6defebc5a81bbca90adc2476154ca244f69 +Author: Lasse Collin +Date: 2019-06-02 00:50:59 +0300 + + liblzma: Fix one more unaligned read to use unaligned_read16ne(). + + src/liblzma/lz/lz_encoder_hash.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c81d77c537f0b8c8672868e1dc6cf7290ce4a25b +Author: Lasse Collin +Date: 2019-06-01 21:41:55 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 386394fc9fcde2615391f804eaa466749f96f4ef +Author: Lasse Collin +Date: 2019-06-01 21:36:13 +0300 + + liblzma: memcmplen: Use ctz32() from tuklib_integer.h. + + The same compiler-specific #ifdefs are already in tuklib_integer.h + + src/liblzma/common/memcmplen.h | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +commit 264ab971ce2994baac41b1579c9c35aba7743fc8 +Author: Lasse Collin +Date: 2019-06-01 21:30:03 +0300 + + tuklib_integer: Cleanup MSVC-specific code. + + src/common/tuklib_integer.h | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +commit 33773c6f2a8711d4aa6656795db52c59a28580ec +Author: Lasse Collin +Date: 2019-06-01 19:01:21 +0300 + + liblzma: Use unaligned_readXXne functions instead of type punning. + + Now gcc -fsanitize=undefined should be clean. + + Thanks to Jeffrey Walton. + + src/liblzma/common/memcmplen.h | 12 ++++++------ + src/liblzma/lzma/lzma_encoder_private.h | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +commit e5f13a66567b1987e0aae42c6fdcd277bb5810ba +Author: Lasse Collin +Date: 2019-06-01 18:46:54 +0300 + + tuklib_integer: Autodetect support for unaligned access on ARM. + + The result is used as the default for --enable-unaligned-access. + The test should work with GCC and Clang. + + m4/tuklib_integer.m4 | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 3bc112c2d38d5f348bce7bc2422286b1692c7490 +Author: Lasse Collin +Date: 2019-06-01 18:41:16 +0300 + + tuklib_integer: Improve unaligned memory access. + + Now memcpy() or GNU C packed structs for unaligned access instead + of type punning. See the comment in this commit for details. + + Avoiding type punning with unaligned access is needed to + silence gcc -fsanitize=undefined. + + New functions: unaliged_readXXne and unaligned_writeXXne where + XX is 16, 32, or 64. + + src/common/tuklib_integer.h | 180 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 168 insertions(+), 12 deletions(-) + +commit 2a22de439ec63da1927b640eda309296a1e8dce5 +Author: Lasse Collin +Date: 2019-05-13 20:05:17 +0300 + + liblzma: Avoid memcpy(NULL, foo, 0) because it is undefined behavior. + + I should have always known this but I didn't. Here is an example + as a reminder to myself: + + int mycopy(void *dest, void *src, size_t n) + { + memcpy(dest, src, n); + return dest == NULL; + } + + In the example, a compiler may assume that dest != NULL because + passing NULL to memcpy() would be undefined behavior. Testing + with GCC 8.2.1, mycopy(NULL, NULL, 0) returns 1 with -O0 and -O1. + With -O2 the return value is 0 because the compiler infers that + dest cannot be NULL because it was already used with memcpy() + and thus the test for NULL gets optimized out. + + In liblzma, if a null-pointer was passed to memcpy(), there were + no checks for NULL *after* the memcpy() call, so I cautiously + suspect that it shouldn't have caused bad behavior in practice, + but it's hard to be sure, and the problematic cases had to be + fixed anyway. + + Thanks to Jeffrey Walton. + + src/liblzma/common/common.c | 6 +++++- + src/liblzma/lz/lz_decoder.c | 12 +++++++++--- + src/liblzma/simple/simple_coder.c | 10 +++++++++- + 3 files changed, 23 insertions(+), 5 deletions(-) + +commit d3fc850cfedc058247d9e334ce59bbc8f2286d8a +Author: Lasse Collin +Date: 2019-05-11 20:56:08 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4adb8288ab61d5f14e212007b8742df0710baf73 +Author: Lasse Collin +Date: 2019-05-11 20:54:12 +0300 + + xz: Update xz man page date. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2fb0ddaa557ce86e38fe06439930fa8665f092fd +Author: Antoine Cœur +Date: 2019-05-08 13:30:57 +0800 + + spelling + + Doxyfile.in | 2 +- + NEWS | 2 +- + doc/examples/11_file_info.c | 2 +- + src/liblzma/api/lzma/block.h | 2 +- + src/liblzma/api/lzma/hardware.h | 2 +- + src/liblzma/api/lzma/lzma12.h | 2 +- + src/liblzma/api/lzma/vli.h | 2 +- + src/liblzma/common/file_info.c | 4 ++-- + src/liblzma/common/hardware_physmem.c | 2 +- + src/liblzma/common/index.c | 4 ++-- + src/liblzma/common/stream_encoder_mt.c | 2 +- + src/liblzma/common/vli_decoder.c | 2 +- + src/liblzma/lz/lz_decoder.c | 2 +- + src/scripts/xzgrep.in | 2 +- + src/xz/args.c | 2 +- + src/xz/coder.c | 4 ++-- + src/xz/list.c | 4 ++-- + src/xz/main.c | 2 +- + src/xz/mytime.h | 2 +- + src/xz/private.h | 2 +- + src/xz/xz.1 | 2 +- + windows/build.bash | 2 +- + 22 files changed, 26 insertions(+), 26 deletions(-) + +commit 4ed339606156bd313ed99237485cb8ed0362d64f +Author: Lasse Collin +Date: 2019-05-01 18:43:10 +0300 + + xz: In xz -lvv look at the widths of the check names too. + + Now the widths of the check names is used to adjust the width + of the Check column. This way there no longer is a need to restrict + the widths of the check names to be at most ten terminal-columns. + + src/xz/list.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +commit 2f4281a1001dcf7fdf1418c0c0d246c16561fb65 +Author: Lasse Collin +Date: 2019-05-01 18:33:25 +0300 + + xz: Fix xz -lvv column alignment to look at the translated strings. + + src/xz/list.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 01d01b7c7c0b8eaf7f780a5584ec52c22d10fa4a +Author: Lasse Collin +Date: 2019-05-01 16:52:36 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 64030c6b17f7743df03a9948a0ccfcdf40c6b97c +Author: Lasse Collin +Date: 2019-05-01 16:43:16 +0300 + + Windows: Update VS version in windows/vs2019/config.h. + + windows/vs2019/config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2dc9117f5fbfab31444a3ca1e55795ccfa8a9f51 +Author: Julien Marrec +Date: 2019-04-25 17:44:06 +0200 + + Windows: Upgrade solution itself + + windows/vs2019/xz_win.sln | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit ac31413916fa9b11bab17f0f0aa63e2869360f6f +Author: Julien Marrec +Date: 2019-04-25 17:40:24 +0200 + + Windows: Upgrade solution with VS2019 + + windows/vs2019/liblzma.vcxproj | 15 ++++++++------- + windows/vs2019/liblzma_dll.vcxproj | 15 ++++++++------- + 2 files changed, 16 insertions(+), 14 deletions(-) + +commit be25a0c37ba92a20c390b4d17fe502457fe96b71 +Author: Julien Marrec +Date: 2019-04-25 17:39:32 +0200 + + Windows: Duplicate windows/vs2017 before upgrading + + windows/vs2019/config.h | 148 ++++++++++++++ + windows/vs2019/liblzma.vcxproj | 356 ++++++++++++++++++++++++++++++++++ + windows/vs2019/liblzma_dll.vcxproj | 385 +++++++++++++++++++++++++++++++++++++ + windows/vs2019/xz_win.sln | 48 +++++ + 4 files changed, 937 insertions(+) + +commit d0e58b3a51e8e616f3dc26ec7b7e4aa0fa6991ad +Author: Lasse Collin +Date: 2019-03-04 22:49:04 +0200 + + README: Update translation instructions. + + XZ Utils is now part of the Translation Project + . + + README | 32 +++++++++++++------------------- + 1 file changed, 13 insertions(+), 19 deletions(-) + +commit a750c35a7d45a16c11c1d40fecee8443c32a9996 +Author: Lasse Collin +Date: 2019-03-04 21:20:39 +0200 + + xz: Automatically align column headings in xz -lvv. + + src/xz/list.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 212 insertions(+), 51 deletions(-) + +commit 6cb42e8aa1dc37bf403a9f5acbd07e86036b7e77 +Author: Lasse Collin +Date: 2019-03-04 01:07:59 +0200 + + xz: Automatically align strings ending in a colon in --list output. + + This should avoid alignment errors in translations with these + strings. + + src/xz/list.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 102 insertions(+), 12 deletions(-) + +commit 1e3f29b62f2c03e50fc9ebea7b83c1497dd35484 +Author: Lasse Collin +Date: 2019-01-13 17:29:23 +0200 + + Windows/VS2017: Omit WindowsTargetPlatformVersion from project files. + + I understood that if a WTPV is specified, it's often wrong + because different VS installations have different SDK version + installed. Omitting the WTPV tag makes VS2017 default to + Windows SDK 8.1 which often is also missing, so in any case + people may need to specify the WTPV before building. But some + day in the future a missing WTPV tag will start to default to + the latest installed SDK which sounds reasonable: + + https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html + + Thanks to "dom". + + windows/INSTALL-MSVC.txt | 4 ++++ + windows/vs2017/liblzma.vcxproj | 1 - + windows/vs2017/liblzma_dll.vcxproj | 1 - + 3 files changed, 4 insertions(+), 2 deletions(-) + +commit 4d86076332aece6314063d3712a5f364172bbb0f +Author: Lasse Collin +Date: 2018-12-20 20:42:29 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit b55d79461d1f6aeaac03c7dae84481e5eb8bea4c +Author: Lasse Collin +Date: 2018-12-14 20:34:30 +0200 + + xz: Fix a crash in progress indicator when in passthru mode. + + "xz -dcfv not_an_xz_file" crashed (all four options are + required to trigger it). It caused xz to call + lzma_get_progress(&strm, ...) when no coder was initialized + in strm. In this situation strm.internal is NULL which leads + to a crash in lzma_get_progress(). + + The bug was introduced when xz started using lzma_get_progress() + to get progress info for multi-threaded compression, so the + bug is present in versions 5.1.3alpha and higher. + + Thanks to Filip Palian for + the bug report. + + src/xz/coder.c | 11 +++++++---- + src/xz/message.c | 18 ++++++++++++++++-- + src/xz/message.h | 3 ++- + 3 files changed, 25 insertions(+), 7 deletions(-) + +commit 4ae5526de013efd1021686fa80bdd10cf1cb9c56 +Author: Lasse Collin +Date: 2018-11-22 17:20:31 +0200 + + xz: Update man page timestamp. + + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 6a36d0d5f49e0080ff64dd9ef250abd489bea2ad +Author: Pavel Raiskup +Date: 2018-11-22 15:14:34 +0100 + + 'have have' typos + + src/xz/signals.c | 2 +- + src/xz/xz.1 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 9eca51ef805ed8002a851df1b4995d71826c8b6e +Author: Lasse Collin +Date: 2018-11-02 20:40:48 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 106d1a663d4ba42b63231caa289f531548df81c1 +Author: Lasse Collin +Date: 2018-11-02 20:18:45 +0200 + + Tests: Add a fuzz test program and a config file for OSS-Fuzz. + + Thanks to Bhargava Shastry and Github user pdknsk. + + tests/Makefile.am | 1 + + tests/ossfuzz/Makefile | 7 ++++ + tests/ossfuzz/config/fuzz.dict | 2 + + tests/ossfuzz/config/fuzz.options | 2 + + tests/ossfuzz/fuzz.c | 82 +++++++++++++++++++++++++++++++++++++++ + 5 files changed, 94 insertions(+) + +commit a18ae42a79a19b1394b41eb3e238139fd28012ec +Author: Lasse Collin +Date: 2018-10-26 22:49:10 +0300 + + liblzma: Don't verify header CRC32s if building for fuzz testing. + + FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is #defined when liblzma + is being built for fuzz testing. + + Most fuzzed inputs would normally get rejected because of incorrect + CRC32 and the actual header decoding code wouldn't get fuzzed. + Disabling CRC32 checks avoids this problem. The fuzzer program + must still use LZMA_IGNORE_CHECK flag to disable verification of + integrity checks of uncompressed data. + + src/liblzma/common/block_header_decoder.c | 5 ++++- + src/liblzma/common/index_decoder.c | 5 ++++- + src/liblzma/common/index_hash.c | 5 ++++- + src/liblzma/common/stream_flags_decoder.c | 10 ++++++++-- + 4 files changed, 20 insertions(+), 5 deletions(-) + +commit f76f7516d6a1c832f61810c82e92d151cc80966c +Author: Lasse Collin +Date: 2018-07-27 18:10:44 +0300 + + xzless: Rename unused variables to silence static analysers. + + In this particular case I don't see this affecting readability + of the code. + + Thanks to Pavel Raiskup. + + src/scripts/xzless.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3cbcaeb07eb7543735befd6f507fdb5fa4363cff +Author: Lasse Collin +Date: 2018-07-27 16:02:58 +0300 + + liblzma: Remove an always-true condition from lzma_index_cat(). + + This should help static analysis tools to see that newg + isn't leaked. + + Thanks to Pavel Raiskup. + + src/liblzma/common/index.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 76762ae6098ec55c326f4b4b4a42e8c1918ee81f +Author: Lasse Collin +Date: 2018-05-19 21:23:25 +0300 + + liblzma: Improve lzma_properties_decode() API documentation. + + src/liblzma/api/lzma/filter.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +commit 2267f5b0d20a5d24e93fcd9f72ea7eeb0d89708c +Author: Lasse Collin +Date: 2018-04-29 18:58:19 +0300 + + Bump the version number to 5.3.1alpha. + + src/liblzma/api/lzma/version.h | 2 +- + src/liblzma/liblzma.map | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit cee3021d30704858e4bdd22240e7d28e570d7451 +Author: Lasse Collin +Date: 2018-04-29 18:48:00 +0300 + + extra/scanlzma: Fix compiler warnings. + + extra/scanlzma/scanlzma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit c5c7ceb08a011b97d261798033e2c39613a69eb7 +Author: Lasse Collin +Date: 2018-04-29 18:44:47 +0300 + + DOS: Add file_info.c to the list of files to build. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit 114cab97af766b21e0fc8620479202fb1e7a5e41 +Author: Lasse Collin +Date: 2018-04-29 18:33:10 +0300 + + Update NEWS for 5.3.1alpha. + + NEWS | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit b8139e11c512bbf32bf58ab0689f9bb6c52819da +Author: Lasse Collin +Date: 2018-04-29 18:15:37 +0300 + + Add NEWS for 5.2.4. + + NEWS | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 47b59d47cfd904a420fbd45629d168ca1973721d +Author: Lasse Collin +Date: 2018-02-06 19:36:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit bc197991690ede24ab143665b5b0f0f9cb35cc46 +Author: Ben Boeckel +Date: 2018-01-29 13:58:18 -0500 + + nothrow: use noexcept for C++11 and newer + + In C++11, the `throw()` specifier is deprecated and `noexcept` is + preffered instead. + + src/liblzma/api/lzma.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit fb6d4f83cb6e144734f2a4216bb117bd56dc3cb5 +Author: Lasse Collin +Date: 2018-02-06 18:02:48 +0200 + + liblzma: Remove incorrect #ifdef from range_common.h. + + In most cases it was harmless but it could affect some + custom build systems. + + Thanks to Pippijn van Steenhoven. + + src/liblzma/rangecoder/range_common.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit bc577d35c2d0ed17f554d2d8107b2a2a9abbac76 +Author: Lasse Collin +Date: 2018-01-10 22:10:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 713bbc1a80f26d34c96ed3dbb9887362204de3a1 +Author: Lasse Collin +Date: 2018-01-10 21:54:27 +0200 + + tuklib_integer: New Intel C compiler needs immintrin.h. + + Thanks to Melanie Blower (Intel) for the patch. + + src/common/tuklib_integer.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit a0ee1afbd99da138b559cb27fa2022e7f1ab44f3 +Author: Lasse Collin +Date: 2017-09-24 20:04:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a1e2c568de29c0b57d873eab40a2879b749da429 +Author: Lasse Collin +Date: 2017-09-16 20:36:20 +0300 + + Windows: Fix paths in VS project files. + + Some paths use slashes instead of backslashes as directory + separators... now it should work (I tested VS2013 version). + + windows/vs2013/liblzma.vcxproj | 12 ++++++------ + windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------ + windows/vs2017/liblzma.vcxproj | 12 ++++++------ + windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------ + 4 files changed, 36 insertions(+), 36 deletions(-) + +commit cea5cf8d26c9d1dc30a808614d79c0b25640e15e +Author: Lasse Collin +Date: 2017-09-16 12:56:20 +0300 + + Windows: Update VS2017 project files to include file info decoder. + + windows/vs2017/liblzma.vcxproj | 2 ++ + windows/vs2017/liblzma_dll.vcxproj | 2 ++ + 2 files changed, 4 insertions(+) + +commit 95d563db3ee497b223e522b699c4d4c29943eef0 +Author: Lasse Collin +Date: 2017-09-16 12:54:23 +0300 + + Windows: Add project files for VS2017. + + These files match the v5.2 branch (no file info decoder). + + windows/vs2017/config.h | 148 ++++++++++++++ + windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++ + windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++ + windows/vs2017/xz_win.sln | 48 +++++ + 4 files changed, 935 insertions(+) + +commit ab72416d62ea8f50ad31d5b8545fcb6a2bf96b73 +Author: Lasse Collin +Date: 2017-09-16 12:45:50 +0300 + + Windows: Update VS2013 project files to include file info decoder. + + windows/vs2013/liblzma.vcxproj | 2 ++ + windows/vs2013/liblzma_dll.vcxproj | 2 ++ + 2 files changed, 4 insertions(+) + +commit 82388980187b0e3794d187762054200bbdcc9a53 +Author: Lasse Collin +Date: 2017-09-16 12:39:43 +0300 + + Windows: Move VS2013 files into windows/vs2013 directory. + + windows/{ => vs2013}/config.h | 0 + windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++--------------- + windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++---------------- + windows/{ => vs2013}/xz_win.sln | 0 + 4 files changed, 279 insertions(+), 279 deletions(-) + +commit 94e3f986aa4e14b4ff01ac24857f499630d6d180 +Author: Lasse Collin +Date: 2017-08-14 20:08:33 +0300 + + Fix or hide warnings from GCC 7's -Wimplicit-fallthrough. + + src/liblzma/lzma/lzma_decoder.c | 6 ++++++ + src/xz/list.c | 2 ++ + 2 files changed, 8 insertions(+) + +commit 0b0e1e6803456aac641a59332200f8e95e2b7ea8 +Author: Alexey Tourbin +Date: 2017-05-16 23:56:35 +0300 + + Docs: Fix a typo in a comment in doc/examples/02_decompress.c. + + doc/examples/02_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a015cd1f90116e655be4eaf4aad42c4c911c2807 +Author: Lasse Collin +Date: 2017-05-23 18:34:43 +0300 + + xz: Fix "xz --list --robot missing_or_bad_file.xz". + + It ended up printing an uninitialized char-array when trying to + print the check names (column 7) on the "totals" line. + + This also changes the column 12 (minimum xz version) to + 50000002 (xz 5.0.0) instead of 0 when there are no valid + input files. + + Thanks to kidmin for the bug report. + + src/xz/list.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit c2e29f06a7d1e3ba242ac2fafc69f5d6e92f62cd +Author: Lasse Collin +Date: 2017-04-24 20:20:11 +0300 + + Docs: Add doc/examples/11_file_info.c. + + doc/examples/11_file_info.c | 206 ++++++++++++++++++++++++++++++++++++++++++++ + doc/examples/Makefile | 3 +- + 2 files changed, 208 insertions(+), 1 deletion(-) + +commit 1520f6ec808896375ac7bf778c449e0f7dea5f46 +Author: Lasse Collin +Date: 2017-04-24 19:48:47 +0300 + + Build: Omit pre-5.0.0 entries from the generated ChangeLog. + + It makes ChangeLog significantly smaller. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 8269782283806c90a8509c2ac2a308344f70e171 +Author: Lasse Collin +Date: 2017-04-24 19:48:23 +0300 + + xz: Use lzma_file_info_decoder() for --list. + + src/xz/list.c | 254 ++++++++++------------------------------------------------ + 1 file changed, 44 insertions(+), 210 deletions(-) + +commit e353d0b1cc0d3997ae5048faa8e6786414953e06 +Author: Lasse Collin +Date: 2017-04-24 19:35:50 +0300 + + liblzma: Add lzma_file_info_decoder(). + + src/liblzma/api/lzma/index.h | 66 ++++ + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/file_info.c | 855 ++++++++++++++++++++++++++++++++++++++++ + src/liblzma/liblzma.map | 7 +- + 4 files changed, 928 insertions(+), 1 deletion(-) + +commit 144ef9e19e9496c995b21505dd1e111c442968d1 +Author: Lasse Collin +Date: 2017-04-24 19:30:22 +0300 + + Update the Git repository URL to HTTPS in ChangeLog. + + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 8c9842c265993d7dd4039f732d3546267fb5ecc4 +Author: Lasse Collin +Date: 2017-04-21 15:05:16 +0300 + + liblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos. + + src/liblzma/api/lzma/base.h | 18 +++++++++--------- + src/liblzma/common/common.c | 2 +- + src/xz/message.c | 2 +- + 3 files changed, 11 insertions(+), 11 deletions(-) + +commit 662b27c417cab248cb365dd7682121bdec4d5ae7 +Author: Lasse Collin +Date: 2017-04-19 22:17:35 +0300 + + Update the home page URLs to HTTPS. + + COPYING | 2 +- + README | 2 +- + configure.ac | 2 +- + doc/faq.txt | 4 ++-- + dos/config.h | 2 +- + src/common/common_w32res.rc | 2 +- + src/xz/xz.1 | 6 +++--- + src/xzdec/xzdec.1 | 4 ++-- + windows/README-Windows.txt | 2 +- + windows/config.h | 2 +- + 10 files changed, 14 insertions(+), 14 deletions(-) + +commit c28f0b3d00af87b92dda229831548d8eb0067d1d +Author: Lasse Collin +Date: 2017-04-05 18:47:22 +0300 + + xz: Add io_seek_src(). + + src/xz/file_io.c | 20 +++++++++++++++++--- + src/xz/file_io.h | 13 +++++++++++++ + 2 files changed, 30 insertions(+), 3 deletions(-) + +commit bba477257d7319c8764890f3669175b866d24944 +Author: Lasse Collin +Date: 2017-03-30 22:01:54 +0300 + + xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. + + xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly + wrong. + + src/xz/file_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit 310d19816d1652b0c8bb1b82574d46345d924752 +Author: Lasse Collin +Date: 2017-03-30 20:03:05 +0300 + + liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs. + + This is to allow other functions to use it without going + via the public API (lzma_index_decoder()). + + src/liblzma/common/Makefile.inc | 1 + + src/liblzma/common/index_decoder.c | 10 +++++----- + src/liblzma/common/index_decoder.h | 24 ++++++++++++++++++++++++ + 3 files changed, 30 insertions(+), 5 deletions(-) + +commit a27920002dbc469f778a134fc665b7c3ea73701b +Author: Lasse Collin +Date: 2017-03-30 20:00:09 +0300 + + liblzma: Add generic support for input seeking (LZMA_SEEK). + + Also mention LZMA_SEEK in xz/message.c to silence a warning. + + src/liblzma/api/lzma/base.h | 31 ++++++++++++++++++++++++++++++- + src/liblzma/common/common.c | 12 +++++++++++- + src/xz/message.c | 1 + + 3 files changed, 42 insertions(+), 2 deletions(-) + +commit a0b1dda409bc3e6e2957a2651663fc411d2caf2d +Author: Lasse Collin +Date: 2017-03-30 19:47:45 +0300 + + liblzma: Fix lzma_memlimit_set(strm, 0). + + The 0 got treated specially in a buggy way and as a result + the function did nothing. The API doc said that 0 was supposed + to return LZMA_PROG_ERROR but it didn't. + + Now 0 is treated as if 1 had been specified. This is done because + 0 is already used to indicate an error from lzma_memlimit_get() + and lzma_memusage(). + + In addition, lzma_memlimit_set() no longer checks that the new + limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive + for the Index decoder and was actually needed only by the + auto decoder. Auto decoder has now been modified to check for + LZMA_MEMUSAGE_BASE. + + src/liblzma/api/lzma/base.h | 7 ++++++- + src/liblzma/common/auto_decoder.c | 3 +++ + src/liblzma/common/common.c | 6 ++++-- + 3 files changed, 13 insertions(+), 3 deletions(-) + +commit 84462afaada61379f5878e46f8f00e25a1cdcf29 +Author: Lasse Collin +Date: 2017-03-30 19:16:55 +0300 + + liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + src/liblzma/common/alone_decoder.c | 5 +---- + src/liblzma/common/auto_decoder.c | 5 +---- + src/liblzma/common/stream_decoder.c | 5 +---- + 4 files changed, 20 insertions(+), 16 deletions(-) + +commit cbc74017939690d13441b8926bb743fb03211b83 +Author: Lasse Collin +Date: 2017-03-30 18:58:18 +0300 + + liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). + + It returned LZMA_PROG_ERROR, which was done to avoid zero as + the limit (because it's a special value elsewhere), but using + LZMA_PROG_ERROR is simply inconvenient and can cause bugs. + + The fix/workaround is to treat 0 as if it were 1 byte. It's + effectively the same thing. The only weird consequence is + that then lzma_memlimit_get() will return 1 even when 0 was + specified as the limit. + + This fixes a very rare corner case in xz --list where a specific + memory usage limit and a multi-stream file could print the + error message "Internal error (bug)" instead of saying that + the memory usage limit is too low. + + src/liblzma/api/lzma/index.h | 18 +++++++++++------- + src/liblzma/common/index_decoder.c | 4 ++-- + 2 files changed, 13 insertions(+), 9 deletions(-) + +commit 78ae13bced912b1b92ae927992c99cbcc463cae7 +Author: Lasse Collin +Date: 2016-12-30 13:25:10 +0200 + + Update NEWS for 5.2.3. + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit 0297863fdb453aed1a25eb025f3ba7bacbbb1357 +Author: Lasse Collin +Date: 2016-12-26 20:55:52 +0200 + + Document --enable-sandbox configure option in INSTALL. + + INSTALL | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +commit d4a0462abe5478193521c14625e1c81fead87f9f +Author: Lasse Collin +Date: 2016-11-21 20:24:50 +0200 + + liblzma: Avoid multiple definitions of lzma_coder structures. + + Only one definition was visible in a translation unit. + It avoided a few casts and temp variables but seems that + this hack doesn't work with link-time optimizations in compilers + as it's not C99/C11 compliant. + + Fixes: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html + + src/liblzma/common/alone_decoder.c | 44 +++++---- + src/liblzma/common/alone_encoder.c | 34 ++++--- + src/liblzma/common/auto_decoder.c | 35 ++++--- + src/liblzma/common/block_decoder.c | 41 ++++---- + src/liblzma/common/block_encoder.c | 40 ++++---- + src/liblzma/common/common.h | 18 ++-- + src/liblzma/common/index_decoder.c | 33 ++++--- + src/liblzma/common/index_encoder.c | 16 ++-- + src/liblzma/common/stream_decoder.c | 50 +++++----- + src/liblzma/common/stream_encoder.c | 56 ++++++----- + src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++----------- + src/liblzma/delta/delta_common.c | 25 ++--- + src/liblzma/delta/delta_decoder.c | 6 +- + src/liblzma/delta/delta_encoder.c | 12 ++- + src/liblzma/delta/delta_private.h | 4 +- + src/liblzma/lz/lz_decoder.c | 60 ++++++------ + src/liblzma/lz/lz_decoder.h | 13 ++- + src/liblzma/lz/lz_encoder.c | 57 +++++++----- + src/liblzma/lz/lz_encoder.h | 9 +- + src/liblzma/lzma/lzma2_decoder.c | 32 ++++--- + src/liblzma/lzma/lzma2_encoder.c | 51 +++++----- + src/liblzma/lzma/lzma_decoder.c | 27 +++--- + src/liblzma/lzma/lzma_encoder.c | 29 +++--- + src/liblzma/lzma/lzma_encoder.h | 9 +- + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +- + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++--- + src/liblzma/lzma/lzma_encoder_private.h | 6 +- + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 61 ++++++------ + src/liblzma/simple/simple_private.h | 12 +-- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 15 +-- + 35 files changed, 532 insertions(+), 423 deletions(-) + +commit a01794c52add98263b49119842c3e7141d1b9ced +Author: Lasse Collin +Date: 2016-10-24 18:53:25 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit df8f446e3ad47e5148b8c8d8b6e519d3ce29cb9d +Author: Lasse Collin +Date: 2016-10-24 18:51:36 +0300 + + tuklib_cpucores: Add support for sched_getaffinity(). + + It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better + than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity() + gives the number of cores available to the process instead of + the total number of cores online. + + As a side effect, this commit fixes a bug on GNU/kFreeBSD where + configure would detect the FreeBSD-specific cpuset_getaffinity() + but it wouldn't actually work because on GNU/kFreeBSD it requires + using -lfreebsd-glue when linking. Now the glibc-specific function + will be used instead. + + Thanks to Sebastian Andrzej Siewior for the original patch + and testing. + + m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 446e4318fa79788e09299d5953b5dd428953d14b +Author: Lasse Collin +Date: 2016-06-30 20:27:36 +0300 + + xz: Fix copying of timestamps on Windows. + + xz used to call utime() on Windows, but its result gets lost + on close(). Using _futime() seems to work. + + Thanks to Martok for reporting the bug: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html + + configure.ac | 2 +- + src/xz/file_io.c | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 1b0ac0c53c761263e91e34195cb21dfdcfeac0bd +Author: Lasse Collin +Date: 2016-06-16 22:46:02 +0300 + + xz: Silence warnings from -Wlogical-op. + + Thanks to Evan Nemerson. + + src/xz/file_io.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit c83b7a03342c3325ff10400b22ee21edfcd1e026 +Author: Lasse Collin +Date: 2016-04-10 20:55:49 +0300 + + Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am. + + Thanks to Christian Kujau. + + src/xz/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ade31a2bfb95c94d05fbfc0ecbba5d6377f2506e +Author: Lasse Collin +Date: 2016-04-10 20:54:17 +0300 + + Build: Bump GNU Gettext version requirement to 0.19. + + It silences a few warnings and most people probably have + 0.19 even on stable distributions. + + Thanks to Christian Kujau. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ac398c3bafa6e4c80e20571373a96947db863b3d +Author: Lasse Collin +Date: 2016-03-13 20:21:49 +0200 + + liblzma: Disable external SHA-256 by default. + + This is the sane thing to do. The conflict with OpenSSL + on some OSes and especially that the OS-provided versions + can be significantly slower makes it clear that it was + a mistake to have the external SHA-256 support enabled by + default. + + Those who want it can now pass --enable-external-sha256 to + configure. INSTALL was updated with notes about OSes where + this can be a bad idea. + + The SHA-256 detection code in configure.ac had some bugs that + could lead to a build failure in some situations. These were + fixed, although it doesn't matter that much now that the + external SHA-256 is disabled by default. + + MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init + in libc instead of libutil. Support for the libutil version + was removed. + + INSTALL | 36 ++++++++++++++++++++++ + configure.ac | 76 +++++++++++++++++++++++------------------------ + src/liblzma/check/check.h | 16 ++++------ + 3 files changed, 79 insertions(+), 49 deletions(-) + +commit 6fd5ecb589a9fdd7a576ea48c4850d496bab9ce5 +Author: Lasse Collin +Date: 2016-03-10 20:27:05 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 473ef0dc69a30e64d5fa0d34aca02f7309faa3e9 +Author: Lasse Collin +Date: 2016-03-10 20:26:49 +0200 + + Build: Avoid SHA256_Init on FreeBSD and MINIX 3. + + On FreeBSD 10 and older, SHA256_Init from libmd conflicts + with libcrypto from OpenSSL. The OpenSSL version has + different sizeof(SHA256_CTX) and it can cause weird + problems if wrong SHA256_Init gets used. + + Looking at the source, MINIX 3 seems to have a similar issue but + I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too. + + NetBSD has SHA256_Init in libc and they had a similar problem, + but they already fixed it in 2009. + + Thanks to Jim Wilcoxson for the bug report that helped + in finding the problem. + + configure.ac | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit faf302137e54d605b44ecf0373cb51a6403a2de1 +Author: Lasse Collin +Date: 2015-11-08 20:16:10 +0200 + + tuklib_physmem: Hopefully silence a warning on Windows. + + src/common/tuklib_physmem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit e52e9151cf8613022d1de4712ff39dbcb666e991 +Author: Lasse Collin +Date: 2015-11-04 23:17:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 14115f84a38161d55eaa2d070f08739bde37e966 +Author: Lasse Collin +Date: 2015-11-04 23:14:00 +0200 + + liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma. + + When optimizing, GCC can reorder code so that an uninitialized + value gets used in a comparison, which makes Valgrind unhappy. + It doesn't happen when compiled with -O0, which I tend to use + when running Valgrind. + + Thanks to Rich Prohaska. I remember this being mentioned long + ago by someone else but nothing was done back then. + + src/liblzma/lz/lz_encoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit f4c95ba94beb71a608eb6eadbf82b44f53a0260e +Author: Lasse Collin +Date: 2015-11-03 20:55:45 +0200 + + liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c. + + It would be too annoying to update other build systems + just because of this. + + src/liblzma/lzma/Makefile.inc | 2 +- + src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c7bc20a6f3e71920871d48db31a79ab58b5a0a4b +Author: Lasse Collin +Date: 2015-11-03 20:47:07 +0200 + + Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built. + + They all need decoder support and if that isn't available, + there's no point trying to build them. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 5cbca1205deeb6fb7afe7a864fa68a57466d928a +Author: Lasse Collin +Date: 2015-11-03 20:35:19 +0200 + + Build: Simplify $enable_{encoders,decoders} usage a bit. + + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit af13781886c8e7a0aabebb5141ea282dc364f5c6 +Author: Lasse Collin +Date: 2015-11-03 20:31:31 +0200 + + Windows/MSVC: Update config.h. + + windows/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 9fa5949330f162c5a2f6653f83025327837e8f39 +Author: Lasse Collin +Date: 2015-11-03 20:29:58 +0200 + + DOS: Update config.h. + + dos/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit cb3111e3ed84152912b5138d690c8d9f00c6ef02 +Author: Lasse Collin +Date: 2015-11-03 20:29:33 +0200 + + xz: Make xz buildable even when encoders or decoders are disabled. + + The patch is quite long but it's mostly about adding new #ifdefs + to omit code when encoders or decoders have been disabled. + + This adds two new #defines to config.h: HAVE_ENCODERS and + HAVE_DECODERS. + + configure.ac | 4 ++++ + src/xz/Makefile.am | 8 ++++++-- + src/xz/args.c | 16 ++++++++++++++++ + src/xz/coder.c | 33 +++++++++++++++++++++++++-------- + src/xz/main.c | 9 +++++++-- + src/xz/private.h | 5 ++++- + 6 files changed, 62 insertions(+), 13 deletions(-) + +commit 4cc584985c0b7a13901da1b7a64ef9f7cc36e8ab +Author: Lasse Collin +Date: 2015-11-03 18:06:40 +0200 + + Build: Build LZMA1/2 presets also when only decoder is wanted. + + People shouldn't rely on the presets when decoding raw streams, + but xz uses the presets as the starting point for raw decoder + options anyway. + + lzma_encocder_presets.c was renamed to lzma_presets.c to + make it clear it's not used solely by the encoder code. + + src/liblzma/lzma/Makefile.inc | 6 +++++- + src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit 23ed1d41489f632155bbc9660f323d57e09da180 +Author: Lasse Collin +Date: 2015-11-03 17:54:48 +0200 + + Build: Fix configure to handle LZMA1 dependency with LZMA2. + + Now it gives an error if LZMA1 encoder/decoder is missing + when LZMA2 encoder/decoder was requested. Even better would + be LZMA2 implicitly enabling LZMA1 but it would need more code. + + configure.ac | 5 ----- + 1 file changed, 5 deletions(-) + +commit b0bc3e03852af13419ea2960881824258d451117 +Author: Lasse Collin +Date: 2015-11-03 17:41:54 +0200 + + Build: Don't omit lzma_cputhreads() unless using --disable-threads. + + Previously it was omitted if encoders were disabled + with --disable-encoders. It didn't make sense and + it also broke the build. + + src/liblzma/common/Makefile.inc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit c6bf438ab39e0fb4a47d3c81725c227919502726 +Author: Lasse Collin +Date: 2015-11-02 18:16:51 +0200 + + liblzma: Fix a build failure related to external SHA-256 support. + + If an appropriate header and structure were found by configure, + but a library with a usable SHA-256 functions wasn't, the build + failed. + + src/liblzma/check/check.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit e18adc56f2262aa9394d46681e9e4b9981ed5e97 +Author: Lasse Collin +Date: 2015-11-02 15:19:10 +0200 + + xz: Always close the file before trying to delete it. + + unlink() can return EBUSY in errno for open files on some + operating systems and file systems. + + src/xz/file_io.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit 282e768a1484e88c8b7ec35655ee4959954ec87a +Author: Lasse Collin +Date: 2015-10-12 21:08:42 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 372e402713a1d4337ffce5f56d5c5c9ed99a66d0 +Author: Lasse Collin +Date: 2015-10-12 21:07:41 +0300 + + Tests: Add tests for the two bugs fixed in index.c. + + tests/test_index.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit 21515d79d778b8730a434f151b07202d52a04611 +Author: Lasse Collin +Date: 2015-10-12 20:45:15 +0300 + + liblzma: Fix lzma_index_dup() for empty Streams. + + Stream Flags and Stream Padding weren't copied from + empty Streams. + + src/liblzma/common/index.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 09f395b6b360c0b13e8559eece1d179b908ebd3a +Author: Lasse Collin +Date: 2015-10-12 20:31:44 +0300 + + liblzma: Add a note to index.c for those using static analyzers. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 3bf857edfef51374f6f3fffae3d817f57d3264a0 +Author: Lasse Collin +Date: 2015-10-12 20:29:09 +0300 + + liblzma: Fix a memory leak in error path of lzma_index_dup(). + + lzma_index_dup() calls index_dup_stream() which, in case of + an error, calls index_stream_end() to free memory allocated + by index_stream_init(). However, it illogically didn't + actually free the memory. To make it logical, the tree + handling code was modified a bit in addition to changing + index_stream_end(). + + Thanks to Evan Nemerson for the bug report. + + src/liblzma/common/index.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit 7f05803979b4b79642d5be4218a79da7a0b12c47 +Author: Lasse Collin +Date: 2015-09-29 13:57:28 +0300 + + Update NEWS for 5.2.2. + + NEWS | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 397fcc0946315b55c3c6d80e37e82a2a78bc15c1 +Author: Hauke Henningsen +Date: 2015-08-17 04:59:54 +0200 + + Update German translation, mostly wrt orthography + + Provide an update of the German translation. + * A lot of compound words were previously written with spaces, while + German orthography is relatively clear in that the components + should not be separated. + * When referring to the actual process of (de)compression rather than the + concept, replace “(De-)Kompression” with “(De-)Komprimierung”. + Previously, both forms were used in this context and are now used in a + manner consistent with “Komprimierung” being more likely to refer to + a process. + * Consistently translate “standard input”/“output” + * Use “Zeichen” instead of false friend “Charakter” for “character” + * Insert commas around relative clauses (as required in German) + * Some other minor corrections + * Capitalize “ß” as “ẞ” + * Consistently start option descriptions in --help with capital letters + + Acked-By: Andre Noll + + * Update after msgmerge + + po/de.po | 383 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 196 insertions(+), 187 deletions(-) + +commit cbc9e39bae715accb44168930a71888480aad569 +Author: Lasse Collin +Date: 2015-08-11 13:23:04 +0300 + + Build: Minor Cygwin cleanup. + + Some tests used "cygwin*" and some used "cygwin". I changed + them all to use "cygwin". Shouldn't affect anything in practice. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit bcacd8ce7a031566858e5e03c1009064c3f1c89e +Author: Lasse Collin +Date: 2015-08-11 13:21:52 +0300 + + Build: Support building of MSYS2 binaries. + + configure.ac | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 0275a5398c01d57b724dec7fea52dec3bd6edc6c +Author: Lasse Collin +Date: 2015-08-09 21:06:26 +0300 + + Windows: Define DLL_EXPORT when building liblzma.dll with MSVC. + + src/liblzma/common/common.h uses it to set __declspec(dllexport) + for the API symbols. + + Thanks to Adam Walling. + + windows/liblzma_dll.vcxproj | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit a74525cf9b945fb0b370e64cf406104beb31729b +Author: Lasse Collin +Date: 2015-08-09 21:02:20 +0300 + + Windows: Omit unneeded header files from MSVC project files. + + windows/liblzma.vcxproj | 5 ----- + windows/liblzma_dll.vcxproj | 5 ----- + 2 files changed, 10 deletions(-) + +commit fbbb295a91caf39faf8838c8c39526e4cb4dc121 +Author: Lasse Collin +Date: 2015-07-12 20:48:19 +0300 + + liblzma: A MSVC-specific hack isn't needed with MSVC 2013 and newer. + + src/liblzma/api/lzma.h | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit 713dbe5c230fe00865a54f5c32358ea30f9a1156 +Author: Lasse Collin +Date: 2015-06-19 20:38:55 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 3a5d755d055d51f99c523b4c2952727e1e69cfa1 +Author: Lasse Collin +Date: 2015-06-19 20:21:30 +0300 + + Windows: Update the docs. + + INSTALL | 29 ++++++++----- + windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++ + windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +- + 3 files changed, 67 insertions(+), 11 deletions(-) + +commit b0798c6aa6184efcefd0bdcca20f96121a13feda +Author: Lasse Collin +Date: 2015-06-19 17:25:31 +0300 + + Windows: Add MSVC project files for building liblzma. + + Thanks to Adam Walling for creating these files. + + windows/liblzma.vcxproj | 359 ++++++++++++++++++++++++++++++++++++++++ + windows/liblzma_dll.vcxproj | 388 ++++++++++++++++++++++++++++++++++++++++++++ + windows/xz_win.sln | 48 ++++++ + 3 files changed, 795 insertions(+) + +commit 9b02a4ffdac1b9f066658ec4c95c0834f4cd2fb7 +Author: Andre Noll +Date: 2015-05-28 15:50:00 +0200 + + Fix typo in German translation. + + As pointed out by Robert Pollak, there's a typo in the German + translation of the compression preset option (-0 ... -9) help text. + "The compressor" translates to "der Komprimierer", and the genitive + form is "des Komprimierers". The old word makes no sense at all. + + po/de.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c7f4041f6b8f4729f88d3bc888b2a4080ae51f72 +Author: Lasse Collin +Date: 2015-05-13 20:57:55 +0300 + + Tests: Fix a memory leak in test_bcj_exact_size. + + Thanks to Cristian Rodríguez. + + tests/test_bcj_exact_size.c | 1 + + 1 file changed, 1 insertion(+) + +commit 17b29d4f0ae0f780fbd69e15a398dc478d8492f8 +Author: Lasse Collin +Date: 2015-05-12 18:08:24 +0300 + + Fix NEWS about threading in 5.2.0. + + Thanks to Andy Hochhaus. + + NEWS | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 49c26920d6e2d85e5c6123e34958aed2e77485ad +Author: Lasse Collin +Date: 2015-05-11 21:26:16 +0300 + + xz: Document that threaded decompression hasn't been implemented yet. + + src/xz/xz.1 | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 5b2458cb244ed237efe4de1ebcf06e1b3a1f4256 +Author: Lasse Collin +Date: 2015-04-20 20:20:29 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 6bd0349c58451b13442e8f463e35de83548bf985 +Author: Lasse Collin +Date: 2015-04-20 19:59:18 +0300 + + Revert "xz: Use pipe2() if available." + + This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd. + It is a problem when libc has pipe2() but the kernel is too + old to have pipe2() and thus pipe2() fails. In xz it's pointless + to have a fallback for non-functioning pipe2(); it's better to + avoid pipe2() completely. + + Thanks to Michael Fox for the bug report. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 +-------- + 2 files changed, 3 insertions(+), 10 deletions(-) + +commit fc0df0f8db87dff45543708a711e17d29c37f632 +Author: Lasse Collin +Date: 2015-04-01 14:45:25 +0300 + + xz: Fix the Capsicum rights on user_abort_pipe. + + src/xz/file_io.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 57393615b31b3788dd77280452d845bcc12d33af +Author: Lasse Collin +Date: 2015-03-31 22:20:11 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1238381143a9a7ce84839c2582ccd56ff750a440 +Author: Lasse Collin +Date: 2015-03-31 22:19:34 +0300 + + xz: Add support for sandboxing with Capsicum. + + The sandboxing is used conditionally as described in main.c. + This isn't optimal but it was much easier to implement than + a full sandboxing solution and it still covers the most common + use cases where xz is writing to standard output. This should + have practically no effect on performance even with small files + as fork() isn't needed. + + C and locale libraries can open files as needed. This has been + fine in the past, but it's a problem with things like Capsicum. + io_sandbox_enter() tries to ensure that various locale-related + files have been loaded before cap_enter() is called, but it's + possible that there are other similar problems which haven't + been seen yet. + + Currently Capsicum is available on FreeBSD 10 and later + and there is a port to Linux too. + + Thanks to Loganaden Velvindron for help. + + configure.ac | 41 +++++++++++++++++++++++++++ + src/xz/Makefile.am | 2 +- + src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/xz/file_io.h | 6 ++++ + src/xz/main.c | 18 ++++++++++++ + src/xz/private.h | 4 +++ + 6 files changed, 151 insertions(+), 1 deletion(-) + +commit 29a087fb5a0c879f0b1bc4c6b989f7b87bacdf9e +Author: Lasse Collin +Date: 2015-03-31 21:12:30 +0300 + + Fix bugs and otherwise improve ax_check_capsicum.m4. + + AU_ALIAS was removed because the new version is incompatible + with the old version. + + It no longer checks for separately. + It's enough to test for it as part of AC_CHECK_DECL. + The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and + HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded. + HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough. + + It no longer does a useless search for the Capsicum library + if the header wasn't found. + + Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying + the argument omitted the default action but the given action + wasn't used instead. + + AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum + support is found. Previously it was part of the default + ACTION-IF-FOUND which a custom action would override. Now + the default action only prepends ${CAPSICUM_LIB} to LIBS. + + The documentation was updated. + + Since there as no serial number, "#serial 2" was added. + + m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 52 deletions(-) + +commit 6e845c6a3eddf2fde9db5a29950421dff60a43ac +Author: Lasse Collin +Date: 2015-03-31 19:20:24 +0300 + + Add m4/ax_check_capsicum.m4 for detecting Capsicum support. + + The file was loaded from this web page: + https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4 + + Thanks to Loganaden Velvindron for pointing it out for me. + + m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit 3717885f9ef2c06f1bcbad9f4c2ed2d5695f844e +Author: Lasse Collin +Date: 2015-03-30 22:44:02 +0300 + + Bump version to 5.3.0alpha and soname to 5.3.99. + + The idea of 99 is that it looks a bit weird in this context. + For new features there's no API/ABI stability in devel versions. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +commit eccd8155e107c5ada03d13e7730675cdf1a44ddc +Author: Lasse Collin +Date: 2015-03-29 22:14:47 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 25263fd9e7a8a913395cb93d7c104cd48c2b4a00 +Author: Lasse Collin +Date: 2015-03-29 22:13:48 +0300 + + Fix the detection of installed RAM on QNX. + + The earlier version compiled but didn't actually work + since sysconf(_SC_PHYS_PAGES) always fails (or so I was told). + + Thanks to Ole André Vadla Ravnås for the patch and testing. + + m4/tuklib_physmem.m4 | 6 +++--- + src/common/tuklib_physmem.c | 14 +++++++++++++- + 2 files changed, 16 insertions(+), 4 deletions(-) + +commit 4c544d2410903d38402221cb783ed85585b6a007 +Author: Lasse Collin +Date: 2015-03-27 22:39:07 +0200 + + Fix CPU core count detection on QNX. + + It tried to use sysctl() on QNX but + - it broke the build because sysctl() needs -lsocket on QNX; + - sysctl() doesn't work for detecting the core count on QNX + even if it compiled. + + sysconf() works. An alternative would have been to use + QNX-specific SYSPAGE_ENTRY(num_cpu) from . + + Thanks to Ole André Vadla Ravnås. + + m4/tuklib_cpucores.m4 | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit e0ea6737b03e83ccaff4514d00e31bb926f8f0f3 +Author: Lasse Collin +Date: 2015-03-07 22:05:57 +0200 + + xz: size_t/uint32_t cleanup in options.c. + + src/xz/options.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8bcca29a65335fd679c13814b70b35b68fa5daed +Author: Lasse Collin +Date: 2015-03-07 22:04:23 +0200 + + xz: Fix a comment and silence a warning in message.c. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f243f5f44c6b19a7c289a0ec73a03ee08364cb5b +Author: Lasse Collin +Date: 2015-03-07 22:01:00 +0200 + + liblzma: Silence more uint32_t vs. size_t warnings. + + src/liblzma/lz/lz_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7f0a4c50f4a374c40acf4b86848f301ad1e82d34 +Author: Lasse Collin +Date: 2015-03-07 19:54:00 +0200 + + xz: Make arg_count an unsigned int to silence a warning. + + Actually the value of arg_count cannot exceed INT_MAX + but it's nicer as an unsigned int. + + src/xz/args.h | 2 +- + src/xz/main.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f6ec46801588b1be29c07c9db98558b521304002 +Author: Lasse Collin +Date: 2015-03-07 19:33:17 +0200 + + liblzma: Fix a warning in index.c. + + src/liblzma/common/index.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a24518971cc621315af142dd3bb7614fab04ad27 +Author: Lasse Collin +Date: 2015-02-26 20:46:14 +0200 + + Build: Fix a CR+LF problem when running autoreconf -fi on OS/2. + + build-aux/version.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dec11497a71518423b5ff0e759100cf8aadf6c7b +Author: Lasse Collin +Date: 2015-02-26 16:53:44 +0200 + + Bump version and soname for 5.2.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 29e39c79975ab89ee5dd671e97064534a9f3a649 +Author: Lasse Collin +Date: 2015-02-26 13:01:09 +0200 + + Update NEWS for 5.2.1. + + NEWS | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd +Author: Lasse Collin +Date: 2015-02-22 19:38:48 +0200 + + xz: Use pipe2() if available. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 ++++++++- + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit 117d962685c72682c63edc9bb765367189800202 +Author: Lasse Collin +Date: 2015-02-21 23:40:26 +0200 + + liblzma: Fix a compression-ratio regression in LZMA1/2 in fast mode. + + The bug was added in the commit + f48fce093b07aeda95c18850f5e086d9f2383380 and thus + affected 5.1.4beta and 5.2.0. Luckily the bug cannot + cause data corruption or other nasty things. + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ae984e31c167d3bc52972ec422dd1ebd5f5d5719 +Author: Lasse Collin +Date: 2015-02-21 23:00:19 +0200 + + xz: Fix the fcntl() usage when creating a pipe for the self-pipe trick. + + Now it reads the old flags instead of blindly setting O_NONBLOCK. + The old code may have worked correctly, but this is better. + + src/xz/file_io.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 2205bb5853098aea36a56df6f5747037175f66b4 +Author: Lasse Collin +Date: 2015-02-10 15:29:34 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d935b0cdf3db440269b9d952b2b281b18f8c7b08 +Author: Lasse Collin +Date: 2015-02-10 15:28:30 +0200 + + tuklib_cpucores: Use cpuset_getaffinity() on FreeBSD if available. + + In FreeBSD, cpuset_getaffinity() is the preferred way to get + the number of available cores. + + Thanks to Rui Paulo for the patch. I edited it slightly, but + hopefully I didn't break anything. + + m4/tuklib_cpucores.m4 | 23 ++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 18 ++++++++++++++++++ + 2 files changed, 40 insertions(+), 1 deletion(-) + +commit eb61bc58c20769cac4d05f363b9c0e8c9c71a560 +Author: Lasse Collin +Date: 2015-02-09 22:08:37 +0200 + + xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp. + + Thanks to Rui Paulo for the fix. + + src/scripts/xzdiff.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit b9a5b6b7a29029680af733082b6a46e0fc01623a +Author: Lasse Collin +Date: 2015-02-03 21:45:53 +0200 + + Add a few casts to tuklib_integer.h to silence possible warnings. + + I heard that Visual Studio 2013 gave warnings without the casts. + + Thanks to Gabi Davar. + + src/common/tuklib_integer.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit c45757135f40e4a0de730ba5fff0100219493982 +Author: Lasse Collin +Date: 2015-01-26 21:24:39 +0200 + + liblzma: Set LZMA_MEMCMPLEN_EXTRA depending on the compare method. + + src/liblzma/common/memcmplen.h | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3c500174ed5485f550972a2a6109c361e875f069 +Author: Lasse Collin +Date: 2015-01-26 20:40:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit fec88d41e672d9e197c9442aecf02bd0dfa6d516 +Author: Lasse Collin +Date: 2015-01-26 20:39:28 +0200 + + liblzma: Silence harmless Valgrind errors. + + Thanks to Torsten Rupp for reporting this. I had + forgotten to run Valgrind before the 5.2.0 release. + + src/liblzma/lz/lz_encoder.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit a9b45badfec0928d20a27c7176c005fa637f7d1e +Author: Lasse Collin +Date: 2015-01-09 21:50:19 +0200 + + xz: Fix comments. + + src/xz/file_io.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 541aee6dd4aa97a809aba281475a21b641bb89e2 +Author: Lasse Collin +Date: 2015-01-09 21:35:06 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4170edc914655310d2363baccf5e615e09b04911 +Author: Lasse Collin +Date: 2015-01-09 21:34:06 +0200 + + xz: Don't fail if stdout doesn't support O_NONBLOCK. + + This is similar to the case with stdin. + + Thanks to Brad Smith for the bug report and testing + on OpenBSD. + + src/xz/file_io.c | 36 +++++++++++++++--------------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit 04bbc0c2843c50c8ad1cba42b937118e38b0508d +Author: Lasse Collin +Date: 2015-01-07 19:18:20 +0200 + + xz: Fix a memory leak in DOS-specific code. + + src/xz/file_io.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f0f1f6c7235ffa901cf76fe18e33749e200b3eea +Author: Lasse Collin +Date: 2015-01-07 19:08:06 +0200 + + xz: Don't fail if stdin doesn't support O_NONBLOCK. + + It's a problem at least on OpenBSD which doesn't support + O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's + a problem on other OSes too since this behavior is allowed + in POSIX-1.2008. + + The code relying on this behavior was committed in June 2013 + and included in 5.1.3alpha released on 2013-10-26. Clearly + the development releases only get limited testing. + + src/xz/file_io.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit d2d484647d9d9d679f03c75abb0404f67069271c +Author: Lasse Collin +Date: 2015-01-06 20:30:15 +0200 + + Tests: Don't hide unexpected error messages in test_files.sh. + + Hiding them makes no sense since normally there's no error + when testing the "good" files. With "bad" files errors are + expected and then it makes sense to keep the messages hidden. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit aae6a6aeda51cf94a47e39ad624728f9bee75e30 +Author: Lasse Collin +Date: 2014-12-30 11:17:16 +0200 + + Update Solaris notes in INSTALL. + + Mention the possible "make check" failure on Solaris in the + Solaris-specific section of INSTALL. It was already in + section 4.5 but it is better mention it in the OS-specific + section too. + + INSTALL | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7815112153178800a3521b9f31960e7cdc26cfba +Author: Lasse Collin +Date: 2014-12-26 12:00:05 +0200 + + Build: POSIX shell isn't required if scripts are disabled. + + INSTALL | 3 ++- + configure.ac | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a +Author: Lasse Collin +Date: 2014-12-21 20:48:37 +0200 + + DOS: Update Makefile. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e +Author: Lasse Collin +Date: 2014-12-21 19:50:38 +0200 + + Windows: Fix bin_i486 to bin_i686 in build.bash. + + windows/build.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cbafa710918195dbba3db02c3fab4f0538235206 +Author: Lasse Collin +Date: 2014-12-21 18:58:44 +0200 + + Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c. + + doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a +Author: Lasse Collin +Date: 2014-12-21 18:56:44 +0200 + + Docs: Update docs/examples/00_README.txt. + + doc/examples/00_README.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6 +Author: Lasse Collin +Date: 2014-12-21 18:11:17 +0200 + + Bump version and soname for 5.2.0. + + I know that soname != app version, but I skip AGE=1 + in -version-info to make the soname match the liblzma + version anyway. It doesn't hurt anything as long as + it doesn't conflict with library versioning rules. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma.map | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..88aa55a --- /dev/null +++ b/NEWS @@ -0,0 +1,1623 @@ + +XZ Utils Release Notes +====================== + +5.4.1 (2023-01-11) + + * liblzma: + + - Fixed the return value of lzma_microlzma_encoder() if the + LZMA options lc/lp/pb are invalid. Invalid lc/lp/pb options + made the function return LZMA_STREAM_END without encoding + anything instead of returning LZMA_OPTIONS_ERROR. + + - Windows / Visual Studio: Workaround a possible compiler bug + when targeting 32-bit x86 and compiling the CLMUL version of + the CRC64 code. The CLMUL code isn't enabled by the Windows + project files but it is in the CMake-based builds. + + * Build systems: + + - Windows-specific CMake changes: + + * Don't try to enable CLMUL CRC64 code if _mm_set_epi64x() + isn't available. This fixes CMake-based build with Visual + Studio 2013. + + * Created a workaround for a build failure with windres + from GNU binutils. It is used only when the C compiler + is GCC (not Clang). The workaround is incompatible + with llvm-windres, resulting in "XZx20Utils" instead + of "XZ Utils" in the resource file, but without the + workaround llvm-windres works correctly. See the + comment in CMakeLists.txt for details. + + * Included the resource files in the xz and xzdec build + rules. Building the command line tools is still + experimental but possible with MinGW-w64. + + - Visual Studio: Added stream_decoder_mt.c to the project + files. Now the threaded decompressor lzma_stream_decoder_mt() + gets built. CMake-based build wasn't affected. + + - Updated windows/INSTALL-MSVC.txt to mention that CMake-based + build is now the preferred method with Visual Studio. The + project files will probably be removed after 5.4.x releases. + + - Changes to #defines in config.h: + + * HAVE_DECL_CLOCK_MONOTONIC was replaced by + HAVE_CLOCK_MONOTONIC. The old macro was always defined + in configure-generated config.h to either 0 or 1. The + new macro is defined (to 1) only if the declaration of + CLOCK_MONOTONIC is available. This matches the way most + other config.h macros work and makes things simpler with + other build systems. + + * HAVE_DECL_PROGRAM_INVOCATION_NAME was replaced by + HAVE_PROGRAM_INVOCATION_NAME for the same reason. + + * Tests: + + - Fixed test script compatibility with ancient /bin/sh + versions. Now the five test_compress_* tests should + no longer fail on Solaris 10. + + - Added and refactored a few tests. + + * Translations: + + - Updated the Catalan and Esperanto translations. + + - Added Korean and Ukrainian man page translations. + + +5.4.0 (2022-12-13) + + This bumps the minor version of liblzma because new features were + added. The API and ABI are still backward compatible with liblzma + 5.2.x and 5.0.x. + + Since 5.3.5beta: + + * All fixes from 5.2.10. + + * The ARM64 filter is now stable. The xz option is now --arm64. + Decompression requires XZ Utils 5.4.0. In the future the ARM64 + filter will be supported by XZ for Java, XZ Embedded (including + the version in Linux), LZMA SDK, and 7-Zip. + + * Translations: + + - Updated Catalan, Croatian, German, Romanian, and Turkish + translations. + + - Updated German man page translations. + + - Added Romanian man page translations. + + Summary of new features added in the 5.3.x development releases: + + * liblzma: + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + - New Filter IDs: + * LZMA_FILTER_ARM64 is for ARM64 binaries. + * LZMA_FILTER_LZMA1EXT is for raw LZMA1 streams that don't + necessarily use the end marker. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to convert a preset or a filter chain + string to a lzma_filter[] and vice versa. These should make + it easier to write applications that allow users to specify + custom compression options. + + - Added lzma_filters_free() which can be convenient for freeing + the filter options in a filter chain (an array of lzma_filter + structures). + + - lzma_file_info_decoder() to makes it a little easier to get + the Index field from .xz files. This helps in getting the + uncompressed file size but an easy-to-use random access + API is still missing which has existed in XZ for Java for + a long time. + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + It is used by erofs-utils and may be used by others too. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded (the XZ Embedded version in Linux got MicroLZMA + support in Linux 5.16). + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added lzma_lzip_decoder() to decompress the .lz (lzip) file + format version 0 and the original unextended version 1 files. + Also lzma_auto_decoder() supports .lz files. + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - CLMUL-based CRC64 on x86-64 and E2K with runtime processor + detection. On 32-bit x86 it currently isn't available unless + --disable-assembler is used which can make the non-CLMUL + CRC64 slower; this might be fixed in the future. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)). + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - --threads=+1 or -T+1 is now a way to put xz into + multi-threaded mode while using only one worker thread. + The + is ignored if the number is not 1. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default soft limit for -T0 is at most 1400 MiB + on all 32-bit platforms. + + - Previously a low value in --memlimit-compress wouldn't cause + xz to switch from multi-threaded mode to single-threaded mode + if the limit cannot otherwise be met; xz failed instead. Now + xz can switch to single-threaded mode and then, if needed, + scale down the LZMA2 dictionary size too just like it already + did when it was started in single-threaded mode. + + - The option --no-adjust no longer prevents xz from scaling down + the number of threads as that doesn't affect the compressed + output (only performance). Now --no-adjust only prevents + adjustments that affect compressed output, that is, with + --no-adjust xz won't switch from multi-threaded mode to + single-threaded mode and won't scale down the LZMA2 + dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. The system-specific default value is currently + the same as the one used for compression with -T0. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + - Added new information to the output of xz --info-memory and + new fields to the output of xz --robot --info-memory. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + - Sandboxing enabled by default: + * Capsicum (FreeBSD) + * pledge(2) (OpenBSD) + + * Scripts now support the .lz format using xz. + + * A few new tests were added. + + * The liblzma-specific tests are now supported in CMake-based + builds too ("make test"). + + +5.3.5beta (2022-12-01) + + * All fixes from 5.2.9. + + * liblzma: + + - Added new LZMA_FILTER_LZMA1EXT for raw encoder and decoder to + handle raw LZMA1 streams that don't have end of payload marker + (EOPM) alias end of stream (EOS) marker. It can be used in + filter chains, for example, with the x86 BCJ filter. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to make it easier for applications + to get custom compression options from a user and convert + it to an array of lzma_filter structures. + + - Added lzma_filters_free(). + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - ARM64 filter was modified. It is still experimental. + + - Fixed LTO build with Clang if -fgnuc-version=10 or similar + was used to make Clang look like GCC >= 10. Now it uses + __has_attribute(__symver__) which should be reliable. + + * xz: + + - --threads=+1 or -T+1 is now a way to put xz into multi-threaded + mode while using only one worker thread. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + * Updated translations: Chinese (simplified), Korean, and Turkish. + + +5.3.4alpha (2022-11-15) + + * All fixes from 5.2.7 and 5.2.8. + + * liblzma: + + - Minor improvements to the threaded decoder. + + - Added CRC64 implementation that uses SSSE3, SSE4.1, and CLMUL + instructions on 32/64-bit x86 and E2K. On 32-bit x86 it's + not enabled unless --disable-assembler is used but then + the non-CLMUL code might be slower. Processor support is + detected at runtime so this is built by default on x86-64 + and E2K. On these platforms, if compiler flags indicate + unconditional CLMUL support (-msse4.1 -mpclmul) then the + generic version is not built, making liblzma 8-9 KiB smaller + compared to having both versions included. + + With extremely compressible files this can make decompression + up to twice as fast but with typical files 5 % improvement + is a more realistic expectation. + + The CLMUL version is slower than the generic version with + tiny inputs (especially at 1-8 bytes per call, but up to + 16 bytes). In normal use in xz this doesn't matter at all. + + - Added an experimental ARM64 filter. This is *not* the final + version! Files created with this experimental version won't + be supported in the future versions! The filter design is + a compromise where improving one use case makes some other + cases worse. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. See the + API docs of lzma_lzip_decoder() for details. Also + lzma_auto_decoder() supports .lz files. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)) + + * xz: + + - Added support for OpenBSD's pledge(2) as a sandboxing method. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added --experimental-arm64. This will be renamed once the + filter is finished. Files created with this experimental + filter will not be supported in the future! + + - Added new fields to the output of xz --robot --info-memory. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + * Scripts now support the .lz format using xz. + + * Build systems: + + - New #defines in config.h: HAVE_ENCODER_ARM64, + HAVE_DECODER_ARM64, HAVE_LZIP_DECODER, HAVE_CPUID_H, + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR, HAVE_USABLE_CLMUL + + - New configure options: --disable-clmul-crc, + --disable-microlzma, --disable-lzip-decoder, and + 'pledge' is now an option in --enable-sandbox (but + it's autodetected by default anyway). + + - INSTALL was updated to document the new configure options. + + - PACKAGERS now lists also --disable-microlzma and + --disable-lzip-decoder as configure options that must + not be used in builds for non-embedded use. + + * Tests: + + - Fix some of the tests so that they skip instead of fail if + certain features have been disabled with configure options. + It's still not perfect. + + - Other improvements to tests. + + * Updated translations: Croatian, Finnish, Hungarian, Polish, + Romanian, Spanish, Swedish, and Ukrainian. + + +5.3.3alpha (2022-08-22) + + * All fixes from 5.2.6. + + * liblzma: + + - Fixed 32-bit build. + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default limit is 1400 MiB on all 32-bit + platforms with -T0. + + Now xz -T0 should just work. It might use too few threads + in some cases but at least it shouldn't easily run out of + memory. It's possible that this will be tweaked before 5.4.0. + + - Changes to --memlimit-compress and --no-adjust: + + In single-threaded mode, --memlimit-compress can make xz + scale down the LZMA2 dictionary size to meet the memory usage + limit. This obviously affects the compressed output. However, + if xz was in threaded mode, --memlimit-compress could make xz + reduce the number of threads but it wouldn't make xz switch + from multi-threaded mode to single-threaded mode or scale + down the LZMA2 dictionary size. This seemed illogical. + + Now --memlimit-compress can make xz switch to single-threaded + mode if one thread in multi-threaded mode uses too much + memory. If memory usage is still too high, then the LZMA2 + dictionary size can be scaled down too. + + The option --no-adjust was also changed so that it no longer + prevents xz from scaling down the number of threads as that + doesn't affect compressed output (only performance). After + this commit --no-adjust only prevents adjustments that affect + compressed output, that is, with --no-adjust xz won't switch + from multithreaded mode to single-threaded mode and won't + scale down the LZMA2 dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + * Tests: + + - Added a few more tests. + + - Added tests/code_coverage.sh to create a code coverage report + of the tests. + + * Build systems: + + - Automake's parallel test harness is now used to make tests + finish faster. + + - Added the CMake files to the distribution tarball. These were + supposed to be in 5.2.5 already. + + - Added liblzma tests to the CMake build. + + - Windows: Fix building of liblzma.dll with the included + Visual Studio project files. + + +5.3.2alpha (2021-10-28) + + This release was made on short notice so that recent erofs-utils can + be built with LZMA support without needing a snapshot from xz.git. + Thus many pending things were not included, not even updated + translations (which would need to be updated for the new --list + strings anyway). + + * All fixes from 5.2.5. + + * xz: + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - Split the long strings used in --list and --info-memory modes + to make them much easier for translators. + + - If built with sandbox support and enabling the sandbox fails, + xz will now immediately exit with exit status of 1. Previously + it would only display a warning if -vv was used. + + - Cap --memlimit-compress to 2000 MiB on MIPS32 because on + MIPS32 userspace processes are limited to 2 GiB of address + space. + + * liblzma: + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + The API is in lzma/container.h. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded. + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added fuzzing support. + + - Support Intel Control-flow Enforcement Technology (CET) in + 32-bit x86 assembly files. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * Scripts: + + - Fix exit status of xzdiff/xzcmp. Exit status could be 2 when + the correct value is 1. + + - Fix exit status of xzgrep. + + - Detect corrupt .bz2 files in xzgrep. + + - Add zstd support to xzgrep and xzdiff/xzcmp. + + - Fix less(1) version detection in xzless. It failed if the + version number from "less -V" contained a dot. + + * Fix typos and technical issues in man pages. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. It might still need a few + more fixes even for liblzma-only builds. + + +5.3.1alpha (2018-04-29) + + * All fixes from 5.2.4. + + * Add lzma_file_info_decoder() into liblzma and use it in xz to + implement the --list feature. + + * Capsicum sandbox support is enabled by default where available + (FreeBSD >= 10). + + +5.2.10 (2022-12-13) + + * xz: Don't modify argv[] when parsing the --memlimit* and + --block-list command line options. This fixes confusing + arguments in process listing (like "ps auxf"). + + * GNU/Linux only: Use __has_attribute(__symver__) to detect if + that attribute is supported. This fixes build on Mandriva where + Clang is patched to define __GNUC__ to 11 by default (instead + of 4 as used by Clang upstream). + + +5.2.9 (2022-11-30) + + * liblzma: + + - Fixed an infinite loop in LZMA encoder initialization + if dict_size >= 2 GiB. (The encoder only supports up + to 1536 MiB.) + + - Fixed two cases of invalid free() that can happen if + a tiny allocation fails in encoder re-initialization + or in lzma_filters_update(). These bugs had some + similarities with the bug fixed in 5.2.7. + + - Fixed lzma_block_encoder() not allowing the use of + LZMA_SYNC_FLUSH with lzma_code() even though it was + documented to be supported. The sync-flush code in + the Block encoder was already used internally via + lzma_stream_encoder(), so this was just a missing flag + in the lzma_block_encoder() API function. + + - GNU/Linux only: Don't put symbol versions into static + liblzma as it breaks things in some cases (and even if + it didn't break anything, symbol versions in static + libraries are useless anyway). The downside of the fix + is that if the configure options --with-pic or --without-pic + are used then it's not possible to build both shared and + static liblzma at the same time on GNU/Linux anymore; + with those options --disable-static or --disable-shared + must be used too. + + * New email address for bug reports is which + forwards messages to Lasse Collin and Jia Tan. + + +5.2.8 (2022-11-13) + + * xz: + + - If xz cannot remove an input file when it should, this + is now treated as a warning (exit status 2) instead of + an error (exit status 1). This matches GNU gzip and it + is more logical as at that point the output file has + already been successfully closed. + + - Fix handling of .xz files with an unsupported check type. + Previously such printed a warning message but then xz + behaved as if an error had occurred (didn't decompress, + exit status 1). Now a warning is printed, decompression + is done anyway, and exit status is 2. This used to work + slightly before 5.0.0. In practice this bug matters only + if xz has been built with some check types disabled. As + instructed in PACKAGERS, such builds should be done in + special situations only. + + - Fix "xz -dc --single-stream tests/files/good-0-empty.xz" + which failed with "Internal error (bug)". That is, + --single-stream was broken if the first .xz stream in + the input file didn't contain any uncompressed data. + + - Fix displaying file sizes in the progress indicator when + working in passthru mode and there are multiple input files. + Just like "gzip -cdf", "xz -cdf" works like "cat" when the + input file isn't a supported compressed file format. In + this case the file size counters weren't reset between + files so with multiple input files the progress indicator + displayed an incorrect (too large) value. + + * liblzma: + + - API docs in lzma/container.h: + * Update the list of decoder flags in the decoder + function docs. + * Explain LZMA_CONCATENATED behavior with .lzma files + in lzma_auto_decoder() docs. + + - OpenBSD: Use HW_NCPUONLINE to detect the number of + available hardware threads in lzma_physmem(). + + - Fix use of wrong macro to detect x86 SSE2 support. + __SSE2_MATH__ was used with GCC/Clang but the correct + one is __SSE2__. The first one means that SSE2 is used + for floating point math which is irrelevant here. + The affected SSE2 code isn't used on x86-64 so this affects + only 32-bit x86 builds that use -msse2 without -mfpmath=sse + (there is no runtime detection for SSE2). It improves LZMA + compression speed (not decompression). + + - Fix the build with Intel C compiler 2021 (ICC, not ICX) + on Linux. It defines __GNUC__ to 10 but doesn't support + the __symver__ attribute introduced in GCC 10. + + * Scripts: Ignore warnings from xz by using --quiet --no-warn. + This is needed if the input .xz files use an unsupported + check type. + + * Translations: + + - Updated Croatian and Turkish translations. + + - One new translations wasn't included because it needed + technical fixes. It will be in upcoming 5.4.0. No new + translations will be added to the 5.2.x branch anymore. + + - Renamed the French man page translation file from + fr_FR.po to fr.po and thus also its install directory + (like /usr/share/man/fr_FR -> .../fr). + + - Man page translations for upcoming 5.4.0 are now handled + in the Translation Project. + + * Update doc/faq.txt a little so it's less out-of-date. + + +5.2.7 (2022-09-30) + + * liblzma: + + - Made lzma_filters_copy() to never modify the destination + array if an error occurs. lzma_stream_encoder() and + lzma_stream_encoder_mt() already assumed this. Before this + change, if a tiny memory allocation in lzma_filters_copy() + failed it would lead to a crash (invalid free() or invalid + memory reads) in the cleanup paths of these two encoder + initialization functions. + + - Added missing integer overflow check to lzma_index_append(). + This affects xz --list and other applications that decode + the Index field from .xz files using lzma_index_decoder(). + Normal decompression of .xz files doesn't call this code + and thus most applications using liblzma aren't affected + by this bug. + + - Single-threaded .xz decoder (lzma_stream_decoder()): If + lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible + to use lzma_memlimit_set() to increase the limit and continue + decoding. This was supposed to work from the beginning + but there was a bug. With other decoders (.lzma or + threaded .xz decoder) this already worked correctly. + + - Fixed accumulation of integrity check type statistics in + lzma_index_cat(). This bug made lzma_index_checks() return + only the type of the integrity check of the last Stream + when multiple lzma_indexes were concatenated. Most + applications don't use these APIs but in xz it made + xz --list not list all check types from concatenated .xz + files. In xz --list --verbose only the per-file "Check:" + lines were affected and in xz --robot --list only the "file" + line was affected. + + - Added ABI compatibility with executables that were linked + against liblzma in RHEL/CentOS 7 or other liblzma builds + that had copied the problematic patch from RHEL/CentOS 7 + (xz-5.2.2-compat-libs.patch). For the details, see the + comment at the top of src/liblzma/validate_map.sh. + + WARNING: This uses __symver__ attribute with GCC >= 10. + In other cases the traditional __asm__(".symver ...") + is used. Using link-time optimization (LTO, -flto) with + GCC versions older than 10 can silently result in + broken liblzma.so.5 (incorrect symbol versions)! If you + want to use -flto with GCC, you must use GCC >= 10. + LTO with Clang seems to work even with the traditional + __asm__(".symver ...") method. + + * xzgrep: Fixed compatibility with old shells that break if + comments inside command substitutions have apostrophes ('). + This problem was introduced in 5.2.6. + + * Build systems: + + - New #define in config.h: HAVE_SYMBOL_VERSIONS_LINUX + + - Windows: Fixed liblzma.dll build with Visual Studio project + files. It broke in 5.2.6 due to a change that was made to + improve CMake support. + + - Windows: Building liblzma with UNICODE defined should now + work. + + - CMake files are now actually included in the release tarball. + They should have been in 5.2.5 already. + + - Minor CMake fixes and improvements. + + * Added a new translation: Turkish + + +5.2.6 (2022-08-12) + + * xz: + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - Cap --memlimit-compress to 2000 MiB instead of 4020 MiB on + MIPS32 because on MIPS32 userspace processes are limited + to 2 GiB of address space. + + * liblzma: + + - Fixed a missing error-check in the threaded encoder. If a + small memory allocation fails, a .xz file with an invalid + Index field would be created. Decompressing such a file would + produce the correct output but result in an error at the end. + Thus this is a "mild" data corruption bug. Note that while + a failed memory allocation can trigger the bug, it cannot + cause invalid memory access. + + - The decoder for .lzma files now supports files that have + uncompressed size stored in the header and still use the + end of payload marker (end of stream marker) at the end + of the LZMA stream. Such files are rare but, according to + the documentation in LZMA SDK, they are valid. + doc/lzma-file-format.txt was updated too. + + - Improved 32-bit x86 assembly files: + * Support Intel Control-flow Enforcement Technology (CET) + * Use non-executable stack on FreeBSD. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * xzgrep: + + - Fixed arbitrary command injection via a malicious filename + (CVE-2022-1271, ZDI-CAN-16587). A standalone patch for + this was released to the public on 2022-04-07. A slight + robustness improvement has been made since then and, if + using GNU or *BSD grep, a new faster method is now used + that doesn't use the old sed-based construct at all. This + also fixes bad output with GNU grep >= 3.5 (2020-09-27) + when xzgrepping binary files. + + This vulnerability was discovered by: + cleemy desu wayo working with Trend Micro Zero Day Initiative + + - Fixed detection of corrupt .bz2 files. + + - Improved error handling to fix exit status in some situations + and to fix handling of signals: in some situations a signal + didn't make xzgrep exit when it clearly should have. It's + possible that the signal handling still isn't quite perfect + but hopefully it's good enough. + + - Documented exit statuses on the man page. + + - xzegrep and xzfgrep now use "grep -E" and "grep -F" instead + of the deprecated egrep and fgrep commands. + + - Fixed parsing of the options -E, -F, -G, -P, and -X. The + problem occurred when multiple options were specied in + a single argument, for example, + + echo foo | xzgrep -Fe foo + + treated foo as a filename because -Fe wasn't correctly + split into -F -e. + + - Added zstd support. + + * xzdiff/xzcmp: + + - Fixed wrong exit status. Exit status could be 2 when the + correct value is 1. + + - Documented on the man page that exit status of 2 is used + for decompression errors. + + - Added zstd support. + + * xzless: + + - Fix less(1) version detection. It failed if the version number + from "less -V" contained a dot. + + * Translations: + + - Added new translations: Catalan, Croatian, Esperanto, + Korean, Portuguese, Romanian, Serbian, Spanish, Swedish, + and Ukrainian + + - Updated the Brazilian Portuguese translation. + + - Added French man page translation. This and the existing + German translation aren't complete anymore because the + English man pages got a few updates and the translators + weren't reached so that they could update their work. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. Building static or shared + liblzma should work fine in most cases. In contrast, building + the command line tools with CMake is still clearly incomplete + and experimental and should be used for testing only. + + +5.2.5 (2020-03-17) + + * liblzma: + + - Fixed several C99/C11 conformance bugs. Now the code is clean + under gcc/clang -fsanitize=undefined. Some of these changes + might have a negative effect on performance with old GCC + versions or compilers other than GCC and Clang. The configure + option --enable-unsafe-type-punning can be used to (mostly) + restore the old behavior but it shouldn't normally be used. + + - Improved API documentation of lzma_properties_decode(). + + - Added a very minor encoder speed optimization. + + * xz: + + - Fixed a crash in "xz -dcfv not_an_xz_file". All four options + were required to trigger it. The crash occurred in the + progress indicator code when xz was in passthru mode where + xz works like "cat". + + - Fixed an integer overflow with 32-bit off_t. It could happen + when decompressing a file that has a long run of zero bytes + which xz would try to write as a sparse file. Since the build + system enables large file support by default, off_t is + normally 64-bit even on 32-bit systems. + + - Fixes for --flush-timeout: + * Fix semi-busy-waiting. + * Avoid unneeded flushes when no new input has arrived + since the previous flush was completed. + + - Added a special case for 32-bit xz: If --memlimit-compress is + used to specify a limit that exceeds 4020 MiB, the limit will + be set to 4020 MiB. The values "0" and "max" aren't affected + by this and neither is decompression. This hack can be + helpful when a 32-bit xz has access to 4 GiB address space + but the specified memlimit exceeds 4 GiB. This can happen + e.g. with some scripts. + + - Capsicum sandbox is now enabled by default where available + (FreeBSD >= 10). The sandbox debug messages (xz -vv) were + removed since they seemed to be more annoying than useful. + + - DOS build now requires DJGPP 2.05 instead of 2.04beta. + A workaround for a locale problem with DJGPP 2.05 was added. + + * xzgrep and other scripts: + + - Added a configure option --enable-path-for-scripts=PREFIX. + It is disabled by default except on Solaris where the default + is /usr/xpg4/bin. See INSTALL for details. + + - Added a workaround for a POSIX shell detection problem on + Solaris. + + * Build systems: + + - Added preliminary build instructions for z/OS. See INSTALL + section 1.2.9. + + - Experimental CMake support was added. It should work to build + static liblzma on a few operating systems. It may or may not + work to build shared liblzma. On some platforms it can build + xz and xzdec too but those are only for testing. See the + comment in the beginning of CMakeLists.txt for details. + + - Visual Studio project files were updated. + WindowsTargetPlatformVersion was removed from VS2017 files + and set to "10.0" in the added VS2019 files. In the future + the VS project files will be removed when CMake support is + good enough. + + - New #defines in config.h: HAVE___BUILTIN_ASSUME_ALIGNED, + HAVE___BUILTIN_BSWAPXX, and TUKLIB_USE_UNSAFE_TYPE_PUNNING. + + - autogen.sh has a new optional dependency on po4a and a new + option --no-po4a to skip that step. This matters only if one + wants to remake the build files. po4a is used to update the + translated man pages but as long as the man pages haven't + been modified, there's nothing to update and one can use + --no-po4a to avoid the dependency on po4a. + + * Translations: + + - XZ Utils translations are now handled by the Translation + Project: https://translationproject.org/domain/xz.html + + - All man pages are now included in German too. + + - New xz translations: Brazilian Portuguese, Finnish, + Hungarian, Chinese (simplified), Chinese (traditional), + and Danish (partial translation) + + - Updated xz translations: French, German, Italian, and Polish + + - Unfortunately a few new xz translations weren't included due + to technical problems like too long lines in --help output or + misaligned column headings in tables. In the future, many of + these strings will be split and e.g. the table column + alignment will be handled in software. This should make the + strings easier to translate. + + +5.2.4 (2018-04-29) + + * liblzma: + + - Allow 0 as memory usage limit instead of returning + LZMA_PROG_ERROR. Now 0 is treated as if 1 byte was specified, + which effectively is the same as 0. + + - Use "noexcept" keyword instead of "throw()" in the public + headers when a C++11 (or newer standard) compiler is used. + + - Added a portability fix for recent Intel C Compilers. + + - Microsoft Visual Studio build files have been moved under + windows/vs2013 and windows/vs2017. + + * xz: + + - Fix "xz --list --robot missing_or_bad_file.xz" which would + try to print an uninitialized string and thus produce garbage + output. Since the exit status is non-zero, most uses of such + a command won't try to interpret the garbage output. + + - "xz --list foo.xz" could print "Internal error (bug)" in a + corner case where a specific memory usage limit had been set. + + +5.2.3 (2016-12-30) + + * xz: + + - Always close a file before trying to delete it to avoid + problems on some operating system and file system combinations. + + - Fixed copying of file timestamps on Windows. + + - Added experimental (disabled by default) sandbox support using + Capsicum (FreeBSD >= 10). See --enable-sandbox in INSTALL. + + * C99/C11 conformance fixes to liblzma. The issues affected at least + some builds using link-time optimizations. + + * Fixed bugs in the rarely-used function lzma_index_dup(). + + * Use of external SHA-256 code is now disabled by default. + It can still be enabled by passing --enable-external-sha256 + to configure. The reasons to disable it by default (see INSTALL + for more details): + + - Some OS-specific SHA-256 implementations conflict with + OpenSSL and cause problems in programs that link against both + liblzma and libcrypto. At least FreeBSD 10 and MINIX 3.3.0 + are affected. + + - The internal SHA-256 is faster than the SHA-256 code in + some operating systems. + + * Changed CPU core count detection to use sched_getaffinity() on + GNU/Linux and GNU/kFreeBSD. + + * Fixes to the build-system and xz to make xz buildable even when + encoders, decoders, or threading have been disabled from libilzma + using configure options. These fixes added two new #defines to + config.h: HAVE_ENCODERS and HAVE_DECODERS. + + +5.2.2 (2015-09-29) + + * Fixed bugs in QNX-specific code. + + * Omitted the use of pipe2() even if it is available to avoid + portability issues with some old Linux and glibc combinations. + + * Updated German translation. + + * Added project files to build static and shared liblzma (not the + whole XZ Utils) with Visual Studio 2013 update 2 or later. + + * Documented that threaded decompression hasn't been implemented + yet. A 5.2.0 NEWS entry describing multi-threading support had + incorrectly said "decompression" when it should have said + "compression". + + +5.2.1 (2015-02-26) + + * Fixed a compression-ratio regression in fast mode of LZMA1 and + LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases. + + * Fixed a portability problem in xz that affected at least OpenBSD. + + * Fixed xzdiff to be compatible with FreeBSD's mktemp which differs + from most other mktemp implementations. + + * Changed CPU core count detection to use cpuset_getaffinity() on + FreeBSD. + + +5.2.0 (2014-12-21) + + Since 5.1.4beta: + + * All fixes from 5.0.8 + + * liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset + was used. + + * xzdiff: If mktemp isn't installed, mkdir will be used as + a fallback to create a temporary directory. Installing mktemp + is still recommended. + + * Updated French, German, Italian, Polish, and Vietnamese + translations. + + Summary of fixes and new features added in the 5.1.x development + releases: + + * liblzma: + + - Added support for multi-threaded compression. See the + lzma_mt structure, lzma_stream_encoder_mt(), and + lzma_stream_encoder_mt_memusage() in , + lzma_get_progress() in , and lzma_cputhreads() + in for details. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for LZMA_IGNORE_CHECK. + + - A few speed optimizations were made. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - liblzma (not the whole XZ Utils) should now be buildable + with MSVC 2013 update 2 or later using windows/config.h. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Multi-threaded compression can be enabled with the + --threads (-T) option. + [Fixed: This originally said "decompression".] + + - New command line options in xz: --single-stream, + --block-size=SIZE, --block-list=SIZES, + --flush-timeout=TIMEOUT, and --ignore-check. + + - xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported + .xz files except files with empty LZMA2 streams require 5.0.2. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + +5.1.4beta (2014-09-14) + + * All fixes from 5.0.6 + + * liblzma: Fixed the use of presets in threaded encoder + initialization. + + * xz --block-list and --block-size can now be used together + in single-threaded mode. Previously the combination only + worked in multi-threaded mode. + + * Added support for LZMA_IGNORE_CHECK to liblzma and made it + available in xz as --ignore-check. + + * liblzma speed optimizations: + + - Initialization of a new LZMA1 or LZMA2 encoder has been + optimized. (The speed of reinitializing an already-allocated + encoder isn't affected.) This helps when compressing many + small buffers with lzma_stream_buffer_encode() and other + similar situations where an already-allocated encoder state + isn't reused. This speed-up is visible in xz too if one + compresses many small files one at a time instead running xz + once and giving all files as command-line arguments. + + - Buffer comparisons are now much faster when unaligned access + is allowed (configured with --enable-unaligned-access). This + speeds up encoding significantly. There is arch-specific code + for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best + results and there's no run-time CPU detection for now). + For other archs there is only generic code which probably + isn't as optimal as arch-specific solutions could be. + + - A few speed optimizations were made to the SHA-256 code. + (Note that the builtin SHA-256 code isn't used on all + operating systems.) + + * liblzma can now be built with MSVC 2013 update 2 or later + using windows/config.h. + + * Vietnamese translation was added. + + +5.1.3alpha (2013-10-26) + + * All fixes from 5.0.5 + + * liblzma: + + - Fixed a deadlock in the threaded encoder. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for native threads on Windows and the ability + to detect the number of CPU cores. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Made the progress indicator work correctly in threaded mode. + + - Threaded encoder now works together with --block-list=SIZES. + + - Added preliminary support for --flush-timeout=TIMEOUT. + It can be useful for (somewhat) real-time streaming. For + now the decompression side has to be done with something + else than the xz tool due to how xz does buffering, but this + should be fixed. + + +5.1.2alpha (2012-07-04) + + * All fixes from 5.0.3 and 5.0.4 + + * liblzma: + + - Fixed a deadlock and an invalid free() in the threaded encoder. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - Use SHA-256 implementation from the operating system if one is + available in libc, libmd, or libutil. liblzma won't use e.g. + OpenSSL or libgcrypt to avoid introducing new dependencies. + + - Fixed liblzma.pc for static linking. + + - Fixed a few portability bugs. + + * xz --decompress --single-stream now fixes the input position after + successful decompression. Now the following works: + + echo foo | xz > foo.xz + echo bar | xz >> foo.xz + ( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz + + Note that it doesn't work if the input is not seekable + or if there is Stream Padding between the concatenated + .xz Streams. + + * xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported .xz + files except files with empty LZMA2 streams require 5.0.2. + + * Added an *incomplete* implementation of --block-list=SIZES to xz. + It only works correctly in single-threaded mode and when + --block-size isn't used at the same time. --block-list allows + specifying the sizes of Blocks which can be useful e.g. when + creating files for random-access reading. + + +5.1.1alpha (2011-04-12) + + * All fixes from 5.0.2 + + * liblzma fixes that will also be included in 5.0.3: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Support for multithreaded compression was added using the simplest + method, which splits the input data into blocks and compresses + them independently. Other methods will be added in the future. + The current method has room for improvement, e.g. it is possible + to reduce the memory usage. + + * Added the options --single-stream and --block-size=SIZE to xz. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + * Support for short 8.3 filenames under DOS was added to xz. It is + experimental and may change before it gets into a stable release. + + +5.0.8 (2014-12-21) + + * Fixed an old bug in xzgrep that affected OpenBSD and probably + a few other operating systems too. + + * Updated French and German translations. + + * Added support for detecting the amount of RAM on AmigaOS/AROS. + + * Minor build system updates. + + +5.0.7 (2014-09-20) + + * Fix regressions introduced in 5.0.6: + + - Fix building with non-GNU make. + + - Fix invalid Libs.private value in liblzma.pc which broke + static linking against liblzma if the linker flags were + taken from pkg-config. + + +5.0.6 (2014-09-14) + + * xzgrep now exits with status 0 if at least one file matched. + + * A few minor portability and build system fixes + + +5.0.5 (2013-06-30) + + * lzmadec and liblzma's lzma_alone_decoder(): Support decompressing + .lzma files that have less common settings in the headers + (dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed + size greater than 256 GiB). The limitations existed to avoid false + positives when detecting .lzma files. The lc + lp <= 4 limitation + still remains since liblzma's LZMA decoder has that limitation. + + NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT + affected by this change. They still consider uncommon .lzma headers + as not being in the .lzma format. Changing this would give way too + many false positives. + + * xz: + + - Interaction of preset and custom filter chain options was + made less illogical. This affects only certain less typical + uses cases so few people are expected to notice this change. + + Now when a custom filter chain option (e.g. --lzma2) is + specified, all preset options (-0 ... -9, -e) earlier are on + the command line are completely forgotten. Similarly, when + a preset option is specified, all custom filter chain options + earlier on the command line are completely forgotten. + + Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e" + which is equivalent to "xz -6e". Earlier -e didn't put xz back + into preset mode and thus the example command was equivalent + to "xz --lzma2=preset=5". + + Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to + "xz -7". Earlier a custom filter chain option didn't make + xz forget the -e option so the example was equivalent to + "xz -7e". + + - Fixes and improvements to error handling. + + - Various fixes to the man page. + + * xzless: Fixed to work with "less" versions 448 and later. + + * xzgrep: Made -h an alias for --no-filename. + + * Include the previously missing debug/translation.bash which can + be useful for translators. + + * Include a build script for Mac OS X. This has been in the Git + repository since 2010 but due to a mistake in Makefile.am the + script hasn't been included in a release tarball before. + + +5.0.4 (2012-06-22) + + * liblzma: + + - Fix lzma_index_init(). It could crash if memory allocation + failed. + + - Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ + filter is used and the application only provides exactly as + much output space as is the uncompressed size of the file. + + - Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't + check if the last call to lzma_code() really returned + LZMA_STREAM_END, which made the program think that truncated + files are valid. + + - New example programs in doc/examples (old programs are now in + doc/examples_old). These have more comments and more detailed + error handling. + + * Fix "xz -lvv foo.xz". It could crash on some corrupted files. + + * Fix output of "xz --robot -lv" and "xz --robot -lvv" which + incorrectly printed the filename also in the "foo (x/x)" format. + + * Fix exit status of "xzdiff foo.xz bar.xz". + + * Fix exit status of "xzgrep foo binary_file". + + * Fix portability to EBCDIC systems. + + * Fix a configure issue on AIX with the XL C compiler. See INSTALL + for details. + + * Update French, German, Italian, and Polish translations. + + +5.0.3 (2011-05-21) + + * liblzma fixes: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Fix command name detection in xzgrep. xzegrep and xzfgrep now + correctly use egrep and fgrep instead of grep. + + * French translation was added. + + +5.0.2 (2011-04-01) + + * LZMA2 decompressor now correctly accepts LZMA2 streams with no + uncompressed data. Previously it considered them corrupt. The + bug can affect applications that use raw LZMA2 streams. It is + very unlikely to affect .xz files because no compressor creates + .xz files with empty LZMA2 streams. (Empty .xz files are a + different thing than empty LZMA2 streams.) + + * "xz --suffix=.foo filename.foo" now refuses to compress the + file due to it already having the suffix .foo. It was already + documented on the man page, but the code lacked the test. + + * "xzgrep -l foo bar.xz" works now. + + * Polish translation was added. + + +5.0.1 (2011-01-29) + + * xz --force now (de)compresses files that have setuid, setgid, + or sticky bit set and files that have multiple hard links. + The man page had it documented this way already, but the code + had a bug. + + * gzip and bzip2 support in xzdiff was fixed. + + * Portability fixes + + * Minor fix to Czech translation + + +5.0.0 (2010-10-23) + + Only the most important changes compared to 4.999.9beta are listed + here. One change is especially important: + + * The memory usage limit is now disabled by default. Some scripts + written before this change may have used --memory=max on xz command + line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED + NOW, because they interfere with user's ability to set the memory + usage limit himself. If user-specified limit causes problems to + your script, blame the user. + + Other significant changes: + + * Added support for XZ_DEFAULTS environment variable. This variable + allows users to set default options for xz, e.g. default memory + usage limit or default compression level. Scripts that use xz + must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT + instead if they need a way to pass options to xz via an + environment variable. + + * The compression settings associated with the preset levels + -0 ... -9 have been changed. --extreme was changed a little too. + It is now less likely to make compression worse, but with some + files the new --extreme may compress slightly worse than the old + --extreme. + + * If a preset level (-0 ... -9) is specified after a custom filter + chain options have been used (e.g. --lzma2), the custom filter + chain will be forgotten. Earlier the preset options were + completely ignored after custom filter chain options had been + seen. + + * xz will create sparse files when decompressing if the uncompressed + data contains long sequences of binary zeros. This is done even + when writing to standard output that is connected to a regular + file and certain additional conditions are met to make it safe. + + * Support for "xz --list" was added. Combine with --verbose or + --verbose --verbose (-vv) for detailed output. + + * I had hoped that liblzma API would have been stable after + 4.999.9beta, but there have been a couple of changes in the + advanced features, which don't affect most applications: + + - Index handling code was revised. If you were using the old + API, you will get a compiler error (so it's easy to notice). + + - A subtle but important change was made to the Block handling + API. lzma_block.version has to be initialized even for + lzma_block_header_decode(). Code that doesn't do it will work + for now, but might break in the future, which makes this API + change easy to miss. + + * The major soname has been bumped to 5.0.0. liblzma API and ABI + are now stable, so the need to recompile programs linking against + liblzma shouldn't arise soon. + diff --git a/PACKAGERS b/PACKAGERS new file mode 100644 index 0000000..b3b0509 --- /dev/null +++ b/PACKAGERS @@ -0,0 +1,233 @@ + +Information to packagers of XZ Utils +==================================== + + 0. Preface + 1. Package naming + 2. Package description + 3. License + 4. configure options + 5. Additional documentation + 6. Extra files + 7. Installing XZ Utils and LZMA Utils in parallel + 8. Example + + +0. Preface +---------- + + This document is meant for people who create and maintain XZ Utils + packages for operating system distributions. The focus is on GNU/Linux + systems, but most things apply to other systems too. + + While the standard "configure && make DESTDIR=$PKG install" should + give a pretty good package, there are some details which packagers + may want to tweak. + + Packagers should also read the INSTALL file. + + +1. Package naming +----------------- + + The preferred name for the XZ Utils package is "xz", because that's + the name of the upstream tarball. Naturally you may have good reasons + to use some other name; I won't get angry about it. ;-) It's just nice + to be able to point people to the correct package name without asking + what distro they have. + + If your distro policy is to split things into small pieces, here is + one suggestion: + + xz xz, xzdec, scripts (xzdiff, xzgrep, etc.), docs + xz-lzma lzma, unlzma, lzcat, lzgrep etc. symlinks and + lzmadec binary for compatibility with LZMA Utils + liblzma liblzma.so.* + liblzma-devel liblzma.so, liblzma.a, API headers + + +2. Package description +---------------------- + + Here is a suggestion which you may use as the package description. + If you can use only one-line description, pick only the first line. + Naturally, feel free to use some other description if you find it + better, and maybe send it to me too. + + Library and command line tools for XZ and LZMA compressed files + + XZ Utils provide a general purpose data compression library + and command line tools. The native file format is the .xz + format, but also the legacy .lzma format is supported. The .xz + format supports multiple compression algorithms, of which LZMA2 + is currently the primary algorithm. With typical files, XZ Utils + create about 30 % smaller files than gzip. + + If you are splitting XZ Utils into multiple packages, here are some + suggestions for package descriptions: + + xz: + + Command line tools for XZ and LZMA compressed files + + This package includes the xz compression tool and other command + line tools from XZ Utils. xz has command line syntax similar to + that of gzip. The native file format is the .xz format, but also + the legacy .lzma format is supported. The .xz format supports + multiple compression algorithms, of which LZMA2 is currently the + primary algorithm. With typical files, XZ Utils create about 30 % + smaller files than gzip. + + Note that this package doesn't include the files needed for + LZMA Utils 4.32.x compatibility. Install also the xz-lzma + package to make XZ Utils emulate LZMA Utils 4.32.x. + + xz-lzma: + + LZMA Utils emulation with XZ Utils + + This package includes executables and symlinks to make + XZ Utils emulate lzma, unlzma, lzcat, and other command + line tools found from the legacy LZMA Utils 4.32.x package. + + liblzma: + + Library for XZ and LZMA compressed files + + liblzma is a general purpose data compression library with + an API similar to that of zlib. liblzma supports multiple + algorithms, of which LZMA2 is currently the primary algorithm. + The native file format is .xz, but also the legacy .lzma + format and raw streams (no headers at all) are supported. + + This package includes the shared library. + + liblzma-devel: + + Library for XZ and LZMA compressed files + + This package includes the API headers, static library, and + other development files related to liblzma. + + +3. License +---------- + + If the package manager supports a license field, you probably should + put GPLv2+ there (GNU GPL v2 or later). The interesting parts of + XZ Utils are in the public domain, but some less important files + ending up into the binary package are under GPLv2+. So it is simplest + to just say GPLv2+ if you cannot specify "public domain and GPLv2+". + + If you split XZ Utils into multiple packages as described earlier + in this file, liblzma and liblzma-dev packages will contain only + public domain code (from XZ Utils at least; compiler or linker may + add some third-party code, which may be copyrighted). + + +4. configure options +-------------------- + + Unless you are building a package for a distribution that is meant + only for embedded systems, don't use the following configure options: + + --enable-debug + --enable-encoders (*) + --enable-decoders + --enable-match-finders + --enable-checks + --enable-small (*) + --disable-threads (*) + --disable-microlzma (*) + --disable-lzip-decoder (*) + + (*) These are OK when building xzdec and lzmadec as described + in INSTALL. + + xzdec and lzmadec don't provide any functionality that isn't already + available in the xz tool. Shipping xzdec and lzmadec without size + optimization and statically-linked liblzma isn't very useful. Doing + that would give users the xzdec man page, which may make it easier + for people to find out that such tools exists, but the executables + wouldn't have any advantage over the full-featured xz. + + +5. Additional documentation +--------------------------- + + "make install" copies some additional documentation to $docdir + (--docdir in configure). There is a copy of the GNU GPL v2, which + can be replaced with a symlink if your distro ships with shared + copies of the common license texts. + + liblzma API is currently only documented using Doxygen tags in the + API headers. It hasn't been tested much how good results Doxygen + is able to make from the tags (e.g. Doxyfile might need tweaking, + the tagging may need to be improved etc.), so it might be simpler + to just let people read docs directly from the .h files for now, + and also save quite a bit in package size at the same time. + + +6. Extra files +-------------- + + The "extra" directory contains some small extra tools or other files. + The exact set of extra files can vary between XZ Utils releases. The + extra files have only limited use or they are too dangerous to be + put directly to $bindir (7z2lzma.sh is a good example, since it can + silently create corrupt output if certain conditions are not met). + + If you feel like it, you may copy the extra directory under the doc + directory (e.g. /usr/share/doc/xz/extra). Maybe some people will find + them useful. However, most people needing these tools probably are + able to find them from the source package too. + + The "debug" directory contains some tools that are useful only when + hacking on XZ Utils. Don't package these tools. + + +7. Installing XZ Utils and LZMA Utils in parallel +------------------------------------------------- + + XZ Utils and LZMA Utils 4.32.x can be installed in parallel by + omitting the compatibility symlinks (lzma, unlzma, lzcat, lzgrep etc.) + from the XZ Utils package. It's probably a good idea to still package + the symlinks into a separate package so that users may choose if they + want to use XZ Utils or LZMA Utils for handling .lzma files. + + +8. Example +---------- + + Here is an example for i686 GNU/Linux that + - links xz and lzmainfo against shared liblzma; + - links size-optimized xzdec and lzmadec against static liblzma + while avoiding libpthread dependency; + - includes only shared liblzma in the final package; and + - copies also the "extra" directory to the package. + + PKG=/tmp/xz-pkg + tar xf xz-x.y.z.tar.gz + cd xz-x.y.z + ./configure \ + --prefix=/usr \ + --disable-static \ + --disable-xzdec \ + --disable-lzmadec \ + CFLAGS='-march=i686 -mtune=generic -O2' + make + make DESTDIR=$PKG install-strip + make clean + ./configure \ + --prefix=/usr \ + --disable-shared \ + --disable-nls \ + --disable-encoders \ + --enable-small \ + --disable-threads \ + CFLAGS='-march=i686 -mtune=generic -Os' + make -C src/liblzma + make -C src/xzdec + make -C src/xzdec DESTDIR=$PKG install-strip + cp -a extra $PKG/usr/share/doc/xz + diff --git a/README b/README new file mode 100644 index 0000000..b9081ed --- /dev/null +++ b/README @@ -0,0 +1,303 @@ + +XZ Utils +======== + + 0. Overview + 1. Documentation + 1.1. Overall documentation + 1.2. Documentation for command-line tools + 1.3. Documentation for liblzma + 2. Version numbering + 3. Reporting bugs + 4. Translations + 5. Other implementations of the .xz format + 6. Contact information + + +0. Overview +----------- + + XZ Utils provide a general-purpose data-compression library plus + command-line tools. The native file format is the .xz format, but + also the legacy .lzma format is supported. The .xz format supports + multiple compression algorithms, which are called "filters" in the + context of XZ Utils. The primary filter is currently LZMA2. With + typical files, XZ Utils create about 30 % smaller files than gzip. + + To ease adapting support for the .xz format into existing applications + and scripts, the API of liblzma is somewhat similar to the API of the + popular zlib library. For the same reason, the command-line tool xz + has a command-line syntax similar to that of gzip. + + When aiming for the highest compression ratio, the LZMA2 encoder uses + a lot of CPU time and may use, depending on the settings, even + hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder + competes with bzip2 in compression speed, RAM usage, and compression + ratio. + + LZMA2 is reasonably fast to decompress. It is a little slower than + gzip, but a lot faster than bzip2. Being fast to decompress means + that the .xz format is especially nice when the same file will be + decompressed very many times (usually on different computers), which + is the case e.g. when distributing software packages. In such + situations, it's not too bad if the compression takes some time, + since that needs to be done only once to benefit many people. + + With some file types, combining (or "chaining") LZMA2 with an + additional filter can improve the compression ratio. A filter chain may + contain up to four filters, although usually only one or two are used. + For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 + in the filter chain can improve compression ratio of executable files. + + Since the .xz format allows adding new filter IDs, it is possible that + some day there will be a filter that is, for example, much faster to + compress than LZMA2 (but probably with worse compression ratio). + Similarly, it is possible that some day there is a filter that will + compress better than LZMA2. + + XZ Utils supports multithreaded compression. XZ Utils doesn't support + multithreaded decompression yet. It has been planned though and taken + into account when designing the .xz file format. In the future, files + that were created in threaded mode can be decompressed in threaded + mode too. + + +1. Documentation +---------------- + +1.1. Overall documentation + + README This file + + INSTALL.generic Generic install instructions for those not familiar + with packages using GNU Autotools + INSTALL Installation instructions specific to XZ Utils + PACKAGERS Information to packagers of XZ Utils + + COPYING XZ Utils copyright and license information + COPYING.GPLv2 GNU General Public License version 2 + COPYING.GPLv3 GNU General Public License version 3 + COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1 + + AUTHORS The main authors of XZ Utils + THANKS Incomplete list of people who have helped making + this software + NEWS User-visible changes between XZ Utils releases + ChangeLog Detailed list of changes (commit log) + TODO Known bugs and some sort of to-do list + + Note that only some of the above files are included in binary + packages. + + +1.2. Documentation for command-line tools + + The command-line tools are documented as man pages. In source code + releases (and possibly also in some binary packages), the man pages + are also provided in plain text (ASCII only) and PDF formats in the + directory "doc/man" to make the man pages more accessible to those + whose operating system doesn't provide an easy way to view man pages. + + +1.3. Documentation for liblzma + + The liblzma API headers include short docs about each function + and data type as Doxygen tags. These docs should be quite OK as + a quick reference. + + There are a few example/tutorial programs that should help in + getting started with liblzma. In the source package the examples + are in "doc/examples" and in binary packages they may be under + "examples" in the same directory as this README. + + Since the liblzma API has similarities to the zlib API, some people + may find it useful to read the zlib docs and tutorial too: + + http://zlib.net/manual.html + http://zlib.net/zlib_how.html + + +2. Version numbering +-------------------- + + The version number format of XZ Utils is X.Y.ZS: + + - X is the major version. When this is incremented, the library + API and ABI break. + + - Y is the minor version. It is incremented when new features + are added without breaking the existing API or ABI. An even Y + indicates a stable release and an odd Y indicates unstable + (alpha or beta version). + + - Z is the revision. This has a different meaning for stable and + unstable releases: + + * Stable: Z is incremented when bugs get fixed without adding + any new features. This is intended to be convenient for + downstream distributors that want bug fixes but don't want + any new features to minimize the risk of introducing new bugs. + + * Unstable: Z is just a counter. API or ABI of features added + in earlier unstable releases having the same X.Y may break. + + - S indicates stability of the release. It is missing from the + stable releases, where Y is an even number. When Y is odd, S + is either "alpha" or "beta" to make it very clear that such + versions are not stable releases. The same X.Y.Z combination is + not used for more than one stability level, i.e. after X.Y.Zalpha, + the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. + + +3. Reporting bugs +----------------- + + Naturally it is easiest for me if you already know what causes the + unexpected behavior. Even better if you have a patch to propose. + However, quite often the reason for unexpected behavior is unknown, + so here are a few things to do before sending a bug report: + + 1. Try to create a small example how to reproduce the issue. + + 2. Compile XZ Utils with debugging code using configure switches + --enable-debug and, if possible, --disable-shared. If you are + using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting + binaries. + + 3. Turn on core dumps. The exact command depends on your shell; + for example in GNU bash it is done with "ulimit -c unlimited", + and in tcsh with "limit coredumpsize unlimited". + + 4. Try to reproduce the suspected bug. If you get "assertion failed" + message, be sure to include the complete message in your bug + report. If the application leaves a coredump, get a backtrace + using gdb: + $ gdb /path/to/app-binary # Load the app to the debugger. + (gdb) core core # Open the coredump. + (gdb) bt # Print the backtrace. Copy & paste to bug report. + (gdb) quit # Quit gdb. + + Report your bug via email or IRC (see Contact information below). + Don't send core dump files or any executables. If you have a small + example file(s) (total size less than 256 KiB), please include + it/them as an attachment. If you have bigger test files, put them + online somewhere and include a URL to the file(s) in the bug report. + + Always include the exact version number of XZ Utils in the bug report. + If you are using a snapshot from the git repository, use "git describe" + to get the exact snapshot version. If you are using XZ Utils shipped + in an operating system distribution, mention the distribution name, + distribution version, and exact xz package version; if you cannot + repeat the bug with the code compiled from unpatched source code, + you probably need to report a bug to your distribution's bug tracking + system. + + +4. Translations +--------------- + + The xz command line tool and all man pages can be translated. + The translations are handled via the Translation Project. If you + wish to help translating xz, please join the Translation Project: + + https://translationproject.org/html/translators.html + + Below are notes and testing instructions specific to xz + translations. + + Testing can be done by installing xz into a temporary directory: + + ./configure --disable-shared --prefix=/tmp/xz-test + # + make -C po update-po + make install + bash debug/translation.bash | less + bash debug/translation.bash | less -S # For --list outputs + + Repeat the above as needed (no need to re-run configure though). + + Note especially the following: + + - The output of --help and --long-help must look nice on + an 80-column terminal. It's OK to add extra lines if needed. + + - In contrast, don't add extra lines to error messages and such. + They are often preceded with e.g. a filename on the same line, + so you have no way to predict where to put a \n. Let the terminal + do the wrapping even if it looks ugly. Adding new lines will be + even uglier in the generic case even if it looks nice in a few + limited examples. + + - Be careful with column alignment in tables and table-like output + (--list, --list --verbose --verbose, --info-memory, --help, and + --long-help): + + * All descriptions of options in --help should start in the + same column (but it doesn't need to be the same column as + in the English messages; just be consistent if you change it). + Check that both --help and --long-help look OK, since they + share several strings. + + * --list --verbose and --info-memory print lines that have + the format "Description: %s". If you need a longer + description, you can put extra space between the colon + and %s. Then you may need to add extra space to other + strings too so that the result as a whole looks good (all + values start at the same column). + + * The columns of the actual tables in --list --verbose --verbose + should be aligned properly. Abbreviate if necessary. It might + be good to keep at least 2 or 3 spaces between column headings + and avoid spaces in the headings so that the columns stand out + better, but this is a matter of opinion. Do what you think + looks best. + + - Be careful to put a period at the end of a sentence when the + original version has it, and don't put it when the original + doesn't have it. Similarly, be careful with \n characters + at the beginning and end of the strings. + + - Read the TRANSLATORS comments that have been extracted from the + source code and included in xz.pot. Some comments suggest + testing with a specific command which needs an .xz file. You + may use e.g. any tests/files/good-*.xz. However, these test + commands are included in translations.bash output, so reading + translations.bash output carefully can be enough. + + - If you find language problems in the original English strings, + feel free to suggest improvements. Ask if something is unclear. + + - The translated messages should be understandable (sometimes this + may be a problem with the original English messages too). Don't + make a direct word-by-word translation from English especially if + the result doesn't sound good in your language. + + Thanks for your help! + + +5. Other implementations of the .xz format +------------------------------------------ + + 7-Zip and the p7zip port of 7-Zip support the .xz format starting + from the version 9.00alpha. + + http://7-zip.org/ + http://p7zip.sourceforge.net/ + + XZ Embedded is a limited implementation written for use in the Linux + kernel, but it is also suitable for other embedded use. + + https://tukaani.org/xz/embedded.html + + +6. Contact information +---------------------- + + If you have questions, bug reports, patches etc. related to XZ Utils, + the project maintainers Lasse Collin and Jia Tan can be reached via + . + + You might find Lasse also from #tukaani on Libera Chat (IRC). + The nick is Larhzu. The channel tends to be pretty quiet, + so just ask your question and someone might wake up. + diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..e7b62b3 --- /dev/null +++ b/THANKS @@ -0,0 +1,163 @@ + +Thanks +====== + +Some people have helped more, some less, but nevertheless everyone's help +has been important. :-) In alphabetical order: + - Mark Adler + - H. Peter Anvin + - Jeff Bastian + - Nelson H. F. Beebe + - Karl Beldan + - Karl Berry + - Anders F. Björklund + - Emmanuel Blot + - Melanie Blower + - Alexander Bluhm + - Martin Blumenstingl + - Ben Boeckel + - Jakub Bogusz + - Adam Borowski + - Maarten Bosmans + - Trent W. Buck + - Kevin R. Bulgrien + - James Buren + - David Burklund + - Daniel Mealha Cabrita + - Milo Casagrande + - Marek Černocký + - Tomer Chachamu + - Vitaly Chikunov + - Antoine Cœur + - Gabi Davar + - İhsan Doğan + - Chris Donawa + - Andrew Dudman + - Markus Duft + - İsmail Dönmez + - Paul Eggert + - Robert Elz + - Gilles Espinasse + - Denis Excoffier + - Michael Felt + - Michael Fox + - Mike Frysinger + - Daniel Richard G. + - Tomasz Gajc + - Bjarni Ingi Gislason + - John Paul Adrian Glaubitz + - Bill Glessner + - Michał Górny + - Jason Gorski + - Juan Manuel Guerrero + - Diederik de Haas + - Joachim Henke + - Christian Hesse + - Vincenzo Innocente + - Peter Ivanov + - Nicholas Jackson + - Sam James + - Hajin Jang + - Jouk Jansen + - Jun I Jin + - Kiyoshi Kanazawa + - Per Øyvind Karlsen + - Iouri Kharon + - Thomas Klausner + - Richard Koch + - Ville Koskinen + - Jan Kratochvil + - Christian Kujau + - Stephan Kulow + - Ilya Kurdyukov + - Peter Lawler + - James M Leddy + - Vincent Lefevre + - Hin-Tak Leung + - Andraž 'ruskie' Levstik + - Cary Lewis + - Wim Lewis + - Xin Li + - Eric Lindblad + - Lorenzo De Liso + - H.J. Lu + - Bela Lubkin + - Gregory Margo + - Julien Marrec + - Ed Maste + - Martin Matuška + - Ivan A. Melnikov + - Jim Meyering + - Arkadiusz Miskiewicz + - Nathan Moinvaziri + - Étienne Mollier + - Conley Moorhous + - Rafał Mużyło + - Adrien Nader + - Evan Nemerson + - Hongbo Ni + - Jonathan Nieder + - Andre Noll + - Peter O'Gorman + - Daniel Packard + - Filip Palian + - Peter Pallinger + - Rui Paulo + - Igor Pavlov + - Diego Elio Pettenò + - Elbert Pol + - Mikko Pouru + - Rich Prohaska + - Trần Ngọc Quân + - Pavel Raiskup + - Ole André Vadla Ravnås + - Eric S. Raymond + - Robert Readman + - Bernhard Reutner-Fischer + - Markus Rickert + - Cristian Rodríguez + - Christian von Roques + - Boud Roukema + - Torsten Rupp + - Stephen Sachs + - Jukka Salmi + - Alexandre Sauvé + - Benno Schulenberg + - Andreas Schwab + - Bhargava Shastry + - Dan Shechter + - Stuart Shelton + - Sebastian Andrzej Siewior + - Ville Skyttä + - Brad Smith + - Bruce Stark + - Pippijn van Steenhoven + - Jonathan Stott + - Dan Stromberg + - Jia Tan + - Vincent Torri + - Paul Townsend + - Mohammed Adnène Trojette + - Alexey Tourbin + - Loganaden Velvindron + - Patrick J. Volkerding + - Martin Väth + - Adam Walling + - Jeffrey Walton + - Christian Weisgerber + - Dan Weiss + - Bert Wesarg + - Fredrik Wikstrom + - Jim Wilcoxson + - Ralf Wildenhues + - Charles Wilson + - Lars Wirzenius + - Pilorz Wojciech + - Ryan Young + - Andreas Zieringer + +Also thanks to all the people who have participated in the Tukaani project. + +I have probably forgot to add some names to the above list. Sorry about +that and thanks for your help. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..7b9a3ad --- /dev/null +++ b/TODO @@ -0,0 +1,109 @@ + +XZ Utils To-Do List +=================== + +Known bugs +---------- + + The test suite is too incomplete. + + If the memory usage limit is less than about 13 MiB, xz is unable to + automatically scale down the compression settings enough even though + it would be possible by switching from BT2/BT3/BT4 match finder to + HC3/HC4. + + XZ Utils compress some files significantly worse than LZMA Utils. + This is due to faster compression presets used by XZ Utils, and + can often be worked around by using "xz --extreme". With some files + --extreme isn't enough though: it's most likely with files that + compress extremely well, so going from compression ratio of 0.003 + to 0.004 means big relative increase in the compressed file size. + + xz doesn't quote unprintable characters when it displays file names + given on the command line. + + tuklib_exit() doesn't block signals => EINTR is possible. + + SIGTSTP is not handled. If xz is stopped, the estimated remaining + time and calculated (de)compression speed won't make sense in the + progress indicator (xz --verbose). + + If liblzma has created threads and fork() gets called, liblzma + code will break in the child process unless it calls exec() and + doesn't touch liblzma. + + +Missing features +---------------- + + Add support for storing metadata in .xz files. A preliminary + idea is to create a new Stream type for metadata. When both + metadata and data are wanted in the same .xz file, two or more + Streams would be concatenated. + + The state stored in lzma_stream should be cloneable, which would + be mostly useful when using a preset dictionary in LZMA2, but + it may have other uses too. Compare to deflateCopy() in zlib. + + Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and + other streams that don't have an end of payload marker. + + Adjust dictionary size when the input file size is known. + Maybe do this only if an option is given. + + xz doesn't support copying extended attributes, access control + lists etc. from source to target file. + + Multithreaded compression: + - Reduce memory usage of the current method. + - Implement threaded match finders. + - Implement pigz-style threading in LZMA2. + + Buffer-to-buffer coding could use less RAM (especially when + decompressing LZMA1 or LZMA2). + + I/O library is not implemented (similar to gzopen() in zlib). + It will be a separate library that supports uncompressed, .gz, + .bz2, .lzma, and .xz files. + + Support changing lzma_options_lzma.mode with lzma_filters_update(). + + Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at + Block and Stream boundaries. + + lzma_strerror() to convert lzma_ret to human readable form? + This is tricky, because the same error codes are used with + slightly different meanings, and this cannot be fixed anymore. + + Make it possible to adjust LZMA2 options in the middle of a Block + so that the encoding speed vs. compression ratio can be optimized + when the compressed data is streamed over network. + + Improved BCJ filters. The current filters are small but they aren't + so great when compressing binary packages that contain various file + types. Specifically, they make things worse if there are static + libraries or Linux kernel modules. The filtering could also be + more effective (without getting overly complex), for example, + streamable variant BCJ2 from 7-Zip could be implemented. + + Filter that autodetects specific data types in the input stream + and applies appropriate filters for the corrects parts of the input. + Perhaps combine this with the BCJ filter improvement point above. + + Long-range LZ77 method as a separate filter or as a new LZMA2 + match finder. + + +Documentation +------------- + + More tutorial programs are needed for liblzma. + + Document the LZMA1 and LZMA2 algorithms. + + +Miscellaneous +------------ + + Try to get the media type for .xz registered at IANA. + diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..5e254c3 --- /dev/null +++ b/config.h.in @@ -0,0 +1,601 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* How many MiB of RAM to assume if the real amount cannot be determined. */ +#undef ASSUME_RAM + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if bswap_16 is available. */ +#undef HAVE_BSWAP_16 + +/* Define to 1 if bswap_32 is available. */ +#undef HAVE_BSWAP_32 + +/* Define to 1 if bswap_64 is available. */ +#undef HAVE_BSWAP_64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if Capsicum is available. */ +#undef HAVE_CAPSICUM + +/* Define to 1 if the system has the type `CC_SHA256_CTX'. */ +#undef HAVE_CC_SHA256_CTX + +/* Define to 1 if you have the `CC_SHA256_Init' function. */ +#undef HAVE_CC_SHA256_INIT + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if crc32 integrity check is enabled. */ +#undef HAVE_CHECK_CRC32 + +/* Define to 1 if crc64 integrity check is enabled. */ +#undef HAVE_CHECK_CRC64 + +/* Define to 1 if sha256 integrity check is enabled. */ +#undef HAVE_CHECK_SHA256 + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if `CLOCK_MONOTONIC' is declared in . */ +#undef HAVE_CLOCK_MONOTONIC + +/* Define to 1 if you have the header file. */ +#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CPUID_H + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if any of HAVE_DECODER_foo have been defined. */ +#undef HAVE_DECODERS + +/* Define to 1 if arm decoder is enabled. */ +#undef HAVE_DECODER_ARM + +/* Define to 1 if arm64 decoder is enabled. */ +#undef HAVE_DECODER_ARM64 + +/* Define to 1 if armthumb decoder is enabled. */ +#undef HAVE_DECODER_ARMTHUMB + +/* Define to 1 if delta decoder is enabled. */ +#undef HAVE_DECODER_DELTA + +/* Define to 1 if ia64 decoder is enabled. */ +#undef HAVE_DECODER_IA64 + +/* Define to 1 if lzma1 decoder is enabled. */ +#undef HAVE_DECODER_LZMA1 + +/* Define to 1 if lzma2 decoder is enabled. */ +#undef HAVE_DECODER_LZMA2 + +/* Define to 1 if powerpc decoder is enabled. */ +#undef HAVE_DECODER_POWERPC + +/* Define to 1 if sparc decoder is enabled. */ +#undef HAVE_DECODER_SPARC + +/* Define to 1 if x86 decoder is enabled. */ +#undef HAVE_DECODER_X86 + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */ +#undef HAVE_ENCODERS + +/* Define to 1 if arm encoder is enabled. */ +#undef HAVE_ENCODER_ARM + +/* Define to 1 if arm64 encoder is enabled. */ +#undef HAVE_ENCODER_ARM64 + +/* Define to 1 if armthumb encoder is enabled. */ +#undef HAVE_ENCODER_ARMTHUMB + +/* Define to 1 if delta encoder is enabled. */ +#undef HAVE_ENCODER_DELTA + +/* Define to 1 if ia64 encoder is enabled. */ +#undef HAVE_ENCODER_IA64 + +/* Define to 1 if lzma1 encoder is enabled. */ +#undef HAVE_ENCODER_LZMA1 + +/* Define to 1 if lzma2 encoder is enabled. */ +#undef HAVE_ENCODER_LZMA2 + +/* Define to 1 if powerpc encoder is enabled. */ +#undef HAVE_ENCODER_POWERPC + +/* Define to 1 if sparc encoder is enabled. */ +#undef HAVE_ENCODER_SPARC + +/* Define to 1 if x86 encoder is enabled. */ +#undef HAVE_ENCODER_X86 + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if __attribute__((__constructor__)) is supported for functions. + */ +#undef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR + +/* Define to 1 if you have the `futimens' function. */ +#undef HAVE_FUTIMENS + +/* Define to 1 if you have the `futimes' function. */ +#undef HAVE_FUTIMES + +/* Define to 1 if you have the `futimesat' function. */ +#undef HAVE_FUTIMESAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_IMMINTRIN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if .lz (lzip) decompression support is enabled. */ +#undef HAVE_LZIP_DECODER + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#undef HAVE_MBRTOWC + +/* Define to 1 to enable bt2 match finder. */ +#undef HAVE_MF_BT2 + +/* Define to 1 to enable bt3 match finder. */ +#undef HAVE_MF_BT3 + +/* Define to 1 to enable bt4 match finder. */ +#undef HAVE_MF_BT4 + +/* Define to 1 to enable hc3 match finder. */ +#undef HAVE_MF_HC3 + +/* Define to 1 to enable hc4 match finder. */ +#undef HAVE_MF_HC4 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MINIX_CONFIG_H + +/* Define to 1 if getopt.h declares extern int optreset. */ +#undef HAVE_OPTRESET + +/* Define to 1 if you have the `pledge' function. */ +#undef HAVE_PLEDGE + +/* Define to 1 if you have the `posix_fadvise' function. */ +#undef HAVE_POSIX_FADVISE + +/* Define to 1 if `program_invocation_name' is declared in . */ +#undef HAVE_PROGRAM_INVOCATION_NAME + +/* Define to 1 if you have the `pthread_condattr_setclock' function. */ +#undef HAVE_PTHREAD_CONDATTR_SETCLOCK + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the `SHA256Init' function. */ +#undef HAVE_SHA256INIT + +/* Define to 1 if the system has the type `SHA256_CTX'. */ +#undef HAVE_SHA256_CTX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHA256_H + +/* Define to 1 if you have the `SHA256_Init' function. */ +#undef HAVE_SHA256_INIT + +/* Define to 1 if the system has the type `SHA2_CTX'. */ +#undef HAVE_SHA2_CTX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHA2_H + +/* Define to 1 if optimizing for size. */ +#undef HAVE_SMALL + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + +/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC + +/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + +/* Define to 1 if `st_uatime' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_UATIME + +/* Define to 1 to if GNU/Linux-specific details are unconditionally wanted for + symbol versioning. Define to 2 to if these are wanted only if also PIC is + defined (allows building both shared and static liblzma at the same time + with Libtool if neither --with-pic nor --without-pic is used). This define + must be used together with liblzma_linux.map. */ +#undef HAVE_SYMBOL_VERSIONS_LINUX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BYTEORDER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_CAPSICUM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if the system has the type `uintptr_t'. */ +#undef HAVE_UINTPTR_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if _mm_set_epi64x and _mm_clmulepi64_si128 are usable. See + configure.ac for details. */ +#undef HAVE_USABLE_CLMUL + +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES + +/* Define to 1 or 0, depending whether the compiler supports simple visibility + declarations. */ +#undef HAVE_VISIBILITY + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the `wcwidth' function. */ +#undef HAVE_WCWIDTH + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if you have the `_futime' function. */ +#undef HAVE__FUTIME + +/* Define to 1 if _mm_movemask_epi8 is available. */ +#undef HAVE__MM_MOVEMASK_EPI8 + +/* Define to 1 if the GNU C extension __builtin_assume_aligned is supported. + */ +#undef HAVE___BUILTIN_ASSUME_ALIGNED + +/* Define to 1 if the GNU C extensions __builtin_bswap16/32/64 are supported. + */ +#undef HAVE___BUILTIN_BSWAPXX + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 when using POSIX threads (pthreads). */ +#undef MYTHREAD_POSIX + +/* Define to 1 when using Windows Vista compatible threads. This uses features + that are not available on Windows XP. */ +#undef MYTHREAD_VISTA + +/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This + avoids use of features that were added in Windows Vista. */ +#undef MYTHREAD_WIN95 + +/* Define to 1 to disable debugging code. */ +#undef NDEBUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Define to 1 if the number of available CPU cores can be detected with + cpuset(2). */ +#undef TUKLIB_CPUCORES_CPUSET + +/* Define to 1 if the number of available CPU cores can be detected with + pstat_getdynamic(). */ +#undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC + +/* Define to 1 if the number of available CPU cores can be detected with + sched_getaffinity() */ +#undef TUKLIB_CPUCORES_SCHED_GETAFFINITY + +/* Define to 1 if the number of available CPU cores can be detected with + sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */ +#undef TUKLIB_CPUCORES_SYSCONF + +/* Define to 1 if the number of available CPU cores can be detected with + sysctl(). */ +#undef TUKLIB_CPUCORES_SYSCTL + +/* Define to 1 if the system supports fast unaligned access to 16-bit, 32-bit, + and 64-bit integers. */ +#undef TUKLIB_FAST_UNALIGNED_ACCESS + +/* Define to 1 if the amount of physical memory can be detected with + _system_configuration.physmem. */ +#undef TUKLIB_PHYSMEM_AIX + +/* Define to 1 if the amount of physical memory can be detected with + getinvent_r(). */ +#undef TUKLIB_PHYSMEM_GETINVENT_R + +/* Define to 1 if the amount of physical memory can be detected with + getsysinfo(). */ +#undef TUKLIB_PHYSMEM_GETSYSINFO + +/* Define to 1 if the amount of physical memory can be detected with + pstat_getstatic(). */ +#undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC + +/* Define to 1 if the amount of physical memory can be detected with + sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */ +#undef TUKLIB_PHYSMEM_SYSCONF + +/* Define to 1 if the amount of physical memory can be detected with sysctl(). + */ +#undef TUKLIB_PHYSMEM_SYSCTL + +/* Define to 1 if the amount of physical memory can be detected with Linux + sysinfo(). */ +#undef TUKLIB_PHYSMEM_SYSINFO + +/* Define to 1 to use unsafe type punning, e.g. char *x = ...; *(int *)x = + 123; which violates strict aliasing rules and thus is undefined behavior + and might result in broken code. */ +#undef TUKLIB_USE_UNSAFE_TYPE_PUNNING + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# undef _NETBSD_SOURCE +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# undef _OPENBSD_SOURCE +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +# undef _XOPEN_SOURCE +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +#undef uintptr_t diff --git a/debug/README b/debug/README new file mode 100644 index 0000000..d42b272 --- /dev/null +++ b/debug/README @@ -0,0 +1,17 @@ + +Debug tools +----------- + + This directory contains a few tiny programs that may be helpful when + debugging XZ Utils. + + These tools are not meant to be installed. Often one needs to edit + the source code a little to make the programs do the wanted things. + If you don't know how these programs could help you, it is likely + that they really are useless to you. + + These aren't intended to be used as example programs. They take some + shortcuts here and there, which correct programs should not do. Many + possible errors (especially I/O errors) are ignored. Don't report + bugs or send patches to fix this kind of bugs. + diff --git a/debug/crc32.c b/debug/crc32.c new file mode 100644 index 0000000..e545a3c --- /dev/null +++ b/debug/crc32.c @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32.c +/// \brief Primitive CRC32 calculation tool +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + + +int +main(void) +{ + uint32_t crc = 0; + + do { + uint8_t buf[BUFSIZ]; + const size_t size = fread(buf, 1, sizeof(buf), stdin); + crc = lzma_crc32(buf, size, crc); + } while (!ferror(stdin) && !feof(stdin)); + + //printf("%08" PRIX32 "\n", crc); + + // I want it little endian so it's easy to work with hex editor. + printf("%02" PRIX32 " ", crc & 0xFF); + printf("%02" PRIX32 " ", (crc >> 8) & 0xFF); + printf("%02" PRIX32 " ", (crc >> 16) & 0xFF); + printf("%02" PRIX32 " ", crc >> 24); + printf("\n"); + + return 0; +} diff --git a/debug/full_flush.c b/debug/full_flush.c new file mode 100644 index 0000000..227f737 --- /dev/null +++ b/debug/full_flush.c @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file full_flush.c +/// \brief Encode files using LZMA_FULL_FLUSH +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +#define CHUNK 64 + + +static lzma_stream strm = LZMA_STREAM_INIT; +static FILE *file_in; + + +static void +encode(size_t size, lzma_action action) +{ + uint8_t in[CHUNK]; + uint8_t out[CHUNK]; + lzma_ret ret; + + do { + if (strm.avail_in == 0 && size > 0) { + const size_t amount = my_min(size, CHUNK); + strm.avail_in = fread(in, 1, amount, file_in); + strm.next_in = in; + size -= amount; // Intentionally not using avail_in. + } + + strm.next_out = out; + strm.avail_out = CHUNK; + + ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN); + + if (ret != LZMA_OK && ret != LZMA_STREAM_END) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } + + fwrite(out, 1, CHUNK - strm.avail_out, stdout); + + } while (size > 0 || strm.avail_out == 0); + + if ((action == LZMA_RUN && ret != LZMA_OK) + || (action != LZMA_RUN && ret != LZMA_STREAM_END)) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } +} + + +int +main(int argc, char **argv) +{ + file_in = argc > 1 ? fopen(argv[1], "rb") : stdin; + + + // Config + lzma_options_lzma opt_lzma; + if (lzma_lzma_preset(&opt_lzma, 1)) { + fprintf(stderr, "preset failed\n"); + exit(1); + } + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_UNKNOWN; + + // Init + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) { + fprintf(stderr, "init failed\n"); + exit(1); + } + +// if (lzma_easy_encoder(&strm, 1)) { +// fprintf(stderr, "init failed\n"); +// exit(1); +// } + + // Encoding + encode(0, LZMA_FULL_FLUSH); + encode(6, LZMA_FULL_FLUSH); + encode(0, LZMA_FULL_FLUSH); + encode(7, LZMA_FULL_FLUSH); + encode(0, LZMA_FULL_FLUSH); + encode(0, LZMA_FINISH); + + // Clean up + lzma_end(&strm); + + return 0; +} diff --git a/debug/hex2bin.c b/debug/hex2bin.c new file mode 100644 index 0000000..7324624 --- /dev/null +++ b/debug/hex2bin.c @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file hex2bin.c +/// \brief Converts hexadecimal input strings to binary +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include +#include + + +static int +getbin(int x) +{ + if (x >= '0' && x <= '9') + return x - '0'; + + if (x >= 'A' && x <= 'F') + return x - 'A' + 10; + + return x - 'a' + 10; +} + + +int +main(void) +{ + while (true) { + int byte = getchar(); + if (byte == EOF) + return 0; + if (!isxdigit(byte)) + continue; + + const int digit = getchar(); + if (digit == EOF || !isxdigit(digit)) { + fprintf(stderr, "Invalid input\n"); + return 1; + } + + byte = (getbin(byte) << 4) | getbin(digit); + if (putchar(byte) == EOF) { + perror(NULL); + return 1; + } + } +} diff --git a/debug/known_sizes.c b/debug/known_sizes.c new file mode 100644 index 0000000..6c3641f --- /dev/null +++ b/debug/known_sizes.c @@ -0,0 +1,129 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file known_sizes.c +/// \brief Encodes .lzma Stream with sizes known in Block Header +/// +/// The input file is encoded in RAM, and the known Compressed Size +/// and/or Uncompressed Size values are stored in the Block Header. +/// As of writing there's no such Stream encoder in liblzma. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include +#include +#include +#include + + +// Support file sizes up to 1 MiB. We use this for output space too, so files +// close to 1 MiB had better compress at least a little or we have a buffer +// overflow. +#define BUFFER_SIZE (1U << 20) + + +int +main(void) +{ + // Allocate the buffers. + uint8_t *in = malloc(BUFFER_SIZE); + uint8_t *out = malloc(BUFFER_SIZE); + if (in == NULL || out == NULL) + return 1; + + // Fill the input buffer. + const size_t in_size = fread(in, 1, BUFFER_SIZE, stdin); + + // Filter setup + lzma_options_lzma opt_lzma; + if (lzma_lzma_preset(&opt_lzma, 1)) + return 1; + + lzma_filter filters[] = { + { + .id = LZMA_FILTER_LZMA2, + .options = &opt_lzma + }, + { + .id = LZMA_VLI_UNKNOWN + } + }; + + lzma_block block = { + .check = LZMA_CHECK_CRC32, + .compressed_size = BUFFER_SIZE, // Worst case reserve + .uncompressed_size = in_size, + .filters = filters, + }; + + lzma_stream strm = LZMA_STREAM_INIT; + if (lzma_block_encoder(&strm, &block) != LZMA_OK) + return 1; + + // Reserve space for Stream Header and Block Header. We need to + // calculate the size of the Block Header first. + if (lzma_block_header_size(&block) != LZMA_OK) + return 1; + + size_t out_size = LZMA_STREAM_HEADER_SIZE + block.header_size; + + strm.next_in = in; + strm.avail_in = in_size; + strm.next_out = out + out_size; + strm.avail_out = BUFFER_SIZE - out_size; + + if (lzma_code(&strm, LZMA_FINISH) != LZMA_STREAM_END) + return 1; + + out_size += strm.total_out; + + if (lzma_block_header_encode(&block, out + LZMA_STREAM_HEADER_SIZE) + != LZMA_OK) + return 1; + + lzma_index *idx = lzma_index_init(NULL); + if (idx == NULL) + return 1; + + if (lzma_index_append(idx, NULL, block.header_size + strm.total_out, + strm.total_in) != LZMA_OK) + return 1; + + if (lzma_index_encoder(&strm, idx) != LZMA_OK) + return 1; + + if (lzma_code(&strm, LZMA_RUN) != LZMA_STREAM_END) + return 1; + + out_size += strm.total_out; + + lzma_end(&strm); + + lzma_index_end(idx, NULL); + + // Encode the Stream Header and Stream Footer. backwards_size is + // needed only for the Stream Footer. + lzma_stream_flags sf = { + .backward_size = strm.total_out, + .check = block.check, + }; + + if (lzma_stream_header_encode(&sf, out) != LZMA_OK) + return 1; + + if (lzma_stream_footer_encode(&sf, out + out_size) != LZMA_OK) + return 1; + + out_size += LZMA_STREAM_HEADER_SIZE; + + // Write out the file. + fwrite(out, 1, out_size, stdout); + + return 0; +} diff --git a/debug/memusage.c b/debug/memusage.c new file mode 100644 index 0000000..bd72b5a --- /dev/null +++ b/debug/memusage.c @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file memusage.c +/// \brief Calculates memory usage using lzma_memory_usage() +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +int +main(void) +{ + lzma_options_lzma lzma = { + .dict_size = (1U << 30) + (1U << 29), + .lc = 3, + .lp = 0, + .pb = 2, + .preset_dict = NULL, + .preset_dict_size = 0, + .mode = LZMA_MODE_NORMAL, + .nice_len = 48, + .mf = LZMA_MF_BT4, + .depth = 0, + }; + +/* + lzma_options_filter filters[] = { + { LZMA_FILTER_LZMA1, + (lzma_options_lzma *)&lzma_preset_lzma[6 - 1] }, + { UINT64_MAX, NULL } + }; +*/ + lzma_filter filters[] = { + { LZMA_FILTER_LZMA1, &lzma }, + { UINT64_MAX, NULL } + }; + + printf("Encoder: %10" PRIu64 " B\n", + lzma_raw_encoder_memusage(filters)); + printf("Decoder: %10" PRIu64 " B\n", + lzma_raw_decoder_memusage(filters)); + + return 0; +} diff --git a/debug/repeat.c b/debug/repeat.c new file mode 100644 index 0000000..a00bde2 --- /dev/null +++ b/debug/repeat.c @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file repeat.c +/// \brief Repeats given string given times +/// +/// This program can be useful when debugging run-length encoder in +/// the Subblock filter, especially the condition when repeat count +/// doesn't fit into 28-bit integer. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include + + +int +main(int argc, char **argv) +{ + if (argc != 3) { + fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]); + exit(1); + } + + unsigned long long count = strtoull(argv[1], NULL, 10); + const size_t size = strlen(argv[2]); + + while (count-- != 0) + fwrite(argv[2], 1, size, stdout); + + return !!(ferror(stdout) || fclose(stdout)); +} diff --git a/debug/sync_flush.c b/debug/sync_flush.c new file mode 100644 index 0000000..2292333 --- /dev/null +++ b/debug/sync_flush.c @@ -0,0 +1,125 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sync_flush.c +/// \brief Encode files using LZMA_SYNC_FLUSH +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include + +#define CHUNK 64 + + +static lzma_stream strm = LZMA_STREAM_INIT; +static FILE *file_in; + + +static void +encode(size_t size, lzma_action action) +{ + uint8_t in[CHUNK]; + uint8_t out[CHUNK]; + lzma_ret ret; + + do { + if (strm.avail_in == 0 && size > 0) { + const size_t amount = my_min(size, CHUNK); + strm.avail_in = fread(in, 1, amount, file_in); + strm.next_in = in; + size -= amount; // Intentionally not using avail_in. + } + + strm.next_out = out; + strm.avail_out = CHUNK; + + ret = lzma_code(&strm, size == 0 ? action : LZMA_RUN); + + if (ret != LZMA_OK && ret != LZMA_STREAM_END) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } + + fwrite(out, 1, CHUNK - strm.avail_out, stdout); + + } while (size > 0 || strm.avail_out == 0); + + if ((action == LZMA_RUN && ret != LZMA_OK) + || (action != LZMA_RUN && ret != LZMA_STREAM_END)) { + fprintf(stderr, "%s:%u: %s: ret == %d\n", + __FILE__, __LINE__, __func__, ret); + exit(1); + } +} + + +int +main(int argc, char **argv) +{ + file_in = argc > 1 ? fopen(argv[1], "rb") : stdin; + + // Config + lzma_options_lzma opt_lzma = { + .dict_size = 1U << 16, + .lc = LZMA_LC_DEFAULT, + .lp = LZMA_LP_DEFAULT, + .pb = LZMA_PB_DEFAULT, + .preset_dict = NULL, + .mode = LZMA_MODE_NORMAL, + .nice_len = 32, + .mf = LZMA_MF_HC3, + .depth = 0, + }; + + lzma_options_delta opt_delta = { + .dist = 16 + }; + + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &opt_lzma; + filters[1].id = LZMA_VLI_UNKNOWN; + + // Init + if (lzma_stream_encoder(&strm, filters, LZMA_CHECK_CRC32) != LZMA_OK) { + fprintf(stderr, "init failed\n"); + exit(1); + } + + // Encoding + encode(0, LZMA_SYNC_FLUSH); + encode(6, LZMA_SYNC_FLUSH); + encode(0, LZMA_SYNC_FLUSH); + encode(7, LZMA_SYNC_FLUSH); + encode(0, LZMA_SYNC_FLUSH); + encode(0, LZMA_FINISH); + +/* + encode(53, LZMA_SYNC_FLUSH); + opt_lzma.lc = 2; + opt_lzma.lp = 1; + opt_lzma.pb = 0; + if (lzma_filters_update(&strm, filters) != LZMA_OK) { + fprintf(stderr, "update failed\n"); + exit(1); + } + encode(404, LZMA_FINISH); +*/ + + // Clean up + lzma_end(&strm); + + return 0; + + // Prevent useless warnings so we don't need to have special CFLAGS + // to disable -Werror. + (void)opt_lzma; + (void)opt_delta; +} diff --git a/debug/translation.bash b/debug/translation.bash new file mode 100644 index 0000000..df4210d --- /dev/null +++ b/debug/translation.bash @@ -0,0 +1,100 @@ +#!/bin/bash + +############################################################################### +# +# Script to check output of some translated messages +# +# This should be useful for translators to check that the translated strings +# look good. This doesn't make xz print all possible strings, but it should +# cover most of the cases where mistakes can easily happen. +# +# Give the path and filename of the xz executable as an argument. If no +# arguments are given, this script uses ../src/xz/xz (relative to the +# location of this script). +# +# You may want to pipe the output of this script to less -S to view the +# tables printed by xz --list on a 80-column terminal. On the other hand, +# viewing the other messages may be better without -S. +# +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +set -e + +# If an argument was given, use it to set the location of the xz executable. +unset XZ +if [ -n "$1" ]; then + XZ=$1 + [ "x${XZ:0:1}" != "x/" ] && XZ="$PWD/$XZ" +fi + +# Locate top_srcdir and go there. +top_srcdir="$(cd -- "$(dirname -- "$0")" && cd .. && pwd)" +cd -- "$top_srcdir" + +# If XZ wasn't already set, use the default location. +XZ=${XZ-"$PWD/src/xz/xz"} +if [ "$(type -t "$XZ" || true)" != "file" ]; then + echo "Give the location of the xz executable as an argument" \ + "to this script." + exit 1 +fi +XZ=$(type -p -- "$XZ") + +# Print the xz version and locale information. +echo "$XZ --version" +"$XZ" --version +echo +if [ -d .git ] && type git > /dev/null 2>&1; then + echo "Source code version in $PWD:" + git describe --abbrev=4 +fi +echo +locale +echo + +# Make the test files directory the current directory. +cd tests/files + +# Put xz in PATH so that argv[0] stays short. +PATH=${XZ%/*}:$PATH + +# Some of the test commands are error messages and thus don't +# return successfully. +set +e + +for CMD in \ + "xz --foobarbaz" \ + "xz --memlimit=123abcd" \ + "xz --memlimit=40MiB -6 /dev/null" \ + "xz --memlimit=0 --info-memory" \ + "xz --memlimit-compress=1234MiB --memlimit-decompress=50MiB --info-memory" \ + "xz --verbose --verbose /dev/null | cat" \ + "xz --lzma2=foobarbaz" \ + "xz --lzma2=foobarbaz=abcd" \ + "xz --lzma2=mf=abcd" \ + "xz --lzma2=preset=foobarbaz" \ + "xz --lzma2=mf=bt4,nice=2" \ + "xz --lzma2=nice=50000" \ + "xz --help" \ + "xz --long-help" \ + "xz --list good-*lzma2*" \ + "xz --list good-1-check*" \ + "xz --list --verbose good-*lzma2*" \ + "xz --list --verbose good-1-check*" \ + "xz --list --verbose --verbose good-*lzma2*" \ + "xz --list --verbose --verbose good-1-check*" \ + "xz --list --verbose --verbose unsupported-check.xz" +do + echo "-----------------------------------------------------------" + echo + echo "\$ $CMD" + eval "$CMD" + echo +done 2>&1 diff --git a/doc/examples/00_README.txt b/doc/examples/00_README.txt new file mode 100644 index 0000000..120e1eb --- /dev/null +++ b/doc/examples/00_README.txt @@ -0,0 +1,31 @@ + +liblzma example programs +======================== + +Introduction + + The examples are written so that the same comments aren't + repeated (much) in later files. + + On POSIX systems, the examples should build by just typing "make". + + The examples that use stdin or stdout don't set stdin and stdout + to binary mode. On systems where it matters (e.g. Windows) it is + possible that the examples won't work without modification. + + +List of examples + + 01_compress_easy.c Multi-call compression using + a compression preset + + 02_decompress.c Multi-call decompression + + 03_compress_custom.c Like 01_compress_easy.c but using + a custom filter chain + (x86 BCJ + LZMA2) + + 04_compress_easy_mt.c Multi-threaded multi-call + compression using a compression + preset + diff --git a/doc/examples/01_compress_easy.c b/doc/examples/01_compress_easy.c new file mode 100644 index 0000000..ec32a37 --- /dev/null +++ b/doc/examples/01_compress_easy.c @@ -0,0 +1,297 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 01_compress_easy.c +/// \brief Compress from stdin to stdout in multi-call mode +/// +/// Usage: ./01_compress_easy PRESET < INFILE > OUTFILE +/// +/// Example: ./01_compress_easy 6 < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static void +show_usage_and_exit(const char *argv0) +{ + fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n" + "PRESET is a number 0-9 and can optionally be " + "followed by `e' to indicate extreme preset\n", + argv0); + exit(EXIT_FAILURE); +} + + +static uint32_t +get_preset(int argc, char **argv) +{ + // One argument whose first char must be 0-9. + if (argc != 2 || argv[1][0] < '0' || argv[1][0] > '9') + show_usage_and_exit(argv[0]); + + // Calculate the preste level 0-9. + uint32_t preset = argv[1][0] - '0'; + + // If there is a second char, it must be 'e'. It will set + // the LZMA_PRESET_EXTREME flag. + if (argv[1][1] != '\0') { + if (argv[1][1] != 'e' || argv[1][2] != '\0') + show_usage_and_exit(argv[0]); + + preset |= LZMA_PRESET_EXTREME; + } + + return preset; +} + + +static bool +init_encoder(lzma_stream *strm, uint32_t preset) +{ + // Initialize the encoder using a preset. Set the integrity to check + // to CRC64, which is the default in the xz command line tool. If + // the .xz file needs to be decompressed with XZ Embedded, use + // LZMA_CHECK_CRC32 instead. + lzma_ret ret = lzma_easy_encoder(strm, preset, LZMA_CHECK_CRC64); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Specified preset is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + // This will be LZMA_RUN until the end of the input file is reached. + // This tells lzma_code() when there will be no more input. + lzma_action action = LZMA_RUN; + + // Buffers to temporarily hold uncompressed input + // and compressed output. + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + // Initialize the input and output pointers. Initializing next_in + // and avail_in isn't really necessary when we are going to encode + // just one file since LZMA_STREAM_INIT takes care of initializing + // those already. But it doesn't hurt much and it will be needed + // if encoding more than one file like we will in 02_decompress.c. + // + // While we don't care about strm->total_in or strm->total_out in this + // example, it is worth noting that initializing the encoder will + // always reset total_in and total_out to zero. But the encoder + // initialization doesn't touch next_in, avail_in, next_out, or + // avail_out. + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + // Loop until the file has been successfully compressed or until + // an error occurs. + while (true) { + // Fill the input buffer if it is empty. + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming and that it should finish the + // encoding. + if (feof(infile)) + action = LZMA_FINISH; + } + + // Tell liblzma do the actual encoding. + // + // This reads up to strm->avail_in bytes of input starting + // from strm->next_in. avail_in will be decremented and + // next_in incremented by an equal amount to match the + // number of input bytes consumed. + // + // Up to strm->avail_out bytes of compressed output will be + // written starting from strm->next_out. avail_out and next_out + // will be incremented by an equal amount to match the number + // of output bytes written. + // + // The encoder has to do internal buffering, which means that + // it may take quite a bit of input before the same data is + // available in compressed form in the output buffer. + lzma_ret ret = lzma_code(strm, action); + + // If the output buffer is full or if the compression finished + // successfully, write the data from the output buffer to + // the output file. + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + // When lzma_code() has returned LZMA_STREAM_END, + // the output buffer is likely to be only partially + // full. Calculate how much new data there is to + // be written to the output file. + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + // Reset next_out and avail_out. + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + // Normally the return value of lzma_code() will be LZMA_OK + // until everything has been encoded. + if (ret != LZMA_OK) { + // Once everything has been encoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Most values listen in lzma_ret + // enumeration aren't possible in this example. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + // This error is returned if the compressed + // or uncompressed size get near 8 EiB + // (2^63 bytes) because that's where the .xz + // file format size limits currently are. + // That is, the possibility of this error + // is mostly theoretical unless you are doing + // something very unusual. + // + // Note that strm->total_in and strm->total_out + // have nothing to do with this error. Changing + // those variables won't increase or decrease + // the chance of getting this error. + msg = "File size limits exceeded"; + break; + + default: + // This is most likely LZMA_PROG_ERROR, but + // if this program is buggy (or liblzma has + // a bug), it may be e.g. LZMA_BUF_ERROR or + // LZMA_OPTIONS_ERROR too. + // + // It is inconvenient to have a separate + // error message for errors that should be + // impossible to occur, but knowing the error + // code is important for debugging. That's why + // it is good to print the error code at least + // when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + // Get the preset number from the command line. + uint32_t preset = get_preset(argc, argv); + + // Initialize a lzma_stream structure. When it is allocated on stack, + // it is simplest to use LZMA_STREAM_INIT macro like below. When it + // is allocated on heap, using memset(strmptr, 0, sizeof(*strmptr)) + // works (as long as NULL pointers are represented with zero bits + // as they are on practically all computers today). + lzma_stream strm = LZMA_STREAM_INIT; + + // Initialize the encoder. If it succeeds, compress from + // stdin to stdout. + bool success = init_encoder(&strm, preset); + if (success) + success = compress(&strm, stdin, stdout); + + // Free the memory allocated for the encoder. If we were encoding + // multiple files, this would only need to be done after the last + // file. See 02_decompress.c for handling of multiple files. + // + // It is OK to call lzma_end() multiple times or when it hasn't been + // actually used except initialized with LZMA_STREAM_INIT. + lzma_end(&strm); + + // Close stdout to catch possible write errors that can occur + // when pending data is flushed from the stdio buffers. + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/02_decompress.c b/doc/examples/02_decompress.c new file mode 100644 index 0000000..98339be --- /dev/null +++ b/doc/examples/02_decompress.c @@ -0,0 +1,287 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 02_decompress.c +/// \brief Decompress .xz files to stdout +/// +/// Usage: ./02_decompress INPUT_FILES... > OUTFILE +/// +/// Example: ./02_decompress foo.xz bar.xz > foobar +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_decoder(lzma_stream *strm) +{ + // Initialize a .xz decoder. The decoder supports a memory usage limit + // and a set of flags. + // + // The memory usage of the decompressor depends on the settings used + // to compress a .xz file. It can vary from less than a megabyte to + // a few gigabytes, but in practice (at least for now) it rarely + // exceeds 65 MiB because that's how much memory is required to + // decompress files created with "xz -9". Settings requiring more + // memory take extra effort to use and don't (at least for now) + // provide significantly better compression in most cases. + // + // Memory usage limit is useful if it is important that the + // decompressor won't consume gigabytes of memory. The need + // for limiting depends on the application. In this example, + // no memory usage limiting is used. This is done by setting + // the limit to UINT64_MAX. + // + // The .xz format allows concatenating compressed files as is: + // + // echo foo | xz > foobar.xz + // echo bar | xz >> foobar.xz + // + // When decompressing normal standalone .xz files, LZMA_CONCATENATED + // should always be used to support decompression of concatenated + // .xz files. If LZMA_CONCATENATED isn't used, the decoder will stop + // after the first .xz stream. This can be useful when .xz data has + // been embedded inside another file format. + // + // Flags other than LZMA_CONCATENATED are supported too, and can + // be combined with bitwise-or. See lzma/container.h + // (src/liblzma/api/lzma/container.h in the source package or e.g. + // /usr/include/lzma/container.h depending on the install prefix) + // for details. + lzma_ret ret = lzma_stream_decoder( + strm, UINT64_MAX, LZMA_CONCATENATED); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + // + // Note that LZMA_MEMLIMIT_ERROR is never possible here. If you + // specify a very tiny limit, the error will be delayed until + // the first headers have been parsed by a call to lzma_code(). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Unsupported decompressor flags"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the decoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile) +{ + // When LZMA_CONCATENATED flag was used when initializing the decoder, + // we need to tell lzma_code() when there will be no more input. + // This is done by setting action to LZMA_FINISH instead of LZMA_RUN + // in the same way as it is done when encoding. + // + // When LZMA_CONCATENATED isn't used, there is no need to use + // LZMA_FINISH to tell when all the input has been read, but it + // is still OK to use it if you want. When LZMA_CONCATENATED isn't + // used, the decoder will stop after the first .xz stream. In that + // case some unused data may be left in strm->next_in. + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "%s: Read error: %s\n", + inname, strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming. As said before, this isn't required + // if the LZMA_CONCATENATED flag isn't used when + // initializing the decoder. + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + // Once everything has been decoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well or that when you aren't + // getting more output it must have successfully + // decoded everything. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Many values listen in lzma_ret + // enumeration aren't possible in this example, but + // can be made possible by enabling memory usage limit + // or adding flags to the decoder initialization. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_FORMAT_ERROR: + // .xz magic bytes weren't found. + msg = "The input is not in the .xz format"; + break; + + case LZMA_OPTIONS_ERROR: + // For example, the headers specify a filter + // that isn't supported by this liblzma + // version (or it hasn't been enabled when + // building liblzma, but no-one sane does + // that unless building liblzma for an + // embedded system). Upgrading to a newer + // liblzma might help. + // + // Note that it is unlikely that the file has + // accidentally became corrupt if you get this + // error. The integrity of the .xz headers is + // always verified with a CRC32, so + // unintentionally corrupt files can be + // distinguished from unsupported files. + msg = "Unsupported compression options"; + break; + + case LZMA_DATA_ERROR: + msg = "Compressed file is corrupt"; + break; + + case LZMA_BUF_ERROR: + // Typically this error means that a valid + // file has got truncated, but it might also + // be a damaged part in the file that makes + // the decoder think the file is truncated. + // If you prefer, you can use the same error + // message for this as for LZMA_DATA_ERROR. + msg = "Compressed file is truncated or " + "otherwise corrupt"; + break; + + default: + // This is most likely LZMA_PROG_ERROR. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "%s: Decoder error: " + "%s (error code %u)\n", + inname, msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + if (argc <= 1) { + fprintf(stderr, "Usage: %s FILES...\n", argv[0]); + return EXIT_FAILURE; + } + + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = true; + + // Try to decompress all files. + for (int i = 1; i < argc; ++i) { + if (!init_decoder(&strm)) { + // Decoder initialization failed. There's no point + // to retry it so we need to exit. + success = false; + break; + } + + FILE *infile = fopen(argv[i], "rb"); + + if (infile == NULL) { + fprintf(stderr, "%s: Error opening the " + "input file: %s\n", + argv[i], strerror(errno)); + success = false; + } else { + success &= decompress(&strm, argv[i], infile, stdout); + fclose(infile); + } + } + + // Free the memory allocated for the decoder. This only needs to be + // done after the last file. + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/03_compress_custom.c b/doc/examples/03_compress_custom.c new file mode 100644 index 0000000..40c85e3 --- /dev/null +++ b/doc/examples/03_compress_custom.c @@ -0,0 +1,193 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 03_compress_custom.c +/// \brief Compress in multi-call mode using x86 BCJ and LZMA2 +/// +/// Usage: ./03_compress_custom < INFILE > OUTFILE +/// +/// Example: ./03_compress_custom < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // Use the default preset (6) for LZMA2. + // + // The lzma_options_lzma structure and the lzma_lzma_preset() function + // are declared in lzma/lzma12.h (src/liblzma/api/lzma/lzma12.h in the + // source package or e.g. /usr/include/lzma/lzma12.h depending on + // the install prefix). + lzma_options_lzma opt_lzma2; + if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) { + // It should never fail because the default preset + // (and presets 0-9 optionally with LZMA_PRESET_EXTREME) + // are supported by all stable liblzma versions. + // + // (The encoder initialization later in this function may + // still fail due to unsupported preset *if* the features + // required by the preset have been disabled at build time, + // but no-one does such things except on embedded systems.) + fprintf(stderr, "Unsupported preset, possibly a bug\n"); + return false; + } + + // Now we could customize the LZMA2 options if we wanted. For example, + // we could set the the dictionary size (opt_lzma2.dict_size) to + // something else than the default (8 MiB) of the default preset. + // See lzma/lzma12.h for details of all LZMA2 options. + // + // The x86 BCJ filter will try to modify the x86 instruction stream so + // that LZMA2 can compress it better. The x86 BCJ filter doesn't need + // any options so it will be set to NULL below. + // + // Construct the filter chain. The uncompressed data goes first to + // the first filter in the array, in this case the x86 BCJ filter. + // The array is always terminated by setting .id = LZMA_VLI_UNKNOWN. + // + // See lzma/filter.h for more information about the lzma_filter + // structure. + lzma_filter filters[] = { + { .id = LZMA_FILTER_X86, .options = NULL }, + { .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 }, + { .id = LZMA_VLI_UNKNOWN, .options = NULL }, + }; + + // Initialize the encoder using the custom filter chain. + lzma_ret ret = lzma_stream_encoder(strm, filters, LZMA_CHECK_CRC64); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples/04_compress_easy_mt.c b/doc/examples/04_compress_easy_mt.c new file mode 100644 index 0000000..efe5697 --- /dev/null +++ b/doc/examples/04_compress_easy_mt.c @@ -0,0 +1,206 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 04_compress_easy_mt.c +/// \brief Compress in multi-call mode using LZMA2 in multi-threaded mode +/// +/// Usage: ./04_compress_easy_mt < INFILE > OUTFILE +/// +/// Example: ./04_compress_easy_mt < foo > foo.xz +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // The threaded encoder takes the options as pointer to + // a lzma_mt structure. + lzma_mt mt = { + // No flags are needed. + .flags = 0, + + // Let liblzma determine a sane block size. + .block_size = 0, + + // Use no timeout for lzma_code() calls by setting timeout + // to zero. That is, sometimes lzma_code() might block for + // a long time (from several seconds to even minutes). + // If this is not OK, for example due to progress indicator + // needing updates, specify a timeout in milliseconds here. + // See the documentation of lzma_mt in lzma/container.h for + // information how to choose a reasonable timeout. + .timeout = 0, + + // Use the default preset (6) for LZMA2. + // To use a preset, filters must be set to NULL. + .preset = LZMA_PRESET_DEFAULT, + .filters = NULL, + + // Use CRC64 for integrity checking. See also + // 01_compress_easy.c about choosing the integrity check. + .check = LZMA_CHECK_CRC64, + }; + + // Detect how many threads the CPU supports. + mt.threads = lzma_cputhreads(); + + // If the number of CPU cores/threads cannot be detected, + // use one thread. Note that this isn't the same as the normal + // single-threaded mode as this will still split the data into + // blocks and use more RAM than the normal single-threaded mode. + // You may want to consider using lzma_easy_encoder() or + // lzma_stream_encoder() instead of lzma_stream_encoder_mt() if + // lzma_cputhreads() returns 0 or 1. + if (mt.threads == 0) + mt.threads = 1; + + // If the number of CPU cores/threads exceeds threads_max, + // limit the number of threads to keep memory usage lower. + // The number 8 is arbitrarily chosen and may be too low or + // high depending on the compression preset and the computer + // being used. + // + // FIXME: A better way could be to check the amount of RAM + // (or available RAM) and use lzma_stream_encoder_mt_memusage() + // to determine if the number of threads should be reduced. + const uint32_t threads_max = 8; + if (mt.threads > threads_max) + mt.threads = threads_max; + + // Initialize the threaded encoder. + lzma_ret ret = lzma_stream_encoder_mt(strm, &mt); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/doc/examples_old/xz_pipe_comp.c b/doc/examples_old/xz_pipe_comp.c new file mode 100644 index 0000000..9f9224b --- /dev/null +++ b/doc/examples_old/xz_pipe_comp.c @@ -0,0 +1,127 @@ +/* + * xz_pipe_comp.c + * A simple example of pipe-only xz compressor implementation. + * version: 2010-07-12 - by Daniel Mealha Cabrita + * Not copyrighted -- provided to the public domain. + * + * Compiling: + * Link with liblzma. GCC example: + * $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp + * + * Usage example: + * $ cat some_file | ./xz_pipe_comp > some_file.xz + */ + +#include +#include +#include +#include +#include + + +/* COMPRESSION SETTINGS */ + +/* analogous to xz CLI options: -0 to -9 */ +#define COMPRESSION_LEVEL 6 + +/* boolean setting, analogous to xz CLI option: -e */ +#define COMPRESSION_EXTREME true + +/* see: /usr/include/lzma/check.h LZMA_CHECK_* */ +#define INTEGRITY_CHECK LZMA_CHECK_CRC64 + + +/* read/write buffer sizes */ +#define IN_BUF_MAX 4096 +#define OUT_BUF_MAX 4096 + +/* error codes */ +#define RET_OK 0 +#define RET_ERROR_INIT 1 +#define RET_ERROR_INPUT 2 +#define RET_ERROR_OUTPUT 3 +#define RET_ERROR_COMPRESSION 4 + + +/* note: in_file and out_file must be open already */ +int xz_compress (FILE *in_file, FILE *out_file) +{ + uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0); + lzma_check check = INTEGRITY_CHECK; + lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */ + uint8_t in_buf [IN_BUF_MAX]; + uint8_t out_buf [OUT_BUF_MAX]; + size_t in_len; /* length of useful data in in_buf */ + size_t out_len; /* length of useful data in out_buf */ + bool in_finished = false; + bool out_finished = false; + lzma_action action; + lzma_ret ret_xz; + int ret; + + ret = RET_OK; + + /* initialize xz encoder */ + ret_xz = lzma_easy_encoder (&strm, preset, check); + if (ret_xz != LZMA_OK) { + fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz); + return RET_ERROR_INIT; + } + + while ((! in_finished) && (! out_finished)) { + /* read incoming data */ + in_len = fread (in_buf, 1, IN_BUF_MAX, in_file); + + if (feof (in_file)) { + in_finished = true; + } + if (ferror (in_file)) { + in_finished = true; + ret = RET_ERROR_INPUT; + } + + strm.next_in = in_buf; + strm.avail_in = in_len; + + /* if no more data from in_buf, flushes the + internal xz buffers and closes the xz data + with LZMA_FINISH */ + action = in_finished ? LZMA_FINISH : LZMA_RUN; + + /* loop until there's no pending compressed output */ + do { + /* out_buf is clean at this point */ + strm.next_out = out_buf; + strm.avail_out = OUT_BUF_MAX; + + /* compress data */ + ret_xz = lzma_code (&strm, action); + + if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz); + out_finished = true; + ret = RET_ERROR_COMPRESSION; + } else { + /* write compressed data */ + out_len = OUT_BUF_MAX - strm.avail_out; + fwrite (out_buf, 1, out_len, out_file); + if (ferror (out_file)) { + out_finished = true; + ret = RET_ERROR_OUTPUT; + } + } + } while (strm.avail_out == 0); + } + + lzma_end (&strm); + return ret; +} + +int main () +{ + int ret; + + ret = xz_compress (stdin, stdout); + return ret; +} + diff --git a/doc/examples_old/xz_pipe_decomp.c b/doc/examples_old/xz_pipe_decomp.c new file mode 100644 index 0000000..fb5ad89 --- /dev/null +++ b/doc/examples_old/xz_pipe_decomp.c @@ -0,0 +1,123 @@ +/* + * xz_pipe_decomp.c + * A simple example of pipe-only xz decompressor implementation. + * version: 2012-06-14 - by Daniel Mealha Cabrita + * Not copyrighted -- provided to the public domain. + * + * Compiling: + * Link with liblzma. GCC example: + * $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp + * + * Usage example: + * $ cat some_file.xz | ./xz_pipe_decomp > some_file + */ + +#include +#include +#include +#include +#include + + +/* read/write buffer sizes */ +#define IN_BUF_MAX 4096 +#define OUT_BUF_MAX 4096 + +/* error codes */ +#define RET_OK 0 +#define RET_ERROR_INIT 1 +#define RET_ERROR_INPUT 2 +#define RET_ERROR_OUTPUT 3 +#define RET_ERROR_DECOMPRESSION 4 + + +/* note: in_file and out_file must be open already */ +int xz_decompress (FILE *in_file, FILE *out_file) +{ + lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */ + const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED; + const uint64_t memory_limit = UINT64_MAX; /* no memory limit */ + uint8_t in_buf [IN_BUF_MAX]; + uint8_t out_buf [OUT_BUF_MAX]; + size_t in_len; /* length of useful data in in_buf */ + size_t out_len; /* length of useful data in out_buf */ + bool in_finished = false; + bool out_finished = false; + lzma_action action; + lzma_ret ret_xz; + int ret; + + ret = RET_OK; + + /* initialize xz decoder */ + ret_xz = lzma_stream_decoder (&strm, memory_limit, flags); + if (ret_xz != LZMA_OK) { + fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz); + return RET_ERROR_INIT; + } + + while ((! in_finished) && (! out_finished)) { + /* read incoming data */ + in_len = fread (in_buf, 1, IN_BUF_MAX, in_file); + + if (feof (in_file)) { + in_finished = true; + } + if (ferror (in_file)) { + in_finished = true; + ret = RET_ERROR_INPUT; + } + + strm.next_in = in_buf; + strm.avail_in = in_len; + + /* if no more data from in_buf, flushes the + internal xz buffers and closes the decompressed data + with LZMA_FINISH */ + action = in_finished ? LZMA_FINISH : LZMA_RUN; + + /* loop until there's no pending decompressed output */ + do { + /* out_buf is clean at this point */ + strm.next_out = out_buf; + strm.avail_out = OUT_BUF_MAX; + + /* decompress data */ + ret_xz = lzma_code (&strm, action); + + if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz); + out_finished = true; + ret = RET_ERROR_DECOMPRESSION; + } else { + /* write decompressed data */ + out_len = OUT_BUF_MAX - strm.avail_out; + fwrite (out_buf, 1, out_len, out_file); + if (ferror (out_file)) { + out_finished = true; + ret = RET_ERROR_OUTPUT; + } + } + } while (strm.avail_out == 0); + } + + /* Bug fix (2012-06-14): If no errors were detected, check + that the last lzma_code() call returned LZMA_STREAM_END. + If not, the file is probably truncated. */ + if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) { + fprintf (stderr, "Input truncated or corrupt\n"); + ret = RET_ERROR_DECOMPRESSION; + } + + lzma_end (&strm); + return ret; +} + +int main () +{ + int ret; + + ret = xz_decompress (stdin, stdout); + return ret; +} + diff --git a/doc/faq.txt b/doc/faq.txt new file mode 100644 index 0000000..3f9068b --- /dev/null +++ b/doc/faq.txt @@ -0,0 +1,244 @@ + +XZ Utils FAQ +============ + +Q: What do the letters XZ mean? + +A: Nothing. They are just two letters, which come from the file format + suffix .xz. The .xz suffix was selected, because it seemed to be + pretty much unused. It has no deeper meaning. + + +Q: What are LZMA and LZMA2? + +A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. It is the name + of the compression algorithm designed by Igor Pavlov for 7-Zip. + LZMA is based on LZ77 and range encoding. + + LZMA2 is an updated version of the original LZMA to fix a couple of + practical issues. In context of XZ Utils, LZMA is called LZMA1 to + emphasize that LZMA is not the same thing as LZMA2. LZMA2 is the + primary compression algorithm in the .xz file format. + + +Q: There are many LZMA related projects. How does XZ Utils relate to them? + +A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly + a subset of the 7-Zip source tree. + + p7zip is 7-Zip's command-line tools ported to POSIX-like systems. + + LZMA Utils provide a gzip-like lzma tool for POSIX-like systems. + LZMA Utils are based on LZMA SDK. XZ Utils are the successor to + LZMA Utils. + + There are several other projects using LZMA. Most are more or less + based on LZMA SDK. See . + + +Q: Why is liblzma named liblzma if its primary file format is .xz? + Shouldn't it be e.g. libxz? + +A: When the designing of the .xz format began, the idea was to replace + the .lzma format and use the same .lzma suffix. It would have been + quite OK to reuse the suffix when there were very few .lzma files + around. However, the old .lzma format became popular before the + new format was finished. The new format was renamed to .xz but the + name of liblzma wasn't changed. + + +Q: Do XZ Utils support the .7z format? + +A: No. Use 7-Zip (Windows) or p7zip (POSIX-like systems) to handle .7z + files. + + +Q: I have many .tar.7z files. Can I convert them to .tar.xz without + spending hours recompressing the data? + +A: In the "extra" directory, there is a script named 7z2lzma.bash which + is able to convert some .7z files to the .lzma format (not .xz). It + needs the 7za (or 7z) command from p7zip. The script may silently + produce corrupt output if certain assumptions are not met, so + decompress the resulting .lzma file and compare it against the + original before deleting the original file! + + +Q: I have many .lzma files. Can I quickly convert them to the .xz format? + +A: For now, no. Since XZ Utils supports the .lzma format, it's usually + not too bad to keep the old files in the old format. If you want to + do the conversion anyway, you need to decompress the .lzma files and + then recompress to the .xz format. + + Technically, there is a way to make the conversion relatively fast + (roughly twice the time that normal decompression takes). Writing + such a tool would take quite a bit of time though, and would probably + be useful to only a few people. If you really want such a conversion + tool, contact Lasse Collin and offer some money. + + +Q: I have installed xz, but my tar doesn't recognize .tar.xz files. + How can I extract .tar.xz files? + +A: xz -dc foo.tar.xz | tar xf - + + +Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)? + +A: It may be possible if the file consists of multiple blocks, which + typically is not the case if the file was created in single-threaded + mode. There is no recovery program yet. + + +Q: Is (some part of) XZ Utils patented? + +A: Lasse Collin is not aware of any patents that could affect XZ Utils. + However, due to the nature of software patents, it's not possible to + guarantee that XZ Utils isn't affected by any third party patent(s). + + +Q: Where can I find documentation about the file format and algorithms? + +A: The .xz format is documented in xz-file-format.txt. It is a container + format only, and doesn't include descriptions of any non-trivial + filters. + + Documenting LZMA and LZMA2 is planned, but for now, there is no other + documentation than the source code. Before you begin, you should know + the basics of LZ77 and range-coding algorithms. LZMA is based on LZ77, + but LZMA is a lot more complex. Range coding is used to compress + the final bitstream like Huffman coding is used in Deflate. + + +Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma? + +A: BCJ filter is called "x86" in liblzma. BCJ2 is not included, + because it requires using more than one encoded output stream. + + +Q: I need to use a script that runs "xz -9". On a system with 256 MiB + of RAM, xz says that it cannot allocate memory. Can I make the + script work without modifying it? + +A: Set a default memory usage limit for compression. You can do it e.g. + in a shell initialization script such as ~/.bashrc or /etc/profile: + + XZ_DEFAULTS=--memlimit-compress=150MiB + export XZ_DEFAULTS + + xz will then scale the compression settings down so that the given + memory usage limit is not reached. This way xz shouldn't run out + of memory. + + Check also that memory-related resource limits are high enough. + On most systems, "ulimit -a" will show the current resource limits. + + +Q: How do I create files that can be decompressed with XZ Embedded? + +A: See the documentation in XZ Embedded. In short, something like + this is a good start: + + xz --check=crc32 --lzma2=preset=6e,dict=64KiB + + Or if a BCJ filter is needed too, e.g. if compressing + a kernel image for PowerPC: + + xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB + + Adjust the dictionary size to get a good compromise between + compression ratio and decompressor memory usage. Note that + in single-call decompression mode of XZ Embedded, a big + dictionary doesn't increase memory usage. + + +Q: How is multi-threaded compression implemented in XZ Utils? + +A: The simplest method is splitting the uncompressed data into blocks + and compressing them in parallel independent from each other. + This is currently the only threading method supported in XZ Utils. + Since the blocks are compressed independently, they can also be + decompressed independently. Together with the index feature in .xz, + this allows using threads to create .xz files for random-access + reading. This also makes threaded decompression possible. + + The independent blocks method has a couple of disadvantages too. It + will compress worse than a single-block method. Often the difference + is not too big (maybe 1-2 %) but sometimes it can be too big. Also, + the memory usage of the compressor increases linearly when adding + threads. + + At least two other threading methods are possible but these haven't + been implemented in XZ Utils: + + Match finder parallelization has been in 7-Zip for ages. It doesn't + affect compression ratio or memory usage significantly. Among the + three threading methods, only this is useful when compressing small + files (files that are not significantly bigger than the dictionary). + Unfortunately this method scales only to about two CPU cores. + + The third method is pigz-style threading (I use that name, because + pigz uses that method). It doesn't + affect compression ratio significantly and scales to many cores. + The memory usage scales linearly when threads are added. This isn't + significant with pigz, because Deflate uses only a 32 KiB dictionary, + but with LZMA2 the memory usage will increase dramatically just like + with the independent-blocks method. There is also a constant + computational overhead, which may make pigz-method a bit dull on + dual-core compared to the parallel match finder method, but with more + cores the overhead is not a big deal anymore. + + Combining the threading methods will be possible and also useful. + For example, combining match finder parallelization with pigz-style + threading or independent-blocks-threading can cut the memory usage + by 50 %. + + +Q: I told xz to use many threads but it is using only one or two + processor cores. What is wrong? + +A: Since multi-threaded compression is done by splitting the data into + blocks that are compressed individually, if the input file is too + small for the block size, then many threads cannot be used. The + default block size increases when the compression level is + increased. For example, xz -6 uses 8 MiB LZMA2 dictionary and + 24 MiB blocks, and xz -9 uses 64 MiB LZMA dictionary and 192 MiB + blocks. If the input file is 100 MiB, xz -6 can use five threads + of which one will finish quickly as it has only 4 MiB to compress. + However, for the same file, xz -9 can only use one thread. + + One can adjust block size with --block-size=SIZE but making the + block size smaller than LZMA2 dictionary is waste of RAM: using + xz -9 with 6 MiB blocks isn't any better than using xz -6 with + 6 MiB blocks. The default settings use a block size bigger than + the LZMA2 dictionary size because this was seen as a reasonable + compromise between RAM usage and compression ratio. + + When decompressing, the ability to use threads depends on how the + file was created. If it was created in multi-threaded mode then + it can be decompressed in multi-threaded mode too if there are + multiple blocks in the file. + + +Q: How do I build a program that needs liblzmadec (lzmadec.h)? + +A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no + liblzmadec. The code using liblzmadec should be ported to use + liblzma instead. If you cannot or don't want to do that, download + LZMA Utils from . + + +Q: The default build of liblzma is too big. How can I make it smaller? + +A: Give --enable-small to the configure script. Use also appropriate + --enable or --disable options to include only those filter encoders + and decoders and integrity checks that you actually need. Use + CFLAGS=-Os (with GCC) or equivalent to tell your compiler to optimize + for size. See INSTALL for information about configure options. + + If the result is still too big, take a look at XZ Embedded. It is + a separate project, which provides a limited but significantly + smaller XZ decoder implementation than XZ Utils. You can find it + at . + diff --git a/doc/history.txt b/doc/history.txt new file mode 100644 index 0000000..8545e23 --- /dev/null +++ b/doc/history.txt @@ -0,0 +1,150 @@ + +History of LZMA Utils and XZ Utils +================================== + +Tukaani distribution + + In 2005, there was a small group working on the Tukaani distribution, + which was a Slackware fork. One of the project's goals was to fit the + distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip + helped a lot. Roughly speaking, one could fit data that took 1000 MiB + in gzipped form into 700 MiB with LZMA. Naturally, the compression + ratio varied across packages, but this was what we got on average. + + Slackware packages have traditionally had .tgz as the filename suffix, + which is an abbreviation of .tar.gz. A logical naming for LZMA + compressed packages was .tlz, being an abbreviation of .tar.lzma. + + At the end of the year 2007, there was no distribution under the + Tukaani project anymore, but development of LZMA Utils was kept going. + Still, there were .tlz packages around, because at least Vector Linux + (a Slackware based distribution) used LZMA for its packages. + + First versions of the modified pkgtools used the LZMA_Alone tool from + Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need + to interact with LZMA_Alone directly. But people soon wanted to use + LZMA for other files too, and the interface of LZMA_Alone wasn't + comfortable for those used to gzip and bzip2. + + +First steps of LZMA Utils + + The first version of LZMA Utils (4.22.0) included a shell script called + lzmash. It was a wrapper that had a gzip-like command-line interface. It + used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep, + zdiff, and related scripts from gzip were adapted to work with LZMA and + were part of the first LZMA Utils release too. + + LZMA Utils 4.22.0 included also lzmadec, which was a small (less than + 10 KiB) decoder-only command-line tool. It was written on top of the + decoder-only C code found from the LZMA SDK. lzmadec was convenient in + situations where LZMA_Alone (a few hundred KiB) would be too big. + + lzmash and lzmadec were written by Lasse Collin. + + +Second generation + + The lzmash script was an ugly and not very secure hack. The last + version of LZMA Utils to use lzmash was 4.27.1. + + LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written + by Ville Koskinen. It was written in C++, and used the encoder and + decoder from C++ LZMA SDK with some little modifications. This tool + replaced both the lzmash script and the LZMA_Alone command-line tool + in LZMA Utils. + + Introducing this new tool caused some temporary incompatibilities, + because the LZMA_Alone executable was simply named lzma like the new + command-line tool, but they had a completely different command-line + interface. The file format was still the same. + + Lasse wrote liblzmadec, which was a small decoder-only library based + on the C code found from LZMA SDK. liblzmadec had an API similar to + zlib, although there were some significant differences, which made it + non-trivial to use it in some applications designed for zlib and + libbzip2. + + The lzmadec command-line tool was converted to use liblzmadec. + + Alexandre Sauvé helped converting the build system to use GNU + Autotools. This made it easier to test for certain less portable + features needed by the new command-line tool. + + Since the new command-line tool never got completely finished (for + example, it didn't support the LZMA_OPT environment variable), the + intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't + polished, but appeared to work well enough, so some people started + using it too. + + Because the development of the third generation of LZMA Utils was + delayed considerably (3-4 years), the 4.32.x branch had to be kept + maintained. It got some bug fixes now and then, and finally it was + decided to call it stable, although most of the missing features were + never added. + + +File format problems + + The file format used by LZMA_Alone was primitive. It was designed with + embedded systems in mind, and thus provided only a minimal set of + features. The two biggest problems for non-embedded use were the lack + of magic bytes and an integrity check. + + Igor and Lasse started developing a new file format with some help + from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin, + and Lars Wirzenius helped with some minor things at some point of the + development. Designing the new format took quite a long time (actually, + too long a time would be a more appropriate expression). It was mostly + because Lasse was quite slow at getting things done due to personal + reasons. + + Originally the new format was supposed to use the same .lzma suffix + that was already used by the old file format. Switching to the new + format wouldn't have caused much trouble when the old format wasn't + used by many people. But since the development of the new format took + such a long time, the old format got quite popular, and it was decided + that the new file format must use a different suffix. + + It was decided to use .xz as the suffix of the new file format. The + first stable .xz file format specification was finally released in + December 2008. In addition to fixing the most obvious problems of + the old .lzma format, the .xz format added some new features like + support for multiple filters (compression algorithms), filter chaining + (like piping on the command line), and limited random-access reading. + + Currently the primary compression algorithm used in .xz is LZMA2. + It is an extension on top of the original LZMA to fix some practical + problems: LZMA2 adds support for flushing the encoder, uncompressed + chunks, eases stateful decoder implementations, and improves support + for multithreading. Since LZMA2 is better than the original LZMA, the + original LZMA is not supported in .xz. + + +Transition to XZ Utils + + The early versions of XZ Utils were called LZMA Utils. The first + releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK. + The code was still directly based on LZMA SDK but ported to C and + converted from a callback API to a stateful API. Later, Igor Pavlov + made a C version of the LZMA encoder too; these ports from C++ to C + were independent in LZMA SDK and LZMA Utils. + + The core of the new LZMA Utils was liblzma, a compression library with + a zlib-like API. liblzma supported both the old and new file format. + The gzip-like lzma command-line tool was rewritten to use liblzma. + + The new LZMA Utils code base was renamed to XZ Utils when the name + of the new file format had been decided. The liblzma compression + library retained its name though, because changing it would have + caused unnecessary breakage in applications already using the early + liblzma snapshots. + + The xz command-line tool can emulate the gzip-like lzma tool by + creating appropriate symlinks (e.g. lzma -> xz). Thus, practically + all scripts using the lzma tool from LZMA Utils will work as is with + XZ Utils (and will keep using the old .lzma format). Still, the .lzma + format is more or less deprecated. XZ Utils will keep supporting it, + but new applications should use the .xz format, and migrating old + applications to .xz is often a good idea too. + diff --git a/doc/lzma-file-format.txt b/doc/lzma-file-format.txt new file mode 100644 index 0000000..4865def --- /dev/null +++ b/doc/lzma-file-format.txt @@ -0,0 +1,173 @@ + +The .lzma File Format +===================== + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Changes + 1. File Format + 1.1. Header + 1.1.1. Properties + 1.1.2. Dictionary Size + 1.1.3. Uncompressed Size + 1.2. LZMA Compressed Data + 2. References + + +0. Preface + + This document describes the .lzma file format, which is + sometimes also called LZMA_Alone format. It is a legacy file + format, which is being or has been replaced by the .xz format. + The MIME type of the .lzma format is `application/x-lzma'. + + The most commonly used software to handle .lzma files are + LZMA SDK, LZMA Utils, 7-Zip, and XZ Utils. This document + describes some of the differences between these implementations + and gives hints what subset of the .lzma format is the most + portable. + + +0.1. Notices and Acknowledgements + + This file format was designed by Igor Pavlov for use in + LZMA SDK. This document was written by Lasse Collin + using the documentation found + from the LZMA SDK. + + This document has been put into the public domain. + + +0.2. Changes + + Last modified: 2022-07-13 21:00+0300 + + Compared to the previous version (2011-04-12 11:55+0300) + the section 1.1.3 was modified to allow End of Payload Marker + with a known Uncompressed Size. + + +1. File Format + + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + | Header | LZMA Compressed Data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + + The .lzma format file consist of 13-byte Header followed by + the LZMA Compressed Data. + + Unlike the .gz, .bz2, and .xz formats, it is not possible to + concatenate multiple .lzma files as is and expect the + decompression tool to decode the resulting file as if it were + a single .lzma file. + + For example, the command line tools from LZMA Utils and + LZMA SDK silently ignore all the data after the first .lzma + stream. In contrast, the command line tool from XZ Utils + considers the .lzma file to be corrupt if there is data after + the first .lzma stream. + + +1.1. Header + + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + | Properties | Dictionary Size | Uncompressed Size | + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + + +1.1.1. Properties + + The Properties field contains three properties. An abbreviation + is given in parentheses, followed by the value range of the + property. The field consists of + + 1) the number of literal context bits (lc, [0, 8]); + 2) the number of literal position bits (lp, [0, 4]); and + 3) the number of position bits (pb, [0, 4]). + + The properties are encoded using the following formula: + + Properties = (pb * 5 + lp) * 9 + lc + + The following C code illustrates a straightforward way to + decode the Properties field: + + uint8_t lc, lp, pb; + uint8_t prop = get_lzma_properties(); + if (prop > (4 * 5 + 4) * 9 + 8) + return LZMA_PROPERTIES_ERROR; + + pb = prop / (9 * 5); + prop -= pb * 9 * 5; + lp = prop / 9; + lc = prop - lp * 9; + + XZ Utils has an additional requirement: lc + lp <= 4. Files + which don't follow this requirement cannot be decompressed + with XZ Utils. Usually this isn't a problem since the most + common lc/lp/pb values are 3/0/2. It is the only lc/lp/pb + combination that the files created by LZMA Utils can have, + but LZMA Utils can decompress files with any lc/lp/pb. + + +1.1.2. Dictionary Size + + Dictionary Size is stored as an unsigned 32-bit little endian + integer. Any 32-bit value is possible, but for maximum + portability, only sizes of 2^n and 2^n + 2^(n-1) should be + used. + + LZMA Utils creates only files with dictionary size 2^n, + 16 <= n <= 25. LZMA Utils can decompress files with any + dictionary size. + + XZ Utils creates and decompresses .lzma files only with + dictionary sizes 2^n and 2^n + 2^(n-1). If some other + dictionary size is specified when compressing, the value + stored in the Dictionary Size field is a rounded up, but the + specified value is still used in the actual compression code. + + +1.1.3. Uncompressed Size + + Uncompressed Size is stored as unsigned 64-bit little endian + integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates + that Uncompressed Size is unknown. End of Payload Marker (*) + is used if Uncompressed Size is unknown. End of Payload Marker + is allowed but rarely used if Uncompressed Size is known. + XZ Utils 5.2.5 and older don't support .lzma files that have + End of Payload Marker together with a known Uncompressed Size. + + XZ Utils rejects files whose Uncompressed Size field specifies + a known size that is 256 GiB or more. This is to reject false + positives when trying to guess if the input file is in the + .lzma format. When Uncompressed Size is unknown, there is no + limit for the uncompressed size of the file. + + (*) Some tools use the term End of Stream (EOS) marker + instead of End of Payload Marker. + + +1.2. LZMA Compressed Data + + Detailed description of the format of this field is out of + scope of this document. + + +2. References + + LZMA SDK - The original LZMA implementation + http://7-zip.org/sdk.html + + 7-Zip + http://7-zip.org/ + + LZMA Utils - LZMA adapted to POSIX-like systems + http://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + http://tukaani.org/xz/ + + The .xz file format - The successor of the .lzma format + http://tukaani.org/xz/xz-file-format.txt + diff --git a/doc/man/pdf-a4/lzmainfo-a4.pdf b/doc/man/pdf-a4/lzmainfo-a4.pdf new file mode 100644 index 0000000..91f2561 Binary files /dev/null and b/doc/man/pdf-a4/lzmainfo-a4.pdf differ diff --git a/doc/man/pdf-a4/xz-a4.pdf b/doc/man/pdf-a4/xz-a4.pdf new file mode 100644 index 0000000..6156cfe Binary files /dev/null and b/doc/man/pdf-a4/xz-a4.pdf differ diff --git a/doc/man/pdf-a4/xzdec-a4.pdf b/doc/man/pdf-a4/xzdec-a4.pdf new file mode 100644 index 0000000..b3a761a Binary files /dev/null and b/doc/man/pdf-a4/xzdec-a4.pdf differ diff --git a/doc/man/pdf-a4/xzdiff-a4.pdf b/doc/man/pdf-a4/xzdiff-a4.pdf new file mode 100644 index 0000000..084cb80 Binary files /dev/null and b/doc/man/pdf-a4/xzdiff-a4.pdf differ diff --git a/doc/man/pdf-a4/xzgrep-a4.pdf b/doc/man/pdf-a4/xzgrep-a4.pdf new file mode 100644 index 0000000..e3c54fb Binary files /dev/null and b/doc/man/pdf-a4/xzgrep-a4.pdf differ diff --git a/doc/man/pdf-a4/xzless-a4.pdf b/doc/man/pdf-a4/xzless-a4.pdf new file mode 100644 index 0000000..01176ed Binary files /dev/null and b/doc/man/pdf-a4/xzless-a4.pdf differ diff --git a/doc/man/pdf-a4/xzmore-a4.pdf b/doc/man/pdf-a4/xzmore-a4.pdf new file mode 100644 index 0000000..f829bf4 Binary files /dev/null and b/doc/man/pdf-a4/xzmore-a4.pdf differ diff --git a/doc/man/pdf-letter/lzmainfo-letter.pdf b/doc/man/pdf-letter/lzmainfo-letter.pdf new file mode 100644 index 0000000..6f2ae17 Binary files /dev/null and b/doc/man/pdf-letter/lzmainfo-letter.pdf differ diff --git a/doc/man/pdf-letter/xz-letter.pdf b/doc/man/pdf-letter/xz-letter.pdf new file mode 100644 index 0000000..9a733d9 Binary files /dev/null and b/doc/man/pdf-letter/xz-letter.pdf differ diff --git a/doc/man/pdf-letter/xzdec-letter.pdf b/doc/man/pdf-letter/xzdec-letter.pdf new file mode 100644 index 0000000..89b2ded Binary files /dev/null and b/doc/man/pdf-letter/xzdec-letter.pdf differ diff --git a/doc/man/pdf-letter/xzdiff-letter.pdf b/doc/man/pdf-letter/xzdiff-letter.pdf new file mode 100644 index 0000000..143e979 Binary files /dev/null and b/doc/man/pdf-letter/xzdiff-letter.pdf differ diff --git a/doc/man/pdf-letter/xzgrep-letter.pdf b/doc/man/pdf-letter/xzgrep-letter.pdf new file mode 100644 index 0000000..54fc897 Binary files /dev/null and b/doc/man/pdf-letter/xzgrep-letter.pdf differ diff --git a/doc/man/pdf-letter/xzless-letter.pdf b/doc/man/pdf-letter/xzless-letter.pdf new file mode 100644 index 0000000..0e48e01 Binary files /dev/null and b/doc/man/pdf-letter/xzless-letter.pdf differ diff --git a/doc/man/pdf-letter/xzmore-letter.pdf b/doc/man/pdf-letter/xzmore-letter.pdf new file mode 100644 index 0000000..1a019e0 Binary files /dev/null and b/doc/man/pdf-letter/xzmore-letter.pdf differ diff --git a/doc/man/txt/lzmainfo.txt b/doc/man/txt/lzmainfo.txt new file mode 100644 index 0000000..fa4e51c --- /dev/null +++ b/doc/man/txt/lzmainfo.txt @@ -0,0 +1,40 @@ +LZMAINFO(1) XZ Utils LZMAINFO(1) + + + +NAME + lzmainfo - show information stored in the .lzma file header + +SYNOPSIS + lzmainfo [--help] [--version] [file...] + +DESCRIPTION + lzmainfo shows information stored in the .lzma file header. It reads + the first 13 bytes from the specified file, decodes the header, and + prints it to standard output in human readable format. If no files are + given or file is -, standard input is read. + + Usually the most interesting information is the uncompressed size and + the dictionary size. Uncompressed size can be shown only if the file + is in the non-streamed .lzma format variant. The amount of memory re- + quired to decompress the file is a few dozen kilobytes plus the dictio- + nary size. + + lzmainfo is included in XZ Utils primarily for backward compatibility + with LZMA Utils. + +EXIT STATUS + 0 All is good. + + 1 An error occurred. + +BUGS + lzmainfo uses MB while the correct suffix would be MiB (2^20 bytes). + This is to keep the output compatible with LZMA Utils. + +SEE ALSO + xz(1) + + + +Tukaani 2013-06-30 LZMAINFO(1) diff --git a/doc/man/txt/xz.txt b/doc/man/txt/xz.txt new file mode 100644 index 0000000..be24360 --- /dev/null +++ b/doc/man/txt/xz.txt @@ -0,0 +1,1589 @@ +XZ(1) XZ Utils XZ(1) + + + +NAME + xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and + .lzma files + +SYNOPSIS + xz [option...] [file...] + +COMMAND ALIASES + unxz is equivalent to xz --decompress. + xzcat is equivalent to xz --decompress --stdout. + lzma is equivalent to xz --format=lzma. + unlzma is equivalent to xz --format=lzma --decompress. + lzcat is equivalent to xz --format=lzma --decompress --stdout. + + When writing scripts that need to decompress files, it is recommended + to always use the name xz with appropriate arguments (xz -d or xz -dc) + instead of the names unxz and xzcat. + +DESCRIPTION + xz is a general-purpose data compression tool with command line syntax + similar to gzip(1) and bzip2(1). The native file format is the .xz + format, but the legacy .lzma format used by LZMA Utils and raw com- + pressed streams with no container format headers are also supported. + In addition, decompression of the .lz format used by lzip is supported. + + xz compresses or decompresses each file according to the selected oper- + ation mode. If no files are given or file is -, xz reads from standard + input and writes the processed data to standard output. xz will refuse + (display an error and skip the file) to write compressed data to stan- + dard output if it is a terminal. Similarly, xz will refuse to read + compressed data from standard input if it is a terminal. + + Unless --stdout is specified, files other than - are written to a new + file whose name is derived from the source file name: + + o When compressing, the suffix of the target file format (.xz or + .lzma) is appended to the source filename to get the target file- + name. + + o When decompressing, the .xz, .lzma, or .lz suffix is removed from + the filename to get the target filename. xz also recognizes the + suffixes .txz and .tlz, and replaces them with the .tar suffix. + + If the target file already exists, an error is displayed and the file + is skipped. + + Unless writing to standard output, xz will display a warning and skip + the file if any of the following applies: + + o File is not a regular file. Symbolic links are not followed, and + thus they are not considered to be regular files. + + o File has more than one hard link. + + o File has setuid, setgid, or sticky bit set. + + o The operation mode is set to compress and the file already has a + suffix of the target file format (.xz or .txz when compressing to + the .xz format, and .lzma or .tlz when compressing to the .lzma for- + mat). + + o The operation mode is set to decompress and the file doesn't have a + suffix of any of the supported file formats (.xz, .txz, .lzma, .tlz, + or .lz). + + After successfully compressing or decompressing the file, xz copies the + owner, group, permissions, access time, and modification time from the + source file to the target file. If copying the group fails, the per- + missions are modified so that the target file doesn't become accessible + to users who didn't have permission to access the source file. xz + doesn't support copying other metadata like access control lists or ex- + tended attributes yet. + + Once the target file has been successfully closed, the source file is + removed unless --keep was specified. The source file is never removed + if the output is written to standard output or if an error occurs. + + Sending SIGINFO or SIGUSR1 to the xz process makes it print progress + information to standard error. This has only limited use since when + standard error is a terminal, using --verbose will display an automati- + cally updating progress indicator. + + Memory usage + The memory usage of xz varies from a few hundred kilobytes to several + gigabytes depending on the compression settings. The settings used + when compressing a file determine the memory requirements of the decom- + pressor. Typically the decompressor needs 5 % to 20 % of the amount of + memory that the compressor needed when creating the file. For example, + decompressing a file created with xz -9 currently requires 65 MiB of + memory. Still, it is possible to have .xz files that require several + gigabytes of memory to decompress. + + Especially users of older systems may find the possibility of very + large memory usage annoying. To prevent uncomfortable surprises, xz + has a built-in memory usage limiter, which is disabled by default. + While some operating systems provide ways to limit the memory usage of + processes, relying on it wasn't deemed to be flexible enough (for exam- + ple, using ulimit(1) to limit virtual memory tends to cripple mmap(2)). + + The memory usage limiter can be enabled with the command line option + --memlimit=limit. Often it is more convenient to enable the limiter by + default by setting the environment variable XZ_DEFAULTS, for example, + XZ_DEFAULTS=--memlimit=150MiB. It is possible to set the limits sepa- + rately for compression and decompression by using --memlimit-com- + press=limit and --memlimit-decompress=limit. Using these two options + outside XZ_DEFAULTS is rarely useful because a single run of xz cannot + do both compression and decompression and --memlimit=limit (or -M + limit) is shorter to type on the command line. + + If the specified memory usage limit is exceeded when decompressing, xz + will display an error and decompressing the file will fail. If the + limit is exceeded when compressing, xz will try to scale the settings + down so that the limit is no longer exceeded (except when using --for- + mat=raw or --no-adjust). This way the operation won't fail unless the + limit is very small. The scaling of the settings is done in steps that + don't match the compression level presets, for example, if the limit is + only slightly less than the amount required for xz -9, the settings + will be scaled down only a little, not all the way down to xz -8. + + Concatenation and padding with .xz files + It is possible to concatenate .xz files as is. xz will decompress such + files as if they were a single .xz file. + + It is possible to insert padding between the concatenated parts or af- + ter the last part. The padding must consist of null bytes and the size + of the padding must be a multiple of four bytes. This can be useful, + for example, if the .xz file is stored on a medium that measures file + sizes in 512-byte blocks. + + Concatenation and padding are not allowed with .lzma files or raw + streams. + +OPTIONS + Integer suffixes and special values + In most places where an integer argument is expected, an optional suf- + fix is supported to easily indicate large integers. There must be no + space between the integer and the suffix. + + KiB Multiply the integer by 1,024 (2^10). Ki, k, kB, K, and KB are + accepted as synonyms for KiB. + + MiB Multiply the integer by 1,048,576 (2^20). Mi, m, M, and MB are + accepted as synonyms for MiB. + + GiB Multiply the integer by 1,073,741,824 (2^30). Gi, g, G, and GB + are accepted as synonyms for GiB. + + The special value max can be used to indicate the maximum integer value + supported by the option. + + Operation mode + If multiple operation mode options are given, the last one takes ef- + fect. + + -z, --compress + Compress. This is the default operation mode when no operation + mode option is specified and no other operation mode is implied + from the command name (for example, unxz implies --decompress). + + -d, --decompress, --uncompress + Decompress. + + -t, --test + Test the integrity of compressed files. This option is equiva- + lent to --decompress --stdout except that the decompressed data + is discarded instead of being written to standard output. No + files are created or removed. + + -l, --list + Print information about compressed files. No uncompressed out- + put is produced, and no files are created or removed. In list + mode, the program cannot read the compressed data from standard + input or from other unseekable sources. + + The default listing shows basic information about files, one + file per line. To get more detailed information, use also the + --verbose option. For even more information, use --verbose + twice, but note that this may be slow, because getting all the + extra information requires many seeks. The width of verbose + output exceeds 80 characters, so piping the output to, for exam- + ple, less -S may be convenient if the terminal isn't wide + enough. + + The exact output may vary between xz versions and different lo- + cales. For machine-readable output, --robot --list should be + used. + + Operation modifiers + -k, --keep + Don't delete the input files. + + Since xz 5.2.6, this option also makes xz compress or decompress + even if the input is a symbolic link to a regular file, has more + than one hard link, or has the setuid, setgid, or sticky bit + set. The setuid, setgid, and sticky bits are not copied to the + target file. In earlier versions this was only done with + --force. + + -f, --force + This option has several effects: + + o If the target file already exists, delete it before compress- + ing or decompressing. + + o Compress or decompress even if the input is a symbolic link + to a regular file, has more than one hard link, or has the + setuid, setgid, or sticky bit set. The setuid, setgid, and + sticky bits are not copied to the target file. + + o When used with --decompress --stdout and xz cannot recognize + the type of the source file, copy the source file as is to + standard output. This allows xzcat --force to be used like + cat(1) for files that have not been compressed with xz. Note + that in future, xz might support new compressed file formats, + which may make xz decompress more types of files instead of + copying them as is to standard output. --format=format can + be used to restrict xz to decompress only a single file for- + mat. + + -c, --stdout, --to-stdout + Write the compressed or decompressed data to standard output in- + stead of a file. This implies --keep. + + --single-stream + Decompress only the first .xz stream, and silently ignore possi- + ble remaining input data following the stream. Normally such + trailing garbage makes xz display an error. + + xz never decompresses more than one stream from .lzma files or + raw streams, but this option still makes xz ignore the possible + trailing data after the .lzma file or raw stream. + + This option has no effect if the operation mode is not --decom- + press or --test. + + --no-sparse + Disable creation of sparse files. By default, if decompressing + into a regular file, xz tries to make the file sparse if the de- + compressed data contains long sequences of binary zeros. It + also works when writing to standard output as long as standard + output is connected to a regular file and certain additional + conditions are met to make it safe. Creating sparse files may + save disk space and speed up the decompression by reducing the + amount of disk I/O. + + -S .suf, --suffix=.suf + When compressing, use .suf as the suffix for the target file in- + stead of .xz or .lzma. If not writing to standard output and + the source file already has the suffix .suf, a warning is dis- + played and the file is skipped. + + When decompressing, recognize files with the suffix .suf in ad- + dition to files with the .xz, .txz, .lzma, .tlz, or .lz suffix. + If the source file has the suffix .suf, the suffix is removed to + get the target filename. + + When compressing or decompressing raw streams (--format=raw), + the suffix must always be specified unless writing to standard + output, because there is no default suffix for raw streams. + + --files[=file] + Read the filenames to process from file; if file is omitted, + filenames are read from standard input. Filenames must be ter- + minated with the newline character. A dash (-) is taken as a + regular filename; it doesn't mean standard input. If filenames + are given also as command line arguments, they are processed be- + fore the filenames read from file. + + --files0[=file] + This is identical to --files[=file] except that each filename + must be terminated with the null character. + + Basic file format and compression options + -F format, --format=format + Specify the file format to compress or decompress: + + auto This is the default. When compressing, auto is equiva- + lent to xz. When decompressing, the format of the input + file is automatically detected. Note that raw streams + (created with --format=raw) cannot be auto-detected. + + xz Compress to the .xz file format, or accept only .xz files + when decompressing. + + lzma, alone + Compress to the legacy .lzma file format, or accept only + .lzma files when decompressing. The alternative name + alone is provided for backwards compatibility with LZMA + Utils. + + lzip Accept only .lz files when decompressing. Compression is + not supported. + + The .lz format version 0 and the unextended version 1 are + supported. Version 0 files were produced by lzip 1.3 and + older. Such files aren't common but may be found from + file archives as a few source packages were released in + this format. People might have old personal files in + this format too. Decompression support for the format + version 0 was removed in lzip 1.18. + + lzip 1.4 and later create files in the format version 1. + The sync flush marker extension to the format version 1 + was added in lzip 1.6. This extension is rarely used and + isn't supported by xz (diagnosed as corrupt input). + + raw Compress or uncompress a raw stream (no headers). This + is meant for advanced users only. To decode raw streams, + you need use --format=raw and explicitly specify the fil- + ter chain, which normally would have been stored in the + container headers. + + -C check, --check=check + Specify the type of the integrity check. The check is calcu- + lated from the uncompressed data and stored in the .xz file. + This option has an effect only when compressing into the .xz + format; the .lzma format doesn't support integrity checks. The + integrity check (if any) is verified when the .xz file is decom- + pressed. + + Supported check types: + + none Don't calculate an integrity check at all. This is usu- + ally a bad idea. This can be useful when integrity of + the data is verified by other means anyway. + + crc32 Calculate CRC32 using the polynomial from IEEE-802.3 + (Ethernet). + + crc64 Calculate CRC64 using the polynomial from ECMA-182. This + is the default, since it is slightly better than CRC32 at + detecting damaged files and the speed difference is neg- + ligible. + + sha256 Calculate SHA-256. This is somewhat slower than CRC32 + and CRC64. + + Integrity of the .xz headers is always verified with CRC32. It + is not possible to change or disable it. + + --ignore-check + Don't verify the integrity check of the compressed data when de- + compressing. The CRC32 values in the .xz headers will still be + verified normally. + + Do not use this option unless you know what you are doing. Pos- + sible reasons to use this option: + + o Trying to recover data from a corrupt .xz file. + + o Speeding up decompression. This matters mostly with SHA-256 + or with files that have compressed extremely well. It's rec- + ommended to not use this option for this purpose unless the + file integrity is verified externally in some other way. + + -0 ... -9 + Select a compression preset level. The default is -6. If mul- + tiple preset levels are specified, the last one takes effect. + If a custom filter chain was already specified, setting a com- + pression preset level clears the custom filter chain. + + The differences between the presets are more significant than + with gzip(1) and bzip2(1). The selected compression settings + determine the memory requirements of the decompressor, thus us- + ing a too high preset level might make it painful to decompress + the file on an old system with little RAM. Specifically, it's + not a good idea to blindly use -9 for everything like it often + is with gzip(1) and bzip2(1). + + -0 ... -3 + These are somewhat fast presets. -0 is sometimes faster + than gzip -9 while compressing much better. The higher + ones often have speed comparable to bzip2(1) with compa- + rable or better compression ratio, although the results + depend a lot on the type of data being compressed. + + -4 ... -6 + Good to very good compression while keeping decompressor + memory usage reasonable even for old systems. -6 is the + default, which is usually a good choice for distributing + files that need to be decompressible even on systems with + only 16 MiB RAM. (-5e or -6e may be worth considering + too. See --extreme.) + + -7 ... -9 + These are like -6 but with higher compressor and decom- + pressor memory requirements. These are useful only when + compressing files bigger than 8 MiB, 16 MiB, and 32 MiB, + respectively. + + On the same hardware, the decompression speed is approximately a + constant number of bytes of compressed data per second. In + other words, the better the compression, the faster the decom- + pression will usually be. This also means that the amount of + uncompressed output produced per second can vary a lot. + + The following table summarises the features of the presets: + + Preset DictSize CompCPU CompMem DecMem + -0 256 KiB 0 3 MiB 1 MiB + -1 1 MiB 1 9 MiB 2 MiB + -2 2 MiB 2 17 MiB 3 MiB + -3 4 MiB 3 32 MiB 5 MiB + -4 4 MiB 4 48 MiB 5 MiB + -5 8 MiB 5 94 MiB 9 MiB + -6 8 MiB 6 94 MiB 9 MiB + -7 16 MiB 6 186 MiB 17 MiB + -8 32 MiB 6 370 MiB 33 MiB + -9 64 MiB 6 674 MiB 65 MiB + + Column descriptions: + + o DictSize is the LZMA2 dictionary size. It is waste of memory + to use a dictionary bigger than the size of the uncompressed + file. This is why it is good to avoid using the presets -7 + ... -9 when there's no real need for them. At -6 and lower, + the amount of memory wasted is usually low enough to not mat- + ter. + + o CompCPU is a simplified representation of the LZMA2 settings + that affect compression speed. The dictionary size affects + speed too, so while CompCPU is the same for levels -6 ... -9, + higher levels still tend to be a little slower. To get even + slower and thus possibly better compression, see --extreme. + + o CompMem contains the compressor memory requirements in the + single-threaded mode. It may vary slightly between xz ver- + sions. Memory requirements of some of the future multi- + threaded modes may be dramatically higher than that of the + single-threaded mode. + + o DecMem contains the decompressor memory requirements. That + is, the compression settings determine the memory require- + ments of the decompressor. The exact decompressor memory us- + age is slightly more than the LZMA2 dictionary size, but the + values in the table have been rounded up to the next full + MiB. + + -e, --extreme + Use a slower variant of the selected compression preset level + (-0 ... -9) to hopefully get a little bit better compression ra- + tio, but with bad luck this can also make it worse. Decompres- + sor memory usage is not affected, but compressor memory usage + increases a little at preset levels -0 ... -3. + + Since there are two presets with dictionary sizes 4 MiB and + 8 MiB, the presets -3e and -5e use slightly faster settings + (lower CompCPU) than -4e and -6e, respectively. That way no two + presets are identical. + + Preset DictSize CompCPU CompMem DecMem + -0e 256 KiB 8 4 MiB 1 MiB + -1e 1 MiB 8 13 MiB 2 MiB + -2e 2 MiB 8 25 MiB 3 MiB + -3e 4 MiB 7 48 MiB 5 MiB + -4e 4 MiB 8 48 MiB 5 MiB + -5e 8 MiB 7 94 MiB 9 MiB + -6e 8 MiB 8 94 MiB 9 MiB + -7e 16 MiB 8 186 MiB 17 MiB + -8e 32 MiB 8 370 MiB 33 MiB + -9e 64 MiB 8 674 MiB 65 MiB + + For example, there are a total of four presets that use 8 MiB + dictionary, whose order from the fastest to the slowest is -5, + -6, -5e, and -6e. + + --fast + --best These are somewhat misleading aliases for -0 and -9, respec- + tively. These are provided only for backwards compatibility + with LZMA Utils. Avoid using these options. + + --block-size=size + When compressing to the .xz format, split the input data into + blocks of size bytes. The blocks are compressed independently + from each other, which helps with multi-threading and makes lim- + ited random-access decompression possible. This option is typi- + cally used to override the default block size in multi-threaded + mode, but this option can be used in single-threaded mode too. + + In multi-threaded mode about three times size bytes will be al- + located in each thread for buffering input and output. The de- + fault size is three times the LZMA2 dictionary size or 1 MiB, + whichever is more. Typically a good value is 2-4 times the size + of the LZMA2 dictionary or at least 1 MiB. Using size less than + the LZMA2 dictionary size is waste of RAM because then the LZMA2 + dictionary buffer will never get fully used. The sizes of the + blocks are stored in the block headers, which a future version + of xz will use for multi-threaded decompression. + + In single-threaded mode no block splitting is done by default. + Setting this option doesn't affect memory usage. No size infor- + mation is stored in block headers, thus files created in single- + threaded mode won't be identical to files created in multi- + threaded mode. The lack of size information also means that a + future version of xz won't be able decompress the files in + multi-threaded mode. + + --block-list=sizes + When compressing to the .xz format, start a new block after the + given intervals of uncompressed data. + + The uncompressed sizes of the blocks are specified as a comma- + separated list. Omitting a size (two or more consecutive com- + mas) is a shorthand to use the size of the previous block. + + If the input file is bigger than the sum of sizes, the last + value in sizes is repeated until the end of the file. A special + value of 0 may be used as the last value to indicate that the + rest of the file should be encoded as a single block. + + If one specifies sizes that exceed the encoder's block size (ei- + ther the default value in threaded mode or the value specified + with --block-size=size), the encoder will create additional + blocks while keeping the boundaries specified in sizes. For ex- + ample, if one specifies --block-size=10MiB + --block-list=5MiB,10MiB,8MiB,12MiB,24MiB and the input file is + 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, + 10, and 1 MiB. + + In multi-threaded mode the sizes of the blocks are stored in the + block headers. This isn't done in single-threaded mode, so the + encoded output won't be identical to that of the multi-threaded + mode. + + --flush-timeout=timeout + When compressing, if more than timeout milliseconds (a positive + integer) has passed since the previous flush and reading more + input would block, all the pending input data is flushed from + the encoder and made available in the output stream. This can + be useful if xz is used to compress data that is streamed over a + network. Small timeout values make the data available at the + receiving end with a small delay, but large timeout values give + better compression ratio. + + This feature is disabled by default. If this option is speci- + fied more than once, the last one takes effect. The special + timeout value of 0 can be used to explicitly disable this fea- + ture. + + This feature is not available on non-POSIX systems. + + This feature is still experimental. Currently xz is unsuitable + for decompressing the stream in real time due to how xz does + buffering. + + --memlimit-compress=limit + Set a memory usage limit for compression. If this option is + specified multiple times, the last one takes effect. + + If the compression settings exceed the limit, xz will attempt to + adjust the settings downwards so that the limit is no longer ex- + ceeded and display a notice that automatic adjustment was done. + The adjustments are done in this order: reducing the number of + threads, switching to single-threaded mode if even one thread in + multi-threaded mode exceeds the limit, and finally reducing the + LZMA2 dictionary size. + + When compressing with --format=raw or if --no-adjust has been + specified, only the number of threads may be reduced since it + can be done without affecting the compressed output. + + If the limit cannot be met even with the adjustments described + above, an error is displayed and xz will exit with exit status + 1. + + The limit can be specified in multiple ways: + + o The limit can be an absolute value in bytes. Using an inte- + ger suffix like MiB can be useful. Example: --memlimit-com- + press=80MiB + + o The limit can be specified as a percentage of total physical + memory (RAM). This can be useful especially when setting the + XZ_DEFAULTS environment variable in a shell initialization + script that is shared between different computers. That way + the limit is automatically bigger on systems with more mem- + ory. Example: --memlimit-compress=70% + + o The limit can be reset back to its default value by setting + it to 0. This is currently equivalent to setting the limit + to max (no memory usage limit). + + For 32-bit xz there is a special case: if the limit would be + over 4020 MiB, the limit is set to 4020 MiB. On MIPS32 2000 MiB + is used instead. (The values 0 and max aren't affected by this. + A similar feature doesn't exist for decompression.) This can be + helpful when a 32-bit executable has access to 4 GiB address + space (2 GiB on MIPS32) while hopefully doing no harm in other + situations. + + See also the section Memory usage. + + --memlimit-decompress=limit + Set a memory usage limit for decompression. This also affects + the --list mode. If the operation is not possible without ex- + ceeding the limit, xz will display an error and decompressing + the file will fail. See --memlimit-compress=limit for possible + ways to specify the limit. + + --memlimit-mt-decompress=limit + Set a memory usage limit for multi-threaded decompression. This + can only affect the number of threads; this will never make xz + refuse to decompress a file. If limit is too low to allow any + multi-threading, the limit is ignored and xz will continue in + single-threaded mode. Note that if also --memlimit-decompress + is used, it will always apply to both single-threaded and multi- + threaded modes, and so the effective limit for multi-threading + will never be higher than the limit set with --memlimit-decom- + press. + + In contrast to the other memory usage limit options, --mem- + limit-mt-decompress=limit has a system-specific default limit. + xz --info-memory can be used to see the current value. + + This option and its default value exist because without any + limit the threaded decompressor could end up allocating an in- + sane amount of memory with some input files. If the default + limit is too low on your system, feel free to increase the limit + but never set it to a value larger than the amount of usable RAM + as with appropriate input files xz will attempt to use that + amount of memory even with a low number of threads. Running out + of memory or swapping will not improve decompression perfor- + mance. + + See --memlimit-compress=limit for possible ways to specify the + limit. Setting limit to 0 resets the limit to the default sys- + tem-specific value. + + + + -M limit, --memlimit=limit, --memory=limit + This is equivalent to specifying --memlimit-compress=limit + --memlimit-decompress=limit --memlimit-mt-decompress=limit. + + --no-adjust + Display an error and exit if the memory usage limit cannot be + met without adjusting settings that affect the compressed out- + put. That is, this prevents xz from switching the encoder from + multi-threaded mode to single-threaded mode and from reducing + the LZMA2 dictionary size. Even when this option is used the + number of threads may be reduced to meet the memory usage limit + as that won't affect the compressed output. + + Automatic adjusting is always disabled when creating raw streams + (--format=raw). + + -T threads, --threads=threads + Specify the number of worker threads to use. Setting threads to + a special value 0 makes xz use up to as many threads as the pro- + cessor(s) on the system support. The actual number of threads + can be fewer than threads if the input file is not big enough + for threading with the given settings or if using more threads + would exceed the memory usage limit. + + The single-threaded and multi-threaded compressors produce dif- + ferent output. Single-threaded compressor will give the small- + est file size but only the output from the multi-threaded com- + pressor can be decompressed using multiple threads. Setting + threads to 1 will use the single-threaded mode. Setting threads + to any other value, including 0, will use the multi-threaded + compressor even if the system supports only one hardware thread. + (xz 5.2.x used single-threaded mode in this situation.) + + To use multi-threaded mode with only one thread, set threads to + +1. The + prefix has no effect with values other than 1. A + memory usage limit can still make xz switch to single-threaded + mode unless --no-adjust is used. Support for the + prefix was + added in xz 5.4.0. + + If an automatic number of threads has been requested and no mem- + ory usage limit has been specified, then a system-specific de- + fault soft limit will be used to possibly limit the number of + threads. It is a soft limit in sense that it is ignored if the + number of threads becomes one, thus a soft limit will never stop + xz from compressing or decompressing. This default soft limit + will not make xz switch from multi-threaded mode to single- + threaded mode. The active limits can be seen with xz + --info-memory. + + Currently the only threading method is to split the input into + blocks and compress them independently from each other. The de- + fault block size depends on the compression level and can be + overridden with the --block-size=size option. + + Threaded decompression only works on files that contain multiple + blocks with size information in block headers. All large enough + files compressed in multi-threaded mode meet this condition, but + files compressed in single-threaded mode don't even if + --block-size=size has been used. + + Custom compressor filter chains + A custom filter chain allows specifying the compression settings in de- + tail instead of relying on the settings associated to the presets. + When a custom filter chain is specified, preset options (-0 ... -9 and + --extreme) earlier on the command line are forgotten. If a preset op- + tion is specified after one or more custom filter chain options, the + new preset takes effect and the custom filter chain options specified + earlier are forgotten. + + A filter chain is comparable to piping on the command line. When com- + pressing, the uncompressed input goes to the first filter, whose output + goes to the next filter (if any). The output of the last filter gets + written to the compressed file. The maximum number of filters in the + chain is four, but typically a filter chain has only one or two fil- + ters. + + Many filters have limitations on where they can be in the filter chain: + some filters can work only as the last filter in the chain, some only + as a non-last filter, and some work in any position in the chain. De- + pending on the filter, this limitation is either inherent to the filter + design or exists to prevent security issues. + + A custom filter chain is specified by using one or more filter options + in the order they are wanted in the filter chain. That is, the order + of filter options is significant! When decoding raw streams (--for- + mat=raw), the filter chain is specified in the same order as it was + specified when compressing. + + Filters take filter-specific options as a comma-separated list. Extra + commas in options are ignored. Every option has a default value, so + you need to specify only those you want to change. + + To see the whole filter chain and options, use xz -vv (that is, use + --verbose twice). This works also for viewing the filter chain options + used by presets. + + --lzma1[=options] + --lzma2[=options] + Add LZMA1 or LZMA2 filter to the filter chain. These filters + can be used only as the last filter in the chain. + + LZMA1 is a legacy filter, which is supported almost solely due + to the legacy .lzma file format, which supports only LZMA1. + LZMA2 is an updated version of LZMA1 to fix some practical is- + sues of LZMA1. The .xz format uses LZMA2 and doesn't support + LZMA1 at all. Compression speed and ratios of LZMA1 and LZMA2 + are practically the same. + + LZMA1 and LZMA2 share the same set of options: + + preset=preset + Reset all LZMA1 or LZMA2 options to preset. Preset con- + sist of an integer, which may be followed by single-let- + ter preset modifiers. The integer can be from 0 to 9, + matching the command line options -0 ... -9. The only + supported modifier is currently e, which matches --ex- + treme. If no preset is specified, the default values of + LZMA1 or LZMA2 options are taken from the preset 6. + + dict=size + Dictionary (history buffer) size indicates how many bytes + of the recently processed uncompressed data is kept in + memory. The algorithm tries to find repeating byte se- + quences (matches) in the uncompressed data, and replace + them with references to the data currently in the dictio- + nary. The bigger the dictionary, the higher is the + chance to find a match. Thus, increasing dictionary size + usually improves compression ratio, but a dictionary big- + ger than the uncompressed file is waste of memory. + + Typical dictionary size is from 64 KiB to 64 MiB. The + minimum is 4 KiB. The maximum for compression is cur- + rently 1.5 GiB (1536 MiB). The decompressor already sup- + ports dictionaries up to one byte less than 4 GiB, which + is the maximum for the LZMA1 and LZMA2 stream formats. + + Dictionary size and match finder (mf) together determine + the memory usage of the LZMA1 or LZMA2 encoder. The same + (or bigger) dictionary size is required for decompressing + that was used when compressing, thus the memory usage of + the decoder is determined by the dictionary size used + when compressing. The .xz headers store the dictionary + size either as 2^n or 2^n + 2^(n-1), so these sizes are + somewhat preferred for compression. Other sizes will get + rounded up when stored in the .xz headers. + + lc=lc Specify the number of literal context bits. The minimum + is 0 and the maximum is 4; the default is 3. In addi- + tion, the sum of lc and lp must not exceed 4. + + All bytes that cannot be encoded as matches are encoded + as literals. That is, literals are simply 8-bit bytes + that are encoded one at a time. + + The literal coding makes an assumption that the highest + lc bits of the previous uncompressed byte correlate with + the next byte. For example, in typical English text, an + upper-case letter is often followed by a lower-case let- + ter, and a lower-case letter is usually followed by an- + other lower-case letter. In the US-ASCII character set, + the highest three bits are 010 for upper-case letters and + 011 for lower-case letters. When lc is at least 3, the + literal coding can take advantage of this property in the + uncompressed data. + + The default value (3) is usually good. If you want maxi- + mum compression, test lc=4. Sometimes it helps a little, + and sometimes it makes compression worse. If it makes it + worse, test lc=2 too. + + lp=lp Specify the number of literal position bits. The minimum + is 0 and the maximum is 4; the default is 0. + + Lp affects what kind of alignment in the uncompressed + data is assumed when encoding literals. See pb below for + more information about alignment. + + pb=pb Specify the number of position bits. The minimum is 0 + and the maximum is 4; the default is 2. + + Pb affects what kind of alignment in the uncompressed + data is assumed in general. The default means four-byte + alignment (2^pb=2^2=4), which is often a good choice when + there's no better guess. + + When the alignment is known, setting pb accordingly may + reduce the file size a little. For example, with text + files having one-byte alignment (US-ASCII, ISO-8859-*, + UTF-8), setting pb=0 can improve compression slightly. + For UTF-16 text, pb=1 is a good choice. If the alignment + is an odd number like 3 bytes, pb=0 might be the best + choice. + + Even though the assumed alignment can be adjusted with pb + and lp, LZMA1 and LZMA2 still slightly favor 16-byte + alignment. It might be worth taking into account when + designing file formats that are likely to be often com- + pressed with LZMA1 or LZMA2. + + mf=mf Match finder has a major effect on encoder speed, memory + usage, and compression ratio. Usually Hash Chain match + finders are faster than Binary Tree match finders. The + default depends on the preset: 0 uses hc3, 1-3 use hc4, + and the rest use bt4. + + The following match finders are supported. The memory + usage formulas below are rough approximations, which are + closest to the reality when dict is a power of two. + + hc3 Hash Chain with 2- and 3-byte hashing + Minimum value for nice: 3 + Memory usage: + dict * 7.5 (if dict <= 16 MiB); + dict * 5.5 + 64 MiB (if dict > 16 MiB) + + hc4 Hash Chain with 2-, 3-, and 4-byte hashing + Minimum value for nice: 4 + Memory usage: + dict * 7.5 (if dict <= 32 MiB); + dict * 6.5 (if dict > 32 MiB) + + bt2 Binary Tree with 2-byte hashing + Minimum value for nice: 2 + Memory usage: dict * 9.5 + + bt3 Binary Tree with 2- and 3-byte hashing + Minimum value for nice: 3 + Memory usage: + dict * 11.5 (if dict <= 16 MiB); + dict * 9.5 + 64 MiB (if dict > 16 MiB) + + bt4 Binary Tree with 2-, 3-, and 4-byte hashing + Minimum value for nice: 4 + Memory usage: + dict * 11.5 (if dict <= 32 MiB); + dict * 10.5 (if dict > 32 MiB) + + mode=mode + Compression mode specifies the method to analyze the data + produced by the match finder. Supported modes are fast + and normal. The default is fast for presets 0-3 and nor- + mal for presets 4-9. + + Usually fast is used with Hash Chain match finders and + normal with Binary Tree match finders. This is also what + the presets do. + + nice=nice + Specify what is considered to be a nice length for a + match. Once a match of at least nice bytes is found, the + algorithm stops looking for possibly better matches. + + Nice can be 2-273 bytes. Higher values tend to give bet- + ter compression ratio at the expense of speed. The de- + fault depends on the preset. + + depth=depth + Specify the maximum search depth in the match finder. + The default is the special value of 0, which makes the + compressor determine a reasonable depth from mf and nice. + + Reasonable depth for Hash Chains is 4-100 and 16-1000 for + Binary Trees. Using very high values for depth can make + the encoder extremely slow with some files. Avoid set- + ting the depth over 1000 unless you are prepared to in- + terrupt the compression in case it is taking far too + long. + + When decoding raw streams (--format=raw), LZMA2 needs only the + dictionary size. LZMA1 needs also lc, lp, and pb. + + --x86[=options] + --arm[=options] + --armthumb[=options] + --arm64[=options] + --powerpc[=options] + --ia64[=options] + --sparc[=options] + Add a branch/call/jump (BCJ) filter to the filter chain. These + filters can be used only as a non-last filter in the filter + chain. + + A BCJ filter converts relative addresses in the machine code to + their absolute counterparts. This doesn't change the size of + the data but it increases redundancy, which can help LZMA2 to + produce 0-15 % smaller .xz file. The BCJ filters are always re- + versible, so using a BCJ filter for wrong type of data doesn't + cause any data loss, although it may make the compression ratio + slightly worse. The BCJ filters are very fast and use an in- + significant amount of memory. + + These BCJ filters have known problems related to the compression + ratio: + + o Some types of files containing executable code (for example, + object files, static libraries, and Linux kernel modules) + have the addresses in the instructions filled with filler + values. These BCJ filters will still do the address conver- + sion, which will make the compression worse with these files. + + o If a BCJ filter is applied on an archive, it is possible that + it makes the compression ratio worse than not using a BCJ + filter. For example, if there are similar or even identical + executables then filtering will likely make the files less + similar and thus compression is worse. The contents of non- + executable files in the same archive can matter too. In + practice one has to try with and without a BCJ filter to see + which is better in each situation. + + Different instruction sets have different alignment: the exe- + cutable file must be aligned to a multiple of this value in the + input data to make the filter work. + + Filter Alignment Notes + x86 1 32-bit or 64-bit x86 + ARM 4 + ARM-Thumb 2 + ARM64 4 4096-byte alignment is best + PowerPC 4 Big endian only + IA-64 16 Itanium + SPARC 4 + + Since the BCJ-filtered data is usually compressed with LZMA2, + the compression ratio may be improved slightly if the LZMA2 op- + tions are set to match the alignment of the selected BCJ filter. + For example, with the IA-64 filter, it's good to set pb=4 or + even pb=4,lp=4,lc=0 with LZMA2 (2^4=16). The x86 filter is an + exception; it's usually good to stick to LZMA2's default four- + byte alignment when compressing x86 executables. + + All BCJ filters support the same options: + + start=offset + Specify the start offset that is used when converting be- + tween relative and absolute addresses. The offset must + be a multiple of the alignment of the filter (see the ta- + ble above). The default is zero. In practice, the de- + fault is good; specifying a custom offset is almost never + useful. + + --delta[=options] + Add the Delta filter to the filter chain. The Delta filter can + be only used as a non-last filter in the filter chain. + + Currently only simple byte-wise delta calculation is supported. + It can be useful when compressing, for example, uncompressed + bitmap images or uncompressed PCM audio. However, special pur- + pose algorithms may give significantly better results than Delta + + LZMA2. This is true especially with audio, which compresses + faster and better, for example, with flac(1). + + Supported options: + + dist=distance + Specify the distance of the delta calculation in bytes. + distance must be 1-256. The default is 1. + + For example, with dist=2 and eight-byte input A1 B1 A2 B3 + A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02. + + Other options + -q, --quiet + Suppress warnings and notices. Specify this twice to suppress + errors too. This option has no effect on the exit status. That + is, even if a warning was suppressed, the exit status to indi- + cate a warning is still used. + + -v, --verbose + Be verbose. If standard error is connected to a terminal, xz + will display a progress indicator. Specifying --verbose twice + will give even more verbose output. + + The progress indicator shows the following information: + + o Completion percentage is shown if the size of the input file + is known. That is, the percentage cannot be shown in pipes. + + o Amount of compressed data produced (compressing) or consumed + (decompressing). + + o Amount of uncompressed data consumed (compressing) or pro- + duced (decompressing). + + o Compression ratio, which is calculated by dividing the amount + of compressed data processed so far by the amount of uncom- + pressed data processed so far. + + o Compression or decompression speed. This is measured as the + amount of uncompressed data consumed (compression) or pro- + duced (decompression) per second. It is shown after a few + seconds have passed since xz started processing the file. + + o Elapsed time in the format M:SS or H:MM:SS. + + o Estimated remaining time is shown only when the size of the + input file is known and a couple of seconds have already + passed since xz started processing the file. The time is + shown in a less precise format which never has any colons, + for example, 2 min 30 s. + + When standard error is not a terminal, --verbose will make xz + print the filename, compressed size, uncompressed size, compres- + sion ratio, and possibly also the speed and elapsed time on a + single line to standard error after compressing or decompressing + the file. The speed and elapsed time are included only when the + operation took at least a few seconds. If the operation didn't + finish, for example, due to user interruption, also the comple- + tion percentage is printed if the size of the input file is + known. + + -Q, --no-warn + Don't set the exit status to 2 even if a condition worth a warn- + ing was detected. This option doesn't affect the verbosity + level, thus both --quiet and --no-warn have to be used to not + display warnings and to not alter the exit status. + + --robot + Print messages in a machine-parsable format. This is intended + to ease writing frontends that want to use xz instead of li- + blzma, which may be the case with various scripts. The output + with this option enabled is meant to be stable across xz re- + leases. See the section ROBOT MODE for details. + + --info-memory + Display, in human-readable format, how much physical memory + (RAM) and how many processor threads xz thinks the system has + and the memory usage limits for compression and decompression, + and exit successfully. + + -h, --help + Display a help message describing the most commonly used op- + tions, and exit successfully. + + -H, --long-help + Display a help message describing all features of xz, and exit + successfully + + -V, --version + Display the version number of xz and liblzma in human readable + format. To get machine-parsable output, specify --robot before + --version. + +ROBOT MODE + The robot mode is activated with the --robot option. It makes the out- + put of xz easier to parse by other programs. Currently --robot is sup- + ported only together with --version, --info-memory, and --list. It + will be supported for compression and decompression in the future. + + Version + xz --robot --version will print the version number of xz and liblzma in + the following format: + + XZ_VERSION=XYYYZZZS + LIBLZMA_VERSION=XYYYZZZS + + X Major version. + + YYY Minor version. Even numbers are stable. Odd numbers are alpha + or beta versions. + + ZZZ Patch level for stable releases or just a counter for develop- + ment releases. + + S Stability. 0 is alpha, 1 is beta, and 2 is stable. S should be + always 2 when YYY is even. + + XYYYZZZS are the same on both lines if xz and liblzma are from the same + XZ Utils release. + + Examples: 4.999.9beta is 49990091 and 5.0.0 is 50000002. + + Memory limit information + xz --robot --info-memory prints a single line with three tab-separated + columns: + + 1. Total amount of physical memory (RAM) in bytes. + + 2. Memory usage limit for compression in bytes (--memlimit-compress). + A special value of 0 indicates the default setting which for sin- + gle-threaded mode is the same as no limit. + + 3. Memory usage limit for decompression in bytes (--memlimit-decom- + press). A special value of 0 indicates the default setting which + for single-threaded mode is the same as no limit. + + 4. Since xz 5.3.4alpha: Memory usage for multi-threaded decompression + in bytes (--memlimit-mt-decompress). This is never zero because a + system-specific default value shown in the column 5 is used if no + limit has been specified explicitly. This is also never greater + than the value in the column 3 even if a larger value has been + specified with --memlimit-mt-decompress. + + 5. Since xz 5.3.4alpha: A system-specific default memory usage limit + that is used to limit the number of threads when compressing with + an automatic number of threads (--threads=0) and no memory usage + limit has been specified (--memlimit-compress). This is also used + as the default value for --memlimit-mt-decompress. + + 6. Since xz 5.3.4alpha: Number of available processor threads. + + In the future, the output of xz --robot --info-memory may have more + columns, but never more than a single line. + + List mode + xz --robot --list uses tab-separated output. The first column of every + line has a string that indicates the type of the information found on + that line: + + name This is always the first line when starting to list a file. The + second column on the line is the filename. + + file This line contains overall information about the .xz file. This + line is always printed after the name line. + + stream This line type is used only when --verbose was specified. There + are as many stream lines as there are streams in the .xz file. + + block This line type is used only when --verbose was specified. There + are as many block lines as there are blocks in the .xz file. + The block lines are shown after all the stream lines; different + line types are not interleaved. + + summary + This line type is used only when --verbose was specified twice. + This line is printed after all block lines. Like the file line, + the summary line contains overall information about the .xz + file. + + totals This line is always the very last line of the list output. It + shows the total counts and sizes. + + The columns of the file lines: + 2. Number of streams in the file + 3. Total number of blocks in the stream(s) + 4. Compressed size of the file + 5. Uncompressed size of the file + 6. Compression ratio, for example, 0.123. If ratio is over + 9.999, three dashes (---) are displayed instead of the ra- + tio. + 7. Comma-separated list of integrity check names. The follow- + ing strings are used for the known check types: None, CRC32, + CRC64, and SHA-256. For unknown check types, Unknown-N is + used, where N is the Check ID as a decimal number (one or + two digits). + 8. Total size of stream padding in the file + + The columns of the stream lines: + 2. Stream number (the first stream is 1) + 3. Number of blocks in the stream + 4. Compressed start offset + 5. Uncompressed start offset + 6. Compressed size (does not include stream padding) + 7. Uncompressed size + 8. Compression ratio + 9. Name of the integrity check + 10. Size of stream padding + + The columns of the block lines: + 2. Number of the stream containing this block + 3. Block number relative to the beginning of the stream (the + first block is 1) + 4. Block number relative to the beginning of the file + 5. Compressed start offset relative to the beginning of the + file + 6. Uncompressed start offset relative to the beginning of the + file + 7. Total compressed size of the block (includes headers) + 8. Uncompressed size + 9. Compression ratio + 10. Name of the integrity check + + If --verbose was specified twice, additional columns are included on + the block lines. These are not displayed with a single --verbose, be- + cause getting this information requires many seeks and can thus be + slow: + 11. Value of the integrity check in hexadecimal + 12. Block header size + 13. Block flags: c indicates that compressed size is present, + and u indicates that uncompressed size is present. If the + flag is not set, a dash (-) is shown instead to keep the + string length fixed. New flags may be added to the end of + the string in the future. + 14. Size of the actual compressed data in the block (this ex- + cludes the block header, block padding, and check fields) + 15. Amount of memory (in bytes) required to decompress this + block with this xz version + 16. Filter chain. Note that most of the options used at com- + pression time cannot be known, because only the options that + are needed for decompression are stored in the .xz headers. + + The columns of the summary lines: + 2. Amount of memory (in bytes) required to decompress this file + with this xz version + 3. yes or no indicating if all block headers have both com- + pressed size and uncompressed size stored in them + Since xz 5.1.2alpha: + 4. Minimum xz version required to decompress the file + + The columns of the totals line: + 2. Number of streams + 3. Number of blocks + 4. Compressed size + 5. Uncompressed size + 6. Average compression ratio + 7. Comma-separated list of integrity check names that were + present in the files + 8. Stream padding size + 9. Number of files. This is here to keep the order of the ear- + lier columns the same as on file lines. + + If --verbose was specified twice, additional columns are included on + the totals line: + 10. Maximum amount of memory (in bytes) required to decompress + the files with this xz version + 11. yes or no indicating if all block headers have both com- + pressed size and uncompressed size stored in them + Since xz 5.1.2alpha: + 12. Minimum xz version required to decompress the file + + Future versions may add new line types and new columns can be added to + the existing line types, but the existing columns won't be changed. + +EXIT STATUS + 0 All is good. + + 1 An error occurred. + + 2 Something worth a warning occurred, but no actual errors oc- + curred. + + Notices (not warnings or errors) printed on standard error don't affect + the exit status. + +ENVIRONMENT + xz parses space-separated lists of options from the environment vari- + ables XZ_DEFAULTS and XZ_OPT, in this order, before parsing the options + from the command line. Note that only options are parsed from the en- + vironment variables; all non-options are silently ignored. Parsing is + done with getopt_long(3) which is used also for the command line argu- + ments. + + XZ_DEFAULTS + User-specific or system-wide default options. Typically this is + set in a shell initialization script to enable xz's memory usage + limiter by default. Excluding shell initialization scripts and + similar special cases, scripts must never set or unset XZ_DE- + FAULTS. + + XZ_OPT This is for passing options to xz when it is not possible to set + the options directly on the xz command line. This is the case + when xz is run by a script or tool, for example, GNU tar(1): + + XZ_OPT=-2v tar caf foo.tar.xz foo + + Scripts may use XZ_OPT, for example, to set script-specific de- + fault compression options. It is still recommended to allow + users to override XZ_OPT if that is reasonable. For example, in + sh(1) scripts one may use something like this: + + XZ_OPT=${XZ_OPT-"-7e"} + export XZ_OPT + +LZMA UTILS COMPATIBILITY + The command line syntax of xz is practically a superset of lzma, un- + lzma, and lzcat as found from LZMA Utils 4.32.x. In most cases, it is + possible to replace LZMA Utils with XZ Utils without breaking existing + scripts. There are some incompatibilities though, which may sometimes + cause problems. + + Compression preset levels + The numbering of the compression level presets is not identical in xz + and LZMA Utils. The most important difference is how dictionary sizes + are mapped to different presets. Dictionary size is roughly equal to + the decompressor memory usage. + + Level xz LZMA Utils + -0 256 KiB N/A + -1 1 MiB 64 KiB + -2 2 MiB 1 MiB + -3 4 MiB 512 KiB + -4 4 MiB 1 MiB + -5 8 MiB 2 MiB + -6 8 MiB 4 MiB + -7 16 MiB 8 MiB + -8 32 MiB 16 MiB + -9 64 MiB 32 MiB + + The dictionary size differences affect the compressor memory usage too, + but there are some other differences between LZMA Utils and XZ Utils, + which make the difference even bigger: + + Level xz LZMA Utils 4.32.x + -0 3 MiB N/A + -1 9 MiB 2 MiB + -2 17 MiB 12 MiB + -3 32 MiB 12 MiB + -4 48 MiB 16 MiB + -5 94 MiB 26 MiB + -6 94 MiB 45 MiB + -7 186 MiB 83 MiB + -8 370 MiB 159 MiB + -9 674 MiB 311 MiB + + The default preset level in LZMA Utils is -7 while in XZ Utils it is + -6, so both use an 8 MiB dictionary by default. + + Streamed vs. non-streamed .lzma files + The uncompressed size of the file can be stored in the .lzma header. + LZMA Utils does that when compressing regular files. The alternative + is to mark that uncompressed size is unknown and use end-of-payload + marker to indicate where the decompressor should stop. LZMA Utils uses + this method when uncompressed size isn't known, which is the case, for + example, in pipes. + + xz supports decompressing .lzma files with or without end-of-payload + marker, but all .lzma files created by xz will use end-of-payload + marker and have uncompressed size marked as unknown in the .lzma + header. This may be a problem in some uncommon situations. For exam- + ple, a .lzma decompressor in an embedded device might work only with + files that have known uncompressed size. If you hit this problem, you + need to use LZMA Utils or LZMA SDK to create .lzma files with known un- + compressed size. + + Unsupported .lzma files + The .lzma format allows lc values up to 8, and lp values up to 4. LZMA + Utils can decompress files with any lc and lp, but always creates files + with lc=3 and lp=0. Creating files with other lc and lp is possible + with xz and with LZMA SDK. + + The implementation of the LZMA1 filter in liblzma requires that the sum + of lc and lp must not exceed 4. Thus, .lzma files, which exceed this + limitation, cannot be decompressed with xz. + + LZMA Utils creates only .lzma files which have a dictionary size of 2^n + (a power of 2) but accepts files with any dictionary size. liblzma ac- + cepts only .lzma files which have a dictionary size of 2^n or 2^n + + 2^(n-1). This is to decrease false positives when detecting .lzma + files. + + These limitations shouldn't be a problem in practice, since practically + all .lzma files have been compressed with settings that liblzma will + accept. + + Trailing garbage + When decompressing, LZMA Utils silently ignore everything after the + first .lzma stream. In most situations, this is a bug. This also + means that LZMA Utils don't support decompressing concatenated .lzma + files. + + If there is data left after the first .lzma stream, xz considers the + file to be corrupt unless --single-stream was used. This may break ob- + scure scripts which have assumed that trailing garbage is ignored. + +NOTES + Compressed output may vary + The exact compressed output produced from the same uncompressed input + file may vary between XZ Utils versions even if compression options are + identical. This is because the encoder can be improved (faster or bet- + ter compression) without affecting the file format. The output can + vary even between different builds of the same XZ Utils version, if + different build options are used. + + The above means that once --rsyncable has been implemented, the result- + ing files won't necessarily be rsyncable unless both old and new files + have been compressed with the same xz version. This problem can be + fixed if a part of the encoder implementation is frozen to keep rsynca- + ble output stable across xz versions. + + Embedded .xz decompressors + Embedded .xz decompressor implementations like XZ Embedded don't neces- + sarily support files created with integrity check types other than none + and crc32. Since the default is --check=crc64, you must use + --check=none or --check=crc32 when creating files for embedded systems. + + Outside embedded systems, all .xz format decompressors support all the + check types, or at least are able to decompress the file without veri- + fying the integrity check if the particular check is not supported. + + XZ Embedded supports BCJ filters, but only with the default start off- + set. + +EXAMPLES + Basics + Compress the file foo into foo.xz using the default compression level + (-6), and remove foo if compression is successful: + + xz foo + + Decompress bar.xz into bar and don't remove bar.xz even if decompres- + sion is successful: + + xz -dk bar.xz + + Create baz.tar.xz with the preset -4e (-4 --extreme), which is slower + than the default -6, but needs less memory for compression and decom- + pression (48 MiB and 5 MiB, respectively): + + tar cf - baz | xz -4e > baz.tar.xz + + A mix of compressed and uncompressed files can be decompressed to stan- + dard output with a single command: + + xz -dcf a.txt b.txt.xz c.txt d.txt.lzma > abcd.txt + + Parallel compression of many files + On GNU and *BSD, find(1) and xargs(1) can be used to parallelize com- + pression of many files: + + find . -type f \! -name '*.xz' -print0 \ + | xargs -0r -P4 -n16 xz -T1 + + The -P option to xargs(1) sets the number of parallel xz processes. + The best value for the -n option depends on how many files there are to + be compressed. If there are only a couple of files, the value should + probably be 1; with tens of thousands of files, 100 or even more may be + appropriate to reduce the number of xz processes that xargs(1) will + eventually create. + + The option -T1 for xz is there to force it to single-threaded mode, be- + cause xargs(1) is used to control the amount of parallelization. + + Robot mode + Calculate how many bytes have been saved in total after compressing + multiple files: + + xz --robot --list *.xz | awk '/^totals/{print $5-$4}' + + A script may want to know that it is using new enough xz. The follow- + ing sh(1) script checks that the version number of the xz tool is at + least 5.0.0. This method is compatible with old beta versions, which + didn't support the --robot option: + + if ! eval "$(xz --robot --version 2> /dev/null)" || + [ "$XZ_VERSION" -lt 50000002 ]; then + echo "Your xz is too old." + fi + unset XZ_VERSION LIBLZMA_VERSION + + Set a memory usage limit for decompression using XZ_OPT, but if a limit + has already been set, don't increase it: + + NEWLIM=$((123 << 20)) # 123 MiB + OLDLIM=$(xz --robot --info-memory | cut -f3) + if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then + XZ_OPT="$XZ_OPT --memlimit-decompress=$NEWLIM" + export XZ_OPT + fi + + Custom compressor filter chains + The simplest use for custom filter chains is customizing a LZMA2 pre- + set. This can be useful, because the presets cover only a subset of + the potentially useful combinations of compression settings. + + The CompCPU columns of the tables from the descriptions of the options + -0 ... -9 and --extreme are useful when customizing LZMA2 presets. + Here are the relevant parts collected from those two tables: + + Preset CompCPU + -0 0 + + -1 1 + -2 2 + -3 3 + -4 4 + -5 5 + -6 6 + -5e 7 + -6e 8 + + If you know that a file requires somewhat big dictionary (for example, + 32 MiB) to compress well, but you want to compress it quicker than xz + -8 would do, a preset with a low CompCPU value (for example, 1) can be + modified to use a bigger dictionary: + + xz --lzma2=preset=1,dict=32MiB foo.tar + + With certain files, the above command may be faster than xz -6 while + compressing significantly better. However, it must be emphasized that + only some files benefit from a big dictionary while keeping the CompCPU + value low. The most obvious situation, where a big dictionary can help + a lot, is an archive containing very similar files of at least a few + megabytes each. The dictionary size has to be significantly bigger + than any individual file to allow LZMA2 to take full advantage of the + similarities between consecutive files. + + If very high compressor and decompressor memory usage is fine, and the + file being compressed is at least several hundred megabytes, it may be + useful to use an even bigger dictionary than the 64 MiB that xz -9 + would use: + + xz -vv --lzma2=dict=192MiB big_foo.tar + + Using -vv (--verbose --verbose) like in the above example can be useful + to see the memory requirements of the compressor and decompressor. Re- + member that using a dictionary bigger than the size of the uncompressed + file is waste of memory, so the above command isn't useful for small + files. + + Sometimes the compression time doesn't matter, but the decompressor + memory usage has to be kept low, for example, to make it possible to + decompress the file on an embedded system. The following command uses + -6e (-6 --extreme) as a base and sets the dictionary to only 64 KiB. + The resulting file can be decompressed with XZ Embedded (that's why + there is --check=crc32) using about 100 KiB of memory. + + xz --check=crc32 --lzma2=preset=6e,dict=64KiB foo + + If you want to squeeze out as many bytes as possible, adjusting the + number of literal context bits (lc) and number of position bits (pb) + can sometimes help. Adjusting the number of literal position bits (lp) + might help too, but usually lc and pb are more important. For example, + a source code archive contains mostly US-ASCII text, so something like + the following might give slightly (like 0.1 %) smaller file than xz -6e + (try also without lc=4): + + xz --lzma2=preset=6e,pb=0,lc=4 source_code.tar + + Using another filter together with LZMA2 can improve compression with + certain file types. For example, to compress a x86-32 or x86-64 shared + library using the x86 BCJ filter: + + xz --x86 --lzma2 libfoo.so + + Note that the order of the filter options is significant. If --x86 is + specified after --lzma2, xz will give an error, because there cannot be + any filter after LZMA2, and also because the x86 BCJ filter cannot be + used as the last filter in the chain. + + The Delta filter together with LZMA2 can give good results with bitmap + images. It should usually beat PNG, which has a few more advanced fil- + ters than simple delta but uses Deflate for the actual compression. + + The image has to be saved in uncompressed format, for example, as un- + compressed TIFF. The distance parameter of the Delta filter is set to + match the number of bytes per pixel in the image. For example, 24-bit + RGB bitmap needs dist=3, and it is also good to pass pb=0 to LZMA2 to + accommodate the three-byte alignment: + + xz --delta=dist=3 --lzma2=pb=0 foo.tiff + + If multiple images have been put into a single archive (for example, + .tar), the Delta filter will work on that too as long as all images + have the same number of bytes per pixel. + +SEE ALSO + xzdec(1), xzdiff(1), xzgrep(1), xzless(1), xzmore(1), gzip(1), + bzip2(1), 7z(1) + + XZ Utils: + XZ Embedded: + LZMA SDK: + + + +Tukaani 2022-12-01 XZ(1) diff --git a/doc/man/txt/xzdec.txt b/doc/man/txt/xzdec.txt new file mode 100644 index 0000000..a914e20 --- /dev/null +++ b/doc/man/txt/xzdec.txt @@ -0,0 +1,80 @@ +XZDEC(1) XZ Utils XZDEC(1) + + + +NAME + xzdec, lzmadec - Small .xz and .lzma decompressors + +SYNOPSIS + xzdec [option...] [file...] + lzmadec [option...] [file...] + +DESCRIPTION + xzdec is a liblzma-based decompression-only tool for .xz (and only .xz) + files. xzdec is intended to work as a drop-in replacement for xz(1) in + the most common situations where a script has been written to use xz + --decompress --stdout (and possibly a few other commonly used options) + to decompress .xz files. lzmadec is identical to xzdec except that lz- + madec supports .lzma files instead of .xz files. + + To reduce the size of the executable, xzdec doesn't support multi- + threading or localization, and doesn't read options from XZ_DEFAULTS + and XZ_OPT environment variables. xzdec doesn't support displaying in- + termediate progress information: sending SIGINFO to xzdec does nothing, + but sending SIGUSR1 terminates the process instead of displaying + progress information. + +OPTIONS + -d, --decompress, --uncompress + Ignored for xz(1) compatibility. xzdec supports only decompres- + sion. + + -k, --keep + Ignored for xz(1) compatibility. xzdec never creates or removes + any files. + + -c, --stdout, --to-stdout + Ignored for xz(1) compatibility. xzdec always writes the decom- + pressed data to standard output. + + -q, --quiet + Specifying this once does nothing since xzdec never displays any + warnings or notices. Specify this twice to suppress errors. + + -Q, --no-warn + Ignored for xz(1) compatibility. xzdec never uses the exit sta- + tus 2. + + -h, --help + Display a help message and exit successfully. + + -V, --version + Display the version number of xzdec and liblzma. + +EXIT STATUS + 0 All was good. + + 1 An error occurred. + + xzdec doesn't have any warning messages like xz(1) has, thus the exit + status 2 is not used by xzdec. + +NOTES + Use xz(1) instead of xzdec or lzmadec for normal everyday use. xzdec + or lzmadec are meant only for situations where it is important to have + a smaller decompressor than the full-featured xz(1). + + xzdec and lzmadec are not really that small. The size can be reduced + further by dropping features from liblzma at compile time, but that + shouldn't usually be done for executables distributed in typical non- + embedded operating system distributions. If you need a truly small .xz + decompressor, consider using XZ Embedded. + +SEE ALSO + xz(1) + + XZ Embedded: + + + +Tukaani 2017-04-19 XZDEC(1) diff --git a/doc/man/txt/xzdiff.txt b/doc/man/txt/xzdiff.txt new file mode 100644 index 0000000..681b00c --- /dev/null +++ b/doc/man/txt/xzdiff.txt @@ -0,0 +1,37 @@ +XZDIFF(1) XZ Utils XZDIFF(1) + + + +NAME + xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files + +SYNOPSIS + xzcmp [cmp_options] file1 [file2] + xzdiff [diff_options] file1 [file2] + lzcmp [cmp_options] file1 [file2] + lzdiff [diff_options] file1 [file2] + +DESCRIPTION + xzcmp and xzdiff invoke cmp(1) or diff(1) on files compressed with + xz(1), lzma(1), gzip(1), bzip2(1), lzop(1), or zstd(1). All options + specified are passed directly to cmp(1) or diff(1). If only one file + is specified, then the files compared are file1 (which must have a suf- + fix of a supported compression format) and file1 from which the com- + pression format suffix has been stripped. If two files are specified, + then they are uncompressed if necessary and fed to cmp(1) or diff(1). + The exit status from cmp(1) or diff(1) is preserved unless a decompres- + sion error occurs; then exit status is 2. + + The names lzcmp and lzdiff are provided for backward compatibility with + LZMA Utils. + +SEE ALSO + cmp(1), diff(1), xz(1), gzip(1), bzip2(1), lzop(1), zstd(1), zdiff(1) + +BUGS + Messages from the cmp(1) or diff(1) programs refer to temporary file- + names instead of those specified. + + + +Tukaani 2021-06-04 XZDIFF(1) diff --git a/doc/man/txt/xzgrep.txt b/doc/man/txt/xzgrep.txt new file mode 100644 index 0000000..596520c --- /dev/null +++ b/doc/man/txt/xzgrep.txt @@ -0,0 +1,49 @@ +XZGREP(1) XZ Utils XZGREP(1) + + + +NAME + xzgrep - search compressed files for a regular expression + +SYNOPSIS + xzgrep [grep_options] [-e] pattern [file...] + xzegrep ... + xzfgrep ... + lzgrep ... + lzegrep ... + lzfgrep ... + +DESCRIPTION + xzgrep invokes grep(1) on files which may be either uncompressed or + compressed with xz(1), lzma(1), gzip(1), bzip2(1), lzop(1), or zstd(1). + All options specified are passed directly to grep(1). + + If no file is specified, then standard input is decompressed if neces- + sary and fed to grep(1). When reading from standard input, gzip(1), + bzip2(1), lzop(1), and zstd(1) compressed files are not supported. + + If xzgrep is invoked as xzegrep or xzfgrep then grep -E or grep -F is + used instead of grep(1). The same applies to names lzgrep, lzegrep, + and lzfgrep, which are provided for backward compatibility with LZMA + Utils. + +EXIT STATUS + 0 At least one match was found from at least one of the input + files. No errors occurred. + + 1 No matches were found from any of the input files. No errors + occurred. + + >1 One or more errors occurred. It is unknown if matches were + found. + +ENVIRONMENT + GREP If the GREP environment variable is set, xzgrep uses it instead + of grep(1), grep -E, or grep -F. + +SEE ALSO + grep(1), xz(1), gzip(1), bzip2(1), lzop(1), zstd(1), zgrep(1) + + + +Tukaani 2022-07-19 XZGREP(1) diff --git a/doc/man/txt/xzless.txt b/doc/man/txt/xzless.txt new file mode 100644 index 0000000..5c14c80 --- /dev/null +++ b/doc/man/txt/xzless.txt @@ -0,0 +1,39 @@ +XZLESS(1) XZ Utils XZLESS(1) + + + +NAME + xzless, lzless - view xz or lzma compressed (text) files + +SYNOPSIS + xzless [file...] + lzless [file...] + +DESCRIPTION + xzless is a filter that displays text from compressed files to a termi- + nal. It works on files compressed with xz(1) or lzma(1). If no files + are given, xzless reads from standard input. + + xzless uses less(1) to present its output. Unlike xzmore, its choice + of pager cannot be altered by setting an environment variable. Com- + mands are based on both more(1) and vi(1) and allow back and forth + movement and searching. See the less(1) manual for more information. + + The command named lzless is provided for backward compatibility with + LZMA Utils. + +ENVIRONMENT + LESSMETACHARS + A list of characters special to the shell. Set by xzless unless + it is already set in the environment. + + LESSOPEN + Set to a command line to invoke the xz(1) decompressor for pre- + processing the input files to less(1). + +SEE ALSO + less(1), xz(1), xzmore(1), zless(1) + + + +Tukaani 2010-09-27 XZLESS(1) diff --git a/doc/man/txt/xzmore.txt b/doc/man/txt/xzmore.txt new file mode 100644 index 0000000..5a9d86c --- /dev/null +++ b/doc/man/txt/xzmore.txt @@ -0,0 +1,34 @@ +XZMORE(1) XZ Utils XZMORE(1) + + + +NAME + xzmore, lzmore - view xz or lzma compressed (text) files + +SYNOPSIS + xzmore [file...] + lzmore [file...] + +DESCRIPTION + xzmore is a filter which allows examination of xz(1) or lzma(1) com- + pressed text files one screenful at a time on a soft-copy terminal. + + To use a pager other than the default more, set environment variable + PAGER to the name of the desired program. The name lzmore is provided + for backward compatibility with LZMA Utils. + + e or q When the prompt --More--(Next file: file) is printed, this com- + mand causes xzmore to exit. + + s When the prompt --More--(Next file: file) is printed, this com- + mand causes xzmore to skip the next file and continue. + + For list of keyboard commands supported while actually viewing the con- + tent of a file, refer to manual of the pager you use, usually more(1). + +SEE ALSO + more(1), xz(1), xzless(1), zmore(1) + + + +Tukaani 2013-06-30 XZMORE(1) diff --git a/doc/xz-file-format.txt b/doc/xz-file-format.txt new file mode 100644 index 0000000..09c83e0 --- /dev/null +++ b/doc/xz-file-format.txt @@ -0,0 +1,1165 @@ + +The .xz File Format +=================== + +Version 1.1.0 (2022-12-11) + + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Getting the Latest Version + 0.3. Version History + 1. Conventions + 1.1. Byte and Its Representation + 1.2. Multibyte Integers + 2. Overall Structure of .xz File + 2.1. Stream + 2.1.1. Stream Header + 2.1.1.1. Header Magic Bytes + 2.1.1.2. Stream Flags + 2.1.1.3. CRC32 + 2.1.2. Stream Footer + 2.1.2.1. CRC32 + 2.1.2.2. Backward Size + 2.1.2.3. Stream Flags + 2.1.2.4. Footer Magic Bytes + 2.2. Stream Padding + 3. Block + 3.1. Block Header + 3.1.1. Block Header Size + 3.1.2. Block Flags + 3.1.3. Compressed Size + 3.1.4. Uncompressed Size + 3.1.5. List of Filter Flags + 3.1.6. Header Padding + 3.1.7. CRC32 + 3.2. Compressed Data + 3.3. Block Padding + 3.4. Check + 4. Index + 4.1. Index Indicator + 4.2. Number of Records + 4.3. List of Records + 4.3.1. Unpadded Size + 4.3.2. Uncompressed Size + 4.4. Index Padding + 4.5. CRC32 + 5. Filter Chains + 5.1. Alignment + 5.2. Security + 5.3. Filters + 5.3.1. LZMA2 + 5.3.2. Branch/Call/Jump Filters for Executables + 5.3.3. Delta + 5.3.3.1. Format of the Encoded Output + 5.4. Custom Filter IDs + 5.4.1. Reserved Custom Filter ID Ranges + 6. Cyclic Redundancy Checks + 7. References + + +0. Preface + + This document describes the .xz file format (filename suffix + ".xz", MIME type "application/x-xz"). It is intended that this + this format replace the old .lzma format used by LZMA SDK and + LZMA Utils. + + +0.1. Notices and Acknowledgements + + This file format was designed by Lasse Collin + and Igor Pavlov. + + Special thanks for helping with this document goes to + Ville Koskinen. Thanks for helping with this document goes to + Mark Adler, H. Peter Anvin, Mikko Pouru, and Lars Wirzenius. + + This document has been put into the public domain. + + +0.2. Getting the Latest Version + + The latest official version of this document can be downloaded + from . + + Specific versions of this document have a filename + xz-file-format-X.Y.Z.txt where X.Y.Z is the version number. + For example, the version 1.0.0 of this document is available + at . + + +0.3. Version History + + Version Date Description + + 1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit + ARM endianness in Section 5.3.2, + language improvements in Section 5.4 + + 1.0.4 2009-08-27 Language improvements in Sections 1.2, + 2.1.1.2, 3.1.1, 3.1.2, and 5.3.1 + + 1.0.3 2009-06-05 Spelling fixes in Sections 5.1 and 5.4 + + 1.0.2 2009-06-04 Typo fixes in Sections 4 and 5.3.1 + + 1.0.1 2009-06-01 Typo fix in Section 0.3 and minor + clarifications to Sections 2, 2.2, + 3.3, 4.4, and 5.3.2 + + 1.0.0 2009-01-14 The first official version + + +1. Conventions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", + "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in [RFC-2119]. + + Indicating a warning means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something worth warning occurred. The operation + SHOULD still finish if a warning is indicated. + + Indicating an error means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something prevented successfully finishing the + operation. The operation MUST be aborted once an error has + been indicated. + + +1.1. Byte and Its Representation + + In this document, byte is always 8 bits. + + A "null byte" has all bits unset. That is, the value of a null + byte is 0x00. + + To represent byte blocks, this document uses notation that + is similar to the notation used in [RFC-1952]: + + +-------+ + | Foo | One byte. + +-------+ + + +---+---+ + | Foo | Two bytes; that is, some of the vertical bars + +---+---+ can be missing. + + +=======+ + | Foo | Zero or more bytes. + +=======+ + + In this document, a boxed byte or a byte sequence declared + using this notation is called "a field". The example field + above would be called "the Foo field" or plain "Foo". + + If there are many fields, they may be split to multiple lines. + This is indicated with an arrow ("--->"): + + +=====+ + | Foo | + +=====+ + + +=====+ + ---> | Bar | + +=====+ + + The above is equivalent to this: + + +=====+=====+ + | Foo | Bar | + +=====+=====+ + + +1.2. Multibyte Integers + + Multibyte integers of static length, such as CRC values, + are stored in little endian byte order (least significant + byte first). + + When smaller values are more likely than bigger values (for + example file sizes), multibyte integers are encoded in a + variable-length representation: + - Numbers in the range [0, 127] are copied as is, and take + one byte of space. + - Bigger numbers will occupy two or more bytes. All but the + last byte of the multibyte representation have the highest + (eighth) bit set. + + For now, the value of the variable-length integers is limited + to 63 bits, which limits the encoded size of the integer to + nine bytes. These limits may be increased in the future if + needed. + + The following C code illustrates encoding and decoding of + variable-length integers. The functions return the number of + bytes occupied by the integer (1-9), or zero on error. + + #include + #include + + size_t + encode(uint8_t buf[static 9], uint64_t num) + { + if (num > UINT64_MAX / 2) + return 0; + + size_t i = 0; + + while (num >= 0x80) { + buf[i++] = (uint8_t)(num) | 0x80; + num >>= 7; + } + + buf[i++] = (uint8_t)(num); + + return i; + } + + size_t + decode(const uint8_t buf[], size_t size_max, uint64_t *num) + { + if (size_max == 0) + return 0; + + if (size_max > 9) + size_max = 9; + + *num = buf[0] & 0x7F; + size_t i = 0; + + while (buf[i++] & 0x80) { + if (i >= size_max || buf[i] == 0x00) + return 0; + + *num |= (uint64_t)(buf[i] & 0x7F) << (i * 7); + } + + return i; + } + + +2. Overall Structure of .xz File + + A standalone .xz files consist of one or more Streams which may + have Stream Padding between or after them: + + +========+================+========+================+ + | Stream | Stream Padding | Stream | Stream Padding | ... + +========+================+========+================+ + + The sizes of Stream and Stream Padding are always multiples + of four bytes, thus the size of every valid .xz file MUST be + a multiple of four bytes. + + While a typical file contains only one Stream and no Stream + Padding, a decoder handling standalone .xz files SHOULD support + files that have more than one Stream or Stream Padding. + + In contrast to standalone .xz files, when the .xz file format + is used as an internal part of some other file format or + communication protocol, it usually is expected that the decoder + stops after the first Stream, and doesn't look for Stream + Padding or possibly other Streams. + + +2.1. Stream + + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + | Stream Header | Block | Block | ... | Block | + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + ---> | Index | Stream Footer | + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + + All the above fields have a size that is a multiple of four. If + Stream is used as an internal part of another file format, it + is RECOMMENDED to make the Stream start at an offset that is + a multiple of four bytes. + + Stream Header, Index, and Stream Footer are always present in + a Stream. The maximum size of the Index field is 16 GiB (2^34). + + There are zero or more Blocks. The maximum number of Blocks is + limited only by the maximum size of the Index field. + + Total size of a Stream MUST be less than 8 EiB (2^63 bytes). + The same limit applies to the total amount of uncompressed + data stored in a Stream. + + If an implementation supports handling .xz files with multiple + concatenated Streams, it MAY apply the above limits to the file + as a whole instead of limiting per Stream basis. + + +2.1.1. Stream Header + + +---+---+---+---+---+---+-------+------+--+--+--+--+ + | Header Magic Bytes | Stream Flags | CRC32 | + +---+---+---+---+---+---+-------+------+--+--+--+--+ + + +2.1.1.1. Header Magic Bytes + + The first six (6) bytes of the Stream are so called Header + Magic Bytes. They can be used to identify the file type. + + Using a C array and ASCII: + const uint8_t HEADER_MAGIC[6] + = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; + + In plain hexadecimal: + FD 37 7A 58 5A 00 + + Notes: + - The first byte (0xFD) was chosen so that the files cannot + be erroneously detected as being in .lzma format, in which + the first byte is in the range [0x00, 0xE0]. + - The sixth byte (0x00) was chosen to prevent applications + from misdetecting the file as a text file. + + If the Header Magic Bytes don't match, the decoder MUST + indicate an error. + + +2.1.1.2. Stream Flags + + The first byte of Stream Flags is always a null byte. In the + future, this byte may be used to indicate a new Stream version + or other Stream properties. + + The second byte of Stream Flags is a bit field: + + Bit(s) Mask Description + 0-3 0x0F Type of Check (see Section 3.4): + ID Size Check name + 0x00 0 bytes None + 0x01 4 bytes CRC32 + 0x02 4 bytes (Reserved) + 0x03 4 bytes (Reserved) + 0x04 8 bytes CRC64 + 0x05 8 bytes (Reserved) + 0x06 8 bytes (Reserved) + 0x07 16 bytes (Reserved) + 0x08 16 bytes (Reserved) + 0x09 16 bytes (Reserved) + 0x0A 32 bytes SHA-256 + 0x0B 32 bytes (Reserved) + 0x0C 32 bytes (Reserved) + 0x0D 64 bytes (Reserved) + 0x0E 64 bytes (Reserved) + 0x0F 64 bytes (Reserved) + 4-7 0xF0 Reserved for future use; MUST be zero for now. + + Implementations SHOULD support at least the Check IDs 0x00 + (None) and 0x01 (CRC32). Supporting other Check IDs is + OPTIONAL. If an unsupported Check is used, the decoder SHOULD + indicate a warning or error. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Stream Header + incorrectly. + + +2.1.1.3. CRC32 + + The CRC32 is calculated from the Stream Flags field. It is + stored as an unsigned 32-bit little endian integer. If the + calculated value does not match the stored one, the decoder + MUST indicate an error. + + The idea is that Stream Flags would always be two bytes, even + if new features are needed. This way old decoders will be able + to verify the CRC32 calculated from Stream Flags, and thus + distinguish between corrupt files (CRC32 doesn't match) and + files that the decoder doesn't support (CRC32 matches but + Stream Flags has reserved bits set). + + +2.1.2. Stream Footer + + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + | CRC32 | Backward Size | Stream Flags | Footer Magic Bytes | + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + + +2.1.2.1. CRC32 + + The CRC32 is calculated from the Backward Size and Stream Flags + fields. It is stored as an unsigned 32-bit little endian + integer. If the calculated value does not match the stored one, + the decoder MUST indicate an error. + + The reason to have the CRC32 field before the Backward Size and + Stream Flags fields is to keep the four-byte fields aligned to + a multiple of four bytes. + + +2.1.2.2. Backward Size + + Backward Size is stored as a 32-bit little endian integer, + which indicates the size of the Index field as multiple of + four bytes, minimum value being four bytes: + + real_backward_size = (stored_backward_size + 1) * 4; + + If the stored value does not match the real size of the Index + field, the decoder MUST indicate an error. + + Using a fixed-size integer to store Backward Size makes + it slightly simpler to parse the Stream Footer when the + application needs to parse the Stream backwards. + + +2.1.2.3. Stream Flags + + This is a copy of the Stream Flags field from the Stream + Header. The information stored to Stream Flags is needed + when parsing the Stream backwards. The decoder MUST compare + the Stream Flags fields in both Stream Header and Stream + Footer, and indicate an error if they are not identical. + + +2.1.2.4. Footer Magic Bytes + + As the last step of the decoding process, the decoder MUST + verify the existence of Footer Magic Bytes. If they don't + match, an error MUST be indicated. + + Using a C array and ASCII: + const uint8_t FOOTER_MAGIC[2] = { 'Y', 'Z' }; + + In hexadecimal: + 59 5A + + The primary reason to have Footer Magic Bytes is to make + it easier to detect incomplete files quickly, without + uncompressing. If the file does not end with Footer Magic Bytes + (excluding Stream Padding described in Section 2.2), it cannot + be undamaged, unless someone has intentionally appended garbage + after the end of the Stream. + + +2.2. Stream Padding + + Only the decoders that support decoding of concatenated Streams + MUST support Stream Padding. + + Stream Padding MUST contain only null bytes. To preserve the + four-byte alignment of consecutive Streams, the size of Stream + Padding MUST be a multiple of four bytes. Empty Stream Padding + is allowed. If these requirements are not met, the decoder MUST + indicate an error. + + Note that non-empty Stream Padding is allowed at the end of the + file; there doesn't need to be a new Stream after non-empty + Stream Padding. This can be convenient in certain situations + [GNU-tar]. + + The possibility of Stream Padding MUST be taken into account + when designing an application that parses Streams backwards, + and the application supports concatenated Streams. + + +3. Block + + +==============+=================+===============+=======+ + | Block Header | Compressed Data | Block Padding | Check | + +==============+=================+===============+=======+ + + +3.1. Block Header + + +-------------------+-------------+=================+ + | Block Header Size | Block Flags | Compressed Size | + +-------------------+-------------+=================+ + + +===================+======================+ + ---> | Uncompressed Size | List of Filter Flags | + +===================+======================+ + + +================+--+--+--+--+ + ---> | Header Padding | CRC32 | + +================+--+--+--+--+ + + +3.1.1. Block Header Size + + This field overlaps with the Index Indicator field (see + Section 4.1). + + This field contains the size of the Block Header field, + including the Block Header Size field itself. Valid values are + in the range [0x01, 0xFF], which indicate the size of the Block + Header as multiples of four bytes, minimum size being eight + bytes: + + real_header_size = (encoded_header_size + 1) * 4; + + If a Block Header bigger than 1024 bytes is needed in the + future, a new field can be added between the Block Header and + Compressed Data fields. The presence of this new field would + be indicated in the Block Header field. + + +3.1.2. Block Flags + + The Block Flags field is a bit field: + + Bit(s) Mask Description + 0-1 0x03 Number of filters (1-4) + 2-5 0x3C Reserved for future use; MUST be zero for now. + 6 0x40 The Compressed Size field is present. + 7 0x80 The Uncompressed Size field is present. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Block Header + incorrectly. + + +3.1.3. Compressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Compressed Size field contains the size of the Compressed + Data field, which MUST be non-zero. Compressed Size is stored + using the encoding described in Section 1.2. If the Compressed + Size doesn't match the size of the Compressed Data field, the + decoder MUST indicate an error. + + +3.1.4. Uncompressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Uncompressed Size field contains the size of the Block + after uncompressing. Uncompressed Size is stored using the + encoding described in Section 1.2. If the Uncompressed Size + does not match the real uncompressed size, the decoder MUST + indicate an error. + + Storing the Compressed Size and Uncompressed Size fields serves + several purposes: + - The decoder knows how much memory it needs to allocate + for a temporary buffer in multithreaded mode. + - Simple error detection: wrong size indicates a broken file. + - Seeking forwards to a specific location in streamed mode. + + It should be noted that the only reliable way to determine + the real uncompressed size is to uncompress the Block, + because the Block Header and Index fields may contain + (intentionally or unintentionally) invalid information. + + +3.1.5. List of Filter Flags + + +================+================+ +================+ + | Filter 0 Flags | Filter 1 Flags | ... | Filter n Flags | + +================+================+ +================+ + + The number of Filter Flags fields is stored in the Block Flags + field (see Section 3.1.2). + + The format of each Filter Flags field is as follows: + + +===========+====================+===================+ + | Filter ID | Size of Properties | Filter Properties | + +===========+====================+===================+ + + Both Filter ID and Size of Properties are stored using the + encoding described in Section 1.2. Size of Properties indicates + the size of the Filter Properties field as bytes. The list of + officially defined Filter IDs and the formats of their Filter + Properties are described in Section 5.3. + + Filter IDs greater than or equal to 0x4000_0000_0000_0000 + (2^62) are reserved for implementation-specific internal use. + These Filter IDs MUST never be used in List of Filter Flags. + + +3.1.6. Header Padding + + This field contains as many null byte as it is needed to make + the Block Header have the size specified in Block Header Size. + If any of the bytes are not null bytes, the decoder MUST + indicate an error. It is possible that there is a new field + present which the decoder is not aware of, and can thus parse + the Block Header incorrectly. + + +3.1.7. CRC32 + + The CRC32 is calculated over everything in the Block Header + field except the CRC32 field itself. It is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + By verifying the CRC32 of the Block Header before parsing the + actual contents allows the decoder to distinguish between + corrupt and unsupported files. + + +3.2. Compressed Data + + The format of Compressed Data depends on Block Flags and List + of Filter Flags. Excluding the descriptions of the simplest + filters in Section 5.3, the format of the filter-specific + encoded data is out of scope of this document. + + +3.3. Block Padding + + Block Padding MUST contain 0-3 null bytes to make the size of + the Block a multiple of four bytes. This can be needed when + the size of Compressed Data is not a multiple of four. If any + of the bytes in Block Padding are not null bytes, the decoder + MUST indicate an error. + + +3.4. Check + + The type and size of the Check field depends on which bits + are set in the Stream Flags field (see Section 2.1.1.2). + + The Check, when used, is calculated from the original + uncompressed data. If the calculated Check does not match the + stored one, the decoder MUST indicate an error. If the selected + type of Check is not supported by the decoder, it SHOULD + indicate a warning or error. + + +4. Index + + +-----------------+===================+ + | Index Indicator | Number of Records | + +-----------------+===================+ + + +=================+===============+-+-+-+-+ + ---> | List of Records | Index Padding | CRC32 | + +=================+===============+-+-+-+-+ + + Index serves several purposes. Using it, one can + - verify that all Blocks in a Stream have been processed; + - find out the uncompressed size of a Stream; and + - quickly access the beginning of any Block (random access). + + +4.1. Index Indicator + + This field overlaps with the Block Header Size field (see + Section 3.1.1). The value of Index Indicator is always 0x00. + + +4.2. Number of Records + + This field indicates how many Records there are in the List + of Records field, and thus how many Blocks there are in the + Stream. The value is stored using the encoding described in + Section 1.2. If the decoder has decoded all the Blocks of the + Stream, and then notices that the Number of Records doesn't + match the real number of Blocks, the decoder MUST indicate an + error. + + +4.3. List of Records + + List of Records consists of as many Records as indicated by the + Number of Records field: + + +========+========+ + | Record | Record | ... + +========+========+ + + Each Record contains information about one Block: + + +===============+===================+ + | Unpadded Size | Uncompressed Size | + +===============+===================+ + + If the decoder has decoded all the Blocks of the Stream, it + MUST verify that the contents of the Records match the real + Unpadded Size and Uncompressed Size of the respective Blocks. + + Implementation hint: It is possible to verify the Index with + constant memory usage by calculating for example SHA-256 of + both the real size values and the List of Records, then + comparing the hash values. Implementing this using + non-cryptographic hash like CRC32 SHOULD be avoided unless + small code size is important. + + If the decoder supports random-access reading, it MUST verify + that Unpadded Size and Uncompressed Size of every completely + decoded Block match the sizes stored in the Index. If only + partial Block is decoded, the decoder MUST verify that the + processed sizes don't exceed the sizes stored in the Index. + + +4.3.1. Unpadded Size + + This field indicates the size of the Block excluding the Block + Padding field. That is, Unpadded Size is the size of the Block + Header, Compressed Data, and Check fields. Unpadded Size is + stored using the encoding described in Section 1.2. The value + MUST never be zero; with the current structure of Blocks, the + actual minimum value for Unpadded Size is five. + + Implementation note: Because the size of the Block Padding + field is not included in Unpadded Size, calculating the total + size of a Stream or doing random-access reading requires + calculating the actual size of the Blocks by rounding Unpadded + Sizes up to the next multiple of four. + + The reason to exclude Block Padding from Unpadded Size is to + ease making a raw copy of Compressed Data without Block + Padding. This can be useful, for example, if someone wants + to convert Streams to some other file format quickly. + + +4.3.2. Uncompressed Size + + This field indicates the Uncompressed Size of the respective + Block as bytes. The value is stored using the encoding + described in Section 1.2. + + +4.4. Index Padding + + This field MUST contain 0-3 null bytes to pad the Index to + a multiple of four bytes. If any of the bytes are not null + bytes, the decoder MUST indicate an error. + + +4.5. CRC32 + + The CRC32 is calculated over everything in the Index field + except the CRC32 field itself. The CRC32 is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + +5. Filter Chains + + The Block Flags field defines how many filters are used. When + more than one filter is used, the filters are chained; that is, + the output of one filter is the input of another filter. The + following figure illustrates the direction of data flow. + + v Uncompressed Data ^ + | Filter 0 | + Encoder | Filter 1 | Decoder + | Filter n | + v Compressed Data ^ + + +5.1. Alignment + + Alignment of uncompressed input data is usually the job of + the application producing the data. For example, to get the + best results, an archiver tool should make sure that all + PowerPC executable files in the archive stream start at + offsets that are multiples of four bytes. + + Some filters, for example LZMA2, can be configured to take + advantage of specified alignment of input data. Note that + taking advantage of aligned input can be beneficial also when + a filter is not the first filter in the chain. For example, + if you compress PowerPC executables, you may want to use the + PowerPC filter and chain that with the LZMA2 filter. Because + not only the input but also the output alignment of the PowerPC + filter is four bytes, it is now beneficial to set LZMA2 + settings so that the LZMA2 encoder can take advantage of its + four-byte-aligned input data. + + The output of the last filter in the chain is stored to the + Compressed Data field, which is is guaranteed to be aligned + to a multiple of four bytes relative to the beginning of the + Stream. This can increase + - speed, if the filtered data is handled multiple bytes at + a time by the filter-specific encoder and decoder, + because accessing aligned data in computer memory is + usually faster; and + - compression ratio, if the output data is later compressed + with an external compression tool. + + +5.2. Security + + If filters would be allowed to be chained freely, it would be + possible to create malicious files, that would be very slow to + decode. Such files could be used to create denial of service + attacks. + + Slow files could occur when multiple filters are chained: + + v Compressed input data + | Filter 1 decoder (last filter) + | Filter 0 decoder (non-last filter) + v Uncompressed output data + + The decoder of the last filter in the chain produces a lot of + output from little input. Another filter in the chain takes the + output of the last filter, and produces very little output + while consuming a lot of input. As a result, a lot of data is + moved inside the filter chain, but the filter chain as a whole + gets very little work done. + + To prevent this kind of slow files, there are restrictions on + how the filters can be chained. These restrictions MUST be + taken into account when designing new filters. + + The maximum number of filters in the chain has been limited to + four, thus there can be at maximum of three non-last filters. + Of these three non-last filters, only two are allowed to change + the size of the data. + + The non-last filters, that change the size of the data, MUST + have a limit how much the decoder can compress the data: the + decoder SHOULD produce at least n bytes of output when the + filter is given 2n bytes of input. This limit is not + absolute, but significant deviations MUST be avoided. + + The above limitations guarantee that if the last filter in the + chain produces 4n bytes of output, the chain as a whole will + produce at least n bytes of output. + + +5.3. Filters + +5.3.1. LZMA2 + + LZMA (Lempel-Ziv-Markov chain-Algorithm) is a general-purpose + compression algorithm with high compression ratio and fast + decompression. LZMA is based on LZ77 and range coding + algorithms. + + LZMA2 is an extension on top of the original LZMA. LZMA2 uses + LZMA internally, but adds support for flushing the encoder, + uncompressed chunks, eases stateful decoder implementations, + and improves support for multithreading. Thus, the plain LZMA + will not be supported in this file format. + + Filter ID: 0x21 + Size of Filter Properties: 1 byte + Changes size of data: Yes + Allow as a non-last filter: No + Allow as the last filter: Yes + + Preferred alignment: + Input data: Adjustable to 1/2/4/8/16 byte(s) + Output data: 1 byte + + The format of the one-byte Filter Properties field is as + follows: + + Bits Mask Description + 0-5 0x3F Dictionary Size + 6-7 0xC0 Reserved for future use; MUST be zero for now. + + Dictionary Size is encoded with one-bit mantissa and five-bit + exponent. The smallest dictionary size is 4 KiB and the biggest + is 4 GiB. + + Raw value Mantissa Exponent Dictionary size + 0 2 11 4 KiB + 1 3 11 6 KiB + 2 2 12 8 KiB + 3 3 12 12 KiB + 4 2 13 16 KiB + 5 3 13 24 KiB + 6 2 14 32 KiB + ... ... ... ... + 35 3 27 768 MiB + 36 2 28 1024 MiB + 37 3 29 1536 MiB + 38 2 30 2048 MiB + 39 3 30 3072 MiB + 40 2 31 4096 MiB - 1 B + + Instead of having a table in the decoder, the dictionary size + can be decoded using the following C code: + + const uint8_t bits = get_dictionary_flags() & 0x3F; + if (bits > 40) + return DICTIONARY_TOO_BIG; // Bigger than 4 GiB + + uint32_t dictionary_size; + if (bits == 40) { + dictionary_size = UINT32_MAX; + } else { + dictionary_size = 2 | (bits & 1); + dictionary_size <<= bits / 2 + 11; + } + + +5.3.2. Branch/Call/Jump Filters for Executables + + These filters convert relative branch, call, and jump + instructions to their absolute counterparts in executable + files. This conversion increases redundancy and thus + compression ratio. + + Size of Filter Properties: 0 or 4 bytes + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Below is the list of filters in this category. The alignment + is the same for both input and output data. + + Filter ID Alignment Description + 0x04 1 byte x86 filter (BCJ) + 0x05 4 bytes PowerPC (big endian) filter + 0x06 16 bytes IA64 filter + 0x07 4 bytes ARM filter [1] + 0x08 2 bytes ARM Thumb filter [1] + 0x09 4 bytes SPARC filter + 0x0A 4 bytes ARM64 filter [2] + + [1] These are for little endian instruction encoding. + This must not be confused with data endianness. + A processor configured for big endian data access + may still use little endian instruction encoding. + The filters don't care about the data endianness. + + [2] 4096-byte alignment gives the best results + because the address in the ADRP instruction + is a multiple of 4096 bytes. + + If the size of Filter Properties is four bytes, the Filter + Properties field contains the start offset used for address + conversions. It is stored as an unsigned 32-bit little endian + integer. The start offset MUST be a multiple of the alignment + of the filter as listed in the table above; if it isn't, the + decoder MUST indicate an error. If the size of Filter + Properties is zero, the start offset is zero. + + Setting the start offset may be useful if an executable has + multiple sections, and there are many cross-section calls. + Taking advantage of this feature usually requires usage of + the Subblock filter, whose design is not complete yet. + + +5.3.3. Delta + + The Delta filter may increase compression ratio when the value + of the next byte correlates with the value of an earlier byte + at specified distance. + + Filter ID: 0x03 + Size of Filter Properties: 1 byte + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Preferred alignment: + Input data: 1 byte + Output data: Same as the original input data + + The Properties byte indicates the delta distance, which can be + 1-256 bytes backwards from the current byte: 0x00 indicates + distance of 1 byte and 0xFF distance of 256 bytes. + + +5.3.3.1. Format of the Encoded Output + + The code below illustrates both encoding and decoding with + the Delta filter. + + // Distance is in the range [1, 256]. + const unsigned int distance = get_properties_byte() + 1; + uint8_t pos = 0; + uint8_t delta[256]; + + memset(delta, 0, sizeof(delta)); + + while (1) { + const int byte = read_byte(); + if (byte == EOF) + break; + + uint8_t tmp = delta[(uint8_t)(distance + pos)]; + if (is_encoder) { + tmp = (uint8_t)(byte) - tmp; + delta[pos] = (uint8_t)(byte); + } else { + tmp = (uint8_t)(byte) + tmp; + delta[pos] = tmp; + } + + write_byte(tmp); + --pos; + } + + +5.4. Custom Filter IDs + + If a developer wants to use custom Filter IDs, there are two + choices. The first choice is to contact Lasse Collin and ask + him to allocate a range of IDs for the developer. + + The second choice is to generate a 40-bit random integer + which the developer can use as a personal Developer ID. + To minimize the risk of collisions, Developer ID has to be + a randomly generated integer, not manually selected "hex word". + The following command, which works on many free operating + systems, can be used to generate Developer ID: + + dd if=/dev/urandom bs=5 count=1 | hexdump + + The developer can then use the Developer ID to create unique + (well, hopefully unique) Filter IDs. + + Bits Mask Description + 0-15 0x0000_0000_0000_FFFF Filter ID + 16-55 0x00FF_FFFF_FFFF_0000 Developer ID + 56-62 0x3F00_0000_0000_0000 Static prefix: 0x3F + + The resulting 63-bit integer will use 9 bytes of space when + stored using the encoding described in Section 1.2. To get + a shorter ID, see the beginning of this Section how to + request a custom ID range. + + +5.4.1. Reserved Custom Filter ID Ranges + + Range Description + 0x0000_0300 - 0x0000_04FF Reserved to ease .7z compatibility + 0x0002_0000 - 0x0007_FFFF Reserved to ease .7z compatibility + 0x0200_0000 - 0x07FF_FFFF Reserved to ease .7z compatibility + + +6. Cyclic Redundancy Checks + + There are several incompatible variations to calculate CRC32 + and CRC64. For simplicity and clarity, complete examples are + provided to calculate the checks as they are used in this file + format. Implementations MAY use different code as long as it + gives identical results. + + The program below reads data from standard input, calculates + the CRC32 and CRC64 values, and prints the calculated values + as big endian hexadecimal strings to standard output. + + #include + #include + #include + + uint32_t crc32_table[256]; + uint64_t crc64_table[256]; + + void + init(void) + { + static const uint32_t poly32 = UINT32_C(0xEDB88320); + static const uint64_t poly64 + = UINT64_C(0xC96C5795D7870F42); + + for (size_t i = 0; i < 256; ++i) { + uint32_t crc32 = i; + uint64_t crc64 = i; + + for (size_t j = 0; j < 8; ++j) { + if (crc32 & 1) + crc32 = (crc32 >> 1) ^ poly32; + else + crc32 >>= 1; + + if (crc64 & 1) + crc64 = (crc64 >> 1) ^ poly64; + else + crc64 >>= 1; + } + + crc32_table[i] = crc32; + crc64_table[i] = crc64; + } + } + + uint32_t + crc32(const uint8_t *buf, size_t size, uint32_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc32_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + uint64_t + crc64(const uint8_t *buf, size_t size, uint64_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc64_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + int + main() + { + init(); + + uint32_t value32 = 0; + uint64_t value64 = 0; + uint64_t total_size = 0; + uint8_t buf[8192]; + + while (1) { + const size_t buf_size + = fread(buf, 1, sizeof(buf), stdin); + if (buf_size == 0) + break; + + total_size += buf_size; + value32 = crc32(buf, buf_size, value32); + value64 = crc64(buf, buf_size, value64); + } + + printf("Bytes: %" PRIu64 "\n", total_size); + printf("CRC-32: 0x%08" PRIX32 "\n", value32); + printf("CRC-64: 0x%016" PRIX64 "\n", value64); + + return 0; + } + + +7. References + + LZMA SDK - The original LZMA implementation + http://7-zip.org/sdk.html + + LZMA Utils - LZMA adapted to POSIX-like systems + http://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + http://tukaani.org/xz/ + + [RFC-1952] + GZIP file format specification version 4.3 + http://www.ietf.org/rfc/rfc1952.txt + - Notation of byte boxes in section "2.1. Overall conventions" + + [RFC-2119] + Key words for use in RFCs to Indicate Requirement Levels + http://www.ietf.org/rfc/rfc2119.txt + + [GNU-tar] + GNU tar 1.21 manual + http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html + - Node 9.4.2 "Blocking Factor", paragraph that begins + "gzip will complain about trailing garbage" + - Note that this URL points to the latest version of the + manual, and may some day not contain the note which is in + 1.21. For the exact version of the manual, download GNU + tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz + diff --git a/extra/7z2lzma/7z2lzma.bash b/extra/7z2lzma/7z2lzma.bash new file mode 100644 index 0000000..1777c78 --- /dev/null +++ b/extra/7z2lzma/7z2lzma.bash @@ -0,0 +1,115 @@ +#!/bin/bash +# +############################################################################# +# +# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must +# have exactly one LZMA compressed stream, which has been created with the +# default lc, lp, and pb values. The CRC32 in the .7z archive is not checked, +# and the script may seem to succeed while it actually created a corrupt .lzma +# file. You should always try uncompressing both the original .7z and the +# created .lzma and compare that the output is identical. +# +# This script requires basic GNU tools and 7z or 7za tool from p7zip. +# +# Last modified: 2009-01-15 14:25+0200 +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +# You can use 7z or 7za, both will work. +SEVENZIP=7za + +if [ $# != 2 -o -z "$1" -o -z "$2" ]; then + echo "Usage: $0 input.7z output.lzma" + exit 1 +fi + +# Converts an integer variable to little endian binary integer. +int2bin() +{ + local LEN=$1 + local NUM=$2 + local HEX=(0 1 2 3 4 5 6 7 8 9 A B C D E F) + local I + for ((I=0; I < "$LEN"; ++I)); do + printf "\\x${HEX[(NUM >> 4) & 0x0F]}${HEX[NUM & 0x0F]}" + NUM=$((NUM >> 8)) + done +} + +# Make sure we get possible errors from pipes. +set -o pipefail + +# Get information about the input file. At least older 7z and 7za versions +# may return with zero exit status even when an error occurred, so check +# if the output has any lines beginning with "Error". +INFO=$("$SEVENZIP" l -slt "$1") +if [ $? != 0 ] || printf '%s\n' "$INFO" | grep -q ^Error; then + printf '%s\n' "$INFO" + exit 1 +fi + +# Check if the input file has more than one compressed block. +if printf '%s\n' "$INFO" | grep -q '^Block = 1'; then + echo "Cannot convert, because the input file has more than" + echo "one compressed block." + exit 1 +fi + +# Get compressed, uncompressed, and dictionary size. +CSIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Packed Size = ([0-9]+$)|\1|p') +USIZE=$(printf '%s\n' "$INFO" | sed -rn 's|^Size = ([0-9]+$)|\1|p') +DICT=$(printf '%s\n' "$INFO" | sed -rn 's|^Method = LZMA:([0-9]+[bkm]?)$|\1|p') + +if [ -z "$CSIZE" -o -z "$USIZE" -o -z "$DICT" ]; then + echo "Parsing output of $SEVENZIP failed. Maybe the file uses some" + echo "other compression method than plain LZMA." + exit 1 +fi + +# The following assumes that the default lc, lp, and pb settings were used. +# Otherwise the output will be corrupt. +printf '\x5D' > "$2" + +# Dictionary size can be either was power of two, bytes, kibibytes, or +# mebibytes. We need to convert it to bytes. +case $DICT in + *b) + DICT=${DICT%b} + ;; + *k) + DICT=${DICT%k} + DICT=$((DICT << 10)) + ;; + *m) + DICT=${DICT%m} + DICT=$((DICT << 20)) + ;; + *) + DICT=$((1 << DICT)) + ;; +esac +int2bin 4 "$DICT" >> "$2" + +# Uncompressed size +int2bin 8 "$USIZE" >> "$2" + +# Copy the actual compressed data. Using multiple dd commands to avoid +# copying large amount of data with one-byte block size, which would be +# annoyingly slow. +BS=8192 +BIGSIZE=$((CSIZE / BS)) +CSIZE=$((CSIZE % BS)) +{ + dd of=/dev/null bs=32 count=1 \ + && dd bs="$BS" count="$BIGSIZE" \ + && dd bs=1 count="$CSIZE" +} < "$1" >> "$2" + +exit $? diff --git a/extra/scanlzma/scanlzma.c b/extra/scanlzma/scanlzma.c new file mode 100644 index 0000000..110f822 --- /dev/null +++ b/extra/scanlzma/scanlzma.c @@ -0,0 +1,88 @@ +/* + scanlzma, scan for lzma compressed data in stdin and echo it to stdout. + Copyright (C) 2006 Timo Lindfors + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + +/* Usage example: + + $ wget http://www.wifi-shop.cz/Files/produkty/wa2204/wa2204av1.4.1.zip + $ unzip wa2204av1.4.1.zip + $ gcc scanlzma.c -o scanlzma -Wall + $ ./scanlzma 0 < WA2204-FW1.4.1/linux-1.4.bin | lzma -c -d | strings | grep -i "copyright" + UpdateDD version 2.5, Copyright (C) 2005 Philipp Benner. + Copyright (C) 2005 Philipp Benner. + Copyright (C) 2005 Philipp Benner. + mawk 1.3%s%s %s, Copyright (C) Michael D. Brennan + # Copyright (C) 1998, 1999, 2001 Henry Spencer. + ... + +*/ + + +/* LZMA compressed file format */ +/* --------------------------- */ +/* Offset Size Description */ +/* 0 1 Special LZMA properties for compressed data */ +/* 1 4 Dictionary size (little endian) */ +/* 5 8 Uncompressed size (little endian). -1 means unknown size */ +/* 13 Compressed data */ + +#include +#include +#include + +#define BUFSIZE 4096 + +int find_lzma_header(unsigned char *buf) { + return (buf[0] < 0xE1 + && buf[0] == 0x5d + && buf[4] < 0x20 + && (memcmp (buf + 10 , "\x00\x00\x00", 3) == 0 + || (memcmp (buf + 5, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 8) == 0))); +} + +int main(int argc, char *argv[]) { + unsigned char buf[BUFSIZE]; + int ret, i, numlzma, blocks=0; + + if (argc != 2) { + printf("usage: %s numlzma < infile | lzma -c -d > outfile\n" + "where numlzma is index of lzma file to extract, starting from zero.\n", + argv[0]); + exit(1); + } + numlzma = atoi(argv[1]); + + for (;;) { + /* Read data. */ + ret = fread(buf, BUFSIZE, 1, stdin); + if (ret != 1) + break; + + /* Scan for signature. */ + for (i = 0; i +#endif + +#include "getopt.h" + +#include +#include +#include +#include + +#ifdef __VMS +# include +#endif + +/* Completely disable NLS for getopt. We won't include translations for it + anyway. If the system lacks getopt_long, missing translations probably + aren't a problem. */ +/* +#ifdef _LIBC +# include +#else +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif +*/ +#define _(msgid) (msgid) + +#if defined _LIBC && defined USE_IN_LIBIO +# include +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + +/* Unlike standard Unix `getopt', functions like `getopt_long' + let the user intersperse the options with the other arguments. + + As `getopt_long' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Using `getopt' or setting the environment variable POSIXLY_CORRECT + disables permutation. + Then the application's behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_int.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Keep a global copy of all internal members of getopt_data. */ + +static struct _getopt_data getopt_data; + + +#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (d->__nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (char **argv, struct _getopt_data *d) +{ + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + d->__nonoption_flags_max_len), + '\0', top + 1 - d->__nonoption_flags_max_len); + d->__nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (int argc, char **argv, const char *optstring, + int posixly_correct, struct _getopt_data *d) +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + d->__first_nonopt = d->__last_nonopt = d->optind; + + d->__nextchar = NULL; + + d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + d->__ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + d->__ordering = REQUIRE_ORDER; + ++optstring; + } + else if (d->__posixly_correct) + d->__ordering = REQUIRE_ORDER; + else + d->__ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (!d->__posixly_correct + && argc == __libc_argc && argv == __libc_argv) + { + if (d->__nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + d->__nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = d->__nonoption_flags_max_len = strlen (orig_str); + if (d->__nonoption_flags_max_len < argc) + d->__nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (d->__nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + d->__nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', d->__nonoption_flags_max_len - len); + } + } + d->__nonoption_flags_len = d->__nonoption_flags_max_len; + } + else + d->__nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. + + If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT + environment variable were set. */ + +int +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct, struct _getopt_data *d) +{ + int print_errors = d->opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + d->optarg = NULL; + + if (d->optind == 0 || !d->__initialized) + { + if (d->optind == 0) + d->optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring, + posixly_correct, d); + d->__initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ + || (d->optind < d->__nonoption_flags_len \ + && __getopt_nonoption_flags[d->optind] == '1')) +#else +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') +#endif + + if (d->__nextchar == NULL || *d->__nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; + + if (d->__ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (d->optind != argc && !strcmp (argv[d->optind], "--")) + { + d->optind++; + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; + + d->optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (d->optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (d->__ordering == REQUIRE_ORDER) + return -1; + d->optarg = argv[d->optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + d->__nextchar = (argv[d->optind] + 1 + + (longopts != NULL && argv[d->optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[d->optind][1] == '-' + || (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + d->optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind - 1][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#else + fprintf (stderr, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#else + fprintf (stderr, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + + d->__nextchar += strlen (d->__nextchar); + + d->optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->__nextchar = (char *) ""; + d->optind++; + d->optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *d->__nextchar++; + char *temp = strchr (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*d->__nextchar == '\0') + ++d->optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (d->__posixly_correct) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: illegal option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); +#endif + } + else + { +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: invalid option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `d->optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; + nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + + d->__nextchar += strlen (d->__nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + d->__nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + d->optind++; + } + else + d->optarg = NULL; + d->__nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; + } + } + return c; + } +} + +int +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct) +{ + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, longind, + long_only, posixly_correct, &getopt_data); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + +int +getopt (int argc, char *const *argv, const char *optstring) +{ + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); +} + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/getopt.in.h b/lib/getopt.in.h new file mode 100644 index 0000000..ea77e3d --- /dev/null +++ b/lib/getopt.in.h @@ -0,0 +1,226 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in this header. When this happens, include the + headers that might declare getopt so that they will not cause + confusion if included after this file. Then systematically rename + identifiers so that they do not collide with the system functions + and variables. Renaming avoids problems with some compilers and + linkers. */ +#if defined __GETOPT_PREFIX && !defined __need_getopt +# include +# include +# include +# undef __need_getopt +# undef getopt +# undef getopt_long +# undef getopt_long_only +# undef optarg +# undef opterr +# undef optind +# undef optopt +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# define getopt __GETOPT_ID (getopt) +# define getopt_long __GETOPT_ID (getopt_long) +# define getopt_long_only __GETOPT_ID (getopt_long_only) +# define optarg __GETOPT_ID (optarg) +# define opterr __GETOPT_ID (opterr) +# define optind __GETOPT_ID (optind) +# define optopt __GETOPT_ID (optopt) +#endif + +/* Standalone applications get correct prototypes for getopt_long and + getopt_long_only; they declare "char **argv". libc uses prototypes + with "char *const *argv" that are incorrect because getopt_long and + getopt_long_only can permute argv; this is required for backward + compatibility (e.g., for LSB 2.0.1). + + This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', + but it caused redefinition warnings if both unistd.h and getopt.h were + included, since unistd.h includes getopt.h having previously defined + __need_getopt. + + The only place where __getopt_argv_const is used is in definitions + of getopt_long and getopt_long_only below, but these are visible + only if __need_getopt is not defined, so it is quite safe to rewrite + the conditional as follows: +*/ +#if !defined __need_getopt +# if defined __GETOPT_PREFIX +# define __getopt_argv_const /* empty */ +# else +# define __getopt_argv_const const +# endif +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifndef __THROW +# ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) (0) +# endif +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `-', then non-option arguments are treated as + arguments to the option '\1'. This behavior is specific to the GNU + `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in + the environment, then do not permute arguments. */ + +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW; + +#ifndef __need_getopt +extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; +extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; + +#endif + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/lib/getopt1.c b/lib/getopt1.c new file mode 100644 index 0000000..da5d533 --- /dev/null +++ b/lib/getopt1.c @@ -0,0 +1,171 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifdef _LIBC +# include +#else +# include +# include "getopt.h" +#endif +#include "getopt_int.h" + +#include + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 0, 0); +} + +int +_getopt_long_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 0, 0, d); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (int argc, char *__getopt_argv_const *argv, + const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 1, 0); +} + +int +_getopt_long_only_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 1, 0, d); +} + + +#ifdef TEST + +#include + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/getopt_int.h b/lib/getopt_int.h new file mode 100644 index 0000000..401579f --- /dev/null +++ b/lib/getopt_int.h @@ -0,0 +1,131 @@ +/* Internal declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_INT_H +#define _GETOPT_INT_H 1 + +extern int _getopt_internal (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct); + + +/* Reentrant versions which can handle parsing multiple argument + vectors at the same time. */ + +/* Data type for reentrant functions. */ +struct _getopt_data +{ + /* These have exactly the same meaning as the corresponding global + variables, except that they are used for the reentrant + versions of getopt. */ + int optind; + int opterr; + int optopt; + char *optarg; + + /* Internal members. */ + + /* True if the internal members have been initialized. */ + int __initialized; + + /* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + char *__nextchar; + + /* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters, or by calling getopt. + + PERMUTE is the default. We permute the contents of ARGV as we + scan, so that eventually all the non-options are at the end. + This allows options to be given in any order, even with programs + that were not written to expect this. + + RETURN_IN_ORDER is an option available to programs that were + written to expect options and other ARGV-elements in any order + and that care about the ordering of the two. We describe each + non-option ARGV-element as if it were the argument of an option + with character code 1. Using `-' as the first character of the + list of option characters selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + + enum + { + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + } __ordering; + + /* If the POSIXLY_CORRECT environment variable is set + or getopt was called. */ + int __posixly_correct; + + + /* Handle permutation of arguments. */ + + /* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first + of them; `last_nonopt' is the index after the last of them. */ + + int __first_nonopt; + int __last_nonopt; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + int __nonoption_flags_max_len; + int __nonoption_flags_len; +# endif +}; + +/* The initializer is necessary to set OPTIND and OPTERR to their + default values and to clear the initialization flag. */ +#define _GETOPT_DATA_INITIALIZER { 1, 1 } + +extern int _getopt_internal_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct, + struct _getopt_data *__data); + +extern int _getopt_long_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + struct _getopt_data *__data); + +extern int _getopt_long_only_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, + int *__longind, + struct _getopt_data *__data); + +#endif /* getopt_int.h */ diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..7a76c70 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,23 @@ +ca +cs +da +de +eo +es +fi +fr +hr +hu +it +ko +pl +pt +pt_BR +ro +sr +sv +tr +uk +vi +zh_CN +zh_TW diff --git a/po/Makevars b/po/Makevars new file mode 100644 index 0000000..dc19bc9 --- /dev/null +++ b/po/Makevars @@ -0,0 +1,46 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# Although you may need slightly wider terminal than 80 chars, it is +# much nicer to edit the output of --help when this is set. +XGETTEXT_OPTIONS += --no-wrap +MSGMERGE += --no-wrap diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..e1438e0 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,13 @@ +# List of source files which contain translatable strings. +src/xz/args.c +src/xz/coder.c +src/xz/file_io.c +src/xz/hardware.c +src/xz/list.c +src/xz/main.c +src/xz/message.c +src/xz/options.c +src/xz/signals.c +src/xz/suffix.c +src/xz/util.c +src/common/tuklib_exit.c diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 0000000..18c024b --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,62 @@ +# Special Makefile rules for English message catalogs with quotation marks. +# +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# This file, Rules-quot, and its auxiliary files (listed under +# DISTFILES.common.extra1) are free software; the Free Software Foundation +# gives unlimited permission to use, copy, distribute, and modify them. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 0000000..4b937aa --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/po/ca.gmo b/po/ca.gmo new file mode 100644 index 0000000..9e21bbc Binary files /dev/null and b/po/ca.gmo differ diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 0000000..eacc6e5 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,1031 @@ +# XZ Utils Catalan Translation +# This file is put in the public domain. +# Jordi Mas i Hernàndez , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-12-12 18:19+0300\n" +"Last-Translator: Jordi Mas i Hernàndez \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: argument no vàlid per a --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: massa arguments per a --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 només es pot utilitzar com a últim element a --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: tipus de format de fitxer desconegut" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: tipus de comprovació d'integritat no suportat" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Només es pot especificar un fitxer amb `--files' o `--files0'." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variable d'entorn %s conté massa arguments" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "El suport de compressió s'ha desactivat en temps de construcció" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "El suport de descompressió s'ha desactivat en temps de construcció" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "No s'admet la compressió de fitxers lzip (.lz)" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "El nombre màxim de filtres és de quatre" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "El límit d'ús de la memòria és massa baix per a la configuració del filtre indicat." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Es desaconsella l'ús d'un predefinit en mode RAW." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Les opcions exactes dels predefinits poden variar entre versions de programari." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "El format .lzma només admet el filtre LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "No es pot usar LZMA1 amb el format .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "La cadena de filtratge és incompatible amb --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Es canvia al mode d'un sol fil a causa de --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "S'utilitzen fins a % fils." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Cadena de filtre no suportada o opcions de filtre" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "La descompressió necessitarà %s MiB de memòria." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "S'ha reduït el nombre de fils de %s a %s per a no excedir el límit d'ús de memòria de %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "S'ha reduït el nombre de fils de %s a un. El límit d'ús automàtic de memòria de %s MiB encara s'està excedint. Es requereix %s MiB de memòria. Es continua igualment." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "S'està canviant al mode d'un sol fil per a no excedir el límit d'ús de la memòria de %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "S'ha ajustat la mida del diccionari LZMA%c de %s MiB a %s MiB per a no excedir el límit d'ús de memòria de %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "S'ha produït un error en crear una canonada: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "No s'ha pogut habilitar l'espai aïllat" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: ha fallat la funció poll(): %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: sembla que el fitxer s'ha mogut, no s'elimina" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: no es pot eliminar: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: no es pot establir el propietari del fitxer: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: no es pot establir el grup de fitxers: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: no es poden establir els permisos del fitxer: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "S'ha produït un error en obtenir els indicadors d'estat del fitxer de l'entrada estàndard: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: és un enllaç simbòlic, s'omet" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: és un directori, s'omet" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: no és un fitxer normal, s'omet" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: el fitxer té el bit de setuid o setgid, s'omet" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: el fitxer té un bit enganxós, s'omet" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: el fitxer d'entrada té més d'un enllaç dur, s'omet" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nom de fitxer buit, s'omet" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "S'ha produït un error en restaurar els indicadors d'estat a l'entrada estàndard: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "S'ha produït un error en obtenir els indicadors d'estat del fitxer de la sortida estàndard: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "S'ha produït un error en restaurar l'indicador O_APPEND a la sortida estàndard: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: ha fallat el tancament del fitxer: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: ha fallat la cerca en intentar crear un fitxer dispers: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: error de lectura: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: error en cercar el fitxer: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: fi inesperat del fitxer" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: error d'escriptura: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Desactivat" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Quantitat de memòria física (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Nombre de fils del processador:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Compressió:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Descompressió:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Descompressió multifil:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Predeterminat per a -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Informació del maquinari:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Límits d'ús de la memòria" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Fluxos:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blocs:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Mida comprimida:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Mida no comprimida:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Relació:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Comprovació:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Farciment del flux:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Memòria necessària:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Mides a les capçaleres:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Nombre de fitxers:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Flux" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Bloc" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Blocs" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "CompOffset" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "UncompOffset" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "CompSize" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "UncompSize" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "TotalSize" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Relació" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Comprovació" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "CheckVal" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Separació" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Capçalera" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Senyals" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "MemUsage" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filtres" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Cap" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "NoConeix2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "NoConeix3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "NoConeix5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "NoConeix6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "NoConeix7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "NoConeix8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "NoConeix9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "NoConeix11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "NoConeix12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "NoConeix13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "NoConeix14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "NoConeix15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: El fitxer està buit" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Massa petit per a ser un fitxer .xz vàlid" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Strms Blocs Comprimit NoComprimit Ràtio Check Nom de fitxer" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Sí" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "No" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versió mínima de XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fitxer\n" +msgstr[1] "%s fitxers\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totals:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list només funciona en fitxers .xz (--format=xz o --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list no admet la lectura des de l'entrada estàndard" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Error en llegir els noms de fitxer: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Final inesperat de l'entrada en llegir els noms de fitxer" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: s'ha trobat un caràcter nul en llegir els noms de fitxer; potser volíeu utilitzar «--files0» en lloc de «--files»?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "La compressió i descompressió amb --robot encara no són admesos." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "No es poden llegir les dades de l'entrada estàndard en llegir els noms de fitxer de l'entrada estàndard" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Error intern (error)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "No es poden establir els gestors de senyals" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Sense comprovació d'integritat; no es verifica la integritat del fitxer" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Tipus no admès de comprovació d'integritat; no es verifica la integritat del fitxer" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "S'ha arribat al límit d'ús de la memòria" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "No s'ha reconegut el format del fitxer" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opcions no suportades" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Les dades comprimides estan malmeses" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Final inesperat de l'entrada" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Es requereixen %s MiB de memòria. El limitador està desactivat." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Es requereixen %s MiB de memòria. El límit és %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Cadena de filtratge: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Proveu «%s --help» per a més informació." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Ús: %s [OPCIÓ]... [FITXER]...\n" +"Comprimeix o descomprimeix FITXERS en format .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Els arguments obligatoris per a opcions llargues també són obligatoris\n" +"per a opcions curtes.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Mode d'operació:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress força la compressió\n" +" -d, --decompress força la descompressió\n" +" -t, --test comprova la integritat del fitxer comprimit\n" +" -l, --list informació sobre els fitxers .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificadors de l'operació:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep manté (no suprimeixis) els fitxers d'entrada\n" +" -f, --force força la sobreescriptura del fitxer de sortida i\n" +" (des)comprimeix els enllaços\n" +" -c, --stdout escriu a la sortida estàndard i no suprimeixis els\n" +" fitxers d'entrada" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream descomprimeix només el primer flux, i silenciosament\n" +" ignora les possibles dades d'entrada restants" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse no creïs fitxers dispersos en descomprimir\n" +" -S, --suffix=.SUF usa el sufix «.SUF» en fitxers comprimits\n" +" --files[=FILE] llegeix els noms de fitxer a processar des del FITXER;\n" +" si s'omet, els noms de fitxer es llegeixen de l'entrada\n" +" estàndard; els noms de fitxer s'han de finalitzar amb el\n" +" caràcter de línia nova\n" +" --files0[=FILE] com --files però usa el caràcter nul com a terminador" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Opcions bàsiques de format i compressió de fitxers:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT fitxer de format per a codificar o descodificar; els\n" +" valors possibles són «auto» (predeterminat), «xz»,\n" +" «lzma», «lzip» i «raw»\n" +" -C, --check=CHECK el tipus de comprovació d'integritat: «none» (useu amb\n" +" precaució), «crc32», «crc64» (predeterminat), o «sha256»" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check no verifiquis la comprovació d'integritat en descomprimir" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 compressió predefinida; per defecte és 6; tingueu en\n" +" compte l'ús de memòria del compressor *i* del\n" +" descompressor abans d'utilitzar 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme intenta millorar la ràtio de compressió usant més temps;\n" +" de CPU no afecta els requisits de memòria del\n" +" descompressor" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NUM usa com a màxim NUM fils; el valor predeterminat és 1;\n" +" estableix a 0 per a utilitzar tants fils com nuclis té\n" +" el processador" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=MIDA\n" +" inicia un bloc nou .xz després de cada MIDA de bytes\n" +" d'entrada; utilitzeu-ho per a establir la mida del bloc\n" +" per a la compressió amb fils" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=MIDES\n" +" inicia un bloc nou .xz després dels intervals de dades\n" +" sense comprimir donats amb separació per comes" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TEMPS\n" +" en comprimir, si han passat més de mil·lisegons de temps\n" +" d'espera des de l'anterior fluix i llegir més entrades\n" +" blocaria, totes les dades pendents es buiden" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LÍMIT\n" +" --memlimit-decompress=LÍMIT\n" +" --memlimit-mt-decompress=LÍMIT\n" +" -M, --memlimit=LÍMIT\n" +" estableix el límit d'ús de memòria per a la compressió,\n" +" descompressió, descompressió amb fils, o tots ells; el\n" +" LÍMIT és en bytes, % de RAM, o 0 per als predeterminats" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust si la configuració de compressió excedeix el límit d'ús\n" +" de memòria, dona error en lloc de reduir la configuració" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Cadena de filtre personalitzada per a la compressió (alternativa per a l'ús\n" +" de predefinits):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPTS] LZMA1 o LZMA2; OPTS és una llista separada per comes de\n" +" --lzma2[=OPTS] zero o més opcions de les següents (valors vàlids;\n" +" predeterminat):\n" +" preset=PRE restableix les opcions a un predefinit\n" +" (0-9[e])\n" +" dict=NUM mida del diccionari (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM nombre de bits de context literal (0-4; 3)\n" +" lp=NUM nombre de bits de posició literal (0-4; 0)\n" +" pb=NUM nombre de bits de posició (0-4; 2)\n" +" mode=MODE mode de compressió (ràpid, normal; normal)\n" +" nice=NUM longitud de coincidència (2-273; 64)\n" +" mf=NAME cercador de coincidències (hc3, hc4, bt2,\n" +" bt3, bt4; bt4)\n" +" depth=NUM profunditat màxima de cerca; 0=automàtic\n" +" (predeterminat)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPTS] filtre BCJ x86 (32-bit i 64-bit)\n" +" --arm[=OPTS] filtre BCJ ARM\n" +" --armthumb[=OPTS] filtre BCJ ARM-Thumb\n" +" --arm64[=OPTS] filtre ARM64 BCJ\n" +" --powerpc[=OPTS] filtre BCJ PowerPC (només endian gran)\n" +" --ia64[=OPTS] filtre IA-64 (Itanium) BCJ\n" +" --sparc[=OPTS] filtre BCJ SPARC\n" +" OPTS vàlids per a tots els filtres BCJ:\n" +" start=Núm. decalatge d'inici per a les conversions\n" +" (per defecte=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPTS] Filtre delta; OPT (valors vàlids; predeterminat):\n" +" dist=Núm. entre bytes que es resten de\n" +" l'altre (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Altres opcions:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet suprimeix els avisos; especifiqueu-ho dues vegades per a\n" +" suprimir també els errors\n" +" -v, --verbose sigues detallat; especifiqueu dues vegades per a tenir\n" +" encara més detall" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn fes que els avisos no afectin l'estat de sortida" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot usa missatges analitzables per la màquina\n" +" (útil per a scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory mostra la quantitat total de RAM i els límits actualment\n" +" actius d'ús de memòria, i surt" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help mostra l'ajuda curta (només mostra les opcions bàsiques)\n" +" -H, --long-help mostra aquesta ajuda llarga i surt" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help mostra aquesta ajuda curta i surt\n" +" -H, --long-help mostra l'ajuda llarga (llista també opcions avançades)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version mostra el número de versió i surt" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Sense FITXER, o quan el FITXER és -, es llegeix l'entrada estàndard.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Informa d'errors a <%s> (en anglès o finès).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Pàgina inicial de %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "AQUESTA ÉS UNA VERSIÓ DE DESENVOLUPAMENT NO DESTINADA A L'ÚS EN PRODUCCIÓ." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: les opcions han de ser parelles «name=value» separades amb comes" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: nom d'opció no vàlid" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: el valor de l'opció no és vàlid" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "No s'admet el LZMA1/LZMA2 predefinit: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "La suma de lc i lp no ha de superar 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: amb --format=raw, --suffix=.SUF és necessari si no s'escriu a la sortida estàndard" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: El nom de fitxer té un sufix desconegut, s'omet" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: El fitxer ja té el sufix «%s», s'ometrà" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: El sufix del nom de fitxer no és vàlid" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: El valor no és un enter decimal no negatiu" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: el sufix multiplicador no és vàlid" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Els sufixos vàlids són `KiB' (2.10), `MiB' (2.20), i `GiB' (2.30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "El valor de l'opció «%s» ha d'estar a l'interval [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Les dades comprimides no es poden llegir des d'un terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Les dades comprimides no es poden escriure en un terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Ha fallat l'escriptura a la sortida estàndard" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Error desconegut" diff --git a/po/cs.gmo b/po/cs.gmo new file mode 100644 index 0000000..9088d10 Binary files /dev/null and b/po/cs.gmo differ diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..76ad3c3 --- /dev/null +++ b/po/cs.po @@ -0,0 +1,1138 @@ +# XZ Utils Czech translation +# This file is put in the public domain. +# Marek Černocký , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: xz-utils\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2010-12-03 11:32+0100\n" +"Last-Translator: Marek Černocký \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n" +"X-Poedit-Language: Czech\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Neznámý typ formátu souboru" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Neznámý typ kontroly integrity" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Spolu s přepínači „--files“ nebo „--files0“ může být zadán pouze jeden soubor" + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Proměnná prostředí %s obsahuje příliš mnoho argumentů" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maximální počet filtrů je čtyři" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Omezení použitelné paměti je příliš malé pro dané nastavení filtru." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Použití přednastavení v režimu raw je nevhodné." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Formát .lzma podporuje pouze filtr LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 nelze použít s formátem .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "" + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Nepodporovaný omezující filtr nebo volby filtru" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Dekomprimace bude vyžadovat %s MiB paměti." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo překročeno omezení použitelné paměti %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo překročeno omezení použitelné paměti %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo překročeno omezení použitelné paměti %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Vypadá to, že soubor byl přesunut, proto nebude odstraněn" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Nelze odstranit: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Nelze nastavit vlastníka souboru: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Nelze nastavit skupinu souboru: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Nelze nastavit oprávnění souboru: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Jedná se o symbolický odkaz, vynechává se" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Jedná se o složku, vynechává se" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Nejedná se o běžný soubor, vynechává se" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Soubor má nastavený bit setuid nebo setgid, vynechává se" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Soubor má nastavený bit sticky, vynechává se" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Vstupní soubor má více než jeden pevný odkaz, vynechává se" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Prázdný název souboru, vynechává se" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Chyba při obnovení příznaku O_APPEND na standardní výstup: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Selhalo zavření souboru: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Selhalo nastavení pozice při pokusu o vytvoření souboru řídké matice: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Chyba čtení: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Chyba při posunu v rámci souboru: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Neočekávaný konec souboru" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Chyba zápisu: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Vypnuto" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Celkové množství fyzické paměti (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Omezení použitelné paměti pro dekomprimaci:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Dosaženo omezení použitelné paměti" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Komprimovaná velikost: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Nekomprimovaná velikost: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Zarovnání proudu: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Potřebná paměť: %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Velikosti v hlavičkách: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Počet souborů: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Celkem:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "žádná" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "neznámá-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "neznámá-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "neznámá-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "neznámá-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "neznámá-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "neznámá-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "neznámá-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "neznámá-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "neznámá-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "neznámá-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "neznámá-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "neznámá-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Soubor je prázdný" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Je příliš malý na to, aby to mohl být platný soubor .xz" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Proud Bloky Komprim Nekomprim Poměr Kontrl Název souboru" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Ano" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Ne" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr "" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s soubor\n" +msgstr[1] "%s soubory\n" +msgstr[2] "%s souborů\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Celkem:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list pracuje pouze se soubory .xz (--format=xz nebo --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list nepodporuje čtení ze standardního vstupu" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Chyba při čtení názvů souborů: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Neočekávaný konec vstupu při čtení názvů souborů" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Byl nalezen nulový znak při čtení názvů souborů; nechtěli jste náhodou použít „--files0“ místo „--files“?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Komprimace a dekomprimace s přepínačem --robot není zatím podporovaná." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Ze standardního vstupu nelze číst data, když se ze standardního vstupu načítají názvy souborů" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "" + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Interní chyba" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Nelze ustanovit ovladač signálu" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Dosaženo omezení použitelné paměti" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Formát souboru nebyl rozpoznán" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Nepodporovaná volba" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Komprimovaná data jsou poškozená" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Neočekávaný konec vstupu" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "" + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Je vyžadováno %s MiB paměti. Limit je %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Omezující filtr: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Zkuste „%s --help“ pro více informací" + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Použití: %s [PŘEPÍNAČ]... [SOUBOR]...\n" +"Komprimuje nebo dekomprimuje SOUBORy ve formátu xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Povinné argumenty pro dlouhé přepínače jsou povinné rovněž pro krátké přepínače.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr "Operační režim:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress provést komprimaci\n" +" -d, --decompress provést dekomprimaci\n" +" -t, --test testovat integritu komprimovaného souboru\n" +" -l, --list vypsat informace o souborech .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +"Modifikátory operací:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep zachovat (nemazat) vstupní soubory\n" +" -f, --force vynutit přepis výstupního souboru a de/komprimovat odkazy\n" +" -c, --stdout zapisovat na standardní výstup a nemazat vstupní soubory" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse nevytvářet při dekomprimaci soubory řídkých matic\n" +" -S, --suffix=.PRIP použít u komprimovaných souborů příponu „.PRIP“\n" +" --files[=SOUBOR] číst názvy souborů, které se mají zpracovat, ze SOUBORu;\n" +" pokud není SOUBOR zadán, čte se ze standardního vstupu;\n" +" názvy souborů musí být zakončeny znakem nového řádku\n" +" --files0[=SOUBOR] stejné jako --files, ale použít k zakončování nulový znak" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +"Základní přepínače pro formát souboru a komprimaci:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FORMÁT formát souboru k zakódování nebo dekódování; možné\n" +" hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n" +" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s rozmyslem),\n" +" „crc32“, „crc64“ (výchozí) nebo „sha256“" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 .. -9 přednastavení komprimace; výchozí je 6; než použijete\n" +" hodnoty 7 – 9, vezměte do úvahy množství použité paměti" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme zkusit zlepšit poměr komprimace využitím více času\n" +" procesoru; nemá vliv na paměťové nároky dekomprimace" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" nastaví omezení použitelné paměti pro komprimaci,\n" +" dekomprimaci nebo obojí; LIMIT je v bajtech, % z paměti\n" +" RAM nebo 0 pro výchozí" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust pokud nastavení komprimace přesáhne omezení použitelné\n" +" paměti, předat chybu namísto snížení nastavení" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +"Vlastní omezující filtr pro komprimaci (alternativa k použití přednastavených):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je čárkou oddělovaný seznam žádné\n" +" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; výchozí):\n" +" preset=PŘE změnit volby na PŘEdnastavené (0 – 9[e])\n" +" dict=POČ velikost slovníku (4 KiB – 1536 MiB; 8 MiB)\n" +" lc=POČ počet kontextových bitů literálu (0 – 4; 3)\n" +" lp=POČ počet pozičních bitů literálu (0 – 4; 0)\n" +" pb=POČ počet pozičních bitů (0 – 4; 2)\n" +" mode=REŽIM režim komprimace (fast, normal; normal)\n" +" nice=NUM příznivá délka shody (2 – 273; 64)\n" +" mf=NÁZEV hledání shod (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=POČ maximální hloubka prohledávání;\n" +" 0 = automaticky (výchozí)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=VOLBY] Filtr x86 BCJ (32bitový a 64bitový)\n" +" --powerpc[=VOLBY] Filtr PowerPC BCJ (pouze big endian)\n" +" --ia64[=VOLBY] Filtr IA64 (Itanium) BCJ\n" +" --arm[=VOLBY] Filtr ARM BCJ (pouze little endian)\n" +" --armthumb[=VOLBY] Filtr ARM-Thumb BCJ (pouze little endian)\n" +" --sparc[=VOLBY] Filtr SPARC BCJ\n" +" Platné volby pro všechny filtry BCJ:\n" +" start=POČ počáteční posun pro převody (výchozí=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=VOLBY] Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n" +" dist=POČ vzdálenost mezi bajty, které jsou odečítány\n" +" jeden od druhého (1 – 256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Ostatní přepínače:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet potlačit varování; zadáním dvakrát, potlačíte i chyby\n" +" -v, --verbose podrobnější zprávy; zadáním dvakrát, budou ještě\n" +" podrobnější" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn způsobí, že varování neovlivní stav ukončení" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot použít strojově analyzovatelné zprávy (užitečné pro\n" +" skripty)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory zobrazit celkové množství paměti RAM a současné aktivní\n" +" omezení použitelné paměti a skončit" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help zobrazit krátkou nápovědu (vypíše jen základní přepínače)\n" +" -H, --long-help zobrazit tuto úplnou nápovědu a skončit" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help zobrazit tuto zkrácenou nápovědu a skončit\n" +" -H, --long-help zobrazit úplnou nápovědu (vypíše i pokročilé přepínače)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version zobrazit číslo verze a skončit" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Pokud SOUBOR není zadán nebo pokud je -, bude se číst ze standardního vstupu.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Chyby hlaste na <%s> (v angličtině nebo finštině).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Domovská stránka %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "" + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Volby musí být páry „název=hodnota“ oddělené čárkami" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Neplatný název volby" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Neplatná hodnota volby" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nepodporované přednastavení LZMA1/LZMA2: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Součet lc a lp nesmí překročit hodnotu 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: S přepínačem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do standardního výstupu" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Název souboru má neznámou příponu, vynechává se" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Soubor již má příponu „%s“, vynechává se" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Neplatná přípona názvu souboru" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Hodnota není nezáporné desítkové číslo" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Neplatná jednotka s předponou" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a „GiB“ (2^30 B)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Hodnota volby „%s“ musí být v rozsahu [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Z terminálu nelze číst komprimovaná data" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Do terminálu nelze zapisovat komprimovaná data" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Zápis do standardního výstupu selhal" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Neznámá chyba" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Omezení použitelné paměti pro komprimaci: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Proudů: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Bloků: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Poměr komprimace: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Typ kontroly: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Proudy:\n" +#~ " Proud Bloky KomprPozice NekomprPozice KomprVelikost NekomprVelikost Poměr Kontrola Zarovnání" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Bloky:\n" +#~ " Proud Blok KomprPozice NekomprPozice CelkVelikost NekomprVelikost Poměr Kontrola" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " KontrHod %*s Hlavič Příznaky KomprVel PoužiPam Filtry" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Vybraný vyhledávač shod vyžaduje minimálně nice=%" + +#~ msgid "Limit was %s MiB, but %s MiB would have been needed" +#~ msgstr "Limit byl %s MiB, ale bylo by zapotřebí %s MiB" + +#~ msgid "%s MiB (%s bytes)\n" +#~ msgstr "%s MiB (%s bajtů)\n" + +#~ msgid "" +#~ " -e, --extreme use more CPU time when encoding to increase compression\n" +#~ " ratio without increasing memory usage of the decoder" +#~ msgstr "" +#~ " -e, --extreme využít více procesorového času pro kódování, čímž se\n" +#~ " zvýší kompresní poměr bez zvýšení paměti použité kodérem" + +#~ msgid "" +#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 indicates\n" +#~ " the default setting, which is 40 % of total RAM" +#~ msgstr "" +#~ " -M, --memory=POČ použít zhruba POČ bajtů paměti jako maximum; 0 znamená\n" +#~ " výchozí nastavení, což je 40% celkového množství paměti" + +#~ msgid "" +#~ "\n" +#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; default):\n" +#~ " size=NUM number of bytes of data per subblock\n" +#~ " (1 - 256Mi; 4Ki)\n" +#~ " rle=NUM run-length encoder chunk size (0-256; 0)" +#~ msgstr "" +#~ "\n" +#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; výchozí):\n" +#~ " size=POČ počet bajtů dat na subblok\n" +#~ " (1 - 256 Mi; 4 Ki)\n" +#~ " rle=POČ velikost dávky pro kodér run-length (0-256; 0)" + +#~ msgid "" +#~ "On this system and configuration, this program will use a maximum of roughly\n" +#~ "%s MiB RAM and " +#~ msgstr "" +#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze zhruba\n" +#~ "%s MiB RAM a " + +#~ msgid "" +#~ "one thread.\n" +#~ "\n" +#~ msgstr "" +#~ "jedno vlákno.\n" +#~ "\n" + +#~ msgid "%s: Invalid multiplier suffix. Valid suffixes:" +#~ msgstr "%s: Neplatná přípona. Platné přípony jsou:" diff --git a/po/da.gmo b/po/da.gmo new file mode 100644 index 0000000..486b7f8 Binary files /dev/null and b/po/da.gmo differ diff --git a/po/da.po b/po/da.po new file mode 100644 index 0000000..6ed649b --- /dev/null +++ b/po/da.po @@ -0,0 +1,1008 @@ +# Danish translation xz. +# This file is put in the public domain. +# Joe Hansen , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2019-03-04 23:08+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Ugyldigt parameter til --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: For mange argumenter til --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 kan kun bruges som det sidste element i --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Ukendt filformattype" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Typen for integritetkontrol er ikke understøttet" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Kun en fil kan angives med »--files« eller »--files0«." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Miljøvariablen %s indeholder for mange argumenter" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Komprimeringsunderstøttelse blev deaktiveret på byggetidspunktet" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Dekomprimeringsunderstøttelse blev deaktiveret på byggetidspunktet" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maksimalt antal filtre er fire" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Begræsningen for brug af hukommelse er for lav for den givne filteropsætning." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Det frarådes at bruge en forhåndskonfiguration i rå tilstand (raw mode)." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "De præcise indstillinger for forhåndskonfigurationerne kan variere mellem programversioner." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Formatet .lzma understøtter kun LZMA1-filteret" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 kan ikke bruges med .xz-formatet" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Filterkæden er ikke kompatibel med --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Skifter til enkelt trådet tilstand på grund af --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Bruger op til % tråde." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Filterkæde eller filterindstillinger er ikke understøttet" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Dekomprimering vil kræve %s MiB hukommelse." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Justerede antallet af tråde fra %s til %s for ikke at overskride begræsningen på brug af hukommelse på %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Justerede antallet af tråde fra %s til %s for ikke at overskride begræsningen på brug af hukommelse på %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Justerede LZMA%c-ordbogsstørrelsen fra %s MiB til %s MiB for ikke at overskride begrænsningen på brug af hukommelse på %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Det opstod en fejl under oprettelse af en datakanal: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Kunne ikke aktivere sandkassen" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() mislykkedes: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Filen er vist blevet flyttet, sletter ikke" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Kan ikke fjerne: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Kan ikke angive filejeren: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Kan ikke angive filgruppen: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Kan ikke angive filtilladelser: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Der opstod en fejl under indhentelse af filstatusflag fra standardind: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Er en symbolsk henvisning, udelader" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Er en mappe, udelader" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Er ikke en normal fil, udelader" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Filen har setuid- eller setgid-bitsæt, udelader" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Fil har klæbende bitsæt, udelader" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Inddatafil har mere end en hård henvisning, udelader" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Tomt filnavn, udelader" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Der opstod en fejl under gendannelse af statusflagene til standardind: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Der opstod en fejl under indhentelse af filstatusflag fra standardud: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Der opstod en fejl under gendannelse af flaget O_APPEND til standardud: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Lukning af filen fejlede: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Søgning fejlede under forsøg på at oprette en tynd fil: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Læsefejl: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Der opstod en fejl under søgning efter filen: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Uventet filafslutning" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Skrivefejl: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Deaktiveret" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Samlet mængde fysisk hukommelse (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Grænse for hukommelsesforbug til dekomprimering: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Begrænsning på brug af hukommelse er nået" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Komprimeret str.: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Ukomprimeret str.: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Strømfyld: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Hukommelse krævet: %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Størrelser i teksthoveder: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Antal filer: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "I alt:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Ingen" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Ukendt-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Ukendt-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Ukendt-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Ukendt-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Ukendt-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Ukendt-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Ukendt-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Ukendt-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Ukendt-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Ukendt-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Ukendt-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Ukendt-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Filen er tom" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: For lille til at være en gyldig .xz-fil" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Ja" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nej" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Minimum for XZ Utils-version: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fil\n" +msgstr[1] "%s filer\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "I alt:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list understøtter ikke læsning fra standardind" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Der opstod en fejl under forsøg på læsning af filnavne: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Uventet afslutning på inddata under forsøg på læsning af filnavne" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Komprimering og dekomprimering med --robot er endnu ikke understøttet." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Intern fejl (fejl)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Kan ikke etbalere signalhåndteringer" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Ingen integritetkontrol; verificerer ikke filintegritet" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Begrænsning på brug af hukommelse er nået" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Filformatet blev ikke genkendt" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Tilvalg er ikke understøttede" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Komprimerede data er ødelagte" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Uventet afslutning på inddata" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB hukommelse er krævet. Begrænseren er deaktiveret." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB hukommelse er krævet. Begrænsningen er %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Filterkæde: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Prøv »%s --help« for yderligere information." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Obligatoriske argumenter til lange tilvalg er også obligatoriske for korte\n" +"tilvalg.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Operationstilstand:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +"Operationsændrere:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +"Andre tilvalg:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr "" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot brug beskeder der kan fortolkes maskinelt (nyttigt\n" +" for skripter)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help vis den korte hjælpetekst (viser kun grundlæggende\n" +" tilvalg)\n" +" -H, --long-help vis den lange hjælpetekst og afslut" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help vis den korte hjælpetekst og afslut\n" +" -H, --long-help vis den lange hjælpetekst (viser også de avancerede\n" +" tilvalg)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version vis versionsnummer og afslut" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Med ingen FIL, eller når FIL er -, læs standardind.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Rapporter fejl til <%s> (på engelsk eller finsk).\n" +"Rapporter oversættelsesfejl til .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s hjemmeside: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "DETTE ER EN UDVIKLINGSVERSION - BRUG IKKE I PRODUKTION." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Tilvalg skal være »navne=værdi«-par adskilt med kommaer" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Ugyldigt tilvalgsnavn" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Ugyldigt tilvalgsværdi" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "LZMA1/LZMA2-forhåndskonfiguration er ikke understøttet: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Summen af lc og lp må ikke være højere end 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: med --format=raw, --suffix=.SUF er krævet med mindre der skrives til standardud" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Filnavn har ukendt endelse, udelader" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Filen har allrede endelsen »%s«, udelader." + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Ugyldig filnavnendelse" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Værdi er ikke et positivt decimalheltal" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Ugyldig multiplikatorendelse" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Gyldige endelser er »KiB« (2^10), »MiB« (2^20) og »GiB« (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Værdien for tilvalget »%s« skal være i intervallet [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Komprimerede data kan ikke læses fra en terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Komprimerede data kan ikke skrives til en terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Skrivning til standardud mislykkedes" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Ukendt fejl" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Sandkassen er deaktiveret på grund af inkompatible kommandolinjeargumenter" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Sandkassen blev aktiveret" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Grænse for hukommelsesforbrug til komprimering: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Strømme: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Blokke: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Pakkeforhold: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Kontrol: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Strømme:\n" +#~ " Strøm Blokke KompForsk. DekompForsk. KompStr. DekompStr. Forh. Kontrol Fyld" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blokke:\n" +#~ " Strøm Blok KompForsk. DekompForsk. Ialtstr. DekompStr. Forh. Kontrol" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " KontrolVær %*sTeksth Flag Kompstr. HukForb. Filtre" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Den valgte matchfinder kræver mindst nice=%" diff --git a/po/de.gmo b/po/de.gmo new file mode 100644 index 0000000..6fa1511 Binary files /dev/null and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..cc8721c --- /dev/null +++ b/po/de.po @@ -0,0 +1,1055 @@ +# XZ Utils German translation +# This file is put in the public domain. +# +# André Noll , 2010. +# Anna Henningsen , 2015. +# Mario Blättermann , 2019, 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-12-05 18:55+0100\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 22.08.3\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Ungültiges Argument für --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Zu viele Argumente für --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 kann nur das letzte Element in --block-list sein" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Unbekanntes Dateiformat" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Integritätsprüfungstyp nicht unterstützt" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Nur eine Datei kann als Argument für »--files« oder »--files0« angegeben werden." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Die Umgebungsvariable %s enthält zu viele Argumente" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Die Unterstützung für Kompression wurde zum Zeitpunkt der Erstellung deaktiviert" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Die Unterstützung für Dekompression wurde zum Zeitpunkt der Erstellung deaktiviert" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Kompression von lzip-Dateien (.lz) wird nicht unterstützt" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maximal vier Filter möglich" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Die Speicherbedarfsbegrenzung ist für die gegebene Filter-Konfiguration zu niedrig." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Verwendung einer Voreinstellung im Roh-Modus wird nicht empfohlen." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Die genauen Optionen der Voreinstellung können zwischen Softwareversionen variieren." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Das .lzma-Format unterstützt nur den LZMA1-Filter" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 kann nicht mit dem .xz-Format verwendet werden" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Diese Filterkette ist inkompatibel zu --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Wegen --flush-timeout wird auf den Einzelthread-Modus umgeschaltet" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Bis zu % Threads werden benutzt." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Filterkette oder Filteroptionen werden nicht unterstützt" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Dekompression wird %s MiB Speicher brauchen." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Anzahl der Threads wurde von %s auf %s reduziert, um die Speicherbedarfsbegrenzung von %s MiB nicht zu übersteigen" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Anzahl der Threads wurde von %s auf einen reduziert. Die automatische Begrenzung des Speicherverbrauchs auf %s MiB wird immer noch überschritten. %s MiB an Speicher sind erforderlich. Es wird dennoch fortgesetzt." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Es wurde in den Einzelthread-Modus gewechselt, um die Speicherbedarfsbegrenzung von %s MiB nicht zu übersteigen" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Die LZMA%c-Wörterbuchgröße wurde von %s MiB auf %s MiB angepasst, um die Speicherbedarfsbegrenzung von %s MiB nicht zu übersteigen" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Fehler beim Erzeugen der Pipeline: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Sandbox konnte nicht aktiviert werden" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() ist fehlgeschlagen: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Datei scheint verschoben worden zu sein, daher wird sie nicht gelöscht" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Löschen nicht möglich: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Dateieigentümer kann nicht gesetzt werden: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Dateigruppe kann nicht gesetzt werden: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Zugriffsrechte können nicht gesetzt werden: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Dateistatus-Markierungen können nicht aus der Standardeingabe ermittelt werden: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Ist ein symbolischer Link, wird übersprungen" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Ist ein Verzeichnis, wird übersprungen" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Keine reguläre Datei, wird übersprungen" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Datei hat das setuid- oder setgid-Bit gesetzt, wird übersprungen" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Datei hat sticky-Bit gesetzt, wird übersprungen" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Eingabedatei hat mehr als einen harten Link, wird übersprungen" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Leerer Dateiname, wird übersprungen" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Fehler beim Wiederherstellen der Status-Markierungen für die Standardeingabe: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Status-Markierungen der Standardausgabe können nicht ermittelt werden: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Fehler beim Wiederherstellen der O_APPEND-Markierungen für die Standardausgabe: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Fehler beim Schließen der Datei: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Positionierungsfehler beim Versuch, eine Sparse-Datei (dünnbesetzte Datei) zu erzeugen: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Lesefehler: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Fehler beim Durchsuchen der Datei: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Unerwartetes Ende der Datei" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Schreibfehler: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Deaktiviert" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Gesamtmenge physischer Speicher (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Anzahl der Prozessor-Threads:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Kompression:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Dekompression:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Multithread-Dekompression:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Vorgabe für -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Hardware-Information:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Speicherbedarfsbegrenzung:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Datenströme:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blöcke:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Größe komprimiert:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Größe unkomprimiert:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Verhältnis:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Prüfung:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Datenstromauffüllung:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Benötigter Speicher:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Größe in Köpfen:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Anzahl Dateien:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Datenstrom" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Block" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Blöcke" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "KompVers" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "UnkompVers" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "KompGröße" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "UnkompGröße" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Gesamt" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Verhältnis" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Prüfung" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "Prüfwert" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Auffüllung" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Kopf" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Flags" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "SpeichVerb" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filter" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Keine" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Unbek.2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Unbek.3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Unbek.5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Unbek.6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Unbek.7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Unbek.8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Unbek.9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Unbek.11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Unbek.12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Unbek.13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Unbek.14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Unbek.15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Datei ist leer" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Zu klein, um eine gültige .xz-Datei zu sein" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Ja" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nein" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Minimal erforderliche XZ Utils-Version: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s Datei\n" +msgstr[1] "%s Dateien\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Gesamt:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list funktioniert nur mit .xz-Dateien (--format=xz oder --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list unterstützt kein Lesen aus der Standardeingabe" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Fehler beim Lesen der Dateinamen: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Unerwartetes Ende der Eingabe beim Lesen der Dateinamen" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Null-Zeichen beim Lesen der Dateinamen gefunden; meinten Sie »--files0« statt »--files«?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Kompression und Dekompression mit --robot wird noch nicht unterstützt." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Lesen der Daten aus der Standardeingabe ist nicht möglich, wenn die Dateinamen auch aus der Standardeingabe gelesen werden" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Interner Fehler (Bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Signalroutine kann nicht gesetzt werden" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Keine Integritätsprüfung; Integrität der Datei wird nicht überprüft" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Typ der Integritätsprüfung wird nicht unterstützt; Integrität der Datei wird nicht überprüft" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Speicherbedarfsbegrenzung erreicht" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Dateiformat nicht erkannt" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Optionen nicht unterstützt" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Komprimierte Daten sind beschädigt" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Unerwartetes Ende der Eingabe" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB Speicher wird benötigt. Die Begrenzung ist deaktiviert." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB Speicher wird benötigt. Die Begrenzung ist %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Filterkette: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Versuchen Sie »%s --help« für mehr Informationen." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Aufruf: %s [OPTION]… [DATEI]…\n" +"Komprimiert oder dekomprimiert .xz-DATEI(EN).\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n" +"zwingend.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Aktionsmodus:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress Kompression erzwingen\n" +" -d, --decompress Dekompression erzwingen\n" +" -t, --test Dateiintegrität überprüfen\n" +" -l, --list Dateiinformationen anzeigen" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Aktionsmodifikatoren:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep Eingabedateien beibehalten (nicht löschen)\n" +" -f, --force Überschreiben der Ausgabedatei erzwingen\n" +" und Links (de)komprimieren\n" +" -c, --stdout In die Standardausgabe schreiben und die\n" +" Eingabedateien nicht löschen" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream Nur den ersten Datenstrom dekomprimieren und\n" +" stillschweigend mögliche weitere Eingabedaten\n" +" ignorieren" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse Beim Dekomprimieren keine Sparse-Dateien\n" +" erzeugen\n" +" -S, --suffix=.END ».END« als Endung für komprimierte Dateien\n" +" benutzen\n" +" --files=[DATEI] Zu verarbeitende Dateinamen aus DATEI lesen;\n" +" falls keine DATEI angegeben wurde, werden \n" +" Dateinamen aus der Standardeingabe gelesen.\n" +" Dateinamen müssen durch einen Zeilenumbruch\n" +" voneinander getrennt werden\n" +" --files0=[DATEI] Wie --files, aber das Null-Zeichen wird als\n" +" Trenner benutzt" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Grundlegende Optionen für Dateiformat und Kompression:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT Dateiformat zur Kodierung oder Dekodierung; mögliche\n" +" Werte sind »auto« (Voreinstellung), »xz«, »lzma«,\n" +" »lzip« und »raw«\n" +" -C, --check=PRÜFUNG Typ der Integritätsprüfung: »none« (Vorsicht),\n" +" »crc32«, »crc64« (Voreinstellung) oder »sha256«" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" +" --ignore-check Integritätsprüfung beim Dekomprimieren\n" +" nicht ausführen" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 .. -9 Kompressionseinstellung; Voreinstellung ist 6.\n" +" Beachten Sie den Speicherbedarf des Kompressors\n" +" *und* des Dekompressors, wenn Sie 7-9 benutzen!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme Versuchen, durch stärkere CPU-Auslastung das\n" +" Kompressionsverhältnis zu verbessern. Dies beeinflusst\n" +" den Speicherbedarf des Dekompressors nicht." + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=ANZAHL Höchstens die angegebene ANZAHL Threads erzeugen;\n" +" die Voreinstellung ist 1. Wenn der Wert 0 angegeben\n" +" wird, dann werden so viele Threads erzeugt, wie\n" +" Prozessorkerne vorhanden sind" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=GRÖẞE\n" +" Einen neuen .xz-Block nach der angegebenen GRÖẞE\n" +" der Eingabe in Bytes beginnen; benutzen Sie diese\n" +" Option, um die Blockgröße für die Kompression mit\n" +" mehreren Threads zu setzen" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=GRÖẞEN\n" +" Einen neuen .xz-Block gemäß der angegebenen, durch\n" +" Kommata getrennten Intervalle an unkomprimierten\n" +" Daten beginnen" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=ZEIT\n" +" Wenn beim Komprimieren mehr als die angegebene ZEIT\n" +" in Millisekunden seit der letzten Leerungsaktion\n" +" vergangen ist und das Lesen von zusätzlichen\n" +" Eingabedaten den Prozess blockieren würde, dann werden\n" +" alle noch ausstehenden Daten geschrieben" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=BEGRENZUNG\n" +" --memlimit-decompress=BEGRENZUNG\n" +" --memlimit-mt-decompress=BEGRENZUNG\n" +" -M, --memlimit=BEGRENZUNG\n" +" Speicherbedarfsbegrenzung für Kompression,\n" +" Dekompression oder beides setzen; die BEGRENZUNG\n" +" wird in Bytes oder als Prozentsatz RAM angegeben.\n" +" Geben Sie 0 an, um die Grundeinstellungen zu\n" +" verwenden." + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust Wenn die Kompressionseinstellungen die\n" +" Speicherbedarfsbegrenzung übersteigen, wird ein\n" +" Fehler ausgegeben, statt die Einstellungen\n" +" nach unten anzupassen." + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Benutzerdefinierte Filterkette für Kompression (alternativ zu Voreinstellung):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPTIONEN] LZMA1 oder LZMA2; OPTIONEN ist eine durch Kommata\n" +" --lzma2[=OPTIONEN] getrennte Liste bestehend aus den folgenden Optionen\n" +" (zulässige Werte; Voreinstellung):\n" +" preset=ZAHL Optionen auf Voreinstellungsstufe\n" +" zurücksetzen (0-9[e])\n" +" dict=ZAHL Wörterbuchgröße (4 KiB - 1536 MiB; 8 MiB)\n" +" lc=ZAHL Anzahl der Literal-Kontext-Bits (0-4; 3)\n" +" lp=ZAHL Anzahl der Literal-Positions-Bits (0-4; 0)\n" +" pb=ZAHL Anzahl der Positions-Bits (0-4; 2)\n" +" mode=MODUS Kompressionsmodus (fast, normal; normal)\n" +" nice=ZAHL Nice-Länge eines Treffers (2-273; 64)\n" +" mf=NAME Algorithmus zum Auffinden von\n" +" Übereinstimmungen (hc3, hc4, bt2, bt3, bt4;\n" +" bt4)\n" +" depth=ZAHL Maximale Suchtiefe; 0=automatisch\n" +" (Voreinstellung)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPTIONEN] x86 BCJ-Filter (32-bit und 64-bit)\n" +" --arm[=OPTIONEN] ARM-BCJ-Filter\n" +" --armthumb[=OPTIONEN] ARM-Thumb-BCJ-Filter\n" +" --arm64[=OPTIONEN] ARM64-BCJ-Filter\n" +" --powerpc[=OPTIONEN] PowerPC-BCJ-Filter (nur Big Endian)\n" +" --ia64[=OPTIONEN] IA64-(Itanium-)BCJ-Filter\n" +" --sparc[=OPTIONEN] SPARC-BCJ-Filter\n" +" Zulässige Optionen für alle BCJ-Filter:\n" +" start=ZAHL Startversatz für Konversion\n" +" (Voreinstellung=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPTIONEN] Delta-Filter; zulässige Optionen (gültige Werte;\n" +" Voreinstellung):\n" +" dist=NUM Abstand zwischen den Bytes, die voneinander\n" +" subtrahiert werden (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Andere Optionen:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet Warnungen unterdrücken; wird diese Option zweimal\n" +" angegeben, werden auch Fehlermeldungen unterdrückt\n" +" -v, --verbose Ausführlicher Modus; wird diese Option zweimal\n" +" angegeben, erfolgen noch ausführlichere Ausgaben" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn Warnungen verändern nicht den Exit-Status" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot Maschinenlesbare Meldungen ausgeben (nützlich für\n" +" Skripte)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory Gesamtspeicher (RAM) sowie die gegenwärtig aktive\n" +" Speicherbedarfsbegrenzung anzeigen\n" +" und das Programm beenden" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help Kurze Hilfe anzeigen (zeigt nur die grundlegenden\n" +" Optionen)\n" +" -H, --long-help Diese lange Hilfe anzeigen und das Programm beenden" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help Diese kurze Hilfe anzeigen und das Programm beenden\n" +" -H, --long-help Die lange Hilfe (und damit auch fortgeschrittene\n" +" Optionen) anzeigen" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version Versionsnummer anzeigen und beenden" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Wenn DATEI nicht angegeben wurde oder DATEI gleich - ist, dann wird aus\n" +"der Standardeingabe gelesen.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Melden Sie Fehler an <%s> (auf Englisch oder Finnisch).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s-Homepage: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "DIES IST EINE NICHT FÜR DEN PRODUKTIVBETRIEB GEEIGNETE ENTWICKLERVERSION." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Optionen müssen in der Form »Name=Wert« gegeben werden, getrennt durch Kommata" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Ungültiger Optionsname" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Ungültiger Optionswert" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "LZMA1/LZMA2-Voreinstellung wird nicht unterstützt: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Die Summe aus lc und lp darf höchstens 4 sein" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Mit --format=raw ist --suffix=.SUF notwendig, falls nicht in die Standardausgabe geschrieben wird" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Dateiname hat unbekanntes Suffix, wird übersprungen" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Datei hat bereits das Suffix »%s«, wird übersprungen" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Ungültige Dateiendung" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Wert ist keine nicht-negative dezimale Ganzzahl" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Ungültige Einheit" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Gültige Einheiten sind »KiB« (2^10), »MiB« (2^20) und »GiB« (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Wert der Option »%s« muss im Bereich [%, %] sein" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Komprimierte Daten können nicht vom Terminal gelesen werden" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Komprimierte Daten können nicht auf das Terminal geschrieben werden" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Schreiben in die Standardausgabe fehlgeschlagen" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Unbekannter Fehler" diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 0000000..506ca9e --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 0000000..6522f0c --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/po/eo.gmo b/po/eo.gmo new file mode 100644 index 0000000..c867edc Binary files /dev/null and b/po/eo.gmo differ diff --git a/po/eo.po b/po/eo.po new file mode 100644 index 0000000..59f464c --- /dev/null +++ b/po/eo.po @@ -0,0 +1,1028 @@ +# Esperanto translations for xz package. +# This file is put in the public domain. +# Keith Bowes , 2019, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2023-01-02 12:16-0500\n" +"Last-Translator: Keith Bowes \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Nevalida parametro por --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Tro da argumentoj por --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 povas nur esti uzata kiel la lasta elemento en --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Nekonata dosierformata tipo" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Nekomprenata tipo de integra kontrolo" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Nur oni dosiero estas specifebla per `--files' aŭ `--files0'." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La medivariablo %s enhavas troajn argumentojn" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Rego de kunpremado estas malaktivigita dum muntotempo" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Rego de malkunpremado estas malaktivigita dum muntotempo" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Ne povas kunpremi lzip-dosierojn (.lz)" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maksimuma nombra da filtriloj estas kvar" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Memoruzada limigo estas tro malgranda por la donita filtrila elekto." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Uzi aprioraĵon en kruda reĝimo estas malkonsilinda." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "La ĝustaj elektoj de la aprioraĵoj povas varii inter programoj eldonoj." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "La .lzma-formato komprenas sole la filtrilon LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA ne estas uzebla por la .xz-formato" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "La filtrila ĉeno estas nekongrua kun --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Ŝanĝas al unufadena reĝimo pro --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Uzas ĝis % fadenoj" + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Nekomprenata filtrila ĉeno aŭ filtrilaj elektoj" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Malkunpremado postulos %s megabajtojn da memoro." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Malpliigis la nombron da fadenoj de %s ĝis %s por ne superi la memoruzadan limigo de %s megabajtoj" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Malpliigis la nombron da fadenoj de %s ĝis unu. La aŭtomata memoruzada limigo de %s megabajtoj ankoraŭ estas superata. %s megabajtoj da memoro estas postulata. Senkonsidere daŭrigas." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Ŝanĝas al unufadena reĝimo por ne superi la memoruzadan limigon de %s megabajtoj" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Alĝŭstigis vortara grando de LZMA%c de %s megabajtoj ĝis %s megabajtoj por ne superi la memoruzadan limigon de %s megabajtoj" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Eraro dum krei dukton: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Malsukcesis aktivigi la sablujon" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() malsukcesis: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Dosiero ŝajne estis movita, ne forigos" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Ne eblas forigi: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Ne eblas agordi la dosieran estron: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Ne eblas agordi la dosieran grupon: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Ne eblas agordi la dosierajn atingopermesojn: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Eraro dum atingi la dosierstatajn flagojn de ĉefenigujon: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Estas simbola ligilo, preterpasas" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Estas dosierujo, preterpasas" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Ne regula dosiero, preterpasas" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Dosiero havas setuid- aŭ setgid-biton, preterpasas" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Dosiero havas glueman biton, preterpasas" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Enmeta dosiero havas pli ol rektan ligilon, preterpasas" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Malplena dosiero, preterpasas" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Eraro dum restarigi la statajn flagojn de la ĉefenigujo: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Eraro dum atingi la dosierstatajn flagojn el la ĉefenigujo: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Eraro dum restarigi la flagon O_APPEND de la ĉefenigujo: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Fermo de la dosiero malsukcesis: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Serĉado malsukcesis dum provi krei maldensan dosieron: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Legeraro: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Eraro dum serĉi la dosieron: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Neatendita dosierfino" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Skriberaro: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Malaktiva" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Kiomo da efektiva memoro (ĉefmemoro)" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Nombro da procesoraj fadenoj:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Kunpremo:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Malkunmpreno:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Plurfadena malkunpremado:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Aprioraĵo por -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Aparataro-informoj:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Memoruzada limigoj:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Fluoj:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blokoj:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Kunpremita grando:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Nekunpremita grando:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Proporcio" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Kontrolo:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Fluo-remburo:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Memoro postulata:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Grandoj en ĉapoj:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Nombro da dosieroj:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Fluo" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Bloko" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Floko" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "KunpMsam" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "MKunMSam" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "Kunpgrando" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "Mkunpgrando" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "KiomGrando" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Proporcio" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Kontrolo" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "KontVal" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Remburo" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Ĉapo" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Flago" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "Mumazado" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filtriloj" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nenio" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Nekonata-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Nekonata-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Nekonata-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Nekonata-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Nekonata-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Nekonata-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Nekonata-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Nekonata-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Nekonata-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Nekonata-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Nekonata-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Nekonata-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Dosiero malplenas" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Tro malgranda por esti valida .xz-dosiero" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Fluoj Blokoj Kunpremita Nekunpremita Propor Kontrol Dosiernomo" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Jes" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Ne" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Minimuma eldono de XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s dosiero\n" +msgstr[1] "%s dosieroj\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Sumoj:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list funkcias nur por .xz-dosierojn (--format=xz aŭ --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list ne regas legadon el la ĉefenigujo" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Eraro dum legi dosiernomojn: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Neatendita fino de enigo dum legi dosiernomojn" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Nula signo trovita dum legi dosiernomojn; eble vi celis uzi la parametron`--files0' anstataŭ `--files'" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Kunpremo kaj malkunmpremo per --robot ankoraŭ ne estas regataj." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Ne eblas legi datumojn el la ĉefenigujo dum legi dosiernomojn el la ĉefenigujo" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Interna programeraro" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Ne eblas establi signalajn traktilojn" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Neniu integra kontrolo; ne certigos dosieran integron" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Nekomprenata tipo de integra kontrolo; ne certigos dosieran integron" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Memoruzada limigo atingita" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Dosierformato ne rekonata" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Nekomprenataj elektoj" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Kunpremitaj datumoj estas koruptaj" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Neatendita fino de enigo" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s megabajtoj da memoro estas postulataj. La limigilo estas malaktiva." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s megabajtoj da memoro estas postulata. La limigo estas %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Filtrila ĉeno: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "`%s --help' provindas por pliaj informaj." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Uzado: %s [ELEKTO].. [DOSIERO]...\n" +"Kunpremi aŭ malkunpremi DOSIEROjN laŭ la .xz-formato.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Devigitaj parametroj por longaj elektoj estas ankaŭ devigitaj por\n" +"mallongaj elektoj.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Operacia reĝimo:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress eldevigi kunpremon\n" +" -d, --decompress eldevigi malkunpremon\n" +" -t, --test certigi la integron de kunpremitan dosieron\n" +" -l, --list listigi informojn pri .xz-dosierojn" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Operacia modifiloj:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep ne forigi enigajn dosierojn\n" +" -f, --force eldevigi anstataŭigi eligajn dosierojn kaj\n" +" (mal)kunpmremajn ligilojn \n" +" -c, --stdout skribi al la ĉefeligujo kaj ne forigi enigajn dosierojn" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream\n" +" malkunpremi nur la unuan fluon kaj silente\n" +" ignori eventualajn ceterajn enigajn datumojn" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne krei maldensajn dosierojn dum malkunpremi\n" +" -S, --suffix=.SUF uzi la sufikson `.SUF' ĉe kunpremataj dosieroj\n" +" --files[=DOSIERO]\n" +" legi dosiernomojn traktotajn de DOSIERO; se DOSIERO estas\n" +" forlasita, dosieroj estas legotaj el la ĉefenigujo;\n" +" dosiernomojn devas finigi novlinio signo\n" +" --files0[=DOSIERO]\n" +" kiel --files sed uzi la nulan signon por finigi" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Bazaj dosierformataj kaj kunpremaj elektoj:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT dosierformato kodota aŭ malkodato; validaj valoroj estas\n" +" `auto' (apriora), `xz', `lzma', 'lzip' kaj `raw'\n" +" -C, --check=KONT tipo de integra kontrolo: `none' (estu atentema),\n" +" `crc32', `crc64' (apriora) aŭ `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check ne certigi la integran kontrolon dum malkunpremo" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 kunpremnivelo; apriore 6; pripensu memoruzadon antaŭ ol\n" +" uzi la nivelojn 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme provi plibonigi kunpreman proporcion per uzado de\n" +" ĉefprocesoran tempon; ne influas la memorajn postulojn\n" +" de malkunpremo" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NOMBRO\n" +" uzi maksimume NOMBRO da fadenoj; apriore 1; 0 por\n" +" uzi fadenojn samnombrajn kiel procesoraj kernoj" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=GRANDO\n" +" komenci novan .xz-blokon post ĉiu GRANDO bajtoj da enigo;\n" +" uzi por agordi la blokan grandon por kunfadena kunpremo" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=GRANDOJ\n" +" komenci novan .xz-blokon post la donitajn intertempojn de\n" +" nekunpremitaj datumoj, apartigataj de komoj" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TEMPOLIMO\n" +" dum kunpremo se pli ol TEMPOLIMO milisekundoj\n" +" okazis post la antaŭan elbufrigo kaj legi pliajn enigojn\n" +" paŭzigus, ĉiuj atendataj datumoj estas elbufrigataj" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMIGO\n" +" --memlimit-decompress=LIMIGO\n" +" --memlimit-mt-decompress=LIMIGO\n" +" -M, --memlimit=LIMO\n" +" agordi memoruzadon por kunpremo, malkunpremo,\n" +" kunfadena kunpmero aŭ ĉiuj el tiuj; LIMIGO estas\n" +" laŭ bajtoj, % da ĉefmemoro, aŭ 0 por aprioraĵoj" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust se kunprema agordo superas la memoruzadan limigon\n" +" montri eraron anstataŭ malgrandigi la agordaĵon" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Propra filtrila ĉeno por kunpremo (alternativaj por uzi antaŭagordaĵon):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=ELEKTOJ] LZMA1 aŭ LZMA2; OPTS estas listo de nul aŭ pliaj\n" +" --lzma2[=ELEKTOJ] de la jenaj elektoj (validaj valoroj; apriora),\n" +" apartigataj de komoj:\n" +" preset=ANT restarigi agordon al antaŭagordaĵon (0-9[e])\n" +" dict=NOM vortara grando (4 kilobajtoj - 1536\n" +" megabajtoj; 8 megabajtoj)\n" +" lc=NOM nombro da laŭvortaj kuntekstaj bitoj\n" +" (0-4; 3)\n" +" lp=NOM nombro da laŭvortaj poziciaj bitoj (0-4; 0)\n" +" pb=NOM nombro da poziciaj bitoj (0-4; 2)\n" +" mode=REĜI kunprema reĝimo (fast, normal; normal)\n" +" nice=NOM bona longo de kongruaĵo (2-273; 64)\n" +" mf=NOMO kongruaĵa trovilo (hc3, hc4, bt2, bt3, bt4;\n" +" bt4)\n" +" depth=NUM maksimuma profundo de serĉo; 0=aŭtomata\n" +" (apriore)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=ELEKTOJ] x86-BCJ-filtrilo (32-bita and 64-bita)\n" +" --arm[=ELEKTOJ] ARM-BCJ-filtrilo\n" +" --armthumb[=ELEKTOJ]\n" +" ARM-Thumb-BCJ-filtrilo\n" +" --arm64[=OPTS] ARM64-BCJ-filtrilo\n" +" --powerpc[=ELEKTOJ] PowerPC-BCJ-filtrilo (nur pezkomenca)\n" +" --ia64[=ELEKTOJ] IA-64 (Itanium)-BCJ-filtrilo\n" +" --sparc[=ELEKTOJ] SPARC-BCJ-filtrilo\n" +" Validaj ELEKTOJ por ĉiuj BCJ-filters:\n" +" start=NOMBRO komenca deŝovo por konvertoj (apriore 0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=ELEKTOJ] Delta filtriloj; validaj valoroj:\n" +" dist=NOMBRO distanco inter bajtoj subtrahataj de unu\n" +" la alia (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Aliaj elektoj:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet silentigi avertojn; uzu dufoje por ankaŭ silentigi erarojn\n" +" -v, --verbose eligi superfluajn informojn; uzu dufoje por pliigi la\n" +" superfluecon" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn avertoj ne influu la eliran staton" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot uzi mesaĝojn facile analizeblaj per skriptoj" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory montri la totalan kiomon de la ĉefmemoro kaj la nune\n" +" aktivaj memoruzadaj limigoj, kaj finiĝi" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help montri la mallongan helpon (listigas nur la bazajn\n" +" elektojn)\n" +" -H, --long-help montri la longan helpon kaj finiĝi" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help montri ĉi tiun mallongan helpon kaj finiĝi\n" +" -H, --long-help montri la longan helpon (listigas ankaŭ la altnivelajn\n" +" elektojn)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version montri la eldonan numeron kaj finiĝi" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Kun neniu DOSIERO aŭ kiam DOSIERO estas -, legi el la ĉefenigujo.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Raporti cimojn al <%s> (en la angla aŭ la suoma).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s ĉefpaĝo: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ĈI TIU ESTAS DISVOLVA REDAKCIO, NE CELATA POR ĈIUTAGA UZADO." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Elektoj devas esti paroj de `name=value`, apartigitaj de komoj" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Nevalida elekto-nomo" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Nevalida elekto-valoro" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nevalida LZMA1/LZMA2 antaŭagordaĵo: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "La sumo de lc kaj lp devas ne esti pli ol 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Kun --format=raw, --suffix=.SUF estas postulata se ne skribi al la ĉefeligujo" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Dosiernomo havas nekonatan sufikson, preterpasas" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Dosiero jam havas la sufikson `%s', preterpasas" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Nevalida dosiernoma sufikso" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Valoro ne estas nenegativa dekuma entjero" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Nevalida multiplika sufikso" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Validaj sufiksoj estas `KiB' (2^10), `MiB' (2^20) kaj `GiB' (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Valoro de la elekto `%s' devas esti inkluzive inter % kaj %" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Kunpremitaj datumoj ne povas esti ligataj de terminalo" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Kunpmremitaj datumoj ne povas esti skribataj al terminalo" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Skribi al la ĉefeligujo malsukcesis" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Nekonata eraro" diff --git a/po/es.gmo b/po/es.gmo new file mode 100644 index 0000000..7e687a0 Binary files /dev/null and b/po/es.gmo differ diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..ce4ba6b --- /dev/null +++ b/po/es.po @@ -0,0 +1,1073 @@ +# Spanish translation for xz-5.4.0-pre1. +# This file is put in the public domain. +# Cristian Othón Martínez Vera , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-10 09:14-0600\n" +"Last-Translator: Cristian Othón Martínez Vera \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Argumento inválido para --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Demasiados argumentos para --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 solo se puede usar como el último elemento en --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Tipo de formato de fichero desconocido" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: No se admite el tipo de verificación de integridad" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Solo se puede especificar un fichero con `--files' o `--files0'." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variable de ambiente %s contiene demasiados argumentos" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Se desactivó el soporte para compresión en el momento de compilación" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Se desactivó el soporte para descompresión en el momento de compilación" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "No se admite la compresión de ficheros lzip (.lz)" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "El número máximo de filtros es cuatro" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "El límite de uso de memoria es muy bajo para la configuración de filtro dada." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "No se recomienda un modo predeterminado en modo crudo." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "El número exacto de las opciones predeterminadas puede variar entre versiones del software." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "El formato .lzma solamente admite el filtro LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "No se puede usar LZMA1 con el formato .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "La cadena de filtros es incompatible con --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Se cambia al modo de un solo hilo debido a --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Se usan hasta % hilos." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "No se admite las opciones de cadena de filtros o de filtro" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "La descompresión necesitará %s MiB de memoria." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Se reduce el número de hilos de %s a %s para no exceder el límite de uso de memoria de %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Se reduce el número de hilos de %s a uno. Aún se está excediendo el límite automático de uso de memoria de %s MiB. Se requieren %s MiB de memoria. Continúa de cualquier manera." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Se ajusta al modo de un solo hilo para no exceder el límite de uso de memoria de %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Se ajusta el tamaño del diccionario LZMA%c de %s MiB a %s MiB para no exceder el límite de uso de memoria de %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Error al crear una tubería: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Falló al activar el arenero" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: falló poll(): %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Al parecer se movió el fichero, no se borra" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: No se puede borrar: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: No se puede establecer el propietario del fichero: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: No se puede establecer el grupo del fichero: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: No se pueden establecer los permisos del fichero: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Error al obtener la opciones de estado de fichero de la entrada estándar: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Es un enlace simbólico, se salta" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Es un directorio, se salta" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: No es un fichero regular, se salta" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: El fichero tiene el bit setuid o setgid activo, se salta" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: El fichero tiene el bit sticky activo, se salta" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: El fichero de entrada tiene más de un enlace duro, se salta" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nombre de fichero vacío, se salta" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Error al restaurar las opciones de estado en la entrada estándar: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Error al obtener las opciones de estado de fichero de la entrada estándar: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Error al restaurar la opción O_APPEND a la salida estándar: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Falló al cerrar el fichero: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Falló la búsqueda al tratar de crear un fichero disperso: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Error de lectura: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Error al buscar en el fichero: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Fin de fichero inesperado" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Error de escritura: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Desactivado" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Cantidad total de memoria física (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Número de hilos de procesador:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Compresión" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Descompresión:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Descompresión multihilos:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Por omisión para -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Información de hardware:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Límites de uso de memoria:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Flujos:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Bloques:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Tamaño comprimido:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Tamaño sin comprimir:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Tasa:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Verificación:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Relleno de flujo:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Memoria requerida:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Tamaños en cabeceras:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Número de ficheros:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Flujo" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Bloque" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Bloques" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "DesplComp" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "DesplDescomp" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "TamComp" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "TamDescomp" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "TamTotal" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Tasa" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Verif" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "ValVerif" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Relleno" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Cabecera" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Opciones" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "UsoMem" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filtros" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Ninguno" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Descon-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Descon-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Descon-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Descon-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Descon-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Descon-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Descon-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Descon-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Descon-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Descon-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Descon-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Descon-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: El fichero está vacío" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Demasiado pequeño para ser un fichero .xz válido" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Flujos Bloques Comprimido Sin-Comprimir Relac Verif Nombre-Fichero" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Sí" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "No" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versión de herramientas XZ mínima: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fichero\n" +msgstr[1] "%s ficheros\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totales:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list solo funciona con ficheros .xz (--format=xz o --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list no admite leer de la entrada estándar" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Error al leer nombres de fichero: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Fin de entrada inesperada al leer nombres de fichero" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Se encontraron caracteres nulos al leer nombres de ficheros. ¿Tal vez quería usar `--files0' en lugar de `--files'?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Aún no se admite la compresión y descompresión con --robot." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "No se pueden leer datos de la entrada estándar cuando se leen nombres de fichero de la entrada estándar" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Error interno (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "No se pueden establecer los manejadores de señales" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "No hay revisión de integridad; no se verifica la integridad del fichero" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "No se admite el tipo de revisión de integridad; no se verifica la integridad del fichero" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Se alcanzó el límite de uso de memoria" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "No se reconoce el formato del fichero" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opciones sin soporte" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Los datos comprimidos están corruptos" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Fin de entrada inesperado" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Se requieren %s MiB de memoria. Se desactiva el limitador." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Se requieren %s MiB de memoria. El límite es %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Cadena de filtro: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Intente `%s --help' para obtener más información." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Modo de empleo: %s [OPCIÓN]... [FICHERO]...\n" +"Comprime o descomprime FICHEROs en el formato .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Los argumentos obligatorios para las opciones largas también son\n" +"obligatorios para las opciones cortas.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Modo de operación:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress fuerza la compresión\n" +" -d, --decompress fuerza la descompresión\n" +" -t, --test prueba la integridad del fichero comprimido\n" +" -l, --list lista la información sobre los ficheros .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificadores de operación:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep conserva (no borra) los ficheros de entrada\n" +" -f, --force fuerza la sobreescritura del fichero de salida y\n" +" (des)comprime enlaces\n" +" -c, --stdout escribe a la entrada estándar y no borra los ficheros\n" +" de entrada" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream solo descomprime el primer flujo, y descarta\n" +" silenciosamente los posibles datos de entrada restantes" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse no crea archivos dispersos durante la descompresión\n" +" -S, --suffix=.SUF usa el sufijo `.SUF' en los ficheros comprimidos\n" +" --files[=FICH] lee los nombres de ficheros a procesar de FICHero;\n" +" si se omite el FICHero, los nombres de fichero se leen\n" +" de la entrada estándar; los nombres de fichero deben\n" +" terminar con el carácter de línea nueva\n" +" --files0[=FICH] como --files pero usa el carácter nulo como terminador" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Opciones básicas de compresión y formato de fichero:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT formato de fichero para codificar o decodificar; los\n" +" valores posibles son\n" +" `auto' (por defecto), `xz', `lzma', `lzip', y `raw'\n" +" -C, --check=VERIF tipo de verificación de integridad:\n" +" `none' (usar con precaución),\n" +" `crc32', `crc64' (por defecto), o `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check no hace la verificación de integridad al descomprimir" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 valor predefinido de compresión; por defecto es 6.\n" +" ¡Considere el uso de memoria del compresor *y*\n" +" del descompresor antes de usar 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme trata de mejorar la razón de compresión usando más\n" +" tiempo de procesamiento; no afecta los requisitos\n" +" de memoria del descompresor" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NÚM usa como máximo NÚM hilos; por defecto es 1;\n" +" establezca a 0 para usar tantos hilos como hayan\n" +" núcleos de procesador" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=TAMAÑO\n" +" inicia un nuevo bloque .xz después de cada TAMAÑO bytes\n" +" de entrada; use esta opción para establecer el tamaño\n" +" de bloque para la compresión con hilos" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=TAMAÑOS\n" +" inicia un nuevo bloque .xz después de cada intervalo\n" +" dado, separado por comas, de datos sin comprimir" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TIEMPO\n" +" al comprimir, si pasaron más de TIEMPO milisegundos\n" +" desde el último descarte y la lectura de más entrada\n" +" produciría un bloqueo, todos los datos pendientes son\n" +" descartados" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LÍMITE\n" +" --memlimit-decompress=LÍMITE\n" +" --memlimit-mt-decompress=LÍMITE\n" +" -M, --memlimit=LÍMITE\n" +" define el límite de uso de memoria para compresión,\n" +" descompresión, descompresión con hilos, o todos los\n" +" anteriores; el LÍMITE está en bytes, % de RAM,\n" +" o 0 para valores por defecto" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust si la configuración de compresión excede el límite de\n" +" uso de memoria, muestra un error en lugar de ajustar\n" +" los valores hacia abajo" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Cadena de filtros para compresión (alternativa a valores predefinidos):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPCIONES] LZMA1 o LZMA2; OPCIONES es una lista separada por comas\n" +" --lzma2[=OPCIONES] de cero o más opciones (valores válidos; por defecto)\n" +" preset=PRE inicia opciones con un valor predefinido\n" +" (0-9[e])\n" +" dict=NÚM tamaño de diccionario (4KiB - 1536MiB; 8MiB)\n" +" lc=NÚM número de bits de contexto literal (0-4; 3)\n" +" lp=NÚM número de bits de posición literal (0-4; 0)\n" +" pb=NÚM número de bits de posición (0-4; 2)\n" +" mode=MODO modo de compresión (fast, normal; normal)\n" +" nice=NÚM longitud para una coincidencia (2-273; 64)\n" +" mf=NOMBRE buscador de coincidencias\n" +" (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NÚM profundidad máxima de búsqueda;\n" +" 0=automática (por defecto)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPCIONES] filtro BCJ para x86 (32-bit y 64-bit)\n" +" --arm[=OPCIONES] filtro BCJ para ARM\n" +" --armthumb[=OPCIONES] filtro BCJ para ARM-Thumb\n" +" --arm64[=OPCIONES] filtro BCJ para ARM64\n" +" --powerpc[=OPCIONES] filtro BCJ para PowerPC (solo big endian)\n" +" --ia64[=OPCIONES] filtro BCJ para IA-64 (Itanium)\n" +" --sparc[=OPCIONES] filtro BCJ para SPARC\n" +" OPCIONES válidas para todos los filtros BCJ:\n" +" start=NÚM inicio de desplazamiento para\n" +" conversiones (por defecto=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPCIONES] Filtro delta; OPCIONES (valores válidos; por defecto):\n" +" dist=NÚM distancia entre bytes que se restan\n" +" uno del otro (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Otras opciones:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet suprime avisos; use dos veces para suprimir errores\n" +" -v, --verbose detallado; use dos veces para obtener aún más detalle" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn los avisos no afectan el estado de la salida" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot usa mensajes analizables por máquina (útil para scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory muestra la cantidad total de RAM y los límites de uso\n" +" de memoria activos, y termina" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help muestra la ayuda corta (solo muestra las opciones básicas)\n" +" -H, --long-help muestra esta ayuda detallada y termina" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help muestra esta ayuda corta y termina\n" +" -H, --long-help muestra la ayuda larga (además muestra opciones avanzadas)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version muestra el número de versión y termina" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Sin FICHEROs, o cuando el FICHERO es -, lee la entrada estándar.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Reporte errores a <%s> (en inglés o finlandés).\n" +"Reporte errores de traducción al español a .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Sitio web de %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ESTA ES UNA VERSIÓN EN DESARROLLO Y NO ESTÁ LISTA PARA USO EN PRODUCCIÓN." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Las opciones deben ser pares `nombre=valor' separadas por comas" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Nombre de opción inválido" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Valor de opción inválido" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "No se admite el valor predefinido LZMA1/LZMA2: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "La suma de lc y lp no debe exceder 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Con --format=raw, se requiere --suffix=.SUF a menos que se escriba a la salida estándar" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: El nombre de fichero tiene un sufijo desconocido, se salta" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: El fichero ya tiene un sufijo `%s', se salta" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Sufijo de nombre de fichero inválido" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: El valor no es un entero decimal no-negativo" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Sufijo multiplicador inválido" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Los sufijos válidos son `KiB' (2^10), `MiB' (2^20), y `GiB' (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "El valor de la opción `%s' debe estar en el rango [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "No se pueden leer datos comprimidos de una terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "No se pueden escribir datos comprimidos a una terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Falló la escritura a la salida estándar" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Error desconocido" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "El buscador de coincidencias seleccionado requiere por lo menos nice=%" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Límite de uso de memoria para compresión: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Flujos: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Bloques: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Relación: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Verificación: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Flujos:\n" +#~ " Flujo Bloques DesplComp DesplUncomp TamComp TamDescomp Razon Verif Relleno" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Bloques:\n" +#~ " Flujo Bloque DesplComp DesplUncomp TamTotal TamDescomp Razon Verif" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " VerifVal %*s Cabece Opciones TamComp UsoMem Filtros" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Se desactiva el arenero debido a argumentos incompatibles en la línea de órdenes" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Se activó el arenero con éxito" diff --git a/po/fi.gmo b/po/fi.gmo new file mode 100644 index 0000000..41ead03 Binary files /dev/null and b/po/fi.gmo differ diff --git a/po/fi.po b/po/fi.po new file mode 100644 index 0000000..803b1f4 --- /dev/null +++ b/po/fi.po @@ -0,0 +1,1059 @@ +# Finnish translations for xz package +# Suomenkielinen käännös xz-paketille. +# This file is put in the public domain. +# Lauri Nurmi , 2019, 2020, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-10 16:17+0200\n" +"Last-Translator: Lauri Nurmi \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Virheellinen argumentti valitsimelle --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Liian monta argumenttia valitsimelle --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0:aa voi käyttää vain viimeisenä alkiona valitsimen --block-list kanssa" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Tuntematon tiedostomuototyyppi" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Eheystarkistuksen tyyppiä ei tueta" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Vain yksi tiedosto voidaan antaa valitsimille ”--files” ja ”--files0”." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Ympäristömuuttuja %s sisältää liian monta argumenttia" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Tiivistämistuki on poistettu käytöstä käännösaikana" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Purkutuki on poistettu käytöstä käännösaikana" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Lzip-tiedostojen (.lz) pakkaamista ei tueta" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Suodattimien enimmäismäärä on neljä" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Muistinkäytön raja on liian matala valituille suotimille." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Esiasetusten käyttö raw-tilassa ei ole suositeltavaa." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Esiasetusten tarkat asetukset saattavat vaihdella ohjelmistoversioiden välillä." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr ".lzma-muoto tukee vain LZMA1-suodinta" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1:tä ei voi käyttää .xz-muodon kanssa" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Suodinketju on yhteensopimaton valitsimen --flush-timeout kanssa" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Vaihdetaan yksisäikeiseen tilaan valitsimen --flush-timeout vuoksi" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Käytetään enintään % säiettä." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Ei-tuettu suodinketju tai suotimen asetukset" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Purkaminen vaatii %s MiB muistia." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Pudotettiin säikeiden määrä %s säikeestä %s:een, jottei ylitettäisi %s MiB:n rajaa muistinkäytölle" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Pudotettiin säikeiden määrä %s säikeestä yhteen. Automaattinen %s MiB:n raja muistinkäytölle ylittyy silti. Vaaditaan %s MiB muistia. Jatketaan kaikesta huolimatta." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Siirrytään yhden säikeen tilaan, jottei ylitettäisi %s MiB:n rajaa muistinkäytölle" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Pudotettiin LZMA%c-sanaston koko %s MiB:stä %s MiB:hen, jottei ylitettäisi %s MiB:n rajaa muistinkäytölle" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Virhe putkea luodessa: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Hiekkalaatikon ottaminen käyttöön epäonnistui" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll()-kutsu epäonnistui: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Tiedosto on nähtävästi siirretty, ei poisteta" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Ei voi poistaa: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Tiedoston omistajaa ei voi asettaa: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Tiedoston ryhmää ei voi asettaa: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Tiedoston oikeuksia ei voi asettaa: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Virhe tiedoston tilalippujen noutamisessa vakiosyötteelle: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: On symbolinen linkki, ohitetaan" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: On hakemisto, ohitetaan" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Ei ole tavallinen tiedosto, ohitetaan" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Tiedostolla on setuid- tai setgid-bitti, ohitetaan" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Tiedostolla on sticky-bitti, ohitetaan" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Syötetiedostoon on yli yksi kova linkki, ohitetaan" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Tyhjä tiedostonimi, ohitetaan" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Virhe tilalippujen palauttamisessa vakiosyötteelle: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Virhe tiedoston tilalippujen noutamisessa vakiotulosteelle: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Virhe O_APPEND-lipun palauttamisessa vakiosyötteelle: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Tiedoston sulkeminen epäonnistui: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Siirtyminen epäonnistui yritettäessä luoda hajanaista tiedostoa: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Lukuvirhe: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Virhe tiedostossa siirtymisessä: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Odottamaton tiedoston loppu" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Kirjoitusvirhe: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Pois käytöstä" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Fyysisen muistin kokonaismäärä (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Suoritinsäikeiden määrä:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Tiivistys:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Purku:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Monisäikeinen purku:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "-T0:n oletusarvo:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Laitteiston tiedot:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Muistinkäytön rajat:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Virrat:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Lohkot:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Tiivistetty koko:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Tiivistämätön koko:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Suhde:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Tarkistus:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Virran tasaus:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Tarvittava muisti:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Koot otsakkeissa:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Tiedostojen määrä:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Virta" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Lohko" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Lohkot" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "TiivSiirr." + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "Tv:tönSiirr." + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "TiivKoko" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "Tv:tönKoko" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Yht.Koko" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Suhde" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Tark." + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "Tark.arvo" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Tasaus" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Otsake" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Liput" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "Muist.käyt." + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Suodattimet" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Ei mitään" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Tuntematon-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Tuntematon-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Tuntematon-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Tuntematon-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Tuntematon-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Tuntematon-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Tuntematon-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Tuntematon-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Tuntematon-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Tuntematon-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Tuntematon-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Tuntematon-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Tiedosto on tyhjä" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Liian pieni kelvolliseksi .xz-tiedostoksi" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Virrat Lohkot Tiivist. Tiivistämätön Suhde Tark. Tiedostonimi" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Kyllä" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Ei" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " XZ Utilsin vähimmäisversio: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s tiedosto\n" +msgstr[1] "%s tiedostoa\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Yhteensä:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list toimii vain .xz-tiedostoille (--format=xz tai --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list ei tue lukemista vakiosyötteestä" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Virhe luettaessa tiedostonimiä: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Odottamaton syötteen loppu tiedostonimiä luettaessa" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Nul-merkki kohdattiin tiedostonimiä lukiessa; oliko tarkoitus antaa valitsin ”--files0” eikä ”--files”?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Tiivistys ja purku --robot -valitsimen kanssa eivät ole vielä tuettuja." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Dataa ei voi lukea vakiosyötteestä kun tiedostonimiä luetaan vakiosyötteestä" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Sisäinen virhe (ohjelmistovika)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Signaalinkäsittelimiä ei voi muodostaa" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Ei eheystarkastusta; ei varmenneta tiedoston eheyttä" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Ei-tuettu eheystarkastuksen tyyppi; ei varmenneta tiedoston eheyttä" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Muistinkäytön raja saavutettu" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Tiedostomuotoa ei tunnistettu" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Ei-tuetut valitsimet" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Tiivistetty data on turmeltunut" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Odottamaton syötteen loppu" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB muistia vaaditaan. Rajoitin on poistettu käytöstä." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB muistia vaaditaan. Raja on %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Suodinketju: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Komento ”%s --help” antaa lisää tietoa." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Käyttö: %s [VALITSIN]... [TIEDOSTO]...\n" +"Tiivistä tai pura .xz-muotoisia TIEDOSTOja.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Pitkien valitsinten pakolliset argumentit ovat pakollisia myös lyhyille.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Toimintatila:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress pakota tiivistys\n" +" -d, --decompress pakota purku\n" +" -t, --test testaa tiivistetyn tiedoston eheys\n" +" -l, --list näytä tietoja .xz-tiedostoista" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Toimintomääreet:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep säilytä (poistamatta) syötetiedostot\n" +" -f, --force pakota tulostiedostojen ylikirjoitus ja pura/tiivistä\n" +" linkit\n" +" -c, --stdout kirjoita vakiotulosteeseen äläkä poista syötetiedostoja" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream pura vain ensimmäinen virta, ja ohita\n" +" hiljaisesti mahdollinen jäljellä oleva syötedata" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse älä luo hajanaisia tiedostoja purettaessa\n" +" -S, --suffix=.PÄÄTE käytä ”.PÄÄTE”-päätettä tiivistetyille tiedostoille\n" +" --files[=TIED] lue käsiteltävät tiedostonimet TIEDostosta; jos TIED\n" +" jätetään antamatta, tiedostonimet luetaan vakiosyötteestä;\n" +" tiedostonimet on päätettävä rivinvaihtomerkillä\n" +" --files0[=TIED] kuten --files mutta käytä päättämiseen nul-merkkiä" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Tiedostomuodon ja tiivistyksen perusvalitsimet:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=MUOTO tuotettava tai luettava tiedostomuoto; vaihtoehdot\n" +" ovat ”auto” (oletus), ”xz”, ”lzma”, ”lzip” ja ”raw”\n" +" -C, --check=CHECK eheystarkastuksen tyyppi: ”none” (käytä varoen),\n" +" ”crc32”, ”crc64” (oletus) tai ”sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check älä suorita eheystarkastusta purettaessa" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 tiivistyksen esiasetus; oletus on 6; ota tiivistyksen\n" +" *ja* purun muistinkäyttö huomioon ennen kuin käytät\n" +" arvoja 7–9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme yritä parantaa tiivistyssuhdetta käyttämällä enemmän\n" +" suoritinaikaa; ei vaikuta purkimen muistivaatimuksiin" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=MÄÄRÄ käytä enintää MÄÄRÄä säiettä; oletus on 1; asettamalla\n" +" 0:ksi käytetään suoritinytimien määrän verran säikeitä" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=KOKO\n" +" aloita uusi .xz-lohko aina KOKO syötetavun jälkeen; käytä\n" +" tätä säikeistetyn tiivistyksen lohkokoon asettamiseen" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=KOOT\n" +" aloita uusi .xz-lohko kun tiivistämätöntä dataa on\n" +" käsitelty pilkuilla erotellut tavumäärät" + +# FIXME: tarvitaan kiva suomenkielinen termi block-verbille tässä merkityksessä +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=AIKAKATKAISU\n" +" jos tiivistettäessä on kulunut yli AIKAKATKAISU ms\n" +" edellisestä huuhtomisesta ja syötteen lukemisen\n" +" jatkaminen pysähtyisi, kaikki odottava data huuhdellaan" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=RAJA\n" +" --memlimit-decompress=RAJA\n" +" -M, --memlimit=RAJA\n" +" aseta muistinkäytön raja tiivistykselle, purkamiselle,\n" +" säikeistetylle purkamisella tai näille kaikille; RAJA\n" +" on tavuja, %-osuus RAMista tai 0 oletusarvoille" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust jos tiivistysasetukset ylittävät muistinkäytön rajan,\n" +" anna virhe äläkä pudota asetuksia alaspäin" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Mukautettu suodinketju tiivistykselle (vaihtoehto esiasetuksille):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=ASET] LZMA1 tai LZMA2; ASETukset ovat yksi tai useampi\n" +" --lzma2[=ASET] seuraavista asetuksista pilkuilla eroteltuina\n" +" (kelvolliset arvot; oletus):\n" +" preset=ESI palauta asetukset esiasetukseen (0-9[e])\n" +" dict=LUKU sanaston koko (4KiB – 1536MiB; 8MiB)\n" +" lc=LUKU literal context -bittien määrä (0-4; 3)\n" +" lp=LUKU literal position -bittien määrä (0-4; 0)\n" +" pb=LUKU position -bittien määrä (0-4; 2)\n" +" mode=TILA tiivistystila (fast, normal; normal)\n" +" nice=LUKU täsmäävyyden nice-pituus (2–273; 64)\n" +" mf=NIMI täsmäävyydenetsin (hc3, hc4, bt2, bt3,\n" +" bt4; bt4)\n" +" depth=LUKU enimmäishakusyvyys; 0=automaattinen (oletus)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=ASET] x86:n BCJ-suodin (32- ja 64-bittiset)\n" +" --arm[=ASET] ARMin BCJ-suodin\n" +" --armthumb[=ASET] ARM-Thumbin BCJ-suodin\n" +" --arm64[=ASET] ARM64:n BCJ-suodin\n" +" --powerpc[=ASET] PowerPC:n BCJ-suodin (vain big endian)\n" +" --ia64[=ASET] IA-64:n (Itanium) BCJ-suodin\n" +" --sparc[=ASET] SPARCin BCJ-suodin\n" +" Kelvolliset ASETukset kaikille BCJ-suotimille:\n" +" start=LUKU muunnoksien aloitussiirtymä (oletus=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=ASET] Muutossuodin; kelvolliset ASETukset (kelv. arvot; oletus):\n" +" dist=LUKU toisistaan vähennettävien tavujen\n" +" välinen etäisyys (1–256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Muut valitsimet:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet vaienna varoitukset; kahdesti antamalla myös virheet\n" +" -v, --verbose ole lavea; kahdesti antamalla vieläkin laveampi" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn älkööt varoitukset vaikuttako paluuarvoon" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot käytä koneluettavia viestejä (sopii skripteihin)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory näytä RAM-muistin kokonaismäärä ja parhaillaan\n" +" vallitsevat muistinkäytön rajat, ja poistu" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help näytä lyhyt ohje (kertoo vain perusvalitsimet)\n" +" -H, --long-help näytä tämä pitkä ohje ja poistu" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help näytä tämä lyhyt ohje ja poistu\n" +" -H, --long-help näytä pitkä ohje (kertoo myös lisävalitsimet)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version näytä versionumero ja poistu" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Jos TIEDOSTOa ei ole annettu, tai se on ”-”, luetaan vakiosyötettä.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Ilmoita ohjelmistovioista (suomeksi) osoitteeseen <%s>.\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s -kotisivu: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "TÄMÄ ON KEHITYSVERSIO, JOTA EI OLE TARKOITETTU TUOTANTOKÄYTTÖÖN." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Asetusten on oltava pilkuilla eroteltuja ”nimi=arvo” -pareja" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Virheellinen asetuksen nimi" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Virheellinen asetuksen arvo" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Ei-tuettu LZMA1/LZMA2-esiasetus: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "lc:n ja lp:n summa ei saa olla yli 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: --format=raw vaatii, että --suffix=.PÄÄTE on annettu, ellei kirjoiteta vakiotulosteeseen" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Tiedostonimen pääte on tuntematon, ohitetaan" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Tiedostolla on jo ”%s”-pääte, ohitetaan" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Virheellinen tiedostonimen pääte" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Arvo ei ole ei ole epänegatiivinen kymmenkantainen kokonaisluku" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Tuntematon kerroin" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Kelvolliset kertoimet ovat ”KiB” (2¹⁰), ”MiB” (2²⁰) ja ”GiB” (2³⁰)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Valitsimen ”%s” arvon on oltava välillä [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Tiivistettyä dataa ei voi lukea päätteestä" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Tiivistettyä dataa ei voi kirjoittaa päätteeseen" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Vakiotulosteeseen kirjoitus epäonnistui" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Tuntematon virhe" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Valittu täsmäävyydenetsin vaatii vähintään nice-arvon=%" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Hiekkalaatikko on poistettu käytöstä yhteensopimattomien komentoriviargumenttien vuoksi" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Hiekkalaatikko otettiin onnistuneesti käyttöön" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Muistinkäytön raja tiivistykselle: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Virrat: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Lohkot: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Suhde: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Tarkistus: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Virrat:\n" +#~ " Virta Lohkot TiivSiirr. Tv:tönSiirr. TiivKoko Tv:tönKoko Suhde Tark. Tasaus" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Lohkot:\n" +#~ " Virta Lohko TiivSiirr. Tv:tönSiirr. Yht.Koko Tv:tönKoko Suhde Tark." + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " Tark.arvo%*s Otsake Liput TiivKoko Muist.käyt. Suotimet" diff --git a/po/fr.gmo b/po/fr.gmo new file mode 100644 index 0000000..a4f0f80 Binary files /dev/null and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..1eb657c --- /dev/null +++ b/po/fr.po @@ -0,0 +1,1135 @@ +# XZ Utils French Translation +# This file is put in the public domain. +# Adrien Nader , 2011-2014. +# Stéphane Aulery , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: xz-5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2019-05-12 05:46+0200\n" +"Last-Translator: Stéphane Aulery \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s : argument de l'option --block-list invalide" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s : trop d'arguments pour l'option --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 peut seulement être utilisé en dernier élément de --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s : Format de fichier inconnu" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s : Type de vérification d'intégrité inconnu" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Un seul fichier peut être spécifié avec `--files' ou `--files0'." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variable d'environnement %s contient trop d'arguments" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Le support de la compression à était désactivé lors de la compilaton" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Le support de la décompression a été désactivé lors de la compilation" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Le nombre maximal de filtres est quatre" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "La limite d'utilisation mémoire est trop basse pour la configuration de filtres donnée." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Utiliser un préréglage en mode `raw' est déconseillé." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Le détail des préréglages peut varier entre différentes versions du logiciel." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Le format .lzma ne prend en charge que le filtre LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Le filtre LZMA1 ne peut être utilisé avec le format .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "La Chaine de filtre est incompatible avec --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Bascule en mode mono-processus à cause de --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Jusqu'à % threads seront utilisés." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Enchaînement ou options de filtres non pris en charge" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "La décompression nécessitera %s MiB de mémoire." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Nombre de threads réduit de %s à %s pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Nombre de threads réduit de %s à %s pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas dépasser la limite d'utilisation mémoire de %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Impossible de créer un tube anonyme (pipe) : %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Echec de l'activation de la sandboxe" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s : L'appel à la fonction poll() a échoué : %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s : Le fichier a apparemment été déplacé, suppression annulée" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s : Impossible de supprimer : %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s : Impossible de modifier le propriétaire du fichier : %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s : Impossible de modifier le groupe propriétaire du fichier : %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s : Impossible de modifier les permissions du fichier : %s" + +# Note from translator on "file status flags". +# The following entry is kept un-translated on purpose. It is difficult to +# translate and should only happen in exceptional circumstances which means +# that translating would: +# - lose some of the meaning +# - make it more difficult to look up in search engines; it might happen one in +# a million times, if we dilute the error message in 20 languages, it will be +# almost impossible to find an explanation and support for the error. +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Echec de la lecture du drapeau d'état du fichier depuis la sortie standard : %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s est un lien symbolique : ignoré" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s est un répertoire : ignoré" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s n'est pas un fichier régulier : ignoré" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s : Le fichier possède les bits `setuid' ou `setgid' : ignoré" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s : Le fichier possède le bit `sticky' : ignoré" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s : Le fichier d'entrée a plus d'un lien matériel : ignoré" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nom de fichier vide, ignoré" + +# See note from translator above titled "file status flags". +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Erreur de restauration du drapeau d'état de l'entrée standard : %s" + +# See note from translator above titled "file status flags". +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Erreur de lecture du drapeau d'état du fichier depuis la sortie standard : %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Impossible de rétablir le drapeau O_APPEND sur la sortie standard : %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s : Impossible de fermer le fichier : %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier pour créer un 'sparse file' : %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s : Impossible de se déplacer dans le fichier : %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s : Fin de fichier inattendue" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s : Erreur d'écriture : %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Désactivé" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Quantité totale de mémoire physique (RAM) : " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Limite d'utilisation pour la décompression : " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Limite d'utilisation mémoire atteinte" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Taille données avec compression : %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Taille données sans compression : %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Octets de rembourrage du flux : %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Mémoire nécessaire : %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Tailles stockées dans l'en-tête : %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Nombre de fichiers : %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Totaux :" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Aucune" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Inconnue-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Inconnue-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Inconnue-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Inconnue-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Inconnue-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Inconnue-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Inconnue-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Inconnue-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Inconnue-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Inconnue-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Inconnue-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Inconnue-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s : Le fichier est vide" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s : Trop petit pour être un fichier xz valide." + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Flux Blocs Compressé Décompressé Ratio Vérif. Nom de fichier" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Oui" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Non" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Version minimale de XZ Utils : %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fichier\n" +msgstr[1] "%s fichiers\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totaux :" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list ne marche que sur les fichiers .xz (--format=xz ou --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list est incompatible avec la lecture sur l'entrée standard" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s : Erreur lors de la lecture des noms de fichiers : %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s : Fin des données inattendue lors de la lecture des noms de fichiers" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s : Caractère NULL détecté lors de la lecture des noms de fichiers ; peut-être pensiez-vous à `--files0' plutot qu'a `--files' ?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "La compression et la décompression ne marchent pas encore avec --robot." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Impossible de lire à la fois les données et les noms de fichiers depuis l'entrée standard" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s : " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Erreur interne (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Impossible d'installer le gestionnaire de signaux" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Pas de données de vérification d'intégrité ; vérification non effectuée" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Méthode de vérification d'intégrité non prise en charge ; vérification non effectuée" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Limite d'utilisation mémoire atteinte" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Format de fichier inconnu" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Options non prises en charge" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Les données compressées sont corrompues" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Fin des données inattendue " + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB de mémoire sont nécessaires. La limite est désactivée." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB de mémoire sont nécessaires, la limite étant %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s : Enchaînement de filtres : %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Éxécutez `%s --help' pour obtenir davantage d'informations." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Utilisation : %s [OPTION]... [FICHIER]...\n" +"Compresse ou decompresse FICHIER(s) au format .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Les arguments obligatoires pour les options longues le sont aussi pour les\n" +"options courtes.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Mode d'opération :\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress forcer le mode compression\n" +" -d, --decompress forcer le mode décompression\n" +" -t, --test tester l'intégrité du fichier compressé\n" +" -l, --list lister les informations sur les fichiers .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificateurs :\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep ne pas supprimer les fichiers d'entrée\n" +" -f, --force forcer l'écrasement éventuel du fichier de sortie et\n" +" (dé)compresser les liens symboliques\n" +" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n" +" fichiers d'entrée" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream décompresser uniquement le premier flux et ignorer\n" +" silencieusement les données éventuellement restantes" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne pas créer de 'sparse file' lors de la décompression\n" +" -S, --suffix=.SUF utiliser le suffixe `.SUF' pour les fichiers compressés\n" +" --files[=FILE] lire les fichiers sur lesquels opérer depuis FILE ; si\n" +" FILE est omis, ceux-ci sont lus depuis l'entrée standard\n" +" et doivent être suivis d'un caractère retour à la ligne\n" +" --files0[=FILE] comme --files mais avec un caractère null comme séparateur" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Options basiques de format de fichier et de compression :\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT format du fichier à encoder ou décoder ; sont acceptés :\n" +" `auto' (par défaut), `xz', `lzma' et `raw'\n" +" -C, --check=CHECK type de vérification d'intégrité : `none' (à utiliser avec\n" +" précaution), `crc32', `crc64' (par défaut) ou `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" +" --ignore-check ne pas vérifier l'intégrité des données lors de\n" +" la décompression" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 préréglage de compression : 6 par défaut ; pensez à\n" +" l'utilisation mémoire du compresseur *et* du décompresseur\n" +" avant d'utiliser 7, 8 ou 9 !" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme essayer d'améliorer la compression en utilisant davantage\n" +" de temps processeur ;\n" +" n'affecte pas les besoins mémoire du décompresseur" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NB créer au plus NB fils de compression (1 par défault) ; la\n" +" valeur 0 est spéciale et équivaut au nombre de processeurs\n" +" de la machine" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=TAILLE\n" +" débuter un bloc XZ après chaque TAILLE octets de données\n" +" d'entrée ; ce réglage sert pour la compression paralléle" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=TAILLES\n" +" débuter des blocs XZ après les TAILLES octets de données\n" +" spécifiées avec des virgules pour séparateur" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TIMEOUT\n" +" pendant la compression, si plus de TIMEOUT ms ont passées\n" +" depuis le dernier flush et que la lecture est bloquée,\n" +" toutes les données en attente snt écrites" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" règle la limite d'utilisation mémoire pour la compression,\n" +" décompression ou les deux ; LIMIT est en octets,\n" +" pourcentage de RAM, ou 0 pour la valeur par défaut" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust si les réglages de compression dépassent la limite\n" +" d'utilisation mémoire, renvoyer une erreur plutôt que de\n" +" diminuer les réglages" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Chaîne de filtres de compression personnalisée (en lieu des préréglages) :" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPTS] LZMA1/2 ; OPTS est une liste d'options parmi les suivantes\n" +" --lzma2[=OPTS] (entre parenthèses : valeurs valides et par défaut) :\n" +" preset=PRE remettre les options à un préréglage (0-9[e])\n" +" dict=NUM taille dictionnaire (4KiB - 1536MiB ; 8MiB)\n" +" lc=NUM nombre de 'literal context bits' (0-4 ; 3)\n" +" lp=NUM nombre de 'literal position bits' (0-4 ; 0)\n" +" pb=NUM nombre de 'position bits' (0-4 ; 2)\n" +" mode=MODE mode de compression (fast, normal ; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME 'match finder' (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM profondeur de recherche maximale ;\n" +" 0=automatique (par défaut)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPTS] filtre BCJ x86 (32-bit et 64-bit)\n" +" --powerpc[=OPTS] filtre BCJ PowerPC ('big endian' uniquement)\n" +" --ia64[=OPTS] filtre BCJ IA-64 (Itanium)\n" +" --arm[=OPTS] filtre BCJ ARM ('little endian' uniquement)\n" +" --armthumb[=OPTS] filtre BCJ ARM-Thumb ('little endian' uniquement)\n" +" --sparc[=OPTS] filtre BCJ SPARC\n" +" OPTS valides pour tous les filtres BCJ :\n" +" start=NUM position de début de la conversion (défaut=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPTS] Filtre delta ; OPTS valides (vals. valides ; par défaut) :\n" +" dist=NUM distance entre les octets soustraits les\n" +" uns aux autres (1-256 ; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Autres options :\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet masquer les avertissements ; spécifier deux fois pour\n" +" aussi masquer les erreurs\n" +" -v, --verbose être bavard ; spécifier deux fois pour l'être davantage" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn les avertissements ne modifient pas le code de sortie" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot utiliser des messages lisibles par un programme\n" +" (utile pour les scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory afficher la quantité totale de RAM ainsi que la limite\n" +" actuelle d'utilisation mémoire puis quitter" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help afficher l'aide courte (ne liste que les options de base)\n" +" -H, --long-help afficher l'aide longue (ceci) puis quitter" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help afficher l'aide courte (ceci) puis quitter\n" +" -H, --long-help afficher l'aide longue (liste aussi les options avancées)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version afficher le numéro de version puis quitter" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Sans FILE ou quand FILE est -, lire l'entrée standard.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Signaler les bogues à <%s> (en anglais ou en finnois).\n" +"Signaler les bogues de traduction à .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Page du projet %s : <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "CECI EST UNE VERSION DE DEVELOPPEMENT QUI NE DOIT PAS ÊTRE UTILISEE EN PRODUCTION." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Les options doivent être des paires `nom=valeur' séparées par des virgules" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s : Nom d'option invalide" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s : Valeur d'option invalide" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Préréglage LZMA1/LZMA2 non reconnu : %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "La somme de lc et lp ne doit pas dépasser 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s : Avec --format=raw, --suffix=.SUF est nécessaire sauf lors de l'écriture vers stdout" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s : Le fichier a un suffixe inconnu, ignoré" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s : Le fichier a déjà le suffixe '%s', ignoré" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Suffixe de nom de fichier invalide" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s : La valeur n'est pas un entier décimal non négatif" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s : Suffixe multiplicateur invalide" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Les suffixes valides sont 'KiB' (2^10), 'MiB' (2^20) et 'GiB' (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "La valeur de l'option '%s' doit être inclue entre % et %" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Les données compressées ne peuvent pas être lues depuis un terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Les données compressées ne peuvent pas être écrites dans un terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Impossible d'écrire vers la sortie standard" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Erreur inconnue" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "La sandbox est désactivée car elle est incompatible avec les arguments passés" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "La sandboxe a été activée avec succès" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Limite d'utilisation pour la compression : " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Flux : %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Blocs : %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Ratio : %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Vérification : %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Flux :\n" +#~ " Flux Blocs PositionComp PositionDécomp TailleComp TailleDécomp Ratio Vérif. Bourrage" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blocs :\n" +#~ " Flux Bloc PositionComp PositionDécomp TailleTot TailleDécomp Ratio Vérif." + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Le `match finder' choisi nécessite au moins nice=%" + +#~ msgid "Error setting O_NONBLOCK on standard input: %s" +#~ msgstr "Impossible d'établir le drapeau O_NONBLOCK sur la sortie standard : %s" + +#~ msgid "Error setting O_NONBLOCK on standard output: %s" +#~ msgstr "Impossible d'activer le drapeau O_NONBLOCK sur la sortie standard : %s" diff --git a/po/hr.gmo b/po/hr.gmo new file mode 100644 index 0000000..c5785a1 Binary files /dev/null and b/po/hr.gmo differ diff --git a/po/hr.po b/po/hr.po new file mode 100644 index 0000000..bea09c8 --- /dev/null +++ b/po/hr.po @@ -0,0 +1,1069 @@ +# Croatian translation of xz. +# This file is put in the public domain. +# +# Božidar Putanec , 2020, 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-12-02 19:30-0800\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: nevaljani argument za --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Previše argumenata za --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 se može koristiti samo kao zadnji element za --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Nepoznati tip formata datoteke" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Nepodržani tip provjere integriteta" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Samo jednu datoteku smijete navesti uz opcije „--files” ili „--files0”." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Varijabla okoline %s sadrži previše argumenata" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Tijekom izrade programa onemogućena je podrška za kompresiju" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Tijekom izrade programa onemogućena je podrška za dekompresiju" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Kompresija lzip datoteka (.lz) nije podržana" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Moguće je najviše do četiri filtara" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Ograničenje upotrebe memorije premalo je za danu postavku filtra." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Nije preporučeno koristiti pretpostavke u sirovom načinu rada." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Točne opcije pretpostavki mogu ovisiti o verziji softvera." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Samo LZMA1 filtar podržava .lzma format" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 se ne može koristi za .xz format" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Lanac filtara nije kompatibilan s --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Prebacivanje u jednodretveni rad zbog --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Koristimo do % dretvi." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Lanac filtara ili opcije filtara nisu podržane" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Za dekompresiju će trebati %s MiB memorije." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Smanjen je broj dretvi od %s na %s da se ne prekorači ograničenje upotrebe memorije od %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Smanjen je broj dretvi od %s na jednu. Ograničenje automatske upotrebe memorije od %s MiB još uvijek je prekoračeno. Potrebno je %s MiB memorije. Ipak nastavljamo dalje." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Prebacivanje na rad s jednom dretvom da se ne prekorači ograničenje upotrebe memorije od %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Prilagođena je veličina LZMA%c rječnika od %s na %s da se ne premaši ograničenje upotrebe memorije od %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Greška pri stvaranju cijevi: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Nije uspjelo omogućiti sandbox" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() nije uspjela: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Izgleda da je datoteka pomaknuta -- ne briše se" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Brisanje nije moguće: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Promijeniti vlasnika datoteke nije moguće: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Promijeniti grupu datoteke nije moguće: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Nije moguće postaviti prava dostupa: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Greška pri dobavljanju statusnih flagova datoteke iz standardnog ulaza: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: To je simbolička poveznica, preskačemo" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: To je direktorij, preskačemo" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: To nije regularna datoteka, preskačemo" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Datoteka ima postavljen setuid ili setgid bit, preskačemo" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Datoteka ima postavljen sticky bit, preskačemo" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Ulazna datoteka ima više od jedne tvrde poveznice, preskačemo" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Prazna datoteka, preskačemo" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Greška pri vraćanju statusnih flagova na standardni ulaz: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Greška pri dobavljanju statusnih flagova datoteke iz standardnog izlazu: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Greška pri vraćanju O_APPEND flagova na standardni izlaz: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Nije uspjelo zatvoriti datoteku: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Poziciona greška pri pokušaju stvaranja raštrkane datoteke: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Greška pri čitanju: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Greška pozicioniranja u datoteci: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Neočekivani kraj datoteke" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Greška pri pisanju: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Onemogućeno" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Količina fizičke memorije (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Broj dretvi procesora:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Kompresija:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Dekompresija:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Više dretvama dekompresija:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Zadano za -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Informacije o hardveru:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Ograničenje za korištenje memorije:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Tokovi:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blokovi:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Komprimirana veličina:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Dekomprimirana veličina:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Omjer:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Kontrola:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Ispuna za tok:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Potrebna memorija:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Veličine u zaglavljima:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Broj datoteka:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Tok" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Blok" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Blokovi" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "KomprOffset" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "DekomprOffset" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "KomprVeličina" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "DekomprVeličina" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "TotalVeličina" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Omjer" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Kontrola" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "KontrolVrijednost" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Ispuna" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Zaglavlje" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Flagi" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "MemUpotreba" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filteri" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nema" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Nepoznat-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Nepoznat-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Nepoznat-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Nepoznat-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Nepoznat-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Nepoznat-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Nepoznat-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Nepoznat-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Nepoznat-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Nepoznat-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Nepoznat-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Nepoznat-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Datoteka je prazna" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Premala, a da bi bila valjana .xz datoteka" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " Tok Blok Komprimirano Dekomprimir Omjer Kontr Datoteka" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Da" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Ne" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Potrebna je inačica XY Utils: %s ili viša\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s datoteka\n" +msgstr[1] "%s datoteke\n" +msgstr[2] "%s datoteka\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Ukupno:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list radi samo sa .xz datoteke (--format=xz ili --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list ne podržava čitanje iz standardnog izlaza" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Greška pri čitanju datoteka: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Neočekivani kraj ulaznih podataka tijekom čitanja imena datoteka" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Prazni (null) znak pronađen pri čitanju imena datoteka; možda ste mislili koristiti „--files0” umjesto „--files”?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Komprimiranje i dekomprimiranje s --robot još nije podržano." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Nije moguće čitati podatke iz standardnog ulaza dok se čitaju imena datoteka iz standardnog ulaza" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Interna greška (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Nije moguće uspostaviti rukovatelje signala" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Nema provjere integriteta -- ne provjeravamo integritet datoteke" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Nepodržani tip provjere integriteta -- ne provjeravamo integritet datoteke" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Dostignuto je ograničenje za korištenje memorije" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Format datoteke nije prepoznat" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Nepodržane opcije" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Komprimirani podaci su oštećeni" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Neočekivani kraj ulaznih podataka" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB memorije je potrebno. Ograničenje je onemogućeno." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB memorije je potrebno. Ograničenje je %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Lanac filtara: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Pokušajte s „`%s --help“ za pomoć i više informacija." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Uporaba: %s [OPCIJA]... [FILE]...\n" +"Komprimira ili dekomprimira DATOTEKE u .xz formatu.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Obvezni argumenti za duge opcije obvezni su također i za kratke opcije.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Način rada:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress komprimira (prisilna kompresija)\n" +" -d, --decompress dekomprimira (prisilna dekompresija)\n" +" -t, --test testira integritet komprimirane datoteke\n" +" -l, --list ispiše podatke o .xz datotekama" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modifikatori načina rada:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep zadrži (ne briše) navedene ulazne datoteke\n" +" -f, --force piše preko izlaznih datoteka i\n" +" preko (de)komprimiranih poveznica \n" +" -c, --stdout piše na standardni izlaz i ne briše\n" +" ulazne datoteke" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream dekomprimira samo prvi tok i nijemo\n" +" zanemari moguće preostale ulazne podatke" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne stvara raštrkane datoteke pri dekompresiji\n" +" -S, --suffix=.SUF rabi sufiks „.SUF” za komprimirane datoteke umjesto .xz\n" +" --files[=DATOTEKA] čita imena datoteka za obradu iz DATOTEKE; ako\n" +" DATOTEKA nije dana, imena datoteka čita iz\n" +" standardnog ulaza; ime datoteke mora završiti\n" +" sa znakom novog reda\n" +" --files0[=DATOTEKA] kao --files, ali popis datoteka završi s NULL znakom" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Osnovne opcije za format datoteka i kompresiju:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT format datoteke za kodiranje ili dekodiranje; mogućnosti:\n" +" „auto” (zadano), „xz”, „lzma”, „lzip“ i „raw”\n" +" -C, --check=KONTROLA tip provjere integriteta: „none” (koristite s oprezom),\n" +" „crc32”, „crc64” (zadano), ili „sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check ne verificira provjeru integriteta pri dekompresiji" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 pretpostavke za kompresiju; zadano je 6; uzmite u obzir\n" +" upotrebu memorije za (de)kompresor prije upotrebe 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme pokuša poboljšati omjer kompresije koristeći više CPU\n" +" vremena; ne utječe na potrebnu memoriju za dekompresiju" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=BROJ rabi ne više od BROJ dretvi; zadano je 1; postavkom 0\n" +" za BROJ koristi se toliko dretvi koliko CPU ima jezgri" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=VELIČINA započne novi.xz blok nakon svakih VELIČINA bajtova\n" +" ulaznih podataka; ovo rabite za postavljanje\n" +" veličine bloka za kompresiju s dretvama" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=VELIČINE započne novi .xz blok nakon svake navedene\n" +" VELIČINE nekomprimiranih ulaznih podataka;\n" +" VELIČINE su zarezom odvojene" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=VRIJEME pri komprimiranju, ako je prošlo više od VRIJEME\n" +" milisekundi od prethodnog pražnjenja, a daljne\n" +" čitanje bi blokiralo ulaz, svi podaci na\n" +" čekanju se isprazne iz kodera na izlaz" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=GRANICA\n" +" --memlimit-decompress=GRANICA\n" +" -M, --memlimit=GRANICA\n" +" ograničenje korištenja memorije za kompresiju,\n" +" dekompresiju, dretvama dekompresiju, ili sve ovo;\n" +" GRANICA je u bajtima, % RAM, ili 0 za zadano" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust ako dane postavke kompresije prekorače ograničenje\n" +" upotrebe memorije, završi s greškom umjesto da\n" +" prilagodi postavke shodno ograničenju memorije" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Prilagođeni lanac filtara za kompresiju (alternativa korištenju pretpostavki):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPCIJE] LZMA1 ili LZMA2; OPCIJE je popis\n" +" --lzma2[=OPCIJE] nula ili više od sljedećih opcija zarezom odijeljenih;\n" +" (valjane vrijednosti; zadano):\n" +" preset=PRE vrati opcije na pretpostavke (0-9[e])\n" +" dict=BROJ veličina rječnika (4KiB - 1536MiB; 8MiB)\n" +" lc=BROJ broj bitova doslovnog konteksta (0-4; 3)\n" +" lp=BROJ broj bitova doslovne pozicije (0-4; 0)\n" +" pb=BROJ broj pozicionih bitova (0-4; 2)\n" +" mode=NAČIN način kompresije (fast, normal; normal)\n" +" nice=BROJ nice-dužina za podudaranje (2-273; 64)\n" +" mf=IME podudarač (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=BROJ max. dubina traženja; 0=automatski (default)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPCIJE] x86 BCJ filtar (32-bit i 64-bit)\n" +" --arm[=OPCIJE] ARM BCJ filtar\n" +" --armthumb[=OPCIJE] ARM-Thumb BCJ filtar\n" +" --arm64[=OPCIJE] ARM64 BCJ filtar\n" +" --powerpc[=OPCIJE] PowerPC BCJ filtar (samo veliki endian)\n" +" --ia64[=OPCIJE] IA-64 (Itanium) BCJ filtar\n" +" --sparc[=OPCIJE] SPARC BCJ filtar\n" +" Valjane OPCIJE za BCJ filtre:\n" +" start=BROJ početni offset za konverzije (zadano=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPCIJE] Delta filtar; valjane OPCIJE\n" +" (valjane vrijednosti; zadano):\n" +" dist=BROJ razmak između bajtova koji se oduzimaju\n" +" jedan od drugog (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Ostale opcije:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet izostavi upozorenja; „-qq” izostavi i greške\n" +" -v, --verbose opširnije informira; „=vv” još više informira" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn upozorenja nemaju utjecaja na status završetka (izlaza)" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot poruke u strojnom formatu (korisno za skripte)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory pokaže ukupnu količinu RAM-a i trenutno\n" +" aktivna ograničenja korištenja memorije, pa iziđe" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help prikaže kratku pomoć (izlista samo osnovne opcije)\n" +" -H, --long-help prikaže ovu dugačku pomoć i iziđe" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help prikaže ovu kratku pomoć i iziđe\n" +" -H, --long-help prikaže dugačku pomoć (izlista i napredne opcije)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version prikaže informacije o inačici i iziđe" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Ako DATOTEKA nije navedena ili je „-“, čita standardni ulaz.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Greške prijavite na <%s> (na engleskom ili finskom).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" +"%s matična mrežna stranica: <%s>\n" +"Pogreške u prijevodu i vaše prijedloge javite na .\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "OVO JE RAZVOJNA INAČICA I NIJE NAMIJENJENA ZA PROIZVODNJU." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Opcije moraju biti parovi „name=value” odvojeni zarezima" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Nevaljano ime opcije" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Nevaljana vrijednost opcije" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nepodržana LZMA1/LZMA2 pretpostavka: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Zbroj lc i lp ne smije biti veći od 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: S/uz --format=raw, --suffix=.SUF je nužan osim ako se piše na standardni izlaz" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Ime datoteke nema poznati sufiks, preskačemo" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Datoteka već ima „%s” sufiks, preskačemo" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Nevaljani sufiks imena datoteke" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Vrijednost nije nula ili pozitivni decimalni cijeli broj" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Nevaljana mjerna jedinica (sufiks)" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Valjani sufiksi (mjerne jedinice) su „KiB” (2^10), „MiB” (2^20), i „GiB” (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Vrijednost opcije „%s” mora biti u rasponu [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Nije moguće čitati komprimirane podatke iz terminala" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Nije moguće pisati komprimirane podatke na terminala" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Pisanje na standardni izlaz nije uspjelo" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Nepoznata greška" + +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "" +#~ "Odabrani podudarač (algoritam za pronalaženje podudaranja)\n" +#~ "zahtijeva barem nice=%" + +#~ msgid "Nepoznat-6" +#~ msgstr "Nepoznat-6" + +#~ msgid "Nepoznat-7" +#~ msgstr "Nepoznat-7" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Sandbox je onemogućen zbog nekompatibilnih argumenata naredbenog retka" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Sandbox je uspješno omogućen" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr " Ograničenje memorije za kompresiju: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Tok(a/ova): %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Blok(a/ova): %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Omjer: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Kontrola: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Tokovi:\n" +#~ " Tok Blokovi KompOffset DekompOffset KompVeličina DekompOffset Omjer Kontrola Ispuna" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blokovi:\n" +#~ " Tok Blok KompOffset DekompOffset KompVeličina DekompOffset Omjer Kontrola" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " KonSvota %*s Zaglav Flags KompVel Memorija Filtri" diff --git a/po/hu.gmo b/po/hu.gmo new file mode 100644 index 0000000..642a6b9 Binary files /dev/null and b/po/hu.gmo differ diff --git a/po/hu.po b/po/hu.po new file mode 100644 index 0000000..81f99b5 --- /dev/null +++ b/po/hu.po @@ -0,0 +1,1073 @@ +# Hungarian translation for xz. +# This file is put in the public domain. +# +# Meskó Balázs , 2019, 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-10 12:13+0100\n" +"Last-Translator: Meskó Balázs \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"plural-forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.1.1\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Érvénytelen argumentum a --block-list kapcsolóhoz" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Túl sok argumentum a --block-list kapcsolóhoz" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "A 0 csak utolsó elemként használható a --block-list kapcsolónál" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Ismeretlen fájlformátumtípus" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Nem támogatott integritás-ellenőrzési típus" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Csak egy fájl adható meg a „--files” vagy „--files0” kapcsolóknál." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "A(z) %s környezeti változó túl sok argumentumot tartalmaz" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "A tömörítési támogatás ki lett kapcsolva fordítási időben" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "A kibontási támogatás ki lett kapcsolva fordítási időben" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Az lzip-fájlok (.lz) tömörítése nem támogatott" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "A szűrők legnagyobb száma négy" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "A memóriahasználat túl alacsony a megadott szűrőbeállításokhoz." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Az előbeállítások használata nyers módban nem javasolt." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Az előbeállítások pontos beállításai különbözhetnek a szoftververziók között." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Az .lzma formátum csak az LZMA1 szűrőt támogatja" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Az LZMA1 nem használható az .xz formátummal" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "A szűrőlánc nem kompatibilis a --flush-timeout kapcsolóval" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Egyszálú módra váltás a --flush-timeout kapcsoló miatt" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Legfeljebb % szál használata." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Nem támogatott szűrőlánc vagy szűrőkapcsolók" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "A kibontáshoz %s MiB memória szükséges." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "A szálak számának csökkentése erről: %s, erre: %s, hogy ne lépje túl a(z) %s MiB-os korlátot" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "A szálak számának csökkentése erről: %s, egyre. A(z) %s MiB-os automatikus memóriahasználati korlát így is túl lett lépve. %s MiB memória szükséges. Ennek ellenére folytatás mindenképpen." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Egyszálú módra váltás, hogy ne lépje túl a(z) %s MiB-os memóriahasználati korlátot" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Az LZMA%c szótár méretének módosítása erről: %s MiB, erre: %s MiB, hogy ne lépje túl a(z) %s MiB-os korlátot" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Hiba a csővezeték létrehozásakor: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "A homokozó engedélyezése sikertelen" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() sikertelen: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Úgy tűnik, hogy a fájl át lett helyezve, nincs eltávolítás" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Nem távolítható el: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: A fájl tulajdonosa nem adható meg: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: A fájl csoportja nem adható meg: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: A fájl jogosultságai nem adhatók meg: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Hiba a fájl állapotjelzőinek lekérdezésekor a szabványos bemenetről: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Szimbolikus link, kihagyás" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Könyvtár, kihagyás" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Nem szabályos fájl, kihagyás" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: A fájlon setuid vagy setgid bit van beállítva, kihagyás" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: A fájlon sticky bit van beállítva, kihagyás" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: A bemeneti fájlhoz több mint egy hard link tartozik, kihagyás" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Üres fájlnév, kihagyás" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Hiba a fájl állapotjelzőinek visszaállításakor a szabványos bemenetre: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Hiba a fájl állapotjelzőinek lekérdezésekor a szabványos kimenetről: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Hiba az O_APPEND visszaállításakor a szabványos kimenetre: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: A fájl lezárása sikertelen: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: A pozícionálás sikertelen a ritka fájl létrehozásának kísérletekor: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Olvasási hiba: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Hiba a fájlban pozícionáláskor: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Váratlan fájlvég" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Írási hiba: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Letiltva" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Fizikai memória (RAM) mennyisége:" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Processzorszálak száma:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Tömörítés:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Kibontás:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Többszálás kibontás:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "A -T0 alapértelmezése:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Hardverjellemzők:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Memóriahasználat korlátja:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Adatfolyamok:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blokkok:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Tömörített méret:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Kibontott méret:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Arány:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Ellenőrzés:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Adatfolyam kerete:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Szükséges memória:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Méretek a fejlécekben:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Fájlok száma:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Adatfolyam" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Blokk" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Blokkok" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "Tömörített eltolás" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "Kibontott eltolás" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "Tömörített méret" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "Kibontott méret" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Teljes méret" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Arány" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Ellenőrzés" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "Ellenőrzőérték" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Keret" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Fejléc" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Jelzők" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "Memóriahasználat" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Szűrők" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nincs" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Névtelen-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Névtelen-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Névtelen-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Névtelen-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Névtelen-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Névtelen-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Névtelen-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Névtelen-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Névtelen-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Névtelen-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Névtelen-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Névtelen-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: A fájl üres" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Túl kicsi, hogy érvényes .xz fájl legyen" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Folyam Blokkok Tömörített Kibontott Arány Ellenőrzés Fájlnév" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Igen" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nem" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Legkisebb XZ Utils verzió: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fájl\n" +msgstr[1] "%s fájl\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Összesen:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "A --list csak .xz fájlokkal működik (--format=xz vagy --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "A --list nem támogatja a szabványos bemenetről beolvasást" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Hiba a fájlnevek olvasásakor: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: A bemenet váratlanul véget ért a fájlnevek olvasásakor" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Null karakter található a fájlnevek olvasásakor; talán a „--files0” kapcsolóra gondolt a „--files” helyett?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "A tömörítés és kibontás még nem támogatott a --robot kapcsolóval." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Az adatok nem olvashatók be a szabványos bemenetről a fájlnevek olvasásakor" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Belső hiba (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "A szignálkezelők nem hozhatók létre" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Nincs integritás-ellenőrzés; a fájl épsége nem lesz ellenőrizve" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Nem támogatott integritás-ellenőrzési típus; a fájl épsége nem lesz ellenőrizve" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Memóriahasználat korlátja elérve" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "A fájlformátum nem felismert" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Nem támogatott kapcsolók" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "A tömörített adatok megsérültek" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "A bemenet váratlanul véget ért" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB memória szükséges. A korlátozás letiltva." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB memória szükséges. A korlát %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Szűrőlánc: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "További információkért adja ki a következő parancsot: „%s --help”." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Használat: %s [KAPCSOLÓ]... [FÁJL]...\n" +".xz formátumú FÁJLok tömörítése vagy kibontása.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "A hosszú kapcsolók kötelező argumentumai a rövid kapcsolók esetén is kötelezők.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Működési mód:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress kényszerített tömörítés\n" +" -d, --decompress kényszerített kibontás\n" +" -t, --test tömörített fájl épségének tesztelése\n" +" -l, --list információk kiírása az .xz fájlokról" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Műveleti módosítók:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep bemeneti fájlok megtartása (ne törölje)\n" +" -f, --force kimeneti fájl kényszerített felülírása,\n" +" és a linkek tömörítése/kibontása\n" +" -c, --stdout írás a szabványos kimenetre írás, és nem törli a\n" +" bemeneti fájlokat" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream csak az első adatfolyam kibontása, és a\n" +" lehetséges hátralévő bemeneti adatok mellőzése" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse ne hozzon létre ritka fájlokat kibontáskor\n" +" -S, --suffix=.SUF a „.SUF” utótag használata a tömörített fájlokon\n" +" --files[=FÁJL] fájlnevek beolvasása a FÁJLból; ha a FÁJL nincs\n" +" megadva, akkor a fájlnevek a szabványos bemenetről\n" +" lesznek beolvasva; a fájlneveket újsor karakterrel\n" +" kell zárni\n" +" --files0[=FÁJL] mint a --files, de a null karaktert használja\n" +" használja elválasztóként" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Alapvető fájlformátum és tömörítési beállítások:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT a kódoláshoz vagy dekódoláshoz használt fájlformátum;\n" +" lehetséges értékek „auto” (alapértelmezett), „xz”,\n" +" „lzma”, „lzip” és „raw”\n" +" -C, --check=ELL integritás-ellenőrzés típusa: „none” (óvatosan használja),\n" +" „crc32”, „crc64” (alapértelmezett) vagy „sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check kibontáskor ne ellenőrizze az épséget" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 tömörítési előbeállítás; alapértelmezett a 6;\n" +" a 7-9 használata előtt vegye figyelembe a tömörítő\n" +" *és* kibontó memóriahasználatát!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme a tömörítési arány javítási kísérlete több CPU-idő\n" +" használatával; nincs hatással a kibontó memóriaigényére" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=SZÁM legfeljebb ennyi szál használata; alapértelmezett az 1;\n" +" állítsa 0-ra, hogy annyi szálat használjon, amennyi\n" +" processzormag áll rendelkezésre" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=MÉRET\n" +" új .xz blokk indítása minden MÉRETnyi bájt bemenet után;\n" +" a többszálas tömörítés blokkméretének megadásához" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=MÉRETEK\n" +" új .xz blokk indítása a vesszőkkel felsorolva megadott\n" +" méretű tömörítetlen adatszakaszok után" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=IDŐTÚLLÉPÉS\n" +" tömörítéskor, ha több mint IDŐTÚLLÉPÉS ezredmásodperc\n" +" telt el az előző kiírástól, és a bemenetolvasás\n" +" blokkolna, akkor minden adat ki lesz írva" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=KORLÁT\n" +" --memlimit-decompress=KORLÁT\n" +" --memlimit-mt-decompress=KORLÁT\n" +" -M, --memlimit=KORLÁT\n" +" a memóriahasználati korlát megadása tömörítéshez,\n" +" kibontáshoz, többszálú kibontású vagy mindháromhoz; a\n" +" KORLÁT bájtokban van megadva, a RAM %-ában, vagy 0 az\n" +" alapértelmezéshez" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust ha a tömörítési beállítások túllépik a memóriahasználati\n" +" korlátot, akkor hibát fog adni a beállítások lefelé\n" +" állítása helyett" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Egyéni szűrőlánc a tömörítéshez (alternatíva az előbeállításokra):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=KAPCS] LZMA1 vagy LZMA2; a KAPCS nulla vagy több vesszővel\n" +" --lzma2[=KAPCS] elválasztott kapcsoló az alábbiak közül\n" +" (érvényes érték; alapértelmezett):\n" +" preset=ELŐ visszaállítás egy előbeállításra (0-9[e])\n" +" dict=SZÁM szótárméret (4KiB - 1536MiB; 8MiB)\n" +" lc=SZÁM literál környezeti bitek száma (0-4; 3)\n" +" lp=SZÁM literál pozícióbitek száma (0-4; 0)\n" +" pb=SZÁM pozícióbitek száma (0-4; 2)\n" +" mode=MÓD tömörítési mód (fast, normal; normal)\n" +" nice=SZÁM az egyezés „nice” hossza (2-273; 64)\n" +" mf=NÉV egyezéskereső (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=SZÁM legnagyobb keresési mélység; 0=automatikus\n" +" (alapértelmezett)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=KAPCS] x86 BCJ szűrő (32 bites és 64 bites)\n" +" --arm[=KAPCS] ARM BCJ szűrő\n" +" --armthumb[=KAPCS] ARM-Thumb BCJ szűrő\n" +" --arm64[=KAPCS] ARM64 BCJ szűrő\n" +" --powerpc[=KAPCS] PowerPC BCJ szűrő (csak big endian esetén)\n" +" --ia64[=KAPCS] IA-64 (Itanium) BCJ szűrő\n" +" --sparc[=KAPCS] SPARC BCJ szűrő\n" +" Érvényes KAPCS az összes BCJ szűrőhöz:\n" +" start=SZÁM kezdési eltolás az átalakításokhoz\n" +" (alapértelmezett=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPTS] Delta szűrő; érvényes KAPCSOLÓK\n" +" (érvényes értékek; alapértelmezett default):\n" +" dist=SZÁM az egymásból kivont bájtok közti\n" +" távolság (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Egyéb kapcsolók:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet figyelmeztetések elrejtése; adja meg kétszer, hogy a\n" +" hibákat is elrejtse\n" +" -v, --verbose legyen bőbeszédű; adja meg kétszer, hogy még bőbeszédűbb\n" +" legyen" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr "" +" -Q, --no-warn a figyelmeztetések nem befolyásolják a kilépési\n" +" állapotkódot" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot géppel értelmezhető üzenetek használata\n" +" (parancsfájlok esetén hasznos)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory az összes RAM mennyiségének és a jelenlegi\n" +" memóriahasználati korlátok megjelenítése, és kilépés" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help a rövid súgó megjelenítése (csak az alapvető kapcsolók)\n" +" -H, --long-help ezen hosszú súgó megjelenítése, és kilépés" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help ezen rövid súgó megjelenítése, és kilépés\n" +" -H, --long-help a hosszú súgó megjelenítése (speciális kapcsolókhoz)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version a verziószám kiírása és kilépés" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"FÁJL nélkül, vagy ha a FÁJL -, olvasás a szabványos bemenetről.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Ide jelentse a hibákat: <%s> (angolul vagy finnül).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s honlap: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "EZ EGY FEJLESZTŐI VÁLTOZAT, NEM ÉLES HASZNÁLATRA SZÁNT." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: A kapcsolóknak vesszőkkel elválasztott „név=érték” pároknak kell lenniük" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Érvénytelen kapcsolónév" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Érvénytelen kapcsolóérték" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nem támogatott LZMA1/LZMA2 előbeállítás: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Az lc és lp összege nem haladhatja meg a 4-et" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: --format=raw esetén, --suffix=.SUF szükséges, hacsak nem a szabványosra kimenetre ír" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: A fájlnév utótagja ismeretlen, kihagyás" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: A(z) „%s” fájlnak már van utótagja, kihagyás" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Érvénytelen fájlnév utótag" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Az érték nem nemnegatív decimális egész szám" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Érvénytelen szorzó utótag" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Az érvényes utótagok: „KiB” (2^10), „MiB” (2^20) és „GiB” (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "A(z) „%s” kapcsoló értékének a(z) [%, %] tartományban kell lennie" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "A tömörített adatokat nem lehet beolvasni a terminálból" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "A tömörített adatokat nem lehet kiírni a terminálba" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "A szabványos kimenetre írás sikertelen" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Ismeretlen hiba" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "A kiválasztott egyezéskeresőhöz legalább nice=% szükséges" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "A homokozó ki lett kapcsolva a nem kompatibilis parancssori argumentumok miatt" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "A homokozó sikeresen engedélyezve" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Memóriahasználat korlátja tömörítéskor: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Adatfolyamok: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Blokkok: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Arány: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Ellenőrzés: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Adatfolyamok:\n" +#~ " Folyam Blokkok TömEltolás KibEltolás TömMéret KibMéret Arány Ellenőrzés Keret" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blokkok:\n" +#~ " Folyam Blokkok TömEltolás KibEltolás TömMéret KibMéret Arány Ellenőrzés" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ÉrtékEll %*s Fejléc Jelzők TömMéret MemHasználat Szűrők" diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100644 index 0000000..ceeebb9 --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,28 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# This file is free software; the Free Software Foundation gives +# unlimited permission to use, copy, distribute, and modify it. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/it.gmo b/po/it.gmo new file mode 100644 index 0000000..5c0ae52 Binary files /dev/null and b/po/it.gmo differ diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..74166e6 --- /dev/null +++ b/po/it.po @@ -0,0 +1,1125 @@ +# Italian translation for xz +# This file is put in the public domain. +# Gruppo traduzione italiano di Ubuntu-it , 2009, 2010 +# Lorenzo De Liso , 2010. +# Milo Casagrande , 2009, 2010, 2011, 2014, 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2019-03-04 14:21+0100\n" +"Last-Translator: Milo Casagrande \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Launchpad-Export-Date: 2010-08-16 19:16+0000\n" +"X-Generator: Poedit 2.2.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: argomento non valido per --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: troppi argomenti per --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 può essere usato solo come ultimo elemento in --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: tipo di formato del file sconosciuto" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: tipo di controllo integrità non supportato" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Solo un file può essere specificato con \"--files\" o \"--files0\"." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "La variabile d'ambiente %s contiene troppi argomenti" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Il supporto alla compressione è stato disabilitato in fase di compilazione" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Il supporto alla decompressione è stato disabilitato in fase di compilazione" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Il numero massimo di filtri è quattro" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Il limite dell'uso della memoria è troppo basso per l'impostazione del filtro dato." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Non è consigliato usare un preset nella modalità raw." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Le opzioni esatte per i preset possono variare tra le versioni del software." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Il formato .lzma supporta solo il filtro LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 non può essere usato con il formato .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "La catena di filtri non è compatibile con --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Passaggio a modalità singolo thread poiché viene usato --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Vengono usati circa % thread." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Catena di filtri od opzioni del filtro non supportata" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "L'estrazione necessita di %s MiB di memoria." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Regolato il numero di thread da %s a %s per non eccedere il limite di utilizzo della memoria di %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Regolato il numero di thread da %s a %s per non eccedere il limite di utilizzo della memoria di %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Regolata la dimensione del dizionario LZMA%c da %s MiB a %s MiB per non superare il limite dell'uso della memoria di %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Errore nel creare una pipe: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Abilitazione modalità sandbox non riuscita" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() non riuscita: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: sembra che il file sia stato spostato, non viene rimosso" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: impossibile rimuovere: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: impossibile impostare il proprietario del file: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: impossibile impostare il gruppo del file: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: impossibile impostare i permessi del file: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Errore nel recuperare le flag di stato del file dallo standard input: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: è un collegamento simbolico, viene saltato" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: è una directory, viene saltata" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: non è un file regolare, viene saltato" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: il file ha il bit setuid o setgid impostato, viene saltato" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: il file ha lo sticky bit impostato, viene saltato" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: il file di input ha più di un collegamento fisico, viene saltato" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nome file vuoto, viene saltato" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Errore nel ripristinare le flag di stato sullo standard input: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Errore nel recuperare le flag di stato del file dallo standard output: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Errore nel ripristinare la flag O_APPEND sullo standard output: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: chiusura del file non riuscita: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: posizionamento non riuscito nel tentativo di creare un file sparso: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: errore di lettura: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: errore nel cercare il file: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: fine del file inaspettata" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: errore di scrittura: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Disabilitato" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Quantità totale di memoria fisica (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Limite utilizzo memoria per l'estrazione: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Limite di utilizzo della memoria raggiunto" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Dim. compresso: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Dim. estratto: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Padding dello stream: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Memoria necessaria: %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Dim. negli header: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Numero di file: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Totali:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nessuno" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Sconosc2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Sconosc3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Sconosc5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Sconosc6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Sconosc7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Sconosc8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Sconosc9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Sconosc11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Sconosc12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Sconosc13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Sconosc14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Sconosc15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: il file è vuoto" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: troppo piccolo per essere un file .xz valido" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " Strm Blocc. Compresso Estratto Rapp. Contr Nome file" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Sì" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "No" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versione \"XZ Utils\" minima: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s file\n" +msgstr[1] "%s file\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totali:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list funziona solamente con file .xz (--format=xz o --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list non è in grado di leggere dallo standard input" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: errore nel leggere i nomi dei file: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: fine dell'input durante la lettura dei nomi dei file non attesa" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: nessun carattere trovato durante la lettura dei nomi dei file; forse si intendeva usare \"--files0\" invece di \"--files\"?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "La compressione e l'estrazione con --robot non sono ancora supportate." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Impossibile leggere i dati dallo standard input durante la lettura dei nomi dei file dallo standard input" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Errore interno (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Impossibile stabilire i gestori dei segnali" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Nessun controllo d'integrità; l'integrità del file non viene verificata" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Tipo di controllo di integrità non supportato; l'integrità del file non viene verificata" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Limite di utilizzo della memoria raggiunto" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Formato di file non riconosciuto" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opzioni non supportate" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "I dati compressi sono danneggiati" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Fine dell'input non attesa" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB di memoria sono richiesti. Il limite è disabilitato." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB di memoria sono richiesti. Il limite è %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: catena di filtri: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Provare \"%s --help\" per maggiori informazioni." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Uso: %s [OPZIONI]... [FILE]...\n" +"Comprime o estrae i FILE nel formato .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle brevi.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Modalità di operazione:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress Forza la compressione\n" +" -d, --decompress Forza l'estrazione\n" +" -t, --test Verifica l'integrità dei file compressi\n" +" -l, --list Elenca informazioni sui file .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificatori di operazioni:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep Mantiene (non elimina) i file di input\n" +" -f, --force Forza la sovrascrittura dell'output e comprime/estrae i\n" +" collegamenti\n" +" -c, --stdout Scrive sullo standard output e non elimina i file di input" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream Decomprime solamente il primo stream e ignora\n" +" silenziosamente i restanti dati di input" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse Non crea file sparsi durante l'estrazione\n" +" -S, --suffix=.SUF Usa il suffisso \".SUF\" sui file compressi\n" +" --files=[FILE] Legge i nomi dei file da elaborare da FILE; se FILE è\n" +" omesso, i nomi dei file sono letti dallo standard input;\n" +" i nomi dei file devono essere terminati con un carattere\n" +" di newline\n" +" --files0=[FILE] Come --files ma usa il carattere null come terminatore" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Formato file di base e opzioni di compressione:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT Formato file per codificare o decodificare; i possibili\n" +" valori sono \"auto\" (predefinito) \"xz\", \"lzma\" e \"raw\"\n" +" -C, --check=CHECK Tipo di verifica integrità: \"none\" (usare con attenzione),\n" +" \"crc32\", \"crc64\" (predefinito) o \"sha256\"" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check Non verifica il codice di integrità quando decomprime" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 Preset di compressione; predefinito è 6; tenere a mente\n" +" l'utilizzo di memoria per comprimere ed estrarre prima\n" +" di usare 7-9" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme Tenta di migliorare il rapporto di compressione\n" +" utilizzando più tempo di CPU; non cambia i requisiti di\n" +" memoria in fase di estrazione" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NUM Usa al massimo NUM thread: il valore predefinito è 1,\n" +" impostare a 0 per usare tanti thread quanti core la CPU\n" +" ha a disposizione" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=DIM\n" +" Avvia un nuovo blocco .xz dopo ogni DIM byte di input:\n" +" usare per impostare la dimensione del blocco durante la\n" +" compressione con thread" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=DIM\n" +" Avvia un nuovo blocco .xz dopo gli intervalli, sperati\n" +" da virgole, di dati non compressi" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TIMEOUT\n" +" Durante la compressione, se sono passati più di TIMEOUT\n" +" millisecondi dal flush precedente e la lettura di\n" +" ulteriore input risulterebbe bloccata, viene eseguito il\n" +" flush di tutti i dati pendenti" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" Imposta il limite di utilizzo della memoria per la\n" +" compressione, l'estrazione o entrambe; LIMIT è in byte,\n" +" % della memoria RAM oppure 0 per il valore predefinito" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust Se le impostazioni di compressione eccedono il limite di\n" +" utilizzo della memoria, lancia un errore invece di\n" +" utilizzare valori più piccoli" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Catena di filtri personalizzati per la compressione (alternative per\n" +" l'utilizzo di preset):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPZ] LZMA1 o LZMA2; OPZ è un elenco separato da virgole di zero\n" +" --lzma2[=OPZ] o più delle seguenti opzioni (valori validi; predefinito):\n" +" preset=NUM Reimposta le opzioni al preset NUM (0-9[e])\n" +" dict=NUM Dimensione del dizionario\n" +" (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM Numero di bit letterali di contesto (0-4; 3)\n" +" lp=NUM Numero di bit letterali di posizione (0-4; 0)\n" +" pb=NUM Numero di bit di posizione (0-4; 2)\n" +" mode=MODE Modalità di compressione\n" +" (fast, normal; normal)\n" +" nice=NUM Lunghezza valida per una corrispondenza\n" +" (2-273; 64)\n" +" mf=NAME Strumento per cercare corrispondenze\n" +" (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM Profondità massima di ricerca; 0=automatica\n" +" (predefinito)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPZ] Filtro BCJ x86 (32 e 64 bit)\n" +" --powerpc[=OPZ] Filtro BCJ PowerPC (solo big endian)\n" +" --ia64[=OPZ] Filtro BCJ IA-64 (Itanium)\n" +" --arm[=OPZ] Filtro BCJ ARM (solo little endian)\n" +" --armthumb[=OPZ] Filtro BCJ ARM-Thumb (solo little endian)\n" +" --sparc[=OPZ] Filtro BCJ SPARC\n" +" OPZ valide per tutti i filtri BCJ:\n" +" start=NUM Offset iniziale per le conversioni\n" +" (predefinito=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPZ] Filtro Delta; OPZ valide (valori validi; predefinito):\n" +" dist=NUM Distanza tra byte sottratti\n" +" gli uni dagli altri (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Altre opzioni:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet Sopprime gli avvisi; specificare due volte per sopprimere\n" +" anche gli errori\n" +" -v, --verbose Output prolisso; specificare due volte per output ancora\n" +" più prolisso" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn Gli avvisi non influenzano lo stato d'uscita" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot Usa messaggi analizzabili (utile per gli script)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory Visualizza la quantità totale di RAM, il limite attuale\n" +" attivo di utilizzo della memore ed esce" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help Stampa l'aiuto breve (elenca solo le opzioni di base)\n" +" -H, --long-help Stampa questo lungo aiuto ed esce" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help Stampa questo breve aiuto ed esce\n" +" -H, --long-help Stampa l'aiuto lungo (elenca anche le opzioni avanzate)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version Stampa il numero della versione ed esce" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Senza FILE, o quando FILE è -, legge lo standard input.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Segnalare i bug a <%s> (in inglese o finlandese).\n" +"Segnalare i bug di traduzione a .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Sito web di %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "Questa è una versione di sviluppo non adatta per utilizzi in produzione." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: le opzioni devono essere coppie \"nome=valore\" separate da virgole" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: nome opzione non valido" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: valore dell'opzione non valido" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Preset LZMA/LZMA2 non supportato: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "La somma di lc e lp non deve superare 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva sullo stdout" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: il nome del file ha un suffisso sconosciuto, viene saltato" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: il file ha già il suffisso \"%s\", viene saltato" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: suffisso del nome del file non valido" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: il valore non è un numero intero decimale non-negativo" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: suffisso del moltiplicatore non valido" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "I suffissi validi sono \"KiB\" (2^10), \"MiB\" (2^20), e \"GiB\" (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Il valore dell'opzione \"%s\" deve essere nell'intervallo [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "I dati compressi non possono essere letti da un terminale" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "I dati compressi non possono essere scritti ad un terminale" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Scrittura sullo standard ouput non riuscita" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Errore sconosciuto" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "La modalità sandbox è disabilitata a causa di argomenti a riga di comando non compatibili" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Sandbox abilitata con successo" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Limite utilizzo memoria per la compressione: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Stream: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Blocchi: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Rapporto: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Controllo: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ "Stream:\n" +#~ " Stream Blocc. Offset comp. Offset estr. Dim. comp. Dim. estratto Rapp. Contr Padding" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blocchi:\n" +#~ " Stream Blocc. Offset comp. Offset estratto Dim. tot. Dim. estratto Rapp. Contr" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " Val.cont %*s Header Flag Dim.compr. Uso mem. Filtri" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Lo strumento per cercare corrispondenze selezionato richiede almeno nice=%" diff --git a/po/ko.gmo b/po/ko.gmo new file mode 100644 index 0000000..0e5e02f Binary files /dev/null and b/po/ko.gmo differ diff --git a/po/ko.po b/po/ko.po new file mode 100644 index 0000000..76c506b --- /dev/null +++ b/po/ko.po @@ -0,0 +1,1061 @@ +# Korean translation for the xz. +# This file is put in the public domain. +# Seong-ho Cho , 2019, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-15 23:00+0900\n" +"Last-Translator: Seong-ho Cho \n" +"Language-Team: Korean \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.3.1\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: --block-list의 인자값이 잘못됨" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: --block-list 인자 갯수가 너무 많음" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 값은 --block-list의 마지막 원소로만 사용할 수 있습니다" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: 알 수 없는 파일 형식" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: 지원하지 않는 무결성 검사 형식" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "`--files' 또는 `--files0' 옵션으로 하나의 파일만 지정할 수 있습니다." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "%s 환경 변수에 너무 많은 인자 값이 들어있습니다" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "빌드 시점에 압축 기능을 비활성했습니다" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "빌드 시점에 압축 해제 기능을 비활성했습니다" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "lzip 파일(.lz) 압축은 지원하지 않습니다" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "최대 필터 갯수는 4 입니다" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "주어진 필터 설정으로는 메모리 사용 제한 값이 너무 적습니다." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "RAW 모드에서의 프리셋 사용은 권장하지 않습니다." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "프리셋의 정확한 옵션 값은 프로그램 버전에 따라 다릅니다." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr ".lzma 형식은 LZMA1 필터만 지원합니다" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr ".xz 형식에는 LZMA1 필터를 사용할 수 없습니다" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "--flush-timeout 옵션에는 필터 체인이 맞지 않습니다" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "--flush-timeout 옵션을 지정하였으므로 단일 스레드 모드로 전환합니다" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "최대 % 스레드를 사용합니다." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "지원하지 않는 필터 체인 또는 필터 옵션" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "압축 해제시 %s MiB 메모리 용량이 필요합니다." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "메모리 사용량 %s MiB 제한을 넘지 않으려 스레드 수를 %s(에)서 %s(으)로 줄였습니다" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "스레드 수가 %s(에)서 하나로 줄었습니다. 메모리 사용 자동 제한량 %s MiB를 여전히 초과합니다. 메모리 공간 %s MiB가 필요합니다. 어쨌든 계속합니다." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "메모리 사용량 %s MiB 제한을 넘지 않으려 단일 스레드 모드로 전환합니다" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "메모리 사용량 %4$s MiB 제한을 넘지 않으려 %2$s MiB에서 %3$s MiB로 LZMA%1$c 딕셔너리 크기를 조정했습니다" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "파이프 생성 오류: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "샌드 박스 활성화 실패" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() 실패: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: 파일을 이동한 것 같음, 제거 안함" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: 제거할 수 없음: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: 파일 소유자를 설정할 수 없음: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: 파일 소유 그룹을 설정할 수 없음: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: 파일 권한을 설정할 수 없음: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "표준 입력에서 파일 상태 플래그 가져오기 오류: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: 심볼릭 링크, 건너뜀" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: 디렉터리입니다, 건너뜀" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: 일반 파일 아님, 건너뜀" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: setuid 또는 setgid 비트 설정 있음, 건너뜀" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: 끈적이 비트 설정이 있는 파일, 건너뜀" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: 입력 파일에 하나 이상의 하드링크가 있습니다, 건너뜀" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "파일 이름 없음, 건너뜀" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "표준 입력으로의 상태 플래그 복원 오류: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "표준 출력에서 파일 상태 플래그 가져오기 오류: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "표준 출력으로의 O_APPEND 플래그 복원 오류: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: 파일 닫기 실패: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: 분할 파일 생성 시도시 탐색 실패: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: 읽기 오류: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: 파일 탐색 오류: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: 예상치 못한 파일의 끝" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: 쓰기 오류: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "사용 안함" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "물리 메모리 양(RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "프로세서 스레드 수:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "압축:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "압축해제:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "멀티 스레드 압축 해제:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "-T0 기본값:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "하드웨어 정보:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "메모리 사용량 제한:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "스트림:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "블록 수:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "압축 용량:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "압축해제 용량:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "압축율:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "검사:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "스트림 패딩:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "요구 메모리:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "헤더 길이:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "파일 갯수:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "스트림" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "블록" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "블록" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "압축오프셋" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "압축해제오프셋" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "압축크기" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "압축해제크기" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "총크기" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "압축율" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "검사" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "검사값" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "패딩" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "헤더" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "플래그" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "메모리사용" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "필터" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "없음" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "알 수 없음-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "알 수 없음-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "알 수 없음-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "알 수 없음-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "알 수 없음-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "알 수 없음-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "알 수 없음-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "알 수 없음-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "알 수 없음-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "알 수 없음-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "알 수 없음-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "알 수 없음-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: 파일 내용 없음" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: 유효한 .xz 파일로 보기에는 너무 작습니다" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "스트림 블록 압축 압축해제 압축율 검사 파일 이름" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "예" + +# 주: 아니오가 아니라 아니요가 맞는 표현 +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "아니요" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " 최소 XZ Utils 버전: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "파일 %s개\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "총:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list 옵션은 .xz 파일에만 동작합니다(--format=xz 또는 --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list 옵션은 표준 입력 읽기를 지원하지 않습니다" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: 파일 이름 읽기 오류: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: 파일 이름 읽는 중 예상치 못한 입력 끝" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: 파일 이름을 읽는 도중 NULL 문자 발견. `--files' 옵션 대신 `--files0' 옵션을 사용하시려는게 아닙니까?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "아직 압축 동작과 압축 해제 동작에 --robot 옵션을 지원하지 않습니다." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "표준 출력에서 파일 이름을 읽을 때 표준 입력에서 데이터를 읽을 수 없습니다" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "내부 오류(버그)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "시그널 처리자를 준비할 수 없습니다" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "무결성 검사 안함. 파일 무결성을 검증하지 않습니다" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "지원하지 않는 무결성 검사 형식. 파일 무결성을 검증하지 않습니다" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "메모리 사용량 한계에 도달했습니다" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "파일 형식을 인식할 수 없음" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "지원하지 않는 옵션" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "압축 데이터 깨짐" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "예상치 못한 입력 끝" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB 메모리 용량이 필요합니다. 제한을 비활성합니다." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB 메모리 용량이 필요합니다. 제한 값은 %s 입니다." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: 필터 체인: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "자세한 사용법은 `%s --help'를 입력하십시오." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"사용법: %s [<옵션>]... [<파일>]...\n" +".xz 형식으로 <파일> 다수를 압축(해제)합니다.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "긴 옵션 버전의 필수 인자는 짧은 옵션 버전에도 해당합니다.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " 동작 방식:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress 압축 강제\n" +" -d, --decompress 압축 해제 강제\n" +" -t, --test 압축 파일 무결성 검사\n" +" -l, --list .xz 파일 정보 출력" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" 동작 지정:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep 입력 파일을 유지합니다(삭제 안함)\n" +" -f, --force 출력 파일을 강제로 덮어쓰고 링크도 압축(해제)합니다\n" +" -c, --stdout 표준 출력으로 기록하고 입력 파일을 삭제하지 않습니다" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream 첫번째 스트림만 압축해제하며, 나머지 입력 데이터는\n" +" 조용히 무시합니다" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse 압축 해제에 활용할 분할 파일을 만들지 않음\n" +" -S, --suffix=.<확장자>\n" +" 압축 파일 확장자에 `.<확장자>'를 사용합니다\n" +" --files[=<파일>]\n" +" <파일> 에서 처리할 파일 이름을 읽습니다. <파일>을\n" +" 생략하면 표준 입력에서 파일 이름을 읽습니다.\n" +" 파일 이름은 개행 문자로 끝나야합니다\n" +" --files0[=<파일>]\n" +" --files 옵션과 비슷하지만 NULL 문자로 끝납니다" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" 기본 파일 형식 및 압축 옵션:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=<형식> 인코딩 디코딩할 파일 형식입니다. 가능한 값:\n" +" `auto' (기본), `xz', `lzma', `lzip', `raw'\n" +" -C, --check=<검사> 무결성 검사 형식: `none'(위험),\n" +" `crc32', `crc64'(기본), `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check 압축 해제시 무결성 검사를 수행하지 않습니다" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 압축 프리셋. 기본값은 6 입니다. 7-9를 사용하려면 입축\n" +" 메모리 사용량*과* 압축 해제 메모리 사용량을 지정하십시오!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme CPU 점유시간을 더 확보하여 압축률을 개선합니다.\n" +" 압축 해제시 메모리 요구 용량에는 영향을 주지 않습니다" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=<개수>\n" +" 최대 스레드 <개수>를 사용합니다. 기본값은 1 입니다\n" +" 실제 프로세서 코어만큼의 스레드를 사용하려면 0 값으로\n" +" 지정합니다" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=<크기>\n" +" 모든 <크기>의 입력 다음 새 .xz 블록을 시작합니다.\n" +" 스레드 압축에 블록 크기를 지정할 때 사용합니다" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=<크기>\n" +" 콤마로 구분한 연속 지정값 만큼 압축해제한 데이터 용량을\n" +" 넘긴 후 새 .xz 블록을 시작합니다" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=<제한시간>\n" +" 앞서 플러싱한 후 더 많은 블록 입력을 읽어들일 때 밀리초\n" +" 단위 <제한시간>을 넘기면 모든 대기 데이터를\n" +" 플러싱아웃합니다" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=<제한용량>\n" +" --memlimit-decompress=<제한용량>\n" +" --memlimit-mt-decompress=<제한용량>\n" +" -M, --memlimit=<제한용량>\n" +" 압축, 압축해제, 또는 각각의 경우에 대한 메모리 사용량\n" +" 제한값을 설정합니다. <제한용량> 값 단위는 바이트 또는 램\n" +" 용량 백분율이며, 기본 값은 0 입니다" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust 압축 설정이 메모리 사용량 제한을 넘어서면\n" +" 설정 값을 줄이는 대신 오류 정보를 나타냅니다" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" 압축용 개별 필터 체인 설정(사전 설정 사용을 대신함):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=<옵션>] LZMA1 또는 LZMA2. <옵션>은 하나도 지정하지 않거나,\n" +" --lzma2[=<옵션>] 다음 옵션 중 한개 이상을 쉼표로 구분하여 지정합니다\n" +" (유효값, 기본값):\n" +" preset=<프리셋> 옵션을 <프리셋>값으로 초기화(0-9[e])\n" +" dict=<숫자> 딕셔너리 크기(4KiB - 1536MiB, 8MiB)\n" +" lc=<숫자> 리터럴 컨텍스트 비트 수(0-4, 3)\n" +" lp=<숫자> 리터럴 위치 비트 수(0-4, 0)\n" +" pb=<숫자> 위치 비트 갯수(0-4, 2)\n" +" mode=<모드> 압축 모드 fast 또는 normal, normal)\n" +" nice=<숫자> nice 일치 길이 값(2-273, 64)\n" +" mf=<이름> 일치 탐색기(hc3, hc4, bt2, bt3, bt4\n" +" 중 하나. bt4)\n" +" depth=<숫자> 최대 검색 깊이. 0=자동(기본값)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=<옵션>] x86 BCJ 필터(32-bit, 64-bit)\n" +" --arm[=<옵션>] ARM BCJ 필터\n" +" --armthumb[=<옵션>] ARM-Thumb BCJ 필터\n" +" --arm64[=<옵션>] ARM64 BCJ 필터\n" +" --powerpc[=<옵션>] PowerPC BCJ 필터 (빅 엔디언 전용)\n" +" --ia64[=<옵션>] IA-64 (아이태니엄) BCJ 필터\n" +" --sparc[=<옵션>] SPARC BCJ 필터\n" +" 모든 BCJ 필터의 유효한 <옵션>:\n" +" start=<숫자> 변환 시작 오프셋(기본값=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=<옵션>] 델타 필터. 유효한 <옵션> (유효값, 기본값):\n" +" dist=<숫자> 각 바이트 값의 차이 값\n" +" (1-256, 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +"기타 옵션:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet 경고 메시지 끔. 오류 메시지도 끄려면 두번 지정합니다\n" +" -v, --verbose 자세히 표시. 더 자세히 표시하려면 두번 지정합니다" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn 경고가 종료 상태에 영향을 주지 않게합니다" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot 기계 해석용 메시지를 사용합니다(스크립트에 적합)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory 총 사용 메모리양과 현재 활성 메모리 사용 제한 값을\n" +" 표시하고 빠져나갑니다" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help 간단한 도움말을 표시합니다(기본 옵션만 나열)\n" +" -H, --long-help 긴 도움말을 표시하고 빠져나갑니다" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help 간단한 도움말을 표시하고 빠져나갑니다\n" +" -H, --long-help 긴 도움말을 표시합니다(고급 옵션도 나열)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version 버전 번호를 표시하고 빠져나갑니다" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"<파일> 값이 없거나, <파일> 값이 - 문자이면, 표준 입력을 읽습니다.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "<%s> (영문 또는 핀란드어)에 버그를 보고하십시오.\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s 홈페이지: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "!! 주의 !! 개발 버전이며 실제 사용 용도가 아닙니다." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: 옵션은 쉼표로 구분한 `이름=값' 쌍이어야합니다" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: 잘못된 옵션 이름" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: 잘못된 옵션 값" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "지원하지 않는 LZMA1/LZMA2 프리셋: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "lc값과 lp값의 합이 4를 초과하면 안됩니다" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: 표준 출력으로 기록하지 않는 한 --format=raw, --suffix=.SUF 옵션이 필요합니다" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: 파일 이름에 알 수 없는 확장자 붙음, 건너뜀" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: 파일에 이미 `%s' 확장자가 붙음, 건너뜀" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: 잘못된 파일 이름 확장자" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: 값은 10진 양수입니다" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: 잘못된 승수 후위 단위" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "유효한 후위 단위는 `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30) 입니다." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "`%s' 옵션 값은 범위[%, %] 안에 있어야 합니다" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "압축 데이터를 터미널에서 읽을 수 없습니다" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "압축 데이터를 터미널에 기록할 수 없습니다" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "표준 출력 기록 실패" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "알 수 없는 오류" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "선택한 일치 탐색기는 최소한 nice=% 상태여야합니다" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "비호환 명령행 인자값이 있어 샌드박스를 비활성했습니다" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "샌드 박스 활성화에 성공했습니다" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "압축 메모리 사용 제한량: " + +#~ msgid " Streams: %s\n" +#~ msgstr " 스트림: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " 블록: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " 압축률: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " 검사: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " 스트림:\n" +#~ " 스트림 블록 압축오프셋 압축해제 오프셋 압축용량 압축해제용량 압축율 검사 패딩" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " 블록:\n" +#~ " 스트림 블록 압축오프셋 압축해제오프셋 총용량 압축해제용량 압축율 검사" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " CheckVal %*s Header 플래그 압축용량 메모리사용량 필터" diff --git a/po/pl.gmo b/po/pl.gmo new file mode 100644 index 0000000..5eb2167 Binary files /dev/null and b/po/pl.gmo differ diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 0000000..fa5b16a --- /dev/null +++ b/po/pl.po @@ -0,0 +1,1027 @@ +# Polish translation for xz. +# This file is put in the public domain. +# Jakub Bogusz , 2011-2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-10 18:02+0100\n" +"Last-Translator: Jakub Bogusz \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Błędny argument dla --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Zbyt dużo argumentów dla --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 w --block-list może być użyte wyłącznie jako ostatni element" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Nieznany typ formatu pliku" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Nieobsługiwany typ kontroli spójności" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Wraz z opcją `--files' lub `--files0' można podać tylko jeden plik." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Zmienna środowiskowa %s zawiera zbyt dużo argumentów" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Obsługa kompresji została wyłączona na etapie budowania" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Obsługa dekompresji została wyłączona na etapie budowania" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Kompresja plików lzip (.lz) nie jest osbługiwana" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maksymalna liczba filtrów to cztery" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Limit użycia pamięci jest zbyt mały dla podanej konfiguracji filtra." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Dokładne opcje ustawień predefiniowanych mogą różnić się między wersjami oprogramowania." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Format .lzma obsługuje tylko filtr LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 nie może być używany z formatem .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Łańcuch filtrów jest niezgodny z --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Przełączanie w tryb jednowątkowy z powodu --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Maksymalna liczba używanych wątków: %." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Dekompresja będzie wymagała %s MiB pamięci." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Zmniejszono liczbę wątków z %s do %s, aby nie przekroczyć limitu użycia pamięci %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Zmniejszono liczbę wątków z %s do jednego. Automatyczny limit użycia pamięci %s MiB jest nadal przekroczony - wymagane jest %s MiB. Kontynuacja mimo to." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Przełączenie w tryb jednowątkowy, aby nie przekroczyć limitu użycia pamięci %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Skorygowano rozmiar słownika LZMA%c z %s MiB do %s MiB aby nie przekroczyć limitu użycia pamięci %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Błąd tworzenia potoku: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Nie udało się włączyć piaskownicy" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() nie powiodło się: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Plik wygląda na przeniesiony, nie zostanie usunięty" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Nie można usunąć: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Nie można ustawić właściciela pliku: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Nie można ustawić grupy pliku: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Nie można ustawić uprawnień pliku: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Błąd podczas pobierania flag stanu pliku ze standardowego wejścia: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Jest dowiązaniem symbolicznym, pominięto" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Jest katalogiem, pominięto" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Nie jest zwykłym plikiem, pominięto" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Plik ma ustawiony bit setuid lub setgid, pominięto" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Plik ma ustawiony bit sticky, pominięto" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Plik wejściowy ma więcej niż jedno dowiązanie zwykłe, pominięto" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Pusta nazwa pliku, pominięto" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Błąd podczas odtwarzania flag stanu dla standardowego wejścia: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Błąd podczas pobierania flag stanu pliku ze standardowego wyjścia: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Błąd podczas odtwarzania flagi O_APPEND dla standardowego wyjścia: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Zamknięcie pliku nie powiodło się: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Zmiana pozycji nie powiodła się podczas próby utworzenia pliku rzadkiego: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Błąd odczytu: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Błąd podczas zmiany pozycji w pliku: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Nieoczekiwany koniec pliku" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Błąd zapisu: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Wyłączony" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Rozmiar pamięci fizycznej (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Liczba wątków procesora:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Kompresja:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Dekompresja:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Dekompresja wielowątkowa:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Domyślnie dla -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Informacje o sprzęcie:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Limity użycia pamięci" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Strumienie:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Bloki:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Rozmiar spakowany:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Rozmiar rozpakowany:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Współczynnik:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Kontrola spójności:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Wyrównanie strumienia:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Wymagana pamięć:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Rozmiar w nagłówkach:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Liczba plików:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Strumień" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Blok" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Bloki" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "Offset spak." + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "Offset rozp." + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "Rozm.spak." + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "Rozm.rozp." + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Rozm.całk." + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Wsp." + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Kontrola" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "S.kontr." + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Wyrównanie" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Nagłówek" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Flagi" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "Uż.pamięci" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filtry" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Brak" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Nieznany-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Nieznany-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Nieznany-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Nieznany-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Nieznany-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Nieznany-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Nieznany-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Nieznany11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Nieznany12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Nieznany13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Nieznany14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Nieznany15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Plik jest pusty" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Za mały na poprawny plik .xz" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Tak" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nie" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Minimalna wersja XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s plik\n" +msgstr[1] "%s pliki\n" +msgstr[2] "%s plików\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Sumarycznie:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list działa tylko z plikami .xz (--format=xz lub --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list nie obsługuje odczytu ze standardowego wejścia" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Błąd odczytu nazw plików: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Nieoczekiwany koniec wejścia podczas odczytu nazw plików" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Napotkano znak NUL podczas odczytu nazw plików; może miało być `--files0' zamiast `--files'?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Kompresja i dekompresja z opcją --robot nie jest jeszcze obsługiwana." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Nie można odczytać danych ze standardowego wejścia przy czytaniu nazw plików ze standardowego wejścia" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Błąd wewnętrzny" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Nie można ustawić obsługi sygnałów" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Brak kontroli spójności; poprawność plików nie będzie weryfikowana" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Nieobsługiwany typ kontroli spójności; poprawność plików nie będzie weryfikowana" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Osiągnięto limit użycia pamięci" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Nie rozpoznany format pliku" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Nieobsługiwane opcje" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Dane skompresowane są uszkodzone" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Nieoczekiwany koniec wejścia" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Wymagane jest %s MiB pamięci. Limit jest wyłączony." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Wymagane jest %s MiB pamięci. Limit to %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Łańcuch filtrów: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Polecenie `%s --help' pokaże więcej informacji." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Składnia: %s [OPCJA]... [PLIK]...\n" +"Kompresja lub dekompresja PLIKÓW w formacie .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Argumenty obowiązkowe dla opcji długich są obowiązkowe również dla opcji\n" +"krótkich.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Tryb pracy:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress wymuszenie kompresji\n" +" -d, --decompress wymuszenie dekompresji\n" +" -t, --test sprawdzenie spójności plików skompresowanych\n" +" -l, --list wypisanie informacji o plikach .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modyfikatory operacji:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep zachowanie (nieusuwanie) plików wejściowych\n" +" -f, --force nadpisywanie plików wyjściowych i (de)kompresja dowiązań\n" +" -c, --stdout zapis na standardowe wyjście, nieusuwanie plików wej." + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream dekompresja tylko pierwszego strumienia, ciche\n" +" zignorowanie pozostałych danych wejściowych" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse nietworzenie plików rzadkich podczas dekompresji\n" +" -S, --suffix=.ROZ użycie rozszerzenia `.ROZ' dla plików skompresowanych\n" +" --files[=PLIK] odczyt nazw plików do przetworzenia z PLIKU; jeśli PLIK\n" +" nie został podany, nazwy są czytane ze standardowego\n" +" wejścia; muszą być zakończone znakiem nowej linii\n" +" --files0[=PLIK] podobnie do --files, ale znakiem kończącym musi być NUL" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Podstawowe opcje formatu pliku i kompresji:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FORM format pliki do kodowania lub dekodowania; możliwe to\n" +" `auto' (domyślny), `xz', 'lzma', `lzip' i `raw'\n" +" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n" +" `crc32', `crc64' (domyślny) lub `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check bez kontroli sprawdzania integralności przy dekompresji" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 predefiniowane opcje kompresji; domyślna to 6; przed\n" +" użyciem wartości 7-9 należy wziąć pod uwagę wykorzystanie\n" +" pamięci przy kompresji *oraz* dekompresji!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme próba poprawy współczynnika kompresji z użyciem większej\n" +" ilości czasu procesora; nie wpływa na wymagania\n" +" pamięciowe dekompresora" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=ILE użycie maksymalnie ILU wątków; domyślnie 1; 0 oznacza\n" +" tyle, ile jest rdzeni procesorów" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=ROZMIAR\n" +" rozpoczęcie nowego bloku .xz co ROZMIAR bajtów wejścia;\n" +" opcja służy do ustawienia rozmiaru bloku dla kompresji\n" +" wielowątkowej" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=ROZMIARY\n" +" rozpoczęcie nowego bloku .xz po rozdzielonych przecinkiem\n" +" przedziałach danych nieskompresowanych" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=CZAS\n" +" przy kompresji, jeśli minęło więcej niż CZAS milisekund\n" +" ostatniegu zapisu bloku, a odczyt kolejnych danych byłby\n" +" blokujący, wszystkie gotowe dane są zapisywane" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" ustawienie limitu użycia pamięci dla kompresji,\n" +" dekompresji, dekompresji wielowątkowej lub wszystkich;\n" +" LIMIT jest w bajtach, % RAM lub 0 dla limitów domyślnych" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust jeśli ustawienia kompresji przekraczają limit użycia\n" +" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n" +" ustawień" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPCJE] LZMA1 lub LZMA2; OPCJE to oddzielona przecinkami lista\n" +" --lzma2[=OPCJE] zera lub więcej następujących opcji (w nawiasach wartości\n" +" poprawne; domyślne):\n" +" preset=PRE ustawienie opcji na predefiniowane (0-9[e])\n" +" dict=ILE rozmiar słownika (4KiB - 1536MiB; 8MiB)\n" +" lc=ILE liczba bitów kontekstu literału (0-4; 3)\n" +" lp=ILE liczba bitów pozycji literału (0-4; 0)\n" +" pp=ILE liczba bitów pozycji (0-4; 2)\n" +" mode=TRYB tryb kompresji (fast, normal; normal)\n" +" nice=ILE długość dopasowania (2-273; 64)\n" +" mf=NAZWA dopasowywacz (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=ILE maks. głębokość szukania; 0=auto (domyślne)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPCJE] Filtr BCJ x86 (32-bitowy lub 64-bitowy)\n" +" --arm[=OPCJE] Filtr BCJ ARM\n" +" --armthumb[=OPCJE] Filtr BCJ ARM-Thumb\n" +" --arm64[=OPCJE] Filtr BCJ ARM64\n" +" --powerpc[=OPCJE] Filtr BCJ PowerPC (tylko big-endian)\n" +" --ia64[=OPCJE] Filtr BCJ IA-64 (Itanium)\n" +" --sparc[=OPCJE] Filtr BCJ SPARC\n" +" Poprawne OPCJE dla wszystkich filtrów BCJ:\n" +" start=ILE offset początku konwersji (domyślnie=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPCJE] Filtr delta; poprawne OPCJE (poprawne wart.; domyślne):\n" +" dist=ILE odległość między bajtami odejmowanymi od\n" +" siebie (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Inne opcje:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet pominięcie ostrzeżeń; dwukrotne podanie pomija też błędy\n" +" -v, --verbose więcej informacji; dwukrotne podanie to jeszcze więcej" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn ostrzeżenia nie mają wpływu na status zakończenia" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory wyświetlenie całkowitej ilości pamięci RAM oraz aktualnie\n" +" aktywnych limitów pamięci i zakończenie pracy" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help wyświetlenie krótkiego opisu (tylko podstawowe opcje)\n" +" -H, --long-help wyświetlenie tego długiego opisu i zakończenie" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help wyświetlenie tego krótkiego opisu i zakończenie\n" +" -H, --long-help wyświetlenie długiego opisu (także opcje zaawansowane)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Jeśli nie podano PLIKU lub PLIK to -, czytane jest standardowe wejście.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Błędy prosimy zgłaszać na adres <%s>\n" +"(w języku angielskim lub fińskim).\n" +"Błędy w tłumaczeniu prosimy zgłaszać na adres\n" +".\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Strona domowa %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "TA WERSJA JEST ROZWOJOWA, NIE PRZEZNACZONA DO UŻYTKU PRODUKCYJNEGO." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Opcje muszą być parami `nazwa=wartość' rozdzielonymi przecinkami" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Błędna nazwa opcji" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Błędna wartość opcji" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Nieobsługiwane ustawienie predefiniowane LZMA1/LZMA2: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Suma lc i lp nie może przekroczyć 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Przy --format=raw i zapisie do pliku wymagana jest opcja --suffix=.ROZ" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Plik już ma rozszerzenie `%s', pominięto" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Błędne rozszerzenie nazwy pliku" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Wartość nie jest nieujemną liczbą całkowitą" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Błędny przyrostek mnożnika" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Poprawne przyrostki to `KiB' (2^10), `MiB' (2^20) i `GiB' (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Wartość opcji `%s' musi być w przedziale [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Dane skompresowane nie mogą być czytane z terminala" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Dane skompresowane nie mogą być zapisywane na terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Zapis na standardowe wyjście nie powiódł się" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Nieznany błąd" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%" diff --git a/po/pt.gmo b/po/pt.gmo new file mode 100644 index 0000000..1f4c0fd Binary files /dev/null and b/po/pt.gmo differ diff --git a/po/pt.po b/po/pt.po new file mode 100644 index 0000000..184af10 --- /dev/null +++ b/po/pt.po @@ -0,0 +1,1138 @@ +# Portuguese (Portugal) Translation for the xz Package +# This file is put in the public domain. +# . +# Pedro Albuquerque , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2019-09-27 08:08+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: argumento inválido para --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: demasiados argumentos para --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 só pode ser usado como o último elemento em --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: tipo de formato de ficheiro desconhecido" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: tipo de verificação de integridade não suportado" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Só pode especificar um ficheiro com \"--files\" ou \"--files0\"." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "A variável de ambiente %s contém demasiados argumentos" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "O suporte a compressão foi desactivado ao compilar" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "O suporte a descompressão foi desactivado ao compilar" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "O número máximo de filtros é quatro" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "O limite de uso de memória é baixo demais para a configuração de filtro dada." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "O uso de uma predefinição em modo bruto é desencorajado." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "As opções exactas de predefinições podem variar entre versões do programa." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "O formato .lzma tem só suporta o filtro LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Impossível utilizar LZMA1 com o formato .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "A cadeia de filtros é incompatível com --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "A mudar para o modo de linha única devido a --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "A usar até % linhas." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Opções de filtro ou cadeia de filtros não suportadas" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "A descompressão precisará de %s MiB de memória." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o número de linhas de %s de %s para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o número de linhas de %s de %s para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o tamanho de dicionário de LZMA%c de %s MiB para %s MiB para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Erro ao criar um túnel: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Falha ao activar a Sandbox" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() falhou: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: o ficheiro parece ter sido movido, não será eliminado" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: impossível remover: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: impossível definir o proprietário do ficheiro: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: impossível definir o grupo do ficheiro: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: impossível definir as permissões do ficheiro: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Erro ao obter as bandeiras de estado da entrada padrão: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: é uma ligação simbólica, a ignorar" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: é uma pasta, a ignorar" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: não é um ficheiro normal, a ignorar" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: o ficheiro tem o bit setuid ou setgid definido, a ignorar" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: o ficheiro tem o bit sticky definido, a ignorar" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: o ficheiro de entrada tem mais de uma ligação absoluta, a ignorar" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nome de ficheiro vazio, a ignorar" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Erro ao restaurar as bandeiras de estado para a entrada padrão: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Erro ao obter as bandeiras de estado do ficheiro da saída padrão: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Erro ao restaurar a bandeira O_APPEND para a saída padrão: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: falha ao fechar o ficheiro: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: falha na procura ao tentar criar um ficheiro escasso: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: erro de leitura: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: erro ao procurar o ficheiro: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: fim de ficheiro inesperado" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: erro de escrita: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Desactivado" + +# Espaços adicionados para manter alinhamento com mensagens adjacentes -- Rafael +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Quantidade total de memória física (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +# Espaços reduzidos para manter alinhamento com mensagens adjacentes -- Rafael +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Limite de uso de memória para descompressão: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Limite de uso de memória alcançado" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Tam. comprimido: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Tam. descomprimido: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Espaço do fluxo: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Memória requerida: %s MiB\n" + +# Espaço adicionado para promover alinhamento, vide "xz -lvv foo.xz" +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Tam. em cabeçalhos: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Nº. de ficheiros: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Totais:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nenhum" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "SemNome-2" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "SemNome-3" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "SemNome-5" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "SemNome-6" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "SemNome-7" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "SemNome-8" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "SemNome-9" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "SemNome-11" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "SemNome-12" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "SemNome-13" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "SemNome-14" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "SemNome-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: o ficheiro está vazio" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: muito pequeno para um ficheiro .xz válido" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Fluxos Blocos Comprimido Descomprimido Rácio Verif. Nome de ficheiro" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Sim" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Não" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versão mínima do XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s ficheiro\n" +msgstr[1] "%s ficheiros\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totais:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list só funciona em ficheiros .xz (--format=xz ou --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list não suporta a leitura da entrada padrão" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: erro ao ler nomes de ficheiro: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: fim de entrada inesperado ao ler nomes de ficheiros" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: encontrado carácter nulo ao ler nomes de ficheiro; talvez queira usar \"--files0\" em vez de \"--files\"?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Compressão e descompressão com --robot ainda não são suportadas." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Impossível ler dados da entrada padrão ao ler nomes de ficheiro da entrada padrão" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Erro interno (erro)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Impossível estabelecer gestores de sinais" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Sem teste de integridade; a integridade do ficheiro não será verificada" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Tipo de verificação de integridade não suportada; a integridade do ficheiro não será verificada" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Limite de uso de memória alcançado" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Formato de ficheiro não reconhecido" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opções não suportadas" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Os dados comprimidos estão corrompidos" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Fim de entrada inesperado" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "São necessários %s MiB de memória. O limitador está desactivado." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "São necessários %s MiB de memória. O limite é %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: cadeia de filtros: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Tente \"%s --help\" para mais informações." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Uso: %s [OPÇÕES]... [FICHEIRO]...\n" +"Comprime ou descomprime FICHEIROs no formato .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Argumentos obrigatórios para opções longas são também obrigatórios para\n" +"opções curtas.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Modo de operação:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress força a compressão\n" +" -d, --decompress força a descompressão\n" +" -t, --test testa a integridade do ficheiro comprimido\n" +" -l, --list lista informações sobre ficheiros .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificadores de operações:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep mantém (não elimina) os ficheiros de entrada\n" +" -f, --force força a sobreposição do ficheiro de saída e a \n" +" (des)compressão de ligações\n" +" -c, --stdout escreve na saída padrão e não elimina os ficheiros de\n" +" entrada" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream descomprime só o primeiro fluxo e ignora silenciosamente\n" +" possíveis dados de entrada restantes" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse não cria ficheiros escassos ao descomprimir\n" +" -S, --suffix=.SUF usa o sufixo \".SUF\" em ficheiros comprimidos\n" +" --files[=FICH] lê nomes de ficheiros para processar de FICH;\n" +" se FICH for omitido, os nomes de ficheiros são\n" +" lidos da entrada padrão; os nomes de ficheiros\n" +" devem ser terminados com o carácter de nova linha\n" +" --files0[=FICH] igual a --files, mas usa o carácter nulo como terminador" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Opções básicas de formato e compressão de ficheiro:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT formato de ficheiro a codificar ou descodificar; os\n" +" valores possíveis são \"auto\" (predefinição), \"xz\",\n" +" \"lzma\" e \"raw\"\n" +" -C, --check=TESTE tipo de teste de integridade: \"none\" (cuidado!),\n" +" \"crc32\", \"crc64\" (predefinição) ou \"sha256\"" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check não verifica a integridade ao descomprimir" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 predefinição de compressão; a predefinição é 6; tenha em\n" +" conta o uso de memória do compressor *e* descompressor\n" +" antes de usar 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme tenta melhorar o rácio de compressão usando mais tempo de\n" +" CPU; não afecta os requisitos de memória do descompressor" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NÚM usa no máximo NÚM linhas; a predefinição é 1; defina para\n" +" 0 para usar tantas linhas como núcleos de processadores\n" +" haja" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=TAM\n" +" inicia novo bloco .xz após cada TAM bytes de entrada;\n" +" use para definir o tamanho de bloco para compressão com\n" +" linhas" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=TAM\n" +" inicia um novo bloco .xz após os intervalos dados,\n" +" separados por vírgulas, de dados descomprimidos" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=EXPIRA\n" +" ao comprimir, se mais de EXPIRA milissegundos tiverem\n" +" passado desde o despejo anterior e ler mais dados da\n" +" entrada bloquearia, todos os dados pendentes serão\n" +" despejados" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMITE\n" +" --memlimit-decompress=LIMITE\n" +" -M, --memlimit=LIMITE\n" +" define o limite de uso de memória para compressão,\n" +" descompressão ou ambos; LIMITE é em bytes, % de RAM ou 0\n" +" para predefinições" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust se as configurações de compressão excederem o limite de\n" +" uso de memória, devolve um erro em vez de reduzir as\n" +" configurações" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Cadeia de filtros personalizada para compressão (alternativa às predefinições):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPÇÕES] LZMA1 ou LZMA2; OPÇÕES é uma lista separada por vírgulas\n" +" de zero ou mais das opções abaixo (valores válidos,\n" +" --lzma2[=OPÇÕES] predefinição):\n" +" preset=PRE repõe as opções para predefinição (0-9[e])\n" +" dict=NÚM tamanho do dicionário (4KiB - 1536MiB; 8MiB)\n" +" lc=NÚM número de bits de contexto literal (0-4; 3)\n" +" lp=NÚM número de bits de posição literal (0-4; 0)\n" +" pb=NÚM número de bits de posição (0-4; 2)\n" +" mode=MODO modo de compressão (fast, normal; normal)\n" +" nice=NÚM tamanho agradável de correspondência (2-273;\n" +" 64)\n" +" mf=NOME localizador de correspondência (hc3, hc4,\n" +" bt2, bt3, bt4; bt4)\n" +" depth=NUM máximo de profundidade de pesquisa;\n" +" 0=automatic (predefinição)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPÇÕES] filtro BCJ x86 (32 bits e 64 bits)\n" +" --powerpc[=OPÇÕES] filtro BCJ PowerPC (só big endian)\n" +" --ia64[=OPÇÕES] filtro BCJ IA-64 (Itanium)\n" +" --arm[=OPÇÕES] filtro BCJ ARM (só little endian)\n" +" --armthumb[=OPÇÕES] filtro BCJ ARM-Thumb (só little endian)\n" +" --sparc[=OPÇÕES] filtro BCJ SPARC\n" +" OPÇÕES válidas para todos os filtros BCJ:\n" +" start=NUM desvio inicial para conversões\n" +" (predefinição=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPÇÕES] filtro delta; OPÇÕES válidas (valores válidos,\n" +" predefinição):\n" +" dist=NÚM distância entre bytes a serem subtraídos\n" +" de cada um (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Outras opções:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet suprime avisos, use duas vezes para suprimir também erros\n" +" -v, --verbose é verboso; use duas vezes para ainda mais verbosidade" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn fazer avisos não afecta o estado da saída" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot usa mensagens analisáveis por máquina (útil para scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory mostra a quantidade total de RAM e os limites de uso\n" +" de memória actualmente activos e sai" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help mostra a ajuda curta (lista só as opções básicas)\n" +" -H, --long-help mostra esta mensagem de ajuda e sai" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help mostra esta mensagem de ajuda e sai\n" +" -H, --long-help mostra a ajuda longa (lista também as opções avançadas)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version mostra o número da versão e sai" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Sem FICH, ou quando FICH é -, lê da entrada padrão.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Reporte erros em <%s> (em inglês ou finlandês).\n" +"Relate erros de tradução em .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Página inicial %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ESTA É UMA VERSÃO DE DESENVOLVIMENTO NÃO DESTINADA A USO EM PRODUÇÃO." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: as opções devem ser pares \"nome=valor\" separados por vírgulas" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: nome de opção inválido" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: valor de opção inválido" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Predefinição LZMA1/LZMA2 não suportada: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "A soma de lc e lp não deve exceder 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: com --format=raw, --suffix=.SUF é requerido, a menos que seja escrito em stdout" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: nome de ficheiro com sufixo desconhecido, a ignorar" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: o ficheiro já tem o sufixo \"%s\", a ignorar" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: sufixo de nome de ficheiro inválido" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: o valor não é um inteiro decimal não-negativo" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: sufixo multiplicador inválido" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Sufixos válidos são \"KiB\" (2^10), \"MiB\" (2^20) e \"GiB\" (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "O valor da opção \"%s\" deve estar no intervalo [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Dados comprimidos não podem ser lidos de um terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Dados comprimidos não podem ser escritos num terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "A escrita para a saída padrão falhou" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Erro desconhecido" + +# Espaços adicionados para manter alinhamento com mensagens adjacentes -- Rafael +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Limite de uso de memória para compressão: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Fluxos: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Blocos: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Rácio: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Verificação: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Fluxos:\n" +#~ " Fluxo Blocos DesvioComp DesvioDescomp Tam.Comp TamDescomp Rácio Verif Espaço" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blocos:\n" +#~ " Fluxo Bloco DesvioComp DesvioDescomp Tam.Total TamDescomp Rácio Verif" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ValVerif %*s Cabeç. Band. Tam.Comp UsoMem. Filtros" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "O localizador de correspondência seleccionado requer pelo menos nice=%" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "A Sandbox está desactivada devido a argumentos de linha de comandos incompatíveis" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "A Sandbox foi activada com sucesso" diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo new file mode 100644 index 0000000..7c7598a Binary files /dev/null and b/po/pt_BR.gmo differ diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..5ebd9d1 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,1136 @@ +# Brazilian Portuguese translations for xz package +# Traduções em português brasileiro para o pacote xz. +# This file is put in the public domain. +# Rafael Fontenelle , 2019-2021. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2021-01-06 22:30-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Virtaal 1.0.0-beta1\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Argumento inválido para --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Argumentos demais para --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 só pode ser usado como o último elemento em --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Tipo de formato de arquivo desconhecido" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Tipo de verificação de integridade sem suporte" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Somente um arquivo pode ser especificado com \"--files\" ou \"--files0\"." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "A variável de ambiente %s contém argumentos demais" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Suporte a compressão foi desabilitado em tempo de compilação" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Suporte a descompressão foi desabilitado em tempo de compilação" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "O número máximo de filtros é quatro" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "O limite de uso de memória é baixo demais para a configuração de filtro dada." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "O uso de uma predefinição em modo bruto é desencorajado." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "As opções exatas de predefinições podem variar entre versões do software." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "O formato .lzma possui suporte apenas ao filtro LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 não pode ser usado com o formato .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "A cadeia de filtros é incompatível com --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Alternando para o modo de thread única por causa de --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Usando até % threads." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Opções de filtro ou cadeia de filtros sem suporte" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "A descompressão precisará de %s MiB de memória." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o número de threads de %s de %s para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o número de threads de %s de %s para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Ajustado o tamanho de dicionário de LZMA%c de %s MiB para %s MiB para não exceder o limite de uso de memória de %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Erro ao criar um pipe: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Falha ao habilitar o sandbox" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() falhou: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: O arquivo parece ter sido movido, não será removido" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Não foi possível remover: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Não foi possível definir o dono do arquivo: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Não foi possível definir o grupo do arquivo: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Não foi possível definir as permissões do arquivo: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Erro ao obter os sinalizadores de status da entrada padrão: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: É um link simbólico, ignorando" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: É um diretório, ignorando" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Não é um arquivo comum, ignorando" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: O arquivo possui o bit setuid ou setgid definido, ignorando" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: O arquivo possui o bit sticky definido, ignorando" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: O arquivo de entrada possui mais de um link físico, ignorando" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Nome de arquivo vazio, ignorando" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Erro ao restaurar os sinalizadores de status para entrada padrão: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Erro ao obter os sinalizadores de status de arquivo da saída padrão: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Erro ao restaurar o sinalizador O_APPEND para a saída padrão: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Fechamento do arquivo falhou: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Busca falhou ao tentar criar um arquivo esparso: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Erro de leitura: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Erro ao buscar o arquivo: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Fim de arquivo inesperado" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Erro de escrita: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Desabilitado" + +# Espaços adicionados para manter alinhamento com mensagens adjacentes -- Rafael +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Quantidade total de memória física (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +# Espaços reduzidos para manter alinhamento com mensagens adjacentes -- Rafael +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Limite de uso de memória para descompressão: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Limite de uso de memória alcançado" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Tam. comprimido: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Tam. descomprimido: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Ajuste do fluxo: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Memória exigida: %s MiB\n" + +# Espaço adicionado para promover alinhamento, vide "xz -lvv foo.xz" +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Tam. cabeçalhos: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Núm. de arquivos: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Totais:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nenhuma" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Incógnito2" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Incógnito3" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Incógnito5" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Incógnito6" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Incógnito7" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Incógnito8" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Incógnito9" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Incógnito11" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Incógnito12" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Incógnito13" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Incógnito14" + +# Não exceder 10 caracteres e espaços não são permitidos -- Rafael +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Incógnito15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: O arquivo está vazio" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Pequeno demais para ser um arquivo .xz válido" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Fluxos Blocos Comprimido Descomprimid Propo Verif Nome de Arquivo" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Sim" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Não" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versão mínima do XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s arquivo\n" +msgstr[1] "%s arquivos\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totais:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list funciona apenas em arquivos .xz (--format=xz ou --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list não possui suporte a leitura da entrada padrão" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Erro ao ler nomes de arquivo: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Fim da entrada inesperado ao ler nomes de arquivos" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Caractere nulo encontrado ao ler nomes de arquivos; talvez você queria usar \"--files0\" em vez de \"--files\"?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Ainda não há suporte a compressão e descompressão com --robot." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Não é possível ler dados da entrada padrão ao ler nomes de arquivos da entrada padrão" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Erro interno (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Não foi possível estabelecer manipuladores de sinais" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Sem verificação de integridade; não será verificada a integridade do arquivo" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Tipo de verificação de integridade sem suporte; não será verificada a integridade do arquivo" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Limite de uso de memória alcançado" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Formato de arquivo não reconhecido" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opções sem suporte" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Os dados comprimidos estão corrompidos" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Fim da entrada inesperado" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB de memória é necessário. O limitador está desabilitado." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB de memória é necessário. O limite é %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Cadeia de filtros: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Tente \"%s --help\" para mais informações." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Uso: %s [OPÇÕES]... [ARQUIVO]...\n" +"Comprime e descomprime ARQUIVOs no formato .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Argumentos obrigatórios para opções longas também o são para opções curtas.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Modo de operação:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress força a compressão\n" +" -d, --decompress força a descompressão\n" +" -t, --test testa a integridade do arquivo comprimido\n" +" -l, --list lista informações sobre arquivos .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificadores de opções:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep mantém (não exclui) os arquivos de entrada\n" +" -f, --force força a sobrescrita do arquivo de entrada e a \n" +" (des)compressão de links\n" +" -c, --stdout escreve a entrada padrão e não exclui os arquivos\n" +" de entrada" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream descomprime apenas o primeiro fluxo, e ignora de forma\n" +" silenciosa possíveis dados de entrada restantes" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse não cria arquivos esparsos ao descomprimir\n" +" -S, --suffix=.SUF usa o sufixo \".SUF\" em arquivos comprimidos\n" +" --files[=ARQUIVO]\n" +" lê nomes de arquivos para processar de ARQUIVO;\n" +" se ARQUIVO for omitido, nomes de arquivos são\n" +" lidos da entrada padrão; nomes de arquivos devem\n" +" ser terminados com o caractere de nova linha\n" +" --files0[=ARQUIVO]\n" +" similar a --files, mas usa o caractere nulo como\n" +" terminador" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Opções básicas de formato de arquivo e compressão:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT formato de arquivo para codificar ou decodificar;\n" +" valores possíveis são\n" +" \"auto\" (padrão), \"xz\", \"lzma\" e \"raw\"\n" +" -C, --check=VERIF tipo de verificação de integridade: \"none\" (cuidado!),\n" +" \"crc32\", \"crc64\" (padrão) ou \"sha256\"" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check não faz a verificação de integridade ao descomprimir" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 predefinição de compressão; padrão é 6; leve o uso de\n" +" memória do compressor *e* descompressor em conta\n" +" antes de usar 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme tenta melhorar a proporção de compressão usando mais\n" +" tempo de CPU; não afeta os requisitos de memória do\n" +" descompressor" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NÚM usa no máximo NÚM threads; o padrão é 1; defina para\n" +" 0 para usar o máximo de threads que há de núcleos de\n" +" processador" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=TAM\n" +" inicia novo bloco .xz após cada TAM bytes de entrada;\n" +" use isso para definido o tamanho de bloco para\n" +" compressão com threads" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=TAM\n" +" inicia um novo bloco .xz após os intervalos dados,\n" +" separados por vírgula, de dados descomprimidos" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TEMPO-LIMITE\n" +" ao comprimir, se mais de TEMPO-LIMITE milissegundos\n" +" tiverem passado desde a liberação anterior e a leitura\n" +" de mais entrada bloquearia, todos os dados pendentes\n" +" serão liberados" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMITE\n" +" --memlimit-decompress=LIMITE\n" +" -M, --memlimit=LIMITE\n" +" define o limite de uso de memória para compressão,\n" +" descompressão ou ambos; LIMITE é em bytes, % de RAM\n" +" ou 0 para padrões" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust se configurações de compressão exceder o limite\n" +" de uso de memória, fornece um erro em vez de\n" +" ajustar as configurações para baixo" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Cadeia de filtros personalizada para compressão (alternativa à predefinição):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +"--lzma1[=OPÇÕES] LZMA1/LZMA2; OPÇÕES é uma lista separada por vírgula de\n" +"--lzma2[=OPÇÕES] zero ou + das opções abaixo (valores válidos, padrão):\n" +" preset=PRE redefine opções para predefinição (0-9[e])\n" +" dict=NÚM tam. de dicionário (4KiB - 1536MiB; 8MiB)\n" +" lc=NÚM núm. de bits de contexto literal (0-4; 3)\n" +" lp=NÚM núm. de bits de posição literal (0-4; 0)\n" +" pb=NÚM núm. de bits de posição (0-4; 2)\n" +" mode=MODO modo de compressão (fast, normal; normal)\n" +" nice=NÚM tam. de nice de correspondência (2-273; 64)\n" +" mf=NOME localizador de correspondência\n" +" (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM máximo de profundidade de pesquisa;\n" +" 0=automatic (padrão)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPÇÕES] filtro BCJ x86 (32 bits e 64 bits)\n" +" --powerpc[=OPÇÕES] filtro BCJ PowerPC (big endian apenas)\n" +" --ia64[=OPÇÕES] filtro BCJ IA-64 (Itanium)\n" +" --arm[=OPÇÕES] filtro BCJ ARM (little endian apenas)\n" +" --armthumb[=OPÇÕES] filtro BCJ ARM-Thumb (little endian apenas)\n" +" --sparc[=OPÇÕES] filtro BCJ SPARC\n" +" OPÇÕES válidas para todos os filtros BCJ:\n" +" start=NUM deslocamento inicial para conversões\n" +" (default=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPÇÕES] filtro delta; OPÇÕES válidas (valores válidos, padrão):\n" +" dist=NÚM distância entre bytes sendo subtraído\n" +" de cada um (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Outras opções:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet suprime avisos, use duas vezes para suprimir erros também\n" +" -v, --verbose ser detalhado; use duas vezes para ainda mais detalhes" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn faz os avisos não afetarem o status de saída" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot usa mensagens analisáveis por máquina (útil p/ scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory exibe a quantidade total de RAM e os limites de uso\n" +" de memória atualmente ativos e sai" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help exibe a ajuda curto (lista apenas as opções básicas)\n" +" -H, --long-help exibe essa ajuda longa e sai" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help exibe essa ajuda curta e sai\n" +" -H, --long-help exibe a ajuda longa (lista também as opções avançadas)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version exibe o número de versão e sai" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Sem ARQUIVO, ou quando ARQUIVO é -, lê da entrada padrão.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Relate erros para <%s> (em inglês ou finlandês).\n" +"Relate erros de tradução para .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Site do %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ESSA É UMA VERSÃO DE DESENVOLVIMENTO, NÃO DESTINADA PARA USO EM PRODUÇÃO." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: As opções devem ser pares \"nome=valor\" separados por vírgulas" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Nome de opção inválido" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Valor de opção inválido" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Predefinição LZMA1/LZMA2 sem suporte: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "A soma de lc e lp não deve exceder 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Com --format=raw, --suffix=.SUF é exigido, a menos que esteja escrevendo para stdout" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: O nome de arquivo tem um sufixo desconhecido, ignorando" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: O arquivo já tem o sufixo \"%s\", ignorando" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Sufixo de nome de arquivo inválido" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: O valor não é um inteiro integral decimal" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Sufixo multiplicador inválido" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Sufixos válidos são \"KiB\" (2^10), \"MiB\" (2^20) e \"GiB\" (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "O valor da opção \"%s\" deve estar no intervalo [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Dados comprimidos não podem ser lidos de um terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Dados comprimidos não podem ser escrito para um terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "A escrita para a saída padrão falhou" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Erro desconhecido" + +# Espaços adicionados para manter alinhamento com mensagens adjacentes -- Rafael +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Limite de uso de memória para compressão: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Fluxos: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Blocos: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Proporção: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Verificação: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Fluxos:\n" +#~ " Fluxo Blocos DeslocComp DeslocDescomp TamanhoComp TamanhoDescomp Propo Verif Ajuste" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blocos:\n" +#~ " Fluxo Bloco DeslocComp DeslocDescomp TamanhoTotal TamanhoDecomp Propo Verif" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ValVerif %*s Cabeç Sinaliz TamComp UsoMem Filtros" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "O localizador de correspondência selecionado requer pelo menos nice=%" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Sandbox está desabilitado em razão de argumentos de linha de comando incompatíveis" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Sandbox foi habilitado com sucesso" diff --git a/po/quot.sed b/po/quot.sed new file mode 100644 index 0000000..0122c46 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin new file mode 100644 index 0000000..8c70dfb --- /dev/null +++ b/po/remove-potcdate.sin @@ -0,0 +1,25 @@ +# Sed script that removes the POT-Creation-Date line in the header entry +# from a POT file. +# +# Copyright (C) 2002 Free Software Foundation, Inc. +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/po/ro.gmo b/po/ro.gmo new file mode 100644 index 0000000..2982a9b Binary files /dev/null and b/po/ro.gmo differ diff --git a/po/ro.po b/po/ro.po new file mode 100644 index 0000000..8cbba7a --- /dev/null +++ b/po/ro.po @@ -0,0 +1,1125 @@ +# Romanian translation for xz. +# Mesajele în limba română pentru pachetul xz. +# This file is put in the public domain. +# +# Remus-Gabriel Chelu , 2022. +# +# Cronologia traducerii fișierului „xz”: +# Traducerea inițială, făcută de R-GC, pentru versiunea xz 5.2.5. +# Actualizare a traducerii pentru versiunea 5.2.6 (nepublicată în TP), făcută de R-GC, 2022. +# Actualizare a algoritmului formelor de plural (de la „trei” la „patru” experimental). +# Actualizare a traducerii pentru versiunea 5.4.0-pre1, făcută de R-GC, 2022. +# Actualizare a traducerii pentru versiunea 5.4.0-pre2, făcută de R-GC, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-12-05 16:11+0100\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=((n==1) ? 0 : (n==2) ? 1 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 2 : 3);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.1.1\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Argument nevalid pentru opțiunea „--block-list”" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Prea multe argumente pentru opțiunea „--block-list”" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 poate fi folosit doar ca ultimul element din opțiunea „--block-list”" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Tip de format de fișier necunoscut" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Tip de verificare a integrității neacceptat" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Numai un fișier poate fi specificat cu „--files” sau „--files0”." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Variabila de mediu „%s” conține prea multe argumente" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Suportul de comprimare a fost dezactivat în timpul construirii" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Suportul de decomprimare a fost dezactivat în timpul construirii" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Comprimarea fișierelor lzip (.lz) nu este acceptată" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Numărul maxim de filtre este patru" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Limita de utilizare a memoriei este prea mică pentru configurarea dată filtrului." + +# Notă: +# cu toate că sunt împotriva americanismelor, am preferat folosirea cuvîntului american, „românizat”, pentru a avea o traducere fluidă, fără construcții încărcate și inecesare... +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Utilizarea unei presetări în modul brut este descurajată." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Opțiunile exacte ale presetărilor pot varia între versiunile de software." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Formatul .lzma acceptă numai filtrul LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 nu poate fi utilizat cu formatul .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Lanțul de filtre este incompatibil cu opțiunea „--flush-timeout”" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Se trece la modul cu un singur fir de execuție datorită opțiunii „--flush-timeout”" + +# NOTĂ: +# - să intru în contact cu dezvoltatorii, pentru ai ruga să introducă a doua formă de plural +# (necesară cel puțin pentru limba română): +# „Se utilizează până la % de fire.” +# **** +# construcție necesară pentru mașini cu +# procesoare/nuclee > 10 +# === +# cred că deja au apărut astfel de „monștrii” +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Se utilizează până la % fire de execuție." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Lanț de filtre sau opțiuni de filtrare neacceptate" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Decomprimarea va avea nevoie de %sMio de memorie." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Numărul de fire de execuție a fost redus de la %s la %s pentru a nu se depăși limita de utilizare a memoriei de %sMio" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "S-a redus numărul de fire de execuție de la %s la unul. Limita automată de utilizare a memoriei de %sMio este încă depășită. Sunt necesari %sMio de memorie. Se continuă în ciuda acestui lucru." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "S-a trecut la modul cu un singur-fir de execuție pentru a nu se depăși limita de utilizare a memoriei de %sMio" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "S-a ajustat dimensiunea dicționarului LZMA%c de la %sMio la %sMio pentru a nu se depăși limita de utilizare a memoriei de %sMio" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Eroare la crearea unui racord(pipe): %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Nu s-a reușit activarea cutiei de probă(sandbox)" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() a eșuat: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Fișierul pare să fi fost mutat, nu eliminat" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Nu se poate elimina: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Nu se poate configura proprietarul fișierului: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Nu se poate configura grupul proprietar al fișierului: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Nu se pot configura permisiunile fișierului: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Eroare la obținerea indicatorilor de stare a fișierului de la intrarea standard: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Este o legătură simbolică, se omite" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Este un director, se omite" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Nu este un fișier obișnuit, se omite" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Fișierul are activați biții «setuid» sau «setgid», se omite" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Fișierul are activat bitul lipicios(sticky), se omite" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Fișierul de intrare are mai mult de o legătură dură, se omite" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Numele fișierului este gol, se omite" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Eroare la restabilirea indicatorilor de stare la intrarea standard: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Eroare la obținerea indicatorilor de stare a fișierului de la ieșirea standard: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Eroare la restabilirea indicatorului O_APPEND la ieșirea standard: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Închiderea fișierului a eșuat: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Căutarea a eșuat când se încerca crearea unui fișier dispers(sparse): %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Eroare de citire: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Eroare la căutarea fișierului: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Sfârșit neașteptat al fișierului" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Eroare de scriere: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Dezactivat" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Cantitatea totală de memorie fizică (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Numărul de fire de execuție ale procesorului:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Comprimare:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Decomprimare:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Decomprimare multiple-fire de execuție:" + +# R-GC, scrie: +# ATENȚIE: +# este vorba de: +# T0 = momentul 0, și nu de: +# TO = la, către. pe, în... +# **** +# probabil tipul de literă folosit de mine în Poedit, să +# nu diferențieze prea mult O de 0... +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Implicit pentru -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Informații despre componentele mașinii:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Limitele de utilizare a memoriei:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Fluxuri:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Blocuri:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Dimensiune comprimată:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Dimensiune decomprimată:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Raport:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Verificare:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Completare flux:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Memorie necesară:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Dim. în antete:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Numărul de fișiere:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Flux" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Bloc" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Blocuri" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "PozițieComprim" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "PozițieDecomprim" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "DimComp" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "DimDecomp" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "DimTotală" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Raport" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Verificare" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "ValVerificare" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Completare" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Antet" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Indicatori" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "UtilizareMem" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filtre" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Nici una" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Necunos-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Necunos-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Necunos-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Necunos-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Necunos-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Necunos-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Necunos-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Necunos-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Necunos-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Necunos-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Necunos-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Necunos-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Fișierul este gol" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Prea mic pentru a fi un fișier .xz valid" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Fluxuri Blocuri Comprimare Decomprimare Raport Verificare Nume fișier" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Da" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nu" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Versiunea minimă XZ Utils: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "un fișier\n" +msgstr[1] "două fișiere\n" +msgstr[2] "%s fișiere\n" +msgstr[3] "%s de fișiere\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Totaluri:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list funcționează numai pe fișierele .xz (--format=xz sau --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list nu acceptă citirea de la intrarea standard" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Eroare la citirea numelor de fișiere: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Sfârșit neașteptat al intrării la citirea numelor de fișiere" + +# Adaptînd sugestia făcută de Daniel Șerbănescu asupra traducerii cuvîntului „null”, am modificat +# traducere de la:„Caracter nul găsit...”, la: +# „Caracter nul(null) găsit...” +# Sugestia făcută de el în baza obiecției că în pagina web, «dexonline» definiția cuvîntului nul, este un pic ambiguă; nu are o bază prea solidă, +# din următoarele motive: +# - pagina în cauză e construită, alimentată și menținută de persoane voluntare, precum noi ca traducători de software. +# - intrările pentru definiția cuvîntului „nul”, sînt extrase din dicționare de uz general; niciuna dintre ele, nu a ieșit dintr-un dicționar tehnic, cu atît mai puțin unul de informatică. +# - utilizatorul software-ului «xz», direct de la linia de comandă, mă îndoiesc că va fi un utilizator ce nu este familiarizat cu nomenclatura din informatică (pentru restul utilizatorilor, acest mesaj nu va fi vizibil, pentru că-l vor utiliza din spatele unui software „IGU” «InterfațăGrafică(de)Utilizator» +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Caracter nul(null) găsit la citirea numelor de fișiere; poate ați vrut să utilizați „--files0” în loc de „--files”?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Comprimarea și decomprimarea cu „--robot” nu sunt încă acceptate." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Nu se pot citi date de la intrarea standard atunci când se citesc numele de fișiere de la intrarea standard" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Eroare internă (bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Nu se pot stabili operatorii de semnal" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Fără verificare a integrității; nu se verifică integritatea fișierului" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Tip neacceptat de verificare a integrității; nu se verifică integritatea fișierului" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Limita de utilizare a memoriei a fost atinsă" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Formatul fișierului nu este recunoscut" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Opțiuni neacceptate" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Datele comprimate sunt corupte" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Sfârșit neașteptat al intrării" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Se necesită %s Mio de memorie. Limitarea este dezactivată." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Se necesită %sMio de memorie. Limita este de %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Lanț de filtre: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Încercați «%s --help» pentru mai multe informații." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Utilizare: %s [OPȚIUNE]... [FIȘIER]...\n" +"Comprimă sau decomprimă FIȘIER(e) în formatul .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Argumentele obligatorii pentru opțiunile lungi sunt obligatorii și\n" +"pentru opțiunile scurte.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Mod de operare:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress forțează comprimarea\n" +" -d, --decompress forțează decomprimarea\n" +" -t, --test testează integritatea fișierului comprimat\n" +" -l, --list listează informații despre fișierele .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Modificatori de operare:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep păstrează (nu șterge) fișierele de intrare\n" +" -f, --force forțează suprascrierea fișierului de ieșire și\n" +" (de)comprimă legăturile\n" +" -c, --stdout scrie la ieșirea standard și nu șterge fișierele de\n" +" intrare" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream decomprimă doar primul flux și ignoră în tăcere\n" +" posibilele date de intrare rămase" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse nu creează fișiere disperse când decomprimă\n" +" -S, --suffix=.SUF utilizează sufixul „.SUF” pentru fișierele comprimate\n" +" --files[=FIȘIER]\n" +" citește numele fișierelor de procesat din FIȘIER;\n" +" dacă FIȘIER este omis, numele de fișiere sunt citite\n" +" de la intrarea standard; numele de fișiere trebuie să\n" +" fie terminate cu caracterul de linie nouă\n" +" --files0[=FIȘIER]\n" +" ca --files, dar folosește caracterul nul(null) ca\n" +" terminator" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Formatul de bază al fișierului și opțiunile de comprimare:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FORMAT\n" +" formatul de fișier pentru codificare sau decodificare;\n" +" valorile posibile sunt „auto” (implicit), „xz”,\n" +" „lzma”, „lzip” și „raw”\n" +" -C, --check=VERIFICARE\n" +" tip de verificare a integrității: „none” (utilizați\n" +" cu precauție), „crc32”, „crc64” (implicit) sau\n" +" „sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check nu se efectuează verificarea integrității la decomprimare" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 presetare comprimare; valoarea implicită este 6;\n" +" luați în considerare memoria utilizată de instrumentul de\n" +" comprimare *și* de instrumentul de decomprimare, înainte\n" +" de a utiliza presetările 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme încearcă să îmbunătățească raportul de comprimare\n" +" folosind mai mult timp CPU-ul; nu afectează cerințele\n" +" de memorie ale instrumentului de decomprimare" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NUMĂR\n" +" utilizați cel mult NUMĂR fire de execuție; implicit\n" +" este 1; specificați valoarea 0 pentru a utiliza atâtea\n" +" fire de execuție câte nuclee de procesor există" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=DIM\n" +" începe un nou bloc .xz după fiecare DIM octeți de intrare\n" +" utilizați acest lucru pentru a stabili dimensiunea\n" +" blocului pentru comprimarea cu fire de execuție" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=DM\n" +" începe un nou bloc .xz după intervalele date separate\n" +" prin virgulă, de date necomprimate" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TIMP_LIMITĂ\n" +" la comprimare, dacă au trecut mai mult de TIMP_LIMITĂ\n" +" milisecunde de la curățarea anterioară și citirea mai\n" +" multor intrări s-ar bloca, toate datele în așteptare\n" +" sunt eliminate" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LIMITA\n" +" --memlimit-decompress=LIMITA\n" +" --memlimit-mt-decompress=LIMITA\n" +" -M, --memlimit=LIMITA\n" +" stabilește limita de utilizare a memoriei pentru\n" +" comprimare, decomprimare, decomprimare cu fire de\n" +" execuție sau toate acestea; LIMITA este exprimată în\n" +" octeți, % din RAM sau 0 pt. a activa valoarea implicită" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust dacă setările de comprimare depășesc limita de utilizare\n" +" a memoriei, dă o eroare în loc să reducă val. stabilite" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Lanț de filtrare personalizat pentru comprimare (alternativă la utilizarea\n" +" presetărilor):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=OPȚIUNI] LZMA1 sau LZMA2; OPȚIUNI este o listă separată prin\n" +" --lzma2[=OPȚIUNI] virgulă, de niciuna sau de mai multe dintre următoarele\n" +" opțiuni (între paranteze: valorile valide, și cele\n" +" implicite):\n" +" preset=PRE resetează opțiunile la o presetare (0-9[e])\n" +" dict=NUM dimensiunea dicționarului (4Ko - 1536Mo;\n" +" 8Mo)\n" +" lc=NUM numărul de biți de context literal (0-4; 3)\n" +" lp=NUM numărul de biți de poziție literală (0-4; 0)\n" +" pb=NUM numărul de biți de poziție (0-4; 2)\n" +" mode=MOD modul de comprimare (fast, normal; normal)\n" +" nice=NUM lungimea „drăguță” a unei potriviri (2-273;\n" +" 64)\n" +" mf=NUME găsitor de potriviri (hc3, hc4, bt2, bt3,\n" +" bt4; bt4)\n" +" depth=NUM adâncimea maximă de căutare; 0=automată\n" +" (valoarea implicită)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPȚIUNI] filtru BCJ x86 (32-biți și 64-biți)\n" +" --arm[=OPȚIUNI] filtru BCJ ARM\n" +" --armthumb[=OPȚ] filtru BCJ ARM-Thumb\n" +" --arm64[=OPȚIUNI] filtru ARM64 BCJ\n" +" --powerpc[=OPȚIUNI] filtru BCJ PowerPC (numai big endian)\n" +" --ia64[=OPȚIUNI] filtru BCJ IA-64 (Itanium)\n" +" --sparc[=OPȚIUNI] filtru BCJ SPARC\n" +" OPȚIUNI valide pentru toate filtrele BCJ:\n" +" start=NUM poziția de pornire a conversiilor (implicit=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPȚIUNI] OPȚIUNI valide (valori valide; valoarea implicită):\n" +" dist=NUM distanța dintre octeți fiind dedusă\n" +" scăzând un octet din celălalt (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Alte opțiuni:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet suprimă avertismentele; specificați de două ori pentru\n" +" a suprima și erorile\n" +" -v, --verbose descriere detaliată; specificați de două ori pentru și\n" +" mai multe detalii" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn face ca avertismentele să nu afecteze starea de ieșire" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot utilizează mesaje analizabile de mașină (utile pentru\n" +" scripturi)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory afișează cantitatea totală de memorie RAM și limitele de\n" +" utilizare a memoriei active în prezent, și iese" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help afișează ajutorul scurt (enumeră doar opțiunile de bază)\n" +" -H, --long-help afișează acest ajutor lung(detaliat) și iese" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help afișează acest scurt mesaj de ajutor, și iese\n" +" -H, --long-help afișează mesajul detaliat de ajutor (afișează și opțiunile\n" +" avansate)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version afișează numărul versiunii, și iese" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Fără FIȘIER, sau când FIȘIER este -, citește intrarea standard.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Raportați erorile la <%s> (în engleză sau finlandeză).\n" +"Raportați erorile de traducere la \n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Pagina principală a %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ACEASTA ESTE O VERSIUNE DE DEZVOLTARE, NEDESTINATĂ UTILIZĂRII ÎN PRODUCȚIE." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Opțiunile trebuie să fie perechi „nume=valoare” separate prin virgule" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Nume de opțiune nevalid" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Valoare nevalidă a opțiunii" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Presetare LZMA1/LZMA2 neacceptată: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Suma de lc și lp nu trebuie să depășească 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Cu --format=raw, este necesar --suffix=.SUF, cu excepția cazului în care se scrie la ieșirea standard(stdout)" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Numele fișierului are un sufix necunoscut, care se omite" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Fișierul are deja sufixul „%s”, se omite" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Sufixul numelui de fișier nu este valid" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Valoarea nu este un număr întreg zecimal nenegativ" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Sufix multiplicator nevalid" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Sufixele valide sunt „KiB” (2^10), „MiB” (2^20) și „GiB” (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Valoarea opțiunii „%s” trebuie să fie în intervalul [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Datele comprimate nu pot fi citite de pe un terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Datele comprimate nu pot fi scrise pe un terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Scrierea la ieșirea standard a eșuat" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Eroare necunoscută" + +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Găsitorul de potriviri selectat necesită cel puțin nice=%" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Limita de utilizare a memoriei pentru comprimare: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Fluxuri: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Blocuri: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Raport: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Verificare: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Fluxuri:\n" +#~ " Flux Blocuri DecalajComp. DecalajDecomp. Dim.Comp. Dim.Decomp. Raport Verif. Compl.Flux" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Blocuri:\n" +#~ " Flux Bloc DecalajComp. DecalajDecomp. Dim.Totală Dim.Decomp. Raport Verif." + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " Val.Verif. %*sAntet Indicat. Dim.Comp. UzMem. Filtre" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Cutia de probă(sandbox) este dezactivată din cauza argumentelor incompatibile din linia de comandă" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Cutia de probă(sandbox) a fost activată cu succes" diff --git a/po/sr.gmo b/po/sr.gmo new file mode 100644 index 0000000..393f8c7 Binary files /dev/null and b/po/sr.gmo differ diff --git a/po/sr.po b/po/sr.po new file mode 100644 index 0000000..17dde8b --- /dev/null +++ b/po/sr.po @@ -0,0 +1,1124 @@ +# Serbian translation of xz. +# This file is put in the public domain. +# Мирослав Николић , 2020. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-06-24 22:07+0800\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Неисправан аргумент за „--block-list“" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Превише аргумената за „--block-list“" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 се може користити само као последњи елемент у „--block-list“-у" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Непозната врста формата датотеке" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Неподржана врста провере целовитости" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Само једну датотеку можете навести са „--files“ или „--files0“." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Променљива окружења „%s“ садржи превише аргумената" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Подршка запакивања је искључена у време изградње" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Подршка распакивања је искључена у време изградње" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Највећи број филтера је четири" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Ограничење коришћења меморије је премало за дато подешавање филтера." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Коришћење претподешавања у сировом режиму је обесхрабрујуће." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Тачне опције претподешавања се могу разликовати од издања до издања софтвера." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Формат „.lzma“ подржава само „LZMA1“ филтер" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "Не можете користити „LZMA1“ са „.xz“ форматом" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Ланац филтера није сагласан са „--flush-timeout“" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Пребацујем се на режим једне нити због „--flush-timeout“" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Користим до % нити." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Неподржан ланац филтера или опције филтера" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "За распакивање ће бити потребно %s MiB меморије." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Број нити је промењен са %s на %s да се неби прекорачило ограничење коришћења меморије од %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Број нити је промењен са %s на %s да се неби прекорачило ограничење коришћења меморије од %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Величина „LZMA%c“ речника је промењена са %s на %s да се неби прекорачило ограничење коришћења меморије од %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Грешка стварања спојке: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Нисам успео да укључим безбедно окружење" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: „poll()“ није успело: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Изгледа да је датотека премештена, не уклањам" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Не могу да уклоним: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Не могу да поставим власника датотеке: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Не могу да поставим групу датотеке: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Не могу да поставим овлашћења датотеке: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Грешка добављања заставица стања датотеке са стандардног улаза: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Јесте симболичка веза прескачем" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Јесте директоријум, прескачем" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Није обична датотека, прескачем" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Датотека има постављен „setuid“ или „setgid“ бит, прескачем" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Датотека има постављен лепљиви бит, прескачем" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Улазна датотека има више од једне чврсте везе, прескачем" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Празан назив датотеке, прескачем" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Грешка повраћаја заставица стања на стандардни улаз: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Грешка добављања заставица стања датотеке са стандардног излаза: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Грешка повраћаја заставице „O_APPEND“ на стандардни излаз: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Затварање датотеке није успело: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Премотавање није успело приликом покушаја прављења оскудне датотеке: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Грешка читања: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Грешка приликом претраге датотеке: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Неочекиван крај датотеке" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Грешка писања: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Искључено" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Укупна количина физичке меморије (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Ограничење коришћења меморије за распакивање: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Ограничење коришћења меморије је достигнуто" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Величина сажетог: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Величина несажетог: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Попуна тока: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Потребна меморија: %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Величине у заглављима: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Број датотека: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Укупно:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Ништа" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Незнано-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Незнано-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Незнано-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Незнано-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Незнано-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Незнано-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Незнано-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Незнано-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Незнано-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Незнано-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Незнано-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Незнано-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Датотека је празна" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Премало је да би било исправна „.xz“ датотека" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Токови Блокови Запаковано Распаковано Однос Провера Датотека" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Да" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Не" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Најмање издање XZ помагала: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s датотека\n" +msgstr[1] "%s датотеке\n" +msgstr[2] "%s датотека\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Укупно:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "„--list“ ради само над „.xz“ датотекама (--format=xz или --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "„--list“ не подржава читање са стандардног улаза" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Грешка читања назива датотека: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Неочекивани крај улаза приликом читања назива датотека" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Нађох ништаван знак приликом читања назива датотека; можта сте хтели да користите „--files0“ уместо „--files“?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Запакивање и распакивање са „--robot“ није још подржано." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Не могу да читам податке са стандардног улаза приликом читања назива датотека са стандардног улаза" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Унутрашња грешка (бубица)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Не могу да успоставим руковаоце сигналом" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Нема провере целовитости; не проверавам целовитост датотеке" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Неподржана врста провере целовитости; не проверавам целовитост датотеке" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Ограничење коришћења меморије је достигнуто" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Није препознат формат датотеке" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Неподржане опције" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Запаковани подаци су оштећени" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Неочекиван крај улаза" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB меморије је потребно. Ограничавач је онемогућен." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB меморије је потребно. Ограничење је %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Ланац филтера: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Пробајте „%s --help“ за више података." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Коришћење: %s [ОПЦИЈА]... [ДАТОТЕКА]...\n" +"Пакује или распакује ДАТОТЕКЕ у „.xz“ формату.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Обавезни аргументи за дуге опције су такође обавезни и за кратке опције.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Режим рада:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress приморава запакивање\n" +" -d, --decompress приморава распакивање\n" +" -t, --test тестира целовитост запаковане датотеке\n" +" -l, --list исписује податке о „.xz“ датотекама" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Измењивачи рада:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep задржава (не брише) улазне датотеке\n" +" -f, --force приморава преписивање излазне датотеке и веза\n" +" (рас)запакивања\n" +" -c, --stdout пише на стандардни излаз и не брише улазне датотеке" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream распакује само први ток, и тихо\n" +" занемарује могуће преостале улазне податке" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse не ствара оскудне датотеке приликом распакивања\n" +" -S, --suffix=.СУФ користи суфикс „.СУФ“ на запакованим датотекама\n" +" --files[=ДТТКА] чита називе датотека за обраду из ДАТОТЕКЕ; ако је\n" +" ДАТОТЕКА изостављено, називи датотека се читају са\n" +" стандардног улаза називи датотека се морају\n" +" завршавати знаком новог реда\n" +" --files0[=ДТТКА] као „--files“ али користи празан знак као завршни" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Основне опције формата датотеке и запакивања:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=ФМТ формат датотеке за кодирање и декодирање; могуће\n" +" вредности су „auto“ (основно), „xz“, „lzma“,\n" +" и „raw“\n" +" -C, --check=ПРОВЕРА врста провере целовитости: „none“ (користите уз\n" +" опрез), „crc32“, „crc64“ (основно), или „sha256“" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" +" --ignore-check не потврђује проверу целовитости приликом\n" +" распакивања" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 претподешавање запакивања; основно је 6; узмите у\n" +" обзир коришћење меморије запакивања *и* распакивања\n" +" пре него ли употребите 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme покушава да побољша однос запакивања користећи више\n" +" времена процесора; не утиче на потребе меморије\n" +" распакивача" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=БР користи највише БР нити; основно је 1; поставите\n" +" на 0 за коришћење онолико нити колико има\n" +" процесорских језгара" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=ВЕЛИЧИНА\n" +" започиње нови „.xz“ блок након свака ВЕЛИЧИНА\n" +" бајта улаза; користите ово да поставите величину\n" +" блока за нитирано запакивање" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=ВЕЛИЧИНА\n" +" започиње нови „.xz“ блок након датих зарезом\n" +" раздвојених периода незапакованих података" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=ВРЕМЕ_ИСТЕКА\n" +" приликом запакивања, ако је прошло више од\n" +" ВРЕМЕ_ИСТЕКА милисекунди до претходног убацивања и\n" +" читања још улаза блокираће, сви подаци на чекању се\n" +" истискују ван" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=ОГРАНИЧЕЊЕ\n" +" --memlimit-decompress=ОГРАНИЧЕЊЕ\n" +" -M, --memlimit=ОГРАНИЧЕЊЕ\n" +" поставља ограничење коришћења меморије за\n" +" запакивање, распакивање, или оба; ОГРАНИЧЕЊЕ је у\n" +" бајтовима, % o РАМ, или 0 за основно" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust ако подешавања запакивања пређу ограничење\n" +" коришћења меморије, даје грешку уместо дотеривања\n" +" подешавања" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Произвољни ланац филтера за запакивање (алтернатива за коришћење\n" +" претподешавања):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=ОПЦИЈЕ] LZMA1 или LZMA2; ОПЦИЈЕ је зарезом раздвојен\n" +" --lzma2[=ОПЦИЈЕ] списак нула или више од пратећих опција (исправне\n" +" вредности; основно):\n" +" preset=ПРЕ враћа опције на претподешавање (0-9[e])\n" +" dict=БРОЈ величина речника (4KiB – 1536MiB; 8MiB)\n" +" lc=БРОЈ број битова дословног контекста (0-4; 3)\n" +" lp=БРОЈ број битова дословног положаја (0-4; 0)\n" +" pb=БРОЈ број битова положаја (0-4; 2)\n" +" mode=РЕЖИМ режим запакивања (брзо, обично; обично)\n" +" nice=БРОЈ фина дужина поклапања (2-273; 64)\n" +" mf=НАЗИВ налазач поклапања (hc3, hc4, bt2, bt3,\n" +" bt4; bt4)\n" +" depth=БРОЈ највећа дубина тражења; 0=самостално\n" +" (основно)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=ОПЦИЈЕ] „x86 BCJ“ филтер (32-бита и 64-бита)\n" +" --powerpc[=ОПЦИЈЕ] „PowerPC BCJ“ филтер (само велика крајњост)\n" +" --ia64[=ОПЦИЈЕ] „IA-64 (Itanium) BCJ“ филтер\n" +" --arm[=ОПЦИЈЕ] „ARM BCJ“ филтер (само мала крајњост)\n" +" --armthumb[=ОПЦИЈЕ] „ARM-Thumb BCJ“ филтер (само мала крајњост)\n" +" --sparc[=ОПЦИЈЕ] „SPARC BCJ“ филтер\n" +" Исправне ОПЦИЈЕ за све „BCJ“ филтере:\n" +" start=БРОЈ померај почетка за претварања\n" +" (основно=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=ОПЦИЈЕ] Делта филтер; исправне ОПЦИЈЕ (исправне вредности;\n" +" основно):\n" +" dist=БРОЈ растојање између бајтова који су\n" +" одузети из свих других (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Остале опције:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet потискује упозорења; наведите два пута да потисне и\n" +" грешке такође\n" +" -v, --verbose бива опширан; наведите два пута за још опширније" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn чини да упозорења не делују на стање излаза" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot користи поруке обрадиве рачунаром\n" +" (корисно за скрипте)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory приказује укупан износ РАМ-а и тренутно активна\n" +" ограничења коришћења меморије, и излази" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help приказује кратку помоћ (исписује само основне\n" +" опције)\n" +" -H, --long-help приказује ову дугу помоћ и излази" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help приказује ову кратку помоћ и излази\n" +" -H, --long-help приказује дугу помоћ (исписује такође и напредне\n" +" опције)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version приказује број издања и излази" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Без ДАТОТЕКЕ, или када је ДАТОТЕКА -, чита стандардни улаз.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Грешке пријавите на <%s> (на енглеском или финском).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "„%s“ матична страница: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ОВО ЈЕ РАЗВОЈНО ИЗДАЊЕ И НИЈЕ НАМЕЊЕНО ЗА ПРОФЕСИОНАЛНУ УПОТРЕБУ." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Опције морају бити парови „name=value“ раздвојени зарезима" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Неисправан назив опције" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Неисправна вредност опције" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Неподржано претподешавање „LZMA1/LZMA2“: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Збир „lc“ и „lp“ не сме премашити 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Са „--format=raw“, „--suffix=.SUF“ је потребно осим ако пише на стандардни излаз" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Назив датотеке има непознат суфикс, прескачем" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Датотека већ има суфикс „%s“, прескачем" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Неисправан суфикс назива датотеке" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Вредност није не-негативан децимални цео број" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Неисправан суфикс умножавача" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Исправни суфикси су KiB (2^10), MiB (2^20), и GiB (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Вредност опције „%s“ мора бити у опсегу [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Запаковани подаци се не могу читати из терминала" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Запаковани подаци се не могу писати на терминал" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Писање на стандардни излаз није успело" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Непозната грешка" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Ограничење коришћења меморије за запакивање: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Токова: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Блокова: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Однос: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Провера: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Токови:\n" +#~ " Ток Блокови Помезапак Поменезапак Велзапак Велнезапак Однос Провера Попуна" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Блокови:\n" +#~ " Ток Блок Помезапак Поменезапак Велукупн Велнезапак Однос Провера" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ВреднПров %*s Заглав Заставице Велзапак Коришмемор Филтери" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Изабрани налазач поклапања захтева барем „nice=%“" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Безбедно окружење је искључено услед несагласних аргумената линије наредби" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Безбедно окружење је успешно укључено" diff --git a/po/stamp-po b/po/stamp-po new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/po/sv.gmo b/po/sv.gmo new file mode 100644 index 0000000..d36b8f0 Binary files /dev/null and b/po/sv.gmo differ diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..733a49d --- /dev/null +++ b/po/sv.po @@ -0,0 +1,1075 @@ +# Swedish messages for xz. +# This file is put in the public domain. +# Sebastian Rasmussen , 2019. +# Luna Jernberg , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-14 19:08+0100\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.1\n" +"X-Poedit-Bookmarks: -1,10,-1,-1,-1,-1,-1,-1,-1,-1\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Ogiltigt argument till --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: För många argument till --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 kan endast användas som det sista elementet i --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Okänd filformatstyp" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Integritetskontrolltyp stöds inte" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Endast en fil kan anges med ”--files” eller ”--files0”." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Miljövariabeln %s innehåller för många argument" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Komprimeringsstöd inaktiverades vid byggtid" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Dekomprimeringsstöd inaktiverades vid byggtid" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Komprimering av lzip-filer (.lz) stöds inte" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Maximalt antal filter är fyra" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Begränsning av minnesanvändning är allt för låg för den angivna filteruppsättningen." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Det avråds från att använda en förinställning i rått läge." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "De exakta flaggorna för förinställningar kan variera mellan programversioner." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Formatet .lzma har endast stöd för LZMA1-filtret" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 kan inte användas tillsammans med .xz-formatet" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Filterkedjan är inkompatibel med --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Växlar till entrådsläge på grund av --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Använder upp till % trådar." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Filterkedja eller filterflaggor stöds inte" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Dekomprimering kommer att kräva %s MiB minne." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Reducerade antalet trådar från %s till %s för att inte överstiga begränsningen av minnesanvändning på %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Reducerade antalet trådar från %s till en. Den automatiska minnesanvändningsgränsen på %s MiB överskrids fortfarande. %s MiB minne krävs. Fortsätter i alla fall." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Ändrar till enkeltrådat läge för att inte överskrida minnesanvändningsgränsen på %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Justerade storlek för LZMA%c-lexikon från %s MiB till %s MiB för att inte överstiga begränsningen av minnesanvändning på %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Fel vid skapande av rörledning: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Misslyckades med att aktivera sandlådan" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() misslyckades: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Filen verkar ha flyttats, tar inte bort" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Kan inte ta bort: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Kan inte sätta filägaren: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Kan inte sätta filgruppen: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Kan inte sätta filrättigheterna: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Fel vid hämtning av filstatusflaggor från standard in: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Är en symbolisk länk, hoppar över" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Är en katalog, hoppar över" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Är inte en vanlig fil, hoppar över" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Filen har setuid- eller setgid-biten satt, hoppar över" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Filen har stickybiten satt, hoppar över" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Indatafilen har mer än en hårdlänk, hoppar över" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Tomt filnamn, hoppar över" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Fel vid återställning av statusflaggorna för standard in: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Fel vid hämtning av filstatusflaggorna från standard ut: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Fel vid återställning av O_APPEND-flaggan till standard ut: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Stängning av filen misslyckades: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Sökning misslyckades vid skapande av gles fil: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Läsfel: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Fel vid sökning i fil: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Oväntat filslut" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Skrivfel: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Inaktiverad" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Totalt mängd fysiskt minne (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Antal processortrådar:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Komprimering:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Dekomprimering:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Flertrådad dekomprimering:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Standard för -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Hårdvaruinformation:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Minnesanvändningsgränser:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Strömmar:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Block:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Komprimerad storlek:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Okomprimerad storlek:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Förhållande:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Kontroll:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Strömfyllnad:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Minne som behövs:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Storlek i huvuden:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Antal filer:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Ström" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Block" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Block" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "Komprimerad position" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "Okomprimerad position" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "Komprimerad storlek" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "Okomprimerad storlek" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Total storlek" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Förhållande" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Kontroll" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "Kontrollvärde" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Fyllnad" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Huvud" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Flaggor" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "Minnesanvändning" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Filters" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Ingen" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Okänd-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Okänd-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Okänd-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Okänd-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Okänd-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Okänd-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Okänd-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Okänd-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Okänd-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Okänd-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Okänd-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Okänd-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Fil är tom" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: För lite för att vara en giltig xz-fil" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Strmr Block Komprimerd Okomprimerd Förh. Kntrll Filnamn" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Ja" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Nej" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Minsta XZ Utils-version: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s fil\n" +msgstr[1] "%s filer\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Total:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list fungerar endast med .xz-filer (--format=xz eller --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list saknar stöd för att läsa från standard in" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Fel vid läsning av filnamn: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Oväntat slut av indata vid läsning av filnamn" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Null-tecken hittat vid läsning av filnamn; kanske menade du att använda ”--files0” istället för ”--files”?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Komprimering och dekomprimering med --robot stöds inte än." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Kan inte läsa data från standard in när filnamn läses från standard in" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Internt fel" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Kan inte etablera signalhanterare" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Ingen integritetskontroll; kan inte verifiera filintegritet" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Typ av integritetskontroll stöds inte; verifierar inte filintegritet" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Begränsning av minnesanvändning uppnådd" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Filformat okänt" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Flaggor stöds inte" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Komprimerad data är korrupt" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Oväntat avslut av indata" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB minne krävs. Begränsaren inaktiverad." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB minne krävs. Begränsningen är %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Filterkedja: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Prova ”%s --help” för vidare information." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Användning: %s [FLAGGA]… [FIL]…\n" +"Komprimera eller dekomprimera FILer i .xz-formatet.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Nödvändiga argument till långa flaggor är också nödvändiga för korta flaggor.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Operationsläge:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress tvinga komprimering\n" +" -d, --decompress tvinga dekomprimering\n" +" -t, --test testa integritet för komprimerad fil\n" +" -l, --list lista information om .xz-filer" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Operationsmodifierare:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep behåll (ta inte bort) indatafiler\n" +" -f, --force tvinga överskrivning av utdatafil och (de)komprimera\n" +" länkar\n" +" -c, --stdout skriv till standard ut och ta inte bort indatafiler" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream dekomprimera endast den första strömmen och hoppa\n" +" tyst över eventuellt återstående indata" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse skapa inte glesa filer vid dekomprimering\n" +" -S, --suffix=.SUF använd ändelse ”.SUF” för komprimerade filer\n" +" --files[=FIL] läs filnamn från FIL; om FIL utelämnas\n" +" kommer filnamn att läsas från standard in;\n" +" filnamn måste avslutas med nyradstecken\n" +" --files0[=FIL] som --files men null-tecknet måste användas" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Grundläggande filformat och komprimeringsflaggor:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=FMT filformat att koda eller avkoda; möjliga värden är\n" +" ”auto” (standard), ”xz”, ”lzma”, ”lzip” och ”raw”\n" +" -C, --check=CHECK typ av integritetskontroll: ”none” (använd med\n" +" försiktighet), ”crc32”, ”crc64” (standard), eller ”sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check verifiera inte integritet vid dekomprimering" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 kompressionsförinställning; standard är 6; ta\n" +" minnesanvändning för komprimerare *och* dekomprimerare\n" +" i beaktande innan du använder 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme försök att förbättra komprimeringsförhållande genom att\n" +" använda mer CPU-tid; påverkar inte minnesanvändning för\n" +" dekomprimerare" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NUM använd som mest NUM trådar; standard är 1; sätt till 0\n" +" för att använda så många trådar som det finns\n" +" processorkärnor" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=STORLEK\n" +" påbörja ett nytt .xz-block efter STORLEK byte indata;\n" +" använd detta för att sätta blockstorleken för trådad\n" +" komprimering" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=STORLEKAR\n" +" påbörja ett nytt .xz-block efter de angivna\n" +" komma-separerade intervallen av okomprimerad data" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=TIDSGRÄNS\n" +" vid komprimering, om mer än TIDSGRÄNS millisekunder har\n" +" passerat sedan den föregående spolningen och läsning av\n" +" mer indata skulle blockera, så kommer all väntande data\n" +" att spolas ut" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=BEGR\n" +" --memlimit-decompress=BEGR\n" +" --memlimit-mt-decompress=BEGR\n" +" -M, --memlimit=BEGR\n" +" sätt begränsning av minnesanvändning för komprimering,\n" +" dekomprimering, trådad dekomprimering, eller alla av\n" +" dessa; BEGR är i byte, % RAM, eller 0 för standardvärden" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust om komprimeringsinställningar överstiger begränsningen av\n" +" minnesanvändning, ge ett fel istället för att justera ner\n" +" inställningarna" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Anpassad filterkedja för komprimering (alternativ till att använda\n" +" förinställningar):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=FLAGGOR] LZMA1 eller LZMA2; FLAGGOR är en kommaseparerad lista av\n" +" noll eller\n" +" --lzma2[=FLAGGOR] fler av följande flaggor (giltiga värden; standard):\n" +" preset=FÖR återställ flaggor till en förinställning\n" +" (0-9[e])\n" +" dict=NUM lexikonstorlek (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM antal bitar för bokstavligkontext (0-4; 3)\n" +" lp=NUM antal bitar för bokstavligposition (0-4; 0)\n" +" pb=NUM antal bitar för position (0-4; 2)\n" +" mode=LÄGE komprimeringsläge (fast, normal; normal)\n" +" nice=NUM bra längd för en matchning (2-273; 64)\n" +" mf=NAMN matchningshittare (hc3, hc4, bt2, bt3, bt4;\n" +" bt4)\n" +" depth=NUM maximalt sökdjup; 0=automatisk (standard)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=FLAGGOR] x86 BCJ-filter (32- och 64-bitar)\n" +" --arm[=FLAGGOR] ARM BCJ-filter\n" +" --armthumb[=FLAGGOR] ARM-Thumb BCJ-filter\n" +" --arm64[=FLAGGOR] ARM64 BCJ-filter\n" +" --powerpc[=FLAGGOR] PowerPC BCJ-filter (endast rak byteordning)\n" +" --ia64[=FLAGGOR] IA-64 (Itanium) BCJ-filter\n" +" --sparc[=FLAGGOR] SPARC BCJ-filter\n" +" Giltiga FLAGGOR för alla BCJ-filter:\n" +" start=NUM startposition för konverteringar\n" +" (standard=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=FLAGGOR] Deltafilter; giltiga FLAGGOR (giltiga värden; standard):\n" +" dist=NUM avstånd mellan byte som subtraheras\n" +" från varandra (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Andra flaggor:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet undertryck varningar; ange två gånger för att också\n" +" undertrycka fel\n" +" -v, --verbose var utförlig; ange två gånger för än mer utförlig" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn låt inte varningar påverka avslutningsstatus" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot använd maskintolkningsbara meddelanden\n" +" (användbara för skript)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory visa den totala mängden RAM och den för närvarande aktiva\n" +" begränsningen av minnesanvändning och avsluta" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help visa den korta hjälpen (listar endast de grundläggande\n" +" flaggorna)\n" +" -H, --long-help visar denna långa hjälp av avsluta" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help visa denna korta hjälp och avsluta\n" +" -H, --long-help visa den långa hjälpen (listar också de avancerade\n" +" flaggorna)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version visa versionsnumret och avsluta" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Med FIL, eller när FIL är -, läs standard in.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Rapportera buggar till <%s> (på engelska eller finska).\n" +"Rapportera översättningsfel till tp-sv@listor.tp-sv.se\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s webbsida: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "DETTA ÄR EN UTVECKLINGSVERSION SOM INTE ÄR AVSEDD FÖR PRODUKTIONSANVÄNDNING." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Flaggor måste vara ”namn=värde”-par separerade med kommatecken" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Ogiltigt flaggnamn" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Ogiltigt flaggvärde" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "LZMA1/LZMA2-förinställning stöds inte: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Summan av lc och lp får inte överstiga 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Med --format=raw, krävs --suffix=.SUF om data inte skrivs till standard ut" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Filnamn har okänd filändelse, hoppar över" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Fil har redan ”%s”-ändelse, hoppar över" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Ogiltig filnamnsändelse" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Värdet är inte ett icke-negativt, decimalt heltal" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Ogiltig multipeländelse" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Giltiga ändelser är ”KiB” (2^10), ”MiB” (2^20) och ”GiB” (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Värdet för flaggan ”%s” måste vara inom intervallet [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Komprimerad data kan inte läsas från en terminal" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Komprimerad data kan inte skrivas till en terminal" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Skrivning till standard ut misslyckades" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Okänt fel" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Den valda matchningshittaren kräver åtminstone nice=%" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Sandlåda inaktiverad på grund av inkompatibla kommandoradsargument" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Sandlåda aktiverades framgångsrikt" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Begränsning av minnesanvändning för komprimering: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Strömmar: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Block: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Förhållande: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Kontroll: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Strömmar:\n" +#~ " Ström Block KompPos OkompPos KompStrl OkompStrl Förh. Kontroll Fyllnad" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Block:\n" +#~ " Ström Block KompPos OkompPos TotalStrl OkompStrl Förh. Kontroll" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " KntrlVär %*s Huvud Flaggor KompStrl Minne Filter" diff --git a/po/tr.gmo b/po/tr.gmo new file mode 100644 index 0000000..744f461 Binary files /dev/null and b/po/tr.gmo differ diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..b952da7 --- /dev/null +++ b/po/tr.po @@ -0,0 +1,1024 @@ +# Turkish translation for xz. +# This file is distributed under the same license as the xz package. +# This file is put in the public domain. +# +# Emir SARI , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-12-05 19:00+0300\n" +"Last-Translator: Emir SARI \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: --block-list için geçersiz argüman" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: --block-list için çok fazla argüman" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0, yalnızca --block-list içindeki son öge olarak kullanılabilir" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Bilinmeyen dosya biçimi türü" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Desteklenmeyen bütünlük denetimi türü" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "'--files' veya '--files0' ile yalnızca bir dosya belirtilebilir." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Çevre değişkeni %s, pek fazla argüman içeriyor" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Sıkıştırma desteği, yapım sırasında devre dışı bırakıldı" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Sıkıştırma açma desteği, yapım sırasında devre dışı bırakıldı" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "lzip dosyalarının (.lz) sıkıştırılması desteklenmiyor" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Olabilecek en çok süzgeç sayısı dörttür" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Verilen süzgeç ayarı için bellek kullanım sınırı pek düşük." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Ham kipte bir önayar kullanımı önerilmez." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Önayarların kesin seçenekleri yazılım sürümleri arasında ayrım gösterebilir." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr ".lzma biçimi, yalnızca LZMA1 süzgecini destekler" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1, .xz biçimi ile birlikte kullanılamaz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Süzgeç zinciri, --flush-timeout ile uyumsuz" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "--flush-timeout nedeniyle tek iş parçacıklı kipe geçiliyor" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "En çok % iş parçacığı kullanılıyor." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Desteklenmeyen süzgeç zinciri veya süzgeç seçenekleri" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Sıkıştırma açma, %s MiB belleğe gereksinim duyacak." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "%3$s MiB bellek kullanımı sınırını aşmamak için iş parçacığı sayısı %1$s -> %2$s olarak ayarlandı" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "İş parçacıklarının sayısı %s -> 1 olarak azaltıldı. %s MiB otomatik bellek sınırı hâlâ aşılıyor. %s MiB belleğe gereksinim var. Yine de sürdürülüyor." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "%s MiB bellek kullanım sınırını aşmamak için tek iş parçacıklı kipe geçiliyor" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "%4$s MiB bellek kullanımı sınırını aşmamak için LZMA%1$c sözlük boyutu %2$s MiB'tan %3$s MiB'a ayarlandı" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Veriyolu oluştururken hata: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Kum havuzu etkinleştirilemedi" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: poll() başarısız oldu: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Dosya taşınmış gibi görünüyor, kaldırılmıyor" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Kaldırılamıyor: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Dosya sahibi ayarlanamıyor: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Dosya grubu ayarlanamıyor: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Dosya izinleri ayarlanamıyor: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Standart girdi'den dosya durum bayrakları alınırken hata: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Bir sembolik bağ, atlanıyor" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Bir dizin, atlanıyor" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Olağan bir dosya değil, atlanıyor" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Dosyanın setuid'si veya setgid biti ayarlanmış, atlanıyor" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Dosyanın yapışkan bit seti var, atlanıyor" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Girdi dosyasında birden çok sabit bağ var, atlanıyor" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Boş dosya adı, atlanıyor" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Standart girdi'ye durum bayrakları geri yüklenirken hata: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Standart çıktı'dan dosya durum bayrakları alınırken hata: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Standart çıktı'dan O_APPEND bayrağı geri yüklenirken hata: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Dosyayı kapatma başarısız: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Bir aralıklı dosya oluşturmaya çalışırken arama başarısız: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Okuma hatası: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Dosyayı ararken hata: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Dosyanın beklenmedik sonu" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Yazma hatası: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Devre dışı" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Fiziksel bellek miktarı (RAM):" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "İşlemci iş parçacığı sayısı:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Sıkıştırma:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Sıkıştırma açma:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Çok iş parçacıklı sıkıştırma açma:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "-T0 için öntanımlı:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Donanım bilgisi:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Bellek kullanım sınırları:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Akışlar:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Bloklar:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Sıkıştırılmış boyut:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Sıkıştırılmamış boyut:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Oran:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Denetim:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Akış dolgusu:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Gereken bellek:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Üstbilgideki boyut:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Dosya sayısı:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Akış" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Blok" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Bloklar" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "SkştrOfseti" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "SkştrmmşOfset" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "SkştrBoyut" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "SkştrmmşBoyut" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "ToplamBoyut" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Oran" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Denetim" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "DğrDentm" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Dolgu" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Üstveri" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Bayrak" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "BelKullnm" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Süzgeçler" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Yok" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "?-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "?-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "?-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "?-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "?-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "?-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "?-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "?-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "?-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "?-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "?-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "?-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Dosya boş" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Geçerli bir .xz dosyası olabilmek için pek küçük" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " Akış Blok Sıkıştırıl. Sıkıştırmas. Oran Denetim Dosya ad" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Evet" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Hayır" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " En düşük XZ Utils sürümü: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s dosya\n" +msgstr[1] "%s dosya\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Toplamlar:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list, yalnızca .xz dosyalarında çalışır (--format=xz veya --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list, standart girdi'den okumayı desteklemez" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Dosya adları okunurken hata: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Dosya adları okunurken beklenmedik girdi sonu" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Dosya adları okunurken boş karakter bulundu; '--files' yerine '--files0' mı demek istediniz?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "--robot ile sıkıştırma ve sıkıştırma açma henüz desteklenmiyor." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Standart girdi'den dosya adları okunurken standart girdi'den veri okunamıyor" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "İç hata (yazılım hatası)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Sinyal işleyicileri tesis edilemiyor" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Bütünlülük denetimi yok; dosya bütünlüğü doğrulanmıyor" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Desteklenmeyen bütünlülük denetimi türü; dosya bütünlüğü doğrulanmıyor" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Bellek kullanım sınırına erişildi" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Dosya biçimi tanımlanamıyor" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Desteklenmeyen seçenekler" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Sıkıştırılmış veri hasarlı" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Beklenmedik girdi sonu" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "%s MiB bellek gerekiyor. Sınırlandırıcı devre dışı bırakıldı." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "%s MiB bellek gerekiyor. Sınır, %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Süzgeç zinciri: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Daha fazla bilgi için '%s --help' deneyin." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Kullanım: %s [SEÇENEK]... [DOSYA]...\n" +".xz biçimindeki dosyaları sıkıştırın veya sıkıştırmasını açın.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Uzun seçenekler için zorunlu olan argümanlar kısa seçenekler için de geçerlidir.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " İşlem kipi:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress sıkıştırmayı zorla\n" +" -d, --decompress sıkıştırma açmayı zorla\n" +" -t, --test sıkıştırılmış dosya bütünlüğünü sına\n" +" -l, --list .xz dosyaları hakkında bilgi listele" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" İşlem değiştiricileri:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep girdi dosyalarını tut (silme)\n" +" -f, --force çıktı dosyası üzerine yazmayı zorla ve bağlantıları\n" +" sıkıştır/sıkıştırmayı aç\n" +" -c, --stdout standart çıktıya yaz ve girdi dosyalarını silme" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream yalnızca ilk akışın sıkıştırmasını aç ve sessizce\n" +" kalan girdi verisini yok say" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse sıkıştırma açarken aralıklı dosyalar oluşturma\n" +" -S, --suffix=.SUF sıkıştırılmış dosyalarda `.SUF' sonekini kullan\n" +" --files[=DOSYA] DOSYA'dan işlemek için dosya adlarını oku; DOSYA\n" +" atlanırsa dosya adları standart girdi'den okunur;\n" +" dosya adları, yenisatır karakteri ile sonlanmalıdır\n" +" --files0[=DSYA] --files gibi; ancak sonlandırıcı olarak null karakteri\n" +" kullan" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Temel dosya biçimi ve sıkıştırma seçenekleri:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=BÇM kodlanacak veya kodu çözülecek dosya biçimi; olası\n" +" değerler: `auto' (öntanımlı), `xz', `lzma', 'lzip'\n" +" ve `raw'\n" +" -C, --check=DNTLE bütünlük denetimi türü: `none' (dikkatli kullanın),\n" +" `crc32', `crc64' (öntanımlı) veya `sha256'" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check sıkıştırma açarken bütünlük denetimini doğrulama" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 sıkıştırma önayarı; öntanımlı 6; 7-9 kullanmadan önce\n" +" sıkıştırma açıcı bellek kullanımını hesaba katın!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme daha çok CPU zamanı kullanarak sıkıştırma oranını\n" +" iyileştirmeye çalış; sıkıştırma açıcı bellek\n" +" gereksinimlerini etkilemez" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=SAYI en çok SAYI iş parçacığı kullan; öntanımlı 1; var olan\n" +" işlemci çekirdeği kadar iş parçacığı kullanmak için\n" +" 0'a ayarlayın" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=BOYUT\n" +" her BOYUT bayt girdiden sonra yeni bir .xz bloku başlat;\n" +" iş parçacığı kullanan sıkıştırma için blok boyutunu\n" +" ayarlamak için bunu kullanın" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=BOYUTLAR\n" +" sıkıştırılmamış verinin virgülle ayrılmış verilen\n" +" aralıklarından sonra yeni bir .xz bloku başlat" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=ZAMANAŞIMI\n" +" sıkıştırırken, bir önceki floştan bu yana ZAMANAŞIMI\n" +" milisaniye geçmişse ve daha çok girdi okuma bloklarsa\n" +" tüm bekleyen veri floşlanır" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=LİMİT\n" +" --memlimit-decompress=LİMİT\n" +" --memlimit-mt-decompress=LİMİT\n" +" -M, --memlimit=LİMİT\n" +" sıkıştırma, sıkıştırma açma, iş parçacıklı sıkıştırma\n" +" açma veya tümü için bellek kullanımı sınırını ayarla;\n" +" LİMİT, bayt, RAM % veya öntanımlılar için 0'dır" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust sıkıştırma ayarları bellek kullanımı sınırını aşarsa\n" +" ayarı aşağı doğru düzeltmek yerine bir hata ver" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Sıkıştırma için özel süzgeç zinciri (önayar kullanımı alternatifi):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=SÇNKLR] LZMA1 veya LZMA2; OPTS, sıfır veya aşağıdaki\n" +" --lzma2[=SÇNKLR] seçeneklerin virgülle ayrılmış değerleridir (geçerli\n" +" değerler; öntanımlı):\n" +" preset=ÖNA seçenekleri bir önayara sıfırla (0-9[e])\n" +" dict=NUM sözlük boyutu (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM düz bağlam bitlerinin sayısı (0-4; 3)\n" +" lp=NUM düz konum bitlerinin sayısı (0-4; 0)\n" +" pb=NUM konum bitlerinin sayısı (0-4; 2)\n" +" mode=KİP sıkıştırma kipi (fast, normal; normal)\n" +" nice=NUM bir eşleşmenin öncelik uzunluğu (2-273; 64)\n" +" mf=AD eşleşme bul (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM en büyük arama derinliği; 0=oto (öntanımlı)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=SÇNKLR] x86 BCJ süzgeci (32 bit ve 64 bit)\n" +" --arm[=SÇNKLR] ARM BCJ süzgeci\n" +" --armthumb[=SÇNKLR] ARM-Thumb BCJ süzgeci\n" +" --arm64[=SÇNKLR] ARM64 BCJ süzgeci\n" +" --powerpc[=SÇNKLR] PowerPC BCJ süzgeci (yalnızca yüksek son basamaklı)\n" +" --ia64[=SÇNKLR] IA-64 (Itanium) BCJ süzgeci\n" +" --sparc[=SÇNKLR] SPARC BCJ süzgeci\n" +" Tüm BCJ süzgeçleri için geçerli SÇNKLR:\n" +" start=NUM dönüşümler başlangıç ofseti (öntanımlı=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=SÇNKLR] Delta süzgeci; geçerli SÇNKLR (geçerli değerler;\n" +" öntanımlı):\n" +" dist=NUM birbirinden çırakılar baytlar arasındaki\n" +" uzaklık (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Diğer seçenekler:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet uyarıları sustur; hataları da susturmak için iki kez\n" +" belirt\n" +" -v, --verbose ayrıntılı ol; daha da çok ayrıntı için iki kez belirt" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn uyarıların çıkış durumunu etkilemesine izin verme" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot makine-ayrıştırılabilir iletiler kullan (betikler için\n" +" yararlı)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory toplam RAM miktarını ve şu anki bellek kullanımı\n" +" sınırlarını görüntüle ve çık" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help kısa yardımı görüntüle (temel seçenekleri listeler)\n" +" -H, --long-help bu uzun yardımı görüntüle ve çık" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help bu kısa yardımı görüntüle ve çık\n" +" -H, --long-help uzun yardımı görüntüle (gelişmiş seçenekleri listeler)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version sürüm numarasını görüntüle ve çık" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"DSYA olmadan veya DSYA - iken standart girdi'yi oku.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "Hataları <%s> adresine bildirin (İngilizce veya Fince).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s ana sayfası: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "BU, NORMAL KULLANIM İÇİN OLMAYAN BİR GELİŞTİRME SÜRÜMÜDÜR." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Seçenekler, virgülle ayrılmış 'ad=değer' çiftleri olmalıdır" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Geçersiz seçenek adı" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Geçersiz seçenek değeri" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Desteklenmeyen LZMA1/LZMA2 önayarı: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "lc ve lp'nin toplamı 4'ü geçmemelidir" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: --format-raw ile, stdout'a yazılmıyorsa --suffix=.SUF gereklidir" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Dosya adında bilinmeyen sonek var, atlanıyor" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Dosyada '%s' soneki halihazırda var, atlanıyor" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Geçersiz dosya adı soneki" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Değer, bir negatif olmayan ondalık tamsayı" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Geçersiz çoklayıcı soneki" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Geçerli sonekler: 'KiB' (2^10), 'MiB' (2^20) ve 'GiB' (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "'%s' seçeneği değeri erimde olmalıdır [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Bir uçbirimden sıkıştırılmış veri okunamaz" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Bir uçbirime sıkıştırılmış veri yazılamaz" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Standart çıktı'ya yazma başarısız" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Bilinmeyen hata" diff --git a/po/uk.gmo b/po/uk.gmo new file mode 100644 index 0000000..916b036 Binary files /dev/null and b/po/uk.gmo differ diff --git a/po/uk.po b/po/uk.po new file mode 100644 index 0000000..6c49d7a --- /dev/null +++ b/po/uk.po @@ -0,0 +1,1085 @@ +# Ukrainian translation for xz. +# This file is put in the public domain. +# +# Yuri Chornoivan , 2019, 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-12 23:03+0200\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 20.12.0\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: некоректний аргумент --block-list" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: забагато аргументів --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 можна використовувати лише як останній елемент у --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: невідомий тип формату файлів" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: непідтримуваний тип перевірки цілісності" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Разом із параметрами --files або --files0 можна вказувати лише один файл." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "У змінній середовища %s міститься надто багато аргументів" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "Підтримку стискання було вимкнено під час збирання програми" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "Підтримку розпаковування було вимкнено під час збирання програми" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "Підтримки стискання файлів lzip (.lz) не передбачено" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Максимальна кількість фільтрів — чотири" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Обмеження на використання пам'яті є надто жорстким для вказаного налаштування фільтрів." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Не варто користуватися визначенням рівня у режимі без обробки." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Точний перелік параметрів рівнів може залежати від версій програмного забезпечення." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "У форматі .lzma передбачено підтримку лише фільтра LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 не можна використовувати разом із визначенням формату .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Ланцюжок фільтрування є несумісним із параметром --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Перемикаємося на однопотоковий режим через використання --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Використовуємо до % потоків обробки." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Непідтримуваний ланцюжок фільтрування або непідтримувані параметри фільтрування" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Для розпаковування знадобляться %s МіБ пам'яті." + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Зменшено кількість потоків обробки з %s до %s, щоб не перевищувати обмеження щодо використання пам'яті у %s МіБ" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "Кількість потоків обробки зменшено з %s до одного. Автоматичне обмеження використання пам'яті у %s МіБ усе ще перевищено. Потрібно %s МіБ пам'яті. Продовжуємо роботу попри це." + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Перемикаємося на однопотоковий режим, щоб не перевищувати обмеження щодо використання пам'яті у %s МіБ" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Скориговано розмір словника LZMA%c з %s МіБ до %s МіБ, щоб не перевищувати обмеження на використання пам'яті у %s МіБ" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Помилка під час створення каналу: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "Не вдалося увімкнути пісочницю" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: помилка poll(): %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: здається, файл пересунуто; не вилучаємо" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: не вдалося вилучити: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: не вдалося встановити власника файла: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: не вдалося встановити групу власника файла: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: не вдалося встановити права доступу до файла: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Помилка під час спроби отримання прапорців стану файла зі стандартного джерела вхідних даних: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: є символічним посиланням; пропускаємо" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: є каталогом; пропускаємо" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: не є звичайним файлом; пропускаємо" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: для файла встановлено біт setuid або setgid; пропускаємо" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: для файла встановлено липкий біт; пропускаємо" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: виявлено декілька жорстких посилань на файл із вхідними даними; пропускаємо" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Порожня назва файла; пропускаємо" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Помилка під час спроби відновлення прапорців стану для стандартного джерела вхідних даних: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Помилка під час спроби отримання прапорців стану файла зі стандартного виведення: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Помилка під час спроби відновлення прапорця O_APPEND для стандартного виведення: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: не вдалося закрити файл: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: помилка позиціювання під час спроби створити розріджений файл: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: помилка читання: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: помилка позиціювання у файлі: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: неочікуваний кінець файла" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: помилка під час спроби запису: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Вимкнено" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "Обсяг фізичної пам'яті (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "Кількість потоків обробки процесором:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "Стискання:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "Розпакування:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "Багатопотокове розпаковування:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "Типове для -T0:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "Дані щодо обладнання:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "Обмеження на використання пам'яті:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "Потоки:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "Блоки:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "Стиснутий розмір:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "Нестиснутий розмір:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "Пропорція:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "Перевірка:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "Доповнення потоку:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "Потрібний об'єм пам'яті:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "Розмір у заголовках:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "Кількість файлів:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "Потік" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "Блок" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "Блоки" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "СтисЗсув" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "НестисЗсув" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "СтисРозмір" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "НестисРозмір" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "Загальний розмір" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "Пропорція" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "Перевірка" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "ЗначПерев" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "Заповн" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "Заголов" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "Прапор" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "ВикПам" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "Фільтри" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Немає" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Невідомо-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Невідомо-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Невідомо-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Невідомо-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Невідомо-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Невідомо-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Невідомо-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "Невідом-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "Невідом-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "Невідом-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "Невідом-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "Невідом-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: файл порожній" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: є надто малим для коректного файла .xz" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Потоки Блоки Стиснуті Нестиснуті Коеф. Перев. Назва файла" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Так" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Ні" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Мінімальна версія програм XZ: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s файл\n" +msgstr[1] "%s файли\n" +msgstr[2] "%s файлів\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Загалом:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list працює лише для файлів .xz (--format=xz або --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "Використання --list скасовує підтримку читання зі стандартного джерела вхідних даних" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: помилка під час читання назв файлів: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: неочікуваний кінець вхідних даних під час читання назв файлів" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: під час читання назв файлів виявлено нуль-символ; можливо, ви хотіли скористатися --files0, а не --files?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "У поточній версії ще не передбачено підтримки стискання або розпаковування з параметром --robot." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Читання даних зі стандартного джерела вхідних даних неможливе, якщо зі стандартного джерела даних виконується читання назв файлів standard input" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Внутрішня помилка (вада)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Не вдалося встановити обробники сигналів" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Немає перевірки цілісності; цілісність файлів перевірено не буде" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Непідтримуваний тип перевірки цілісності; перевірки цілісності виконано не буде" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Перевищено обмеження на використання пам'яті" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Формат файла не розпізнано" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Непідтримувані параметри" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Стиснені дані пошкоджено" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Несподіваний кінець вхідних даних" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Потрібно %s МіБ пам'яті. Обмеження вимкнено." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Потрібно %s МіБ пам'яті. Маємо обмеження у %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: ланцюжок фільтрування: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Спробуйте «%s --help» для отримання докладнішого опису." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Користування: %s [ПАРАМЕТР]... [ФАЙЛ]...\n" +"Стиснути або розпакувати файли у форматі .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" +"Обов’язкові аргументи для довгих форм запису параметрів є обов’язковими і для\n" +"скорочених форм.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Режим роботи:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress примусово стиснути\n" +" -d, --decompress примусово розпакувати\n" +" -t, --test перевірити цілісність стиснених файлів\n" +" -l, --list вивести дані щодо файлів .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Модифікатори дій:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep зберігати (не вилучати) вхідні файли\n" +" -f, --force примусово перезаписувати вихідний файл і (роз)пакувати\n" +" посилання\n" +" -c, --stdout записувати дані до стандартного виведення і не вилучати\n" +" вхідні файли" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream розпакувати лише перший потік і без запитань\n" +" ігнорувати решту вхідних даних" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse не створювати розріджених файлів під час розпаковування\n" +" -S, --suffix=.SUF використовувати суфікс .SUF для стиснених файлів\n" +" --files[=ФАЙЛ] прочитати назви файлів для обробки з файла ФАЙЛ; якщо\n" +" ФАЙЛ не вказано, назви файлів буде прочитано зі\n" +" стандартного джерела введення; список назв файлів має\n" +" бути завершено символом нового рядка\n" +" --files0[=ФАЙЛ] подібний до --files, але список файлів завершується\n" +" нуль-символом" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Базові параметри формату файлів і стискання:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=ФОРМАТ формат файлів для кодування або декодування; можливими\n" +" є значення auto (типове), xz, lzma, lzip та raw\n" +" -C, --check=ТИП тип перевірки цілісності: none («немає», будьте обережні),\n" +" crc32, crc64 (типовий) або sha256" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check не виконувати перевірку цілісності при розпаковуванні" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 рівень стискання; типовим є 6; візьміть до уваги\n" +" параметри використання пам'яті для пакування і\n" +" розпакування, перш ніж використовувати рівні 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme спробувати поліпшити рівень стискання ширшим використанням\n" +" процесора; не впливає на вимоги щодо пам'яті для\n" +" розпаковування" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=N використовувати не більше N потоків; типовим є\n" +" значення 1; встановіть значення 0, щоб програма\n" +" використовувала стільки потоків, скільки є ядер\n" +" у процесора" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=РОЗМІР\n" +" розпочинати новий файл .xz кожні РОЗМІР байтів вхідних\n" +" даних; цим параметром слід користуватися для\n" +" встановлення розміру блоку для пакування у декілька\n" +" потоків" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=РОЗМІРИ\n" +" розпочинати нові блоки .xz після вказаних інтервалів\n" +" нестиснених даних; записи відокремлюються комами" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=ЧАС_ОЧІКУВАННЯ\n" +" під час стискання, якщо з часу попереднього спорожнення\n" +" буфера і читання додаткового блоку вхідних даних\n" +" минуло більше за ЧАС_ОЧІКУВАННЯ мілісекунд, витерти\n" +" усі дані у черзі" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=ОБМЕЖЕННЯ\n" +" --memlimit-decompress=ОБМЕЖЕННЯ\n" +" -M, --memlimit=ОБМЕЖЕННЯ\n" +" встановити обмеження на використання пам'яті для\n" +" стискання, розпаковування, потокового розпаковування\n" +" або усіх режимів; ОБМЕЖЕННЯ слід вказувати у байтах,\n" +" % RAM або вказати 0 (типове значення)" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust якщо параметри стискання призводять до перевищення\n" +" обмежень на пам'ять, вивести помилку і не коригувати\n" +" параметри" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Нетиповий ланцюжок фільтрування для стискання (альтернатива використання\n" +" рівнів):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=ПАРАМЕТРИ] LZMA1 або LZMA2; ПАРАМЕТРИ — відокремлений комами список\n" +" --lzma2[=ПАРАМЕТРИ] нуля або декількох параметрів (коректні значення;\n" +" типове):\n" +" preset=РІВ скинути параметри до рівня (0-9[e])\n" +" dict=N розмір словника (4KiB - 1536MiB; 8MiB)\n" +" lc=N кількість буквальних контекстних бітів\n" +" (0-4; 3)\n" +" lp=N кількість буквальних бітів позицій (0-4; 0)\n" +" pb=N кількість бітів позицій (0-4; 2)\n" +" mode=РЕЖИМ режим стискання (fast, normal; normal)\n" +" nice=N довжина відповідності nice (2-273; 64)\n" +" mf=НАЗВА пошук відповідності (hc3, hc4, bt2, bt3,\n" +" bt4; bt4)\n" +" depth=N макс. глибина пошуку; 0=авто (типова)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=ПАРАМ] фільтр BCJ x86 (32-бітовий і 64-бітовий)\n" +" --arm[=ПАРАМ] фільтр BCJ ARM\n" +" --armthumb[=ПАРАМ] фільтр BCJ ARM-Thumb\n" +" --arm64[=ПАРАМ] фільтр BCJ ARM64\n" +" --powerpc[=ПАРАМ] фільтр BCJ PowerPC (лише зворотний порядок байтів)\n" +" --ia64[=ПАРАМ] фільтр BCJ IA-64 (Itanium)\n" +" --sparc[=ПАРАМ] фільтр BCJ SPARC\n" +" Коректні значення ПАРАМЕТРИ для усіх фільтрів BCJ:\n" +" start=N початковий зсув для перетворень (типовий=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=ПАРАМЕТРИ] дельта-фільтр; коректні ПАРАМЕТРИ (значення; типове):\n" +" dist=N відстань між байтами, які віднімаються\n" +" один від одного (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Інші параметри:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet придушити попередження; вкажіть двічі, щоб придушити\n" +" помилки\n" +" -v, --verbose режим докладних повідомлень; вкажіть двічі, щоб підвищити\n" +" докладність" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn попередження не впливають на стан виходу" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot використовувати повідомлення для обробки комп'ютером\n" +" (корисно для створення сценаріїв)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory вивести загальні дані щодо оперативної пам'яті і поточних\n" +" обмежень щодо її використання, потім завершити роботу" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help вивести коротке довідкове повідомлення (лише базові\n" +" параметри)\n" +" -H, --long-help вивести це розширене довідкове повідомлення і завершити\n" +" роботу" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help показати цю коротку довідку і завершити роботу\n" +" -H, --long-help показати розгорнуту довідку (із усіма додатковими\n" +" параметрами)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version вивести дані щодо версії програми і завершити роботу" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Якщо вхідний файл не вказаний, або якщо вказано символ -,\n" +"використовується стандартний ввід.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Сповіщайте розробників про вади за адресою <%s>\n" +"(англійською і фінською).\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Домашня сторінка %s: <%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ЦЕ ТЕСТОВА ВЕРСІЯ, ЯКУ НЕ ПРИЗНАЧЕНО ДЛЯ ПРОМИСЛОВОГО ВИКОРИСТАННЯ." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: параметри -- пари «назва=значення», відокремлені комами" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: некоректна назва параметра" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: некоректне значення параметра" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Непідтримуваний рівень стискання LZMA1/LZMA2: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Сума lc і lp не повинна перевищувати 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "" +"%s: якщо вказано --format=raw, слід вказати і --suffix=.SUF, якщо дані\n" +"виводяться не до стандартного виведення" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: назва файла має невідомий суфікс; пропускаємо" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: файл вже має суфікс назви %s; пропускаємо" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: некоректний суфікс назви файла" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: значення не є невід'ємним десятковим цілим" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: некоректний суфікс множника" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Коректними є суфікси «KiB» (2^10), «MiB» (2^20) та «GiB» (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Значення параметра «%s» має належати до діапазону [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Стиснені дані неможливо прочитати з термінала" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Стиснені дані неможливо записати до термінала" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Не вдалося записати дані до стандартного виведення" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Невідома помилка" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Вибраний засіб пошуку відповідності потребує принаймні nice=%" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Обмеження пам'яті для пакування: " + +#~ msgid " Streams: %s\n" +#~ msgstr " Потоки: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " Блоки: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " Коефіцієнт: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " Перевірка: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Потоки:\n" +#~ " Потік Блоки ЗсувСтисн. ЗсувНестисн. РозмСтисн. РозмНестисн Коеф. Перевірка Доповнення" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Блоки:\n" +#~ " Потік Блок ЗсувСтисн. ЗсувНестисн. ЗагРозм. РозмНестисн Коеф. Перевірка" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " ЗначПер %*s Загол. Прапорці РозмСтисн ВикПам Фільтри" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "Пісочницю вимкнено через несумісні параметри у рядку команди" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "Пісочницю успішно увімкнено" diff --git a/po/vi.gmo b/po/vi.gmo new file mode 100644 index 0000000..70806f0 Binary files /dev/null and b/po/vi.gmo differ diff --git a/po/vi.po b/po/vi.po new file mode 100644 index 0000000..9cb7e38 --- /dev/null +++ b/po/vi.po @@ -0,0 +1,1119 @@ +# Vietnamese translations for xz package +# Bản dịch tiếng Việt cho gói xz. +# This file is put in the public domain. +# Trần Ngọc Quân , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.1.4beta\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2014-09-25 09:06+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Poedit-Basepath: ../\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s: Đối số cho --block-list không hợp lệ" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s: Quá nhiều đối số cho --block-list" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 chỉ có thể dùng như là phần tử cuối trong --block-list" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s: Không hiểu kiểu định dạng tập tin" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s: Không hỗ trợ kiểu kiểm tra toàn vẹn" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "Chỉ được đưa ra một tập tin cho “--files” hay “--files0”." + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "Biến môi trường %s chứa quá nhiều đối số" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "Số lượng bộ lọc tối đa là bốn" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "Mức giới hạn dùng bộ nhớ là quá thấp cho việc cài đặt bộ lọc đã cho." + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "Dùng hiện tại trong chế độ thô là ngớ ngẩn." + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "Các tùy chọn trích xuất của chỉnh trước có thể biến đổi phụ thuộc vào phiên bản." + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "Định dạng .lzma chỉ hỗ trợ bộ lọc LZMA1" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 không thể được dùng với định dạng .xz" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "Móc xích lọc là không tương thích với --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "Chuyển sang chế độ đơn tuyến trình bởi vì --flush-timeout" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "Dùng đến % tuyến trình." + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "Không hỗ trợ lọc móc xích hay tùy chọn lọc" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "Giải nén sẽ cần %s MiB bộ nhớ." + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "Chỉnh số lượng tuyến trình từ %s thành %s để không vượt quá giới hạn tiêu dùng bộ nhớ là %s MiB" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "Chỉnh số lượng tuyến trình từ %s thành %s để không vượt quá giới hạn tiêu dùng bộ nhớ là %s MiB" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Chỉnh cỡ từ điển LZMA%c từ %s MiB thành %s MiB để không vượt quá giới hạn tiêu dùng bộ nhớ là %s MiB" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "Gặp lỗi khi tạo một ống dẫn: %s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s: hàm poll() bị lỗi: %s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s: Tập tin có lẽ đã bị di chuyển, không phải gỡ bỏ" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s: Không thể gỡ bỏ: %s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s: Không thể đặt chủ sở hữu tập tin: %s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s: Không thể đặt nhóm tập tin: %s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s: Không thể đặt chế độ đọc ghi cho tập tin: %s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "Gặp lỗi khi lấy các cờ trạng thái tập tin từ đầu vào tiêu chuẩn: %s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s: Là một liên kết mềm nên bỏ qua" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s: Không phải là một thư mục nên bỏ qua" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s: Không phải là tập tin thường nên bỏ qua" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s: Tập tin có đặt bít setuid hoặc setgid nên bỏ qua" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s: Tập tin có bít sticky nên bỏ qua" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s: Tập tin đầu vào có nhiều hơn một liên kết cứng nên bỏ qua" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "Tên tập tin trống rỗng nên bỏ qua" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "Gặp lỗi khi phục hồi các cờ trạng thái tới đầu vào tiêu chuẩn: %s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "Gặp lỗi khi lấy các cờ trạng thái tập tin từ đầu vào tiêu chuẩn: %s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "Gặp lỗi khi phục hồi cờ O_APPEND trên đầu ra tiêu chuẩn: %s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s: Gặp lỗi khi đóng tập tin: %s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s: Gặp lỗi khi di chuyển vị trí đọc khi cố tạo một tập tin rải rác: %s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s: Lỗi đọc: %s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s: Gặp lỗi khi di chuyển vị trí đọc tập tin: %s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s: Kết thúc tập tin bất ngờ" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s: Lỗi ghi: %s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "Bị tắt" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "Tổng dung lượng bộ nhớ vật lý (RAM): " + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "Mức giới hạn dùng bộ nhớ cho giải nén:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "Đã chạm mốc giới hạn sử dụng bộ nhớ" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " Cỡ khi bị nén: %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " Cỡ sau giải nén: %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " Đệm luồng dữ liệu: %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " Bộ nhớ cần: %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " Kích cỡ phần đầu: %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " Số tập tin: %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "Tổng cộng:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "Không" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "Chưa_biết2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "Chưa_biết3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "Chưa_biết5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "Chưa_biết6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "Chưa_biết7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "Chưa_biết8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "Chưa_biết9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "ChưaBiết11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "ChưaBiết12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "ChưaBiết13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "ChưaBiết14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "ChưaBiết15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s: Tập tin trống rỗng" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s: Là quá nhỏ đối với tập tin .xz hợp lệ" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "Luồng Khối Nén Giải nén Tỷ lệ Ktra Tập tin" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "Có" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "Không" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " Phiên bản “XZ Utils” tối thiểu: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s tập tin\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "Tổng cộng:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list chỉ hoạt động trên các tập tin .xz (--format=xz hay --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list không hỗ trợ đọc từ đầu vào tiêu chuẩn" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s: Gặp lỗi khi đọc tên tập tin: %s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s: Gặp kết thúc đầu vào bất ngờ khi đọc các tên tập tin" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Gặp ký hiệu Null khi đọc tên tập tin; có lẽ ý bạn muốn là dùng “--files0” chứ không phải “--files'?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "Nén và giải nén với --robot vẫn chưa được hỗ trợ." + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Không thể đọc dữ liệu từ đầu vào tiêu chuẩn khi đọc tập tin từ đầu vào tiêu chuẩn" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "Lỗi nội bộ (lỗi)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "Không thể thiết lập bộ xử lý tín hiệu" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "Không có kiểm tra toàn vẹn nên không thể thẩm tra tính toàn vẹn của tập tin" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "Kiểu kiểm tra toàn vẹn chưa được hỗ trợ; nên không thể thẩm tra tính toàn vẹn của tập tin" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "Đã chạm mốc giới hạn sử dụng bộ nhớ" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "Không nhận ra định dạng tập tin" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "Tùy chọn không được hỗ trợ" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "Dữ liệu đã nén bị hỏng" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "Gặp kết thúc đầu vào bất ngờ" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "Yêu cầu cần có %s MiB bộ nhớ. Nhưng giới hạn bị tắt." + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "Yêu cầu cần có %s MiB bộ nhớ. Nhưng giới hạn là %s." + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s: Móc xích lọc: %s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "Hãy chạy lệnh “%s --help” để xem thông tin thêm." + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"Cách dùng: %s [TÙY CHỌN]... [TẬP TIN]...\n" +"Nén hoặc giải nén các TẬP TIN có định dạng .xz.\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Các tùy chọn dài bắt buộc phải có đối số thì với tùy chọn ngắn cũng vậy.\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " Chế độ thao tác:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress ép buộc nén\n" +" -d, --decompress ép buộc giải nén\n" +" -t, --test kiểm tra tính toàn vẹn của tập tin nén\n" +" -l, --list liệt kê các thông tin về tập tin .xz" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" Bộ chỉnh sửa thao tác:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep giữ lại (đừng xóa) tập tin đầu vào\n" +" -f, --force buộc ghi đè tập tin đầu ra và (giải) nén các liên kết\n" +" -c, --stdout ghi ra đầu ra tiêu chuẩn và không xóa tập tin đầu vào" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream chỉ giải nén luồng dữ liệu đầu, và bỏ qua\n" +" dữ liệu đầu vào còn lại có thể" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse đừng tạo các tập tin rải rác khi giải nén\n" +" -S, --suffix=.ĐUÔI dùng hậu tố “.ĐUÔI” trên các tập tin nén\n" +" --files[=TẬP-TIN] đọc các tập tin cần xử lý từ TẬP-TIN; nếu không có\n" +" TẬP-TIN thì tên tập tin sẽ được đọc vào từ đầu vào tiêu\n" +" chuẩn; chúng phải được kết thúc bằng ký tự dòng mới\n" +" --files0[=TẬP-TIN] giống --files nhưng ký tự kết thúc là null" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" Các tùy chọn về định dạng và nén cơ bản:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=ĐDạng định dạng tập tin cần mã hóa hoặc giải mã; giá trị có thể\n" +" là “auto” (mặc định), “xz”, “lzma”, và “raw”\n" +" -C, --check=KIỂM kiểu kiểm tra toàn vẹn: “none” (thận trọng khi dùng),\n" +" “crc32”, “crc64” (mặc định), hay “sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check không thẩm tra tính toàn vẹn khi giải nén" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 đặt mức nén; mặc định là 6; tiêu dùng nhiều bộ nhớ khi nén\n" +" và giải nén, nên tính toán trước khi dùng 7-9!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme cố gắng nâng cao mức nén bằng cách dùng nhiều CPU hơn;\n" +" nhưng không yêu cần nhiều bộ nhớ khi giải nén" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=SỐ dùng tối đa là SỐ tuyến trình; mặc định là 1; đặt\n" +" thành 0 để dùng số lượng bằng số lõi vi xử lý" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=CỠ\n" +" bắt đầu một khối .xz mới sau mỗi CỠ byte của đầu vào;\n" +" dùng tùy chọn này để đặt cỡ khối cho nén tuyến trình" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=CỠ\n" +" bắt đầu một khối .xz mới sau một danh sách ngăn\n" +" cách bằng dấu phẩy nhịp dữ của dữ liệu chưa nén" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=THỜI_GIAN_CHỜ\n" +" khi đang nén, nếu đã trải qua hơn THỜI_GIAN_CHỜ milli-giây\n" +" kể từ lần đẩy dữ liệu lên đĩa trước đó và đang đọc thêm\n" +" khối nữa, mọi dữ liệu đang chờ sẽ được ghi lên đĩa" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=GIỚI_HẠN\n" +" --memlimit-decompress=GIỚI_HẠN\n" +" -M, --memlimit=GIỚI_HẠN\n" +" đặt mức giới hạn dùng bộ nhớ cho việc nén, giải nén,\n" +" hoặc cả hai; GIỚI_HẠN có đơn vị là byte, % của RAM,\n" +" hay 0 cho mặc định" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust nếu các cài đặt nén vượt quá giới hạn dùng bộ nhớ,\n" +" đưa ra một lỗi thay vì sửa đổi các cài đặt xuống" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" Móc xích lọc tùy chỉnh cho nén (thay cho việc dùng chỉnh trước):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=CTC] LZMA1 hay LZMA2; CÁC-TÙY-CHỌN là danh sách của không hoặc\n" +" --lzma2[=CTC] hơn các tùy chọn sau đây (giá trị hợp lệ; mặc định):\n" +" preset=PRE các tùy chọn tối ưu nén (0-9[e])\n" +" dict=SỐ cỡ từ điển (4KiB - 1536MiB; 8MiB)\n" +" lc=SỐ số bít ngữ cảnh văn bản (0-4; 3)\n" +" lp=SỐ số bít vị trí văn bản (0-4; 0)\n" +" pb=SỐ số bít vị trí (0-4; 2)\n" +" mode=CHẾ_ĐỘ chế độ nén (fast, normal; normal)\n" +" nice=SỐ chiều dài “tốt” của khớp (2-273; 64)\n" +" mf=TÊN bộ tìm khớp (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=SỐ mức sâu tìm kiếm tối đa; 0=tự động (mặc định)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPTS] bộ lọc x86 BCJ (32-bit và 64-bit)\n" +" --powerpc[=OPTS] bộ lọc PowerPC BCJ (chỉ big endian)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ\n" +" --arm[=OPTS] bộ lọc ARM BCJ (chỉ little endian)\n" +" --armthumb[=OPTS] bộ lọc ARM-Thumb BCJ (chỉ little endian)\n" +" --sparc[=OPTS] bộ lọc SPARC BCJ\n" +" các tùy chọn hợp lệ cho mọi bộ lọc BCJ:\n" +" start=SỐ khoảng bù khởi đầu cho chuyển đổi (mặc định=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=OPTS] bộ lọc Delta;\n" +" CÁC-TÙY-CHỌN hợp lệ (giá trị hợp lệ; mặc định):\n" +" dist=SỐ khoảng cách giữa các byte được trừ từ\n" +" những cái khác (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" Tùy chọn khác:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet không xuất các cảnh báo;\n" +" chỉ định hai lần nến bạn muốn chặn cả báo lỗi\n" +" -v, --verbose thông báo chi tiết; dùng hai lần nếu muốn chi tiết hơn" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn làm cho các cảnh báo không ảnh hưởng đến trạng thái thoát" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" +" --robot dùng các thông điệp máy có thể phân tích\n" +" (hữu dụng với scripts)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" +" --info-memory hiển thị tổng lượng RAM và mức giới hạn tiêu dùng\n" +" bộ nhớ hiện tại, rồi thoát" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help hiển thị trợ giúp dạng ngắn gọn\n" +" (chỉ liệt kê các tùy chọn cơ bản)\n" +" -H, --long-help hiển thị trợ giúp đầy đủ rồi thoát" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help hiển thị trợ giúp dạng ngắn gọn rồi thoát\n" +" -H, --long-help hiển thị trợ giúp đầy đủ\n" +" (liệt kê cả những tùy chọn cấp cao)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version hiển thị số phiên bản và thoát" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"Không có TẬP_TIN, hoặc TẬP_TIN là “-”, thì đọc đầu vào tiêu chuẩn.\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"Hãy báo cáo lỗi cho <%s> (bằng tiếng Anh hoặc Phần Lan).\n" +"Thông báo lỗi dịch cho: .\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "Trang chủ %s: <%s>.\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "ĐÂY LÀ PHIÊN BẢN PHÁT TRIỂN VÀ NÓ KHÔNG PHÙ HỢP VỚI MỤC ĐÍCH SẢN XUẤT." + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s: Các tùy chọn phải là các cặp “name=value” ngăn cách nhau bằng dấu phẩy" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s: Tên tùy chọn không hợp lệ" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s: Giá trị của tùy chọn không hợp lệ" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "Hiện nay chưa hỗ trợ LZMA1/LZMA2: %s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "Tổng số lượng lc và lp không được vượt quá 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: Nếu --format=raw, --suffix=.SUF sẽ được yêu cầu trừ trường hợp ghi ra đầu ra tiêu chuẩn" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s: Tên tập tin có phần hậu tố chưa biết nên bỏ qua" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s: Tập tin đã sẵn có hậu tố “%s” nên bỏ qua" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s: Hậu tố tên tập tin không hợp lệ" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s: Giá trị không phải là số thập phân nguyên không âm" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s: Hậu tố nhân tố không hợp lệ" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "Các hậu tố hợp lệ là “KiB” (2^10), “MiB” (2^20), và “GiB” (2^30)." + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "Giá trị cuả tùy chọn “%s” phải nằm trong vùng [%, %]" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "Dữ liệu đã nén không thể đọc từ thiết bị cuối" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "Dữ liệu đã nén không thể ghi ra thiết bị cuối" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "Gặp lỗi khi ghi dữ liệu vào đầu ra tiêu chuẩn" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "Lỗi chưa biết" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "Mức giới hạn dùng bộ nhớ cho nén: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " Luồng dữ liệu: %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " Khối: %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " Tỷ lệ nén: %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " Kiểm tra: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " Luồng dữ liệu:\n" +#~ " Luồng Khối BùNén BùGiảiNén CỡNén CỡGiảiNén TỷLệ Ktra Đệm" + +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " Khối:\n" +#~ " Luồng Khối BùNén BùGiảiNén CỡTổng CỡGiảiNén TỷLệ Ktra" + +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " GTrịKiểm %*s Đầu Cờ CỡNén DùngRAM BộLọc" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "Bộ tìm khớp đã chọn yêu cầu mức “tốt” ít nhất là nice=%" + +#~ msgid "Error setting O_NONBLOCK on standard input: %s" +#~ msgstr "Lỗi cài đặt O_NONBLOCK trên đầu vào tiêu chuẩn: %s" + +#~ msgid "Error setting O_NONBLOCK on standard output: %s" +#~ msgstr "Lỗi cài đặt O_NONBLOCK trên đầu ra tiêu chuẩn: %s" + +#~ msgid "" +#~ " --block-size=SIZE\n" +#~ " when compressing to the .xz format, start a new block\n" +#~ " after every SIZE bytes of input; 0=disabled (default)" +#~ msgstr "" +#~ " --block-size=CỠ\n" +#~ " khi nén thành định dạng .xz, bắt đầu khối mới\n" +#~ " sau mỗi SỐ byte đầu vào; 0=tắt (mặc định)" diff --git a/po/xz.pot b/po/xz.pot new file mode 100644 index 0000000..3318a91 --- /dev/null +++ b/po/xz.pot @@ -0,0 +1,920 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "" + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "" + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "" + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "" + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr "" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "" + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "" + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr "" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr "" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "" +msgstr[1] "" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "" + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "" + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "" + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "" + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "" + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr "" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr "" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr "" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr "" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr "" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr "" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "" + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "" + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "" diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo new file mode 100644 index 0000000..989327c Binary files /dev/null and b/po/zh_CN.gmo differ diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000..1a210e1 --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,1050 @@ +# Chinese translations for xz package +# xz 软件包的简体中文翻译。 +# This file is put in the public domain. +# Boyuan Yang <073plan@gmail.com>, 2019, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: xz 5.4.0-pre1\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2022-11-30 13:31-0500\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s:--block-list 的无效参数" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s:--block-list 得到过多参数" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 仅可用于 --block-list 的最后一个元素" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s:位置文件格式类型" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s:不支持的完整性检查类型" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "仅可使用“--files”或“--files0”指定一个文件。" + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "环境变量 %s 包含过多参数" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "压缩支持已在构建时禁用" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "解压支持已在构建时禁用" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "不支持对 lzip 文件 (.lz) 的压缩" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "过滤器最多数量为四" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "内存用量限制对指定过滤器设置过低。" + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "不推荐在 raw 模式使用预设等级。" + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "各个预设等级所使用的准确选项列表在不同软件版本之间可能不同。" + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr ".lzma 格式只支持 LZMA1 过滤器" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 无法用于 .xz 格式" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "过滤器链和 --flush-timeout 不兼容" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "因 --flush-timeout 而切换至单线程模式" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "使用最多 % 个线程。" + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "不支持的过滤器链或过滤器选项" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "解压缩需要 %s MiB 的内存。" + +#: src/xz/coder.c:309 +#, c-format +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "已将所使用的线程数从 %s 减小为 %s,以不超出 %s MiB 的内存用量限制" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "已将所使用的线程数从 %s 减小为 1。这仍然超出了自动的内存使用限制 %s MiB。需要 %s MiB 的内存。继续操作。" + +#: src/xz/coder.c:356 +#, c-format +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "正在切换到单线程模式以不超出 %s MiB 的内存用量限制" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "已调整 LZMA%c 字典大小(从 %s MiB 调整为 %s MiB),以不超出 %s MiB 的内存用量限制" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "创建管道时出错:%s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "沙盒启用失败" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s:poll() 失败:%s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s:文件似乎已移动,不再进行删除操作" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s:无法删除:%s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s:无法设置文件所有者:%s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s:无法设置文件所有组:%s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s:无法设置文件权限:%s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "从标准输入获取文件状态标志出错:%s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s:是符号链接,跳过" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s:是目录,跳过" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s:不是标准文件,跳过" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s:文件有设置用户ID或设置组ID标识,跳过" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s:文件有粘滞位标识,跳过" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s:输入文件有多于一个硬链接,跳过" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "空文件名,跳过" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "回复标准输入的状态标志时出错:%s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "获取标准输出的文件状态标志时出错:%s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "恢复标准输出的 O_APPEND 标志时出错:%s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s:关闭文件失败:%s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s:尝试创建稀疏文件时 seek 失败:%s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s:读取错误:%s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s:seek 文件时出错:%s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s:未预期的文件结束" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s:写入错误:%s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "已禁用" + +#: src/xz/hardware.c:269 +msgid "Amount of physical memory (RAM):" +msgstr "物理内存(RAM)用量:" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "处理器线程数:" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "压缩:" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "解压缩:" + +#: src/xz/hardware.c:273 +msgid "Multi-threaded decompression:" +msgstr "多线程解压缩:" + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "-T0 的默认值:" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "硬件信息:" + +#: src/xz/hardware.c:299 +msgid "Memory usage limits:" +msgstr "内存使用限制:" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "流:" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "块:" + +#: src/xz/list.c:70 +msgid "Compressed size:" +msgstr "压缩后大小:" + +#: src/xz/list.c:71 +msgid "Uncompressed size:" +msgstr "解压缩大小:" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "比例:" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "校验:" + +#: src/xz/list.c:74 +msgid "Stream Padding:" +msgstr "流填充大小:" + +#: src/xz/list.c:75 +msgid "Memory needed:" +msgstr "所需内存:" + +#: src/xz/list.c:76 +msgid "Sizes in headers:" +msgstr "头部存放大小:" + +#: src/xz/list.c:79 +msgid "Number of files:" +msgstr "文件数量:" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "流" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "块" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "块" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "压缩偏移量" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "解压偏移量" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "压缩后大小" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "解压缩大小" + +#: src/xz/list.c:129 +msgid "TotalSize" +msgstr "总大小" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "比例" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "校验" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "校验值" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "填充" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "头部" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "标志" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "内存用量" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "过滤器" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "无" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "未知-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "未知-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "未知-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "未知-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "未知-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "未知-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "未知-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "未知-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "未知-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "未知-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "未知-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "未知-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s:文件为空" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s:过小而不是有效的 .xz 文件" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " 流 块 压缩大小 解压大小 比例 校验 文件名" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "是" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "否" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " 最低 XZ Utils 版本:%s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s 文件\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "总计:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list 仅适用于 .xz 文件(--format=xz 或 --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list 不支持从标准输入读取" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s:读取文件名列表时出错:%s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s:读取文件名列表时遇到未预期的输入结束" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s:读取文件名列表时获得了空字符;您可能想要使用“--files0”而非“--files”?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "尚不支持带 --robot 的压缩和解压缩。" + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "无法同时从标准输入读取数据和文件名列表" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s:" + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "内部错误(bug)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "无法建立信号处理器" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "无完整性检查;将不验证文件完整性" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "不支持的完整性检查类型;将不验证文件完整性" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "达到内存使用限制" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "无法识别文件格式" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "不支持的选项" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "压缩数据已损坏" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "输入意外结束" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "需要 %s MiB 的内存空间。限制已禁用。" + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "需要 %s MiB 的内存空间。限制为 %s。" + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s:过滤器链:%s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "请尝试执行“%s --help”来获取更多信息。" + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"用法:%s [选项]... [文件]...\n" +"使用 .xz 格式压缩或解压缩文件。\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "必选参数对长短选项同时适用。\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " 操作模式:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress 强制压缩\n" +" -d, --decompress 强制解压缩\n" +" -t, --test 测试压缩文件完整性\n" +" -l, --list 列出 .xz 文件的信息" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" 操作修饰符:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep 保留(不要删除)输入文件\n" +" -f, --force 强制覆写输出文件和(解)压缩链接\n" +" -c, --stdout 向标准输出写入,同时不要删除输入文件" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr " --single-stream 仅解压缩第一个流,忽略其后可能继续出现的输入数据" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse 解压缩时不要创建稀疏文件\n" +" -S, --suffix=.SUF 压缩文件使用指定的“.SUF”后缀名\n" +" --files[=文件] 从指定文件读取要处理的文件名列表;如果省略了指定文件名,\n" +" 将从标准输入读取文件名列表;文件名必须使用换行符分隔\n" +" --files0[=文件] 类似 --files,但使用空字符进行分隔" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" 基本文件格式和压缩选项:\n" + +#: src/xz/message.c:1007 +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=格式 要编码或解码的文件格式;可能的值包括\n" +" “auto”(默认)、“xz”、“lzma”、\n" +" “lzip”和“raw”\n" +" -C, --check=类型 完整性检查类型:“none”(请谨慎使用)、\n" +" “crc32”、“crc64”(默认)或“sha256”" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check 解压缩时不要进行完整性检查验证" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 压缩预设等级;默认为 6;使用 7-9 的等级之前,请先考虑\n" +" 压缩和解压缩所需的内存用量!(会占用大量内存空间)" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme 尝试使用更多 CPU 时间来改进压缩比率;\n" +" 不会影响解压缩的内存需求量" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=数量 使用最多指定数量的线程;默认值为 1;设置为 0\n" +" 可以使用与处理器内核数量相同的线程数" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=块大小\n" +" 输入每读取指定块大小的数据后即开始一个新的 .xz 块;\n" +" 使用该选项可以设置多线程压缩中的块大小" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" +" --block-list=块大小列表\n" +" 在所给出的未压缩数据间隔大小的数据之后开始一个新的\n" +" .xz 块(使用逗号分隔)" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" +" --flush-timeout=超时时间\n" +" 进行压缩时,如果从上次刷洗输出之后经过了指定的超时时间\n" +" 且读取更多数据会被阻塞,则刷洗输出所有缓冲数据" + +#: src/xz/message.c:1043 +#, no-c-format +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=限制用量\n" +" --memlimit-decompress=限制用量\n" +" --memlimit-mt-decompress=限制用量\n" +" -M, --memlimit=限制用量\n" +" 设置压缩、解压缩、多线程解压缩或者共同的内存用量限制;\n" +" 所指定限制量单位为字节,或以百分号 % 结尾表示内存比例,\n" +" 或者指定 0 取软件默认值" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr " --no-adjust 如果压缩设置超出内存用量限制,不调整设置而直接报错" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" 用于压缩的自定义过滤器链(不使用预设等级时的备选用法):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=选项] LZMA1 或 LZMA2;指定选项是用逗号分隔的下列选项的组合,\n" +" --lzma2[=选项] 值应当为零或大于零(有效值;默认值):\n" +" preset=PRE 将选项重置为预设配置 (0-9[e])\n" +" dict=数字 字典大小 (4KiB - 1536MiB; 8MiB)\n" +" lc=数字 literal context 位的数量 (0-4; 3)\n" +" lp=数字 literal position 位的数量 (0-4; 0)\n" +" pb=数字 position 位的数量 (0-4; 2)\n" +" mode=模式 压缩模式 (fast, normal; normal)\n" +" nice=数字 匹配的 nice 值 (2-273; 64)\n" +" mf=名称 匹配搜索器 match finder\n" +" (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=数字 最大搜索深度; 0=自动(默认)" + +#: src/xz/message.c:1082 +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=选项] x86 BCJ 过滤器(32 位和 64 位)\n" +" --arm[=选项] ARM BCJ 过滤器\n" +" --armthumb[=选项] ARM-Thumb BCJ 过滤器\n" +" --arm64[=选项] ARM64 BCJ 过滤器\n" +" --powerpc[=选项] PowerPC BCJ 过滤器(仅大端序)\n" +" --ia64[=选项] IA-64 (Itanium,安腾) BCJ 过滤器\n" +" --sparc[=选项] SPARC BCJ 过滤器\n" +" 所有过滤器可用选项:\n" +" start=数字 转换的起始偏移量(默认=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" +"\n" +" --delta[=选项] 增量过滤器;有效选项(有效值;默认值):\n" +" dist=NUM 相减的字节之间的距离 (1-256; 1)" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" 其它选项:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet 不显示警告信息;指定两次可不显示错误信息\n" +" -v, --verbose 输出详细信息;指定两次可以输出更详细的信息" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn 使得警告信息不影响程序退出返回值" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot 使用机器可解析的信息(对于脚本有用)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr " --info-memory 显示 RAM 总量和当前配置的内存用量限制,然后退出" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help 显示短帮助信息(仅列出基本选项)\n" +" -H, --long-help 显示本长帮助信息" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help 显示本短帮助信息并退出\n" +" -H, --long-help 显示长帮助信息(同时列出高级选项)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version 显示软件版本号并退出" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"如果没有指定文件,或者文件为\"-\",则从标准输入读取。\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "" +"请使用英文或芬兰语向 <%s> 报告软件错误。\n" +"请使用中文向 TP 简体中文翻译团队 \n" +"报告软件的简体中文翻译错误。\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s 主页:<%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "这是开发版本,不适用于生产环境使用。" + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s:选项必须按照“名称=值”的格式成对出现,使用半角逗号分隔" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s:无效的选项名称" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s:无效的选项值" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "不支持的 LZMA1/LZMA2 预设等级:%s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "lc 和 lp 的和必须不大于 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s:在启用 --format-raw 选项时,必须指定 --suffix=.SUF 获知写入至标准输出" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s:文件名有未知后缀,跳过" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s:文件已有“%s”后缀名,跳过" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s:无效的文件名后缀" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s:值不是非负十进制整数" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s:无效的乘数后缀" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "有效的后缀包括“KiB”(2^10)、“MiB”(2^20)和“GiB”(2^30)。" + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "选项“%s”的值必须位于 [%, %] 范围内" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "压缩数据不能从终端读取" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "压缩数据不能向终端写入" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "写入标准输出失败" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "未知错误" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "所选中的匹配搜索器(match finder)至少需要 nice=%" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "沙盒已因不兼容的命令行参数而禁用" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "已成功启用沙盒" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "用于压缩的内存用量限制: " + +#~ msgid " Streams: %s\n" +#~ msgstr " 流: %s\n" + +#~ msgid " Blocks: %s\n" +#~ msgstr " 块: %s\n" + +#~ msgid " Ratio: %s\n" +#~ msgstr " 压缩比: %s\n" + +#~ msgid " Check: %s\n" +#~ msgstr " 校验方式: %s\n" + +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " 流:\n" +#~ " 流 块 压缩偏移量 解压偏移量 压缩大小 解压大小 比例 校验 填充" + +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " 块:\n" +#~ " 流 块 压缩偏移量 解压偏移量 总计大小 解压大小 比例 校验" + +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " CheckVal %*s 头部 标记 压缩大小 内存使用 过滤器" diff --git a/po/zh_TW.gmo b/po/zh_TW.gmo new file mode 100644 index 0000000..a1d3923 Binary files /dev/null and b/po/zh_TW.gmo differ diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100644 index 0000000..f9dd78a --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,1091 @@ +# Chinese translations for xz package. +# This file is put in the public domain. +# +# pan93412 , 2019. +msgid "" +msgstr "" +"Project-Id-Version: xz 5.2.4\n" +"Report-Msgid-Bugs-To: xz@tukaani.org\n" +"POT-Creation-Date: 2023-01-11 19:01+0200\n" +"PO-Revision-Date: 2019-04-23 22:00+0800\n" +"Last-Translator: pan93412 \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.2.1\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#: src/xz/args.c:77 +#, c-format +msgid "%s: Invalid argument to --block-list" +msgstr "%s:傳入 --block-list 的參數無效" + +#: src/xz/args.c:87 +#, c-format +msgid "%s: Too many arguments to --block-list" +msgstr "%s:傳入 --block-list 的參數過多" + +#: src/xz/args.c:116 +msgid "0 can only be used as the last element in --block-list" +msgstr "0 只能作為 --block-list 的最後一個元素" + +#: src/xz/args.c:451 +#, c-format +msgid "%s: Unknown file format type" +msgstr "%s:未知檔案格式類型" + +#: src/xz/args.c:474 src/xz/args.c:482 +#, c-format +msgid "%s: Unsupported integrity check type" +msgstr "%s:不支援的完整性檢查類型" + +#: src/xz/args.c:518 +msgid "Only one file can be specified with `--files' or `--files0'." +msgstr "「--files」或「--files0」只能指定一個檔案。" + +#: src/xz/args.c:586 +#, c-format +msgid "The environment variable %s contains too many arguments" +msgstr "%s 環境變數包含過多參數" + +#: src/xz/args.c:688 +msgid "Compression support was disabled at build time" +msgstr "已在編譯時停用壓縮支援" + +#: src/xz/args.c:695 +msgid "Decompression support was disabled at build time" +msgstr "已在編譯時停用解壓縮支援" + +#: src/xz/args.c:701 +msgid "Compression of lzip files (.lz) is not supported" +msgstr "" + +#: src/xz/coder.c:115 +msgid "Maximum number of filters is four" +msgstr "最多只能指定 4 個篩選器" + +#: src/xz/coder.c:134 +msgid "Memory usage limit is too low for the given filter setup." +msgstr "記憶體用量限制過低,不足以設定指定的篩選器。" + +#: src/xz/coder.c:169 +msgid "Using a preset in raw mode is discouraged." +msgstr "不建議在 Raw 模式使用設定檔。" + +#: src/xz/coder.c:171 +msgid "The exact options of the presets may vary between software versions." +msgstr "設定檔的選項可能因軟體版本而有異。" + +#: src/xz/coder.c:194 +msgid "The .lzma format supports only the LZMA1 filter" +msgstr ".lzma 格式僅支援 LZMA1 篩選器" + +#: src/xz/coder.c:202 +msgid "LZMA1 cannot be used with the .xz format" +msgstr "LZMA1 不能與 .xz 格式一同使用" + +#: src/xz/coder.c:219 +msgid "The filter chain is incompatible with --flush-timeout" +msgstr "篩選鏈不相容 --flush-timeout" + +#: src/xz/coder.c:225 +msgid "Switching to single-threaded mode due to --flush-timeout" +msgstr "因指定 --flush-timeout,因此切換到單執行緒模式" + +#: src/xz/coder.c:249 +#, c-format +msgid "Using up to % threads." +msgstr "使用最多 % 個執行緒。" + +#: src/xz/coder.c:265 +msgid "Unsupported filter chain or filter options" +msgstr "不支援的篩選鏈或篩選器選項" + +#: src/xz/coder.c:277 +#, c-format +msgid "Decompression will need %s MiB of memory." +msgstr "解壓縮將需要 %s MiB 的記憶體。" + +#: src/xz/coder.c:309 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgstr "已將 %s 個執行緒調整至 %s,以不超過記憶體用量的 %s MiB 限制" + +#: src/xz/coder.c:329 +#, c-format +msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway." +msgstr "" + +#: src/xz/coder.c:356 +#, fuzzy, c-format +#| msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB" +msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB" +msgstr "已將 %s 個執行緒調整至 %s,以不超過記憶體用量的 %s MiB 限制" + +#: src/xz/coder.c:411 +#, c-format +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "已將 LZMA%c 的字典大小從 %s MiB 調整至 %s MiB,以不超過記憶體用量的 %s MiB 限制" + +#: src/xz/file_io.c:110 src/xz/file_io.c:118 +#, c-format +msgid "Error creating a pipe: %s" +msgstr "建立管線時發生錯誤:%s" + +#: src/xz/file_io.c:235 +msgid "Failed to enable the sandbox" +msgstr "無法啟用沙盒" + +#: src/xz/file_io.c:277 +#, c-format +msgid "%s: poll() failed: %s" +msgstr "%s:poll() 失敗:%s" + +#. TRANSLATORS: When compression or decompression finishes, +#. and xz is going to remove the source file, xz first checks +#. if the source file still exists, and if it does, does its +#. device and inode numbers match what xz saw when it opened +#. the source file. If these checks fail, this message is +#. shown, %s being the filename, and the file is not deleted. +#. The check for device and inode numbers is there, because +#. it is possible that the user has put a new file in place +#. of the original file, and in that case it obviously +#. shouldn't be removed. +#: src/xz/file_io.c:344 +#, c-format +msgid "%s: File seems to have been moved, not removing" +msgstr "%s:檔案似乎已經遷移,不移除" + +#: src/xz/file_io.c:351 src/xz/file_io.c:907 +#, c-format +msgid "%s: Cannot remove: %s" +msgstr "%s:無法移除:%s" + +#: src/xz/file_io.c:377 +#, c-format +msgid "%s: Cannot set the file owner: %s" +msgstr "%s:無法設定檔案所有者:%s" + +#: src/xz/file_io.c:390 +#, c-format +msgid "%s: Cannot set the file group: %s" +msgstr "%s:無法設定檔案群組:%s" + +#: src/xz/file_io.c:409 +#, c-format +msgid "%s: Cannot set the file permissions: %s" +msgstr "%s:無法設定檔案權限:%s" + +#: src/xz/file_io.c:535 +#, c-format +msgid "Error getting the file status flags from standard input: %s" +msgstr "從標準輸入取得檔案狀態旗標時發生錯誤:%s" + +#: src/xz/file_io.c:593 src/xz/file_io.c:655 +#, c-format +msgid "%s: Is a symbolic link, skipping" +msgstr "%s:是個符號連結,跳過" + +#: src/xz/file_io.c:684 +#, c-format +msgid "%s: Is a directory, skipping" +msgstr "%s:是個目錄,跳過" + +#: src/xz/file_io.c:690 +#, c-format +msgid "%s: Not a regular file, skipping" +msgstr "%s:不是一般檔案,跳過" + +#: src/xz/file_io.c:707 +#, c-format +msgid "%s: File has setuid or setgid bit set, skipping" +msgstr "%s:檔案已設定 setuid 或 setgid 位元,跳過" + +#: src/xz/file_io.c:714 +#, c-format +msgid "%s: File has sticky bit set, skipping" +msgstr "%s:檔案已設定黏性位元(sticky bit),跳過" + +#: src/xz/file_io.c:721 +#, c-format +msgid "%s: Input file has more than one hard link, skipping" +msgstr "%s:輸入檔有超過一個實際連結 (hard link),跳過" + +#: src/xz/file_io.c:763 +msgid "Empty filename, skipping" +msgstr "空檔名,跳過" + +#: src/xz/file_io.c:817 +#, c-format +msgid "Error restoring the status flags to standard input: %s" +msgstr "將狀態旗標還原到標準輸入時發生錯誤:%s" + +#: src/xz/file_io.c:865 +#, c-format +msgid "Error getting the file status flags from standard output: %s" +msgstr "從標準輸出取得檔案狀態旗標時發生錯誤:%s" + +#: src/xz/file_io.c:1043 +#, c-format +msgid "Error restoring the O_APPEND flag to standard output: %s" +msgstr "將 O_APPEND 旗標還原到標準輸出時發生錯誤:%s" + +#: src/xz/file_io.c:1055 +#, c-format +msgid "%s: Closing the file failed: %s" +msgstr "%s:關閉檔案失敗:%s" + +#: src/xz/file_io.c:1091 src/xz/file_io.c:1354 +#, c-format +msgid "%s: Seeking failed when trying to create a sparse file: %s" +msgstr "%s:嘗試建立疏鬆檔案時發生搜尋失敗:%s" + +#: src/xz/file_io.c:1192 +#, c-format +msgid "%s: Read error: %s" +msgstr "%s:讀取時發生錯誤:%s" + +#: src/xz/file_io.c:1222 +#, c-format +msgid "%s: Error seeking the file: %s" +msgstr "%s:搜尋檔案時發生錯誤:%s" + +#: src/xz/file_io.c:1246 +#, c-format +msgid "%s: Unexpected end of file" +msgstr "%s:非期望的檔案結尾" + +#: src/xz/file_io.c:1305 +#, c-format +msgid "%s: Write error: %s" +msgstr "%s:寫入時發生錯誤:%s" + +#: src/xz/hardware.c:238 +msgid "Disabled" +msgstr "已停用" + +#: src/xz/hardware.c:269 +#, fuzzy +#| msgid "Total amount of physical memory (RAM): " +msgid "Amount of physical memory (RAM):" +msgstr "實體記憶體 (RAM) 總量:" + +#: src/xz/hardware.c:270 +msgid "Number of processor threads:" +msgstr "" + +#: src/xz/hardware.c:271 +msgid "Compression:" +msgstr "" + +#: src/xz/hardware.c:272 +msgid "Decompression:" +msgstr "" + +#: src/xz/hardware.c:273 +#, fuzzy +#| msgid "Memory usage limit for decompression: " +msgid "Multi-threaded decompression:" +msgstr "解壓縮記憶體限制: " + +#: src/xz/hardware.c:274 +msgid "Default for -T0:" +msgstr "" + +#: src/xz/hardware.c:292 +msgid "Hardware information:" +msgstr "" + +#: src/xz/hardware.c:299 +#, fuzzy +#| msgid "Memory usage limit reached" +msgid "Memory usage limits:" +msgstr "達到記憶體用量上限" + +#: src/xz/list.c:68 +msgid "Streams:" +msgstr "" + +#: src/xz/list.c:69 +msgid "Blocks:" +msgstr "" + +#: src/xz/list.c:70 +#, fuzzy +#| msgid " Compressed size: %s\n" +msgid "Compressed size:" +msgstr " 壓縮大小:       %s\n" + +#: src/xz/list.c:71 +#, fuzzy +#| msgid " Uncompressed size: %s\n" +msgid "Uncompressed size:" +msgstr " 未壓縮大小:      %s\n" + +#: src/xz/list.c:72 +msgid "Ratio:" +msgstr "" + +#: src/xz/list.c:73 +msgid "Check:" +msgstr "" + +#: src/xz/list.c:74 +#, fuzzy +#| msgid " Stream padding: %s\n" +msgid "Stream Padding:" +msgstr " 串流填充:       %s\n" + +#: src/xz/list.c:75 +#, fuzzy +#| msgid " Memory needed: %s MiB\n" +msgid "Memory needed:" +msgstr " 所需記憶體量:     %s MiB\n" + +#: src/xz/list.c:76 +#, fuzzy +#| msgid " Sizes in headers: %s\n" +msgid "Sizes in headers:" +msgstr " 檔頭中標示大小:    %s\n" + +#: src/xz/list.c:79 +#, fuzzy +#| msgid " Number of files: %s\n" +msgid "Number of files:" +msgstr " 檔案數:        %s\n" + +#: src/xz/list.c:122 +msgid "Stream" +msgstr "" + +#: src/xz/list.c:123 +msgid "Block" +msgstr "" + +#: src/xz/list.c:124 +msgid "Blocks" +msgstr "" + +#: src/xz/list.c:125 +msgid "CompOffset" +msgstr "" + +#: src/xz/list.c:126 +msgid "UncompOffset" +msgstr "" + +#: src/xz/list.c:127 +msgid "CompSize" +msgstr "" + +#: src/xz/list.c:128 +msgid "UncompSize" +msgstr "" + +#: src/xz/list.c:129 +#, fuzzy +#| msgid "Totals:" +msgid "TotalSize" +msgstr "總計:" + +#: src/xz/list.c:130 +msgid "Ratio" +msgstr "" + +#: src/xz/list.c:131 +msgid "Check" +msgstr "" + +#: src/xz/list.c:132 +msgid "CheckVal" +msgstr "" + +#: src/xz/list.c:133 +msgid "Padding" +msgstr "" + +#: src/xz/list.c:134 +msgid "Header" +msgstr "" + +#: src/xz/list.c:135 +msgid "Flags" +msgstr "" + +#: src/xz/list.c:136 +msgid "MemUsage" +msgstr "" + +#: src/xz/list.c:137 +msgid "Filters" +msgstr "" + +#. TRANSLATORS: Indicates that there is no integrity check. +#. This string is used in tables. In older xz version this +#. string was limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:169 +msgid "None" +msgstr "無" + +#. TRANSLATORS: Indicates that integrity check name is not known, +#. but the Check ID is known (here 2). In older xz version these +#. strings were limited to ten columns in a fixed-width font, but +#. nowadays there is no strict length restriction anymore. +#: src/xz/list.c:175 +msgid "Unknown-2" +msgstr "未知-2" + +#: src/xz/list.c:176 +msgid "Unknown-3" +msgstr "未知-3" + +#: src/xz/list.c:178 +msgid "Unknown-5" +msgstr "未知-5" + +#: src/xz/list.c:179 +msgid "Unknown-6" +msgstr "未知-6" + +#: src/xz/list.c:180 +msgid "Unknown-7" +msgstr "未知-7" + +#: src/xz/list.c:181 +msgid "Unknown-8" +msgstr "未知-8" + +#: src/xz/list.c:182 +msgid "Unknown-9" +msgstr "未知-9" + +#: src/xz/list.c:184 +msgid "Unknown-11" +msgstr "未知-11" + +#: src/xz/list.c:185 +msgid "Unknown-12" +msgstr "未知-12" + +#: src/xz/list.c:186 +msgid "Unknown-13" +msgstr "未知-13" + +#: src/xz/list.c:187 +msgid "Unknown-14" +msgstr "未知-14" + +#: src/xz/list.c:188 +msgid "Unknown-15" +msgstr "未知-15" + +#: src/xz/list.c:351 +#, c-format +msgid "%s: File is empty" +msgstr "%s:檔案是空的" + +#: src/xz/list.c:356 +#, c-format +msgid "%s: Too small to be a valid .xz file" +msgstr "%s:因過小而不認為是個有效 .xz 檔" + +#. TRANSLATORS: These are column headings. From Strms (Streams) +#. to Ratio, the columns are right aligned. Check and Filename +#. are left aligned. If you need longer words, it's OK to +#. use two lines here. Test with "xz -l foo.xz". +#: src/xz/list.c:730 +msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" +msgstr " 串流  區塊    已壓縮    未壓縮  比例 檢驗碼 檔名" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "Yes" +msgstr "是" + +#: src/xz/list.c:1025 src/xz/list.c:1203 +msgid "No" +msgstr "否" + +#: src/xz/list.c:1027 src/xz/list.c:1205 +#, c-format +msgid " Minimum XZ Utils version: %s\n" +msgstr " 最小 XZ 工具程式版本: %s\n" + +#. TRANSLATORS: %s is an integer. Only the plural form of this +#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". +#: src/xz/list.c:1178 +#, c-format +msgid "%s file\n" +msgid_plural "%s files\n" +msgstr[0] "%s 個檔案\n" + +#: src/xz/list.c:1191 +msgid "Totals:" +msgstr "總計:" + +#: src/xz/list.c:1269 +msgid "--list works only on .xz files (--format=xz or --format=auto)" +msgstr "--list 只能在 .xz 檔使用(--format=xz 或 --format=auto)" + +#: src/xz/list.c:1275 +msgid "--list does not support reading from standard input" +msgstr "--list 不支援從標準輸入讀取" + +#: src/xz/main.c:89 +#, c-format +msgid "%s: Error reading filenames: %s" +msgstr "%s:讀取檔名時發生錯誤:%s" + +#: src/xz/main.c:96 +#, c-format +msgid "%s: Unexpected end of input when reading filenames" +msgstr "%s:讀取檔名時遇到非預期的輸入結尾" + +#: src/xz/main.c:120 +#, c-format +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s:讀取檔名時發現空字元;或許您想使用「--files0」而非「--files」?" + +#: src/xz/main.c:188 +msgid "Compression and decompression with --robot are not supported yet." +msgstr "尚未支援搭配 --robot 壓縮和解壓縮。" + +#: src/xz/main.c:266 +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "從標準輸入讀取檔名時,無法從標準輸入讀取資料" + +#. TRANSLATORS: This is the program name in the beginning +#. of the line in messages. Usually it becomes "xz: ". +#. This is a translatable string because French needs +#. a space before a colon. +#: src/xz/message.c:725 +#, c-format +msgid "%s: " +msgstr "%s:" + +#: src/xz/message.c:797 src/xz/message.c:856 +msgid "Internal error (bug)" +msgstr "內部錯誤(臭蟲)" + +#: src/xz/message.c:804 +msgid "Cannot establish signal handlers" +msgstr "無法確立信號處理器" + +#: src/xz/message.c:813 +msgid "No integrity check; not verifying file integrity" +msgstr "沒有完整性檢查;不驗證檔案完整性" + +#: src/xz/message.c:816 +msgid "Unsupported type of integrity check; not verifying file integrity" +msgstr "未知完整性檢查類型;不驗證檔案完整性" + +#: src/xz/message.c:823 +msgid "Memory usage limit reached" +msgstr "達到記憶體用量上限" + +#: src/xz/message.c:826 +msgid "File format not recognized" +msgstr "無法識別檔案格式" + +#: src/xz/message.c:829 +msgid "Unsupported options" +msgstr "不支援的選項" + +#: src/xz/message.c:832 +msgid "Compressed data is corrupt" +msgstr "壓縮資料是損壞的" + +#: src/xz/message.c:835 +msgid "Unexpected end of input" +msgstr "遇到非預期輸入結尾" + +#: src/xz/message.c:877 +#, c-format +msgid "%s MiB of memory is required. The limiter is disabled." +msgstr "需要 %s MiB 的記憶體。已停用記憶體限制器。" + +#: src/xz/message.c:905 +#, c-format +msgid "%s MiB of memory is required. The limit is %s." +msgstr "需要 %s MiB 的記憶體。記憶體限制為 %s。" + +#: src/xz/message.c:924 +#, c-format +msgid "%s: Filter chain: %s\n" +msgstr "%s:篩選鏈:%s\n" + +#: src/xz/message.c:935 +#, c-format +msgid "Try `%s --help' for more information." +msgstr "嘗試「%s --help」取得更多資訊。" + +#: src/xz/message.c:961 +#, c-format +msgid "" +"Usage: %s [OPTION]... [FILE]...\n" +"Compress or decompress FILEs in the .xz format.\n" +"\n" +msgstr "" +"用法:%s [選項]... [檔案]...\n" +"用 .xz 格式壓縮,或解壓縮 .xz 格式中的 <檔案>。\n" +"\n" + +#: src/xz/message.c:968 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "長選項的必填參數,對短選項也是必填。\n" + +#: src/xz/message.c:972 +msgid " Operation mode:\n" +msgstr " 操作模式:\n" + +#: src/xz/message.c:975 +msgid "" +" -z, --compress force compression\n" +" -d, --decompress force decompression\n" +" -t, --test test compressed file integrity\n" +" -l, --list list information about .xz files" +msgstr "" +" -z, --compress 強制壓縮\n" +" -d, --decompress 強制解壓縮\n" +" -t, --test 測試壓縮檔完整性\n" +" -l, --list 列出 .xz 檔的資訊" + +#: src/xz/message.c:981 +msgid "" +"\n" +" Operation modifiers:\n" +msgstr "" +"\n" +" 操作修飾詞:\n" + +#: src/xz/message.c:984 +msgid "" +" -k, --keep keep (don't delete) input files\n" +" -f, --force force overwrite of output file and (de)compress links\n" +" -c, --stdout write to standard output and don't delete input files" +msgstr "" +" -k, --keep 保留(不刪除)輸入檔\n" +" -f, --force 強制覆寫輸出檔並(解)壓縮連結\n" +" -c, --stdout 寫入標準輸出並不刪除輸入檔" + +#: src/xz/message.c:993 +msgid "" +" --single-stream decompress only the first stream, and silently\n" +" ignore possible remaining input data" +msgstr "" +" --single-stream 僅解壓縮第一個串流,再\n" +" 安靜地忽略可能剩餘的輸入檔" + +#: src/xz/message.c:996 +msgid "" +" --no-sparse do not create sparse files when decompressing\n" +" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" +" --files[=FILE] read filenames to process from FILE; if FILE is\n" +" omitted, filenames are read from the standard input;\n" +" filenames must be terminated with the newline character\n" +" --files0[=FILE] like --files but use the null character as terminator" +msgstr "" +" --no-sparse 不在解壓縮時建立疏鬆檔案\n" +" -S, --suffix=.SUF 在壓縮檔加上後綴「.SUF」\n" +" --files[=檔案] 讀取檔案名稱以處理 <檔案>;如省略 <檔案>\n" +" 則從標準輸入讀取檔名;檔名必須以換行字元作為結尾\n" +" --files0[=檔案] 類似 --files 但是以 null 空字元作結尾" + +#: src/xz/message.c:1005 +msgid "" +"\n" +" Basic file format and compression options:\n" +msgstr "" +"\n" +" 基本檔案格式與壓縮選項:\n" + +#: src/xz/message.c:1007 +#, fuzzy +#| msgid "" +#| " -F, --format=FMT file format to encode or decode; possible values are\n" +#| " `auto' (default), `xz', `lzma', and `raw'\n" +#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n" +#| " `crc32', `crc64' (default), or `sha256'" +msgid "" +" -F, --format=FMT file format to encode or decode; possible values are\n" +" `auto' (default), `xz', `lzma', `lzip', and `raw'\n" +" -C, --check=CHECK integrity check type: `none' (use with caution),\n" +" `crc32', `crc64' (default), or `sha256'" +msgstr "" +" -F, --format=格式 用於編碼或解碼的檔案格式;可用的值有:\n" +" 「auto」(預設)、「xz」、「lzma」及「raw」\n" +" -C, --check=檢查碼 完整性檢查類型:「none」(請小心使用)、「crc32」、\n" +" 「crc64」(預設值)或「sha256」" + +#: src/xz/message.c:1012 +msgid " --ignore-check don't verify the integrity check when decompressing" +msgstr " --ignore-check 不在解壓縮時驗證完整性" + +#: src/xz/message.c:1016 +msgid "" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 ... -9 壓縮設定檔;預設值為 6;使用 7-9 前請考慮\n" +" 壓縮和解壓縮所使用的記憶體!" + +#: src/xz/message.c:1020 +msgid "" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" +" does not affect decompressor memory requirements" +msgstr "" +" -e, --extreme 使用更多 CPU 時間以嘗試改善壓縮比;\n" +" 不影響解壓縮器的記憶體需求" + +#: src/xz/message.c:1024 +msgid "" +" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n" +" to use as many threads as there are processor cores" +msgstr "" +" -T, --threads=NUM 使用最多 NUM 個執行緒;預設為 1;設成 0 則使用所有的\n" +" 處理機核心" + +#: src/xz/message.c:1029 +msgid "" +" --block-size=SIZE\n" +" start a new .xz block after every SIZE bytes of input;\n" +" use this to set the block size for threaded compression" +msgstr "" +" --block-size=大小\n" +" 輸入每 <大小> 位元組後,開始一個新 .xz 區塊;\n" +" 使用此功能以設定多執行緒壓縮的區塊大小" + +#: src/xz/message.c:1033 +msgid "" +" --block-list=SIZES\n" +" start a new .xz block after the given comma-separated\n" +" intervals of uncompressed data" +msgstr "" + +#: src/xz/message.c:1037 +msgid "" +" --flush-timeout=TIMEOUT\n" +" when compressing, if more than TIMEOUT milliseconds has\n" +" passed since the previous flush and reading more input\n" +" would block, all pending data is flushed out" +msgstr "" + +#: src/xz/message.c:1043 +#, fuzzy, no-c-format +#| msgid "" +#| " --memlimit-compress=LIMIT\n" +#| " --memlimit-decompress=LIMIT\n" +#| " -M, --memlimit=LIMIT\n" +#| " set memory usage limit for compression, decompression,\n" +#| " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" +msgid "" +" --memlimit-compress=LIMIT\n" +" --memlimit-decompress=LIMIT\n" +" --memlimit-mt-decompress=LIMIT\n" +" -M, --memlimit=LIMIT\n" +" set memory usage limit for compression, decompression,\n" +" threaded decompression, or all of these; LIMIT is in\n" +" bytes, % of RAM, or 0 for defaults" +msgstr "" +" --memlimit-compress=限制\n" +" --memlimit-decompress=限制\n" +" -M, --memlimit=限制\n" +" 限制壓縮、解壓縮或兩者的記憶體用量上限;\n" +" <限制> 可以是位元組、記憶體百分比 (%)、或 0(預設值)" + +#: src/xz/message.c:1052 +msgid "" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" +msgstr "" +" --no-adjust 若壓縮設定超過記憶體用量上限,請給出\n" +" 錯誤而非下調設定" + +#: src/xz/message.c:1058 +msgid "" +"\n" +" Custom filter chain for compression (alternative for using presets):" +msgstr "" +"\n" +" 自訂壓縮篩選鏈(使用設定檔時選用):" + +#: src/xz/message.c:1067 +msgid "" +"\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" +" preset=PRE reset options to a preset (0-9[e])\n" +" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM number of literal context bits (0-4; 3)\n" +" lp=NUM number of literal position bits (0-4; 0)\n" +" pb=NUM number of position bits (0-4; 2)\n" +" mode=MODE compression mode (fast, normal; normal)\n" +" nice=NUM nice length of a match (2-273; 64)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=操作] LZMA1 或 LZMA2;<操作> 是以下選項中的 0 個或以上選項\n" +" --lzma2[=操作] (有效值; 預設):\n" +" preset=PRE 將選項重設至某設定檔的選項 (0-9[e])\n" +" dict=NUM 字典大小 (4KiB - 1536MiB; 8MiB)\n" +" lc=NUM 文字內文位元數 (0-4; 3)\n" +" lp=NUM 文字位置位元數 (0-4; 0)\n" +" pb=NUM 位置位元數 (0-4; 2)\n" +" mode=模式 壓縮模式 (fast, normal; normal)\n" +" nice=NUM 符合項目的 nice 長度 (2-273; 64)\n" +" mf=名稱 尋找符合搜尋器 (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM 最大搜尋深度;0=自動(預設)" + +#: src/xz/message.c:1082 +#, fuzzy +#| msgid "" +#| "\n" +#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +#| " --arm[=OPTS] ARM BCJ filter (little endian only)\n" +#| " --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n" +#| " --sparc[=OPTS] SPARC BCJ filter\n" +#| " Valid OPTS for all BCJ filters:\n" +#| " start=NUM start offset for conversions (default=0)" +msgid "" +"\n" +" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" +" --arm[=OPTS] ARM BCJ filter\n" +" --armthumb[=OPTS] ARM-Thumb BCJ filter\n" +" --arm64[=OPTS] ARM64 BCJ filter\n" +" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n" +" --sparc[=OPTS] SPARC BCJ filter\n" +" Valid OPTS for all BCJ filters:\n" +" start=NUM start offset for conversions (default=0)" +msgstr "" +"\n" +" --x86[=OPTS] x86 BCJ 篩選器 (32 位元和 64 位元)\n" +" --powerpc[=OPTS] PowerPC BCJ 篩選器(僅大端序)\n" +" --ia64[=OPTS] IA-64 (Itanium) BCJ 篩選器\n" +" --arm[=OPTS] ARM BCJ 篩選器(僅小端序)\n" +" --armthumb[=OPTS] ARM-Thumb BCJ 篩選器(僅小端序)\n" +" --sparc[=OPTS] SPARC BCJ 篩選器\n" +" 所有 BCJ 篩選器可用的 OPTS:\n" +" start=NUM 轉換起始位移(預設值=0)" + +#: src/xz/message.c:1095 +msgid "" +"\n" +" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" +" dist=NUM distance between bytes being subtracted\n" +" from each other (1-256; 1)" +msgstr "" + +#: src/xz/message.c:1103 +msgid "" +"\n" +" Other options:\n" +msgstr "" +"\n" +" 其他選項:\n" + +#: src/xz/message.c:1106 +msgid "" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" +" -v, --verbose be verbose; specify twice for even more verbose" +msgstr "" +" -q, --quiet 隱藏警告訊息;指定兩次也一併隱藏錯誤訊息\n" +" -v, --verbose 輸出較詳細內容;指定兩次更詳細輸出" + +#: src/xz/message.c:1111 +msgid " -Q, --no-warn make warnings not affect the exit status" +msgstr " -Q, --no-warn 即使有警告,退出狀態碼仍不變" + +#: src/xz/message.c:1113 +msgid " --robot use machine-parsable messages (useful for scripts)" +msgstr " --robot 使用機器可解析訊息(適合用於指令稿)" + +#: src/xz/message.c:1116 +msgid "" +" --info-memory display the total amount of RAM and the currently active\n" +" memory usage limits, and exit" +msgstr " --info-memory 顯示記憶體總量和使用中的記憶體用量限制後退出" + +#: src/xz/message.c:1119 +msgid "" +" -h, --help display the short help (lists only the basic options)\n" +" -H, --long-help display this long help and exit" +msgstr "" +" -h, --help 顯示較短說明(僅列出基本選項)\n" +" -H, --long-help 顯示較長說明後退出" + +#: src/xz/message.c:1123 +msgid "" +" -h, --help display this short help and exit\n" +" -H, --long-help display the long help (lists also the advanced options)" +msgstr "" +" -h, --help 顯示較短說明後退出\n" +" -H, --long-help 顯示較長說明(也列出進階選項)" + +#: src/xz/message.c:1128 +msgid " -V, --version display the version number and exit" +msgstr " -V, --version 顯示版本號碼後退出" + +#: src/xz/message.c:1130 +msgid "" +"\n" +"With no FILE, or when FILE is -, read standard input.\n" +msgstr "" +"\n" +"如果未指定 <檔案>,或 <檔案> 是 -,則從標準輸入讀取。\n" + +#. TRANSLATORS: This message indicates the bug reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the email or WWW +#. address for translation bugs. Thanks. +#: src/xz/message.c:1136 +#, c-format +msgid "Report bugs to <%s> (in English or Finnish).\n" +msgstr "請回報臭蟲至 <%s>(使用英文或芬蘭語)。\n" + +#: src/xz/message.c:1138 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s 首頁:<%s>\n" + +#: src/xz/message.c:1142 +msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE." +msgstr "此為開發版本,不打算在生產環境使用。" + +#: src/xz/options.c:86 +#, c-format +msgid "%s: Options must be `name=value' pairs separated with commas" +msgstr "%s:選項形式必須為以逗號分隔的「name=value」值對" + +#: src/xz/options.c:93 +#, c-format +msgid "%s: Invalid option name" +msgstr "%s:選項名稱無效" + +#: src/xz/options.c:113 +#, c-format +msgid "%s: Invalid option value" +msgstr "%s:選項值無效" + +#: src/xz/options.c:247 +#, c-format +msgid "Unsupported LZMA1/LZMA2 preset: %s" +msgstr "不支援的 LZMA1/LZMA2 設定檔:%s" + +#: src/xz/options.c:355 +msgid "The sum of lc and lp must not exceed 4" +msgstr "lc 和 lp 的總和不能超過 4" + +#: src/xz/suffix.c:137 src/xz/suffix.c:268 +#, c-format +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s:搭配 --format=raw 時,除非寫入標準輸出,否則需要 --suffix=.SUF" + +#: src/xz/suffix.c:168 +#, c-format +msgid "%s: Filename has an unknown suffix, skipping" +msgstr "%s:檔名有未知後綴,跳過" + +#: src/xz/suffix.c:189 +#, c-format +msgid "%s: File already has `%s' suffix, skipping" +msgstr "%s:檔案已有「%s」後綴,跳過" + +#: src/xz/suffix.c:405 +#, c-format +msgid "%s: Invalid filename suffix" +msgstr "%s:檔名後綴無效" + +#: src/xz/util.c:71 +#, c-format +msgid "%s: Value is not a non-negative decimal integer" +msgstr "%s:數值不是非負數十進位整數" + +#: src/xz/util.c:113 +#, c-format +msgid "%s: Invalid multiplier suffix" +msgstr "%s:乘數後綴無效" + +#: src/xz/util.c:115 +msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." +msgstr "有效的後綴有「KiB」(2^10)、「MiB」(2^20) 及「GiB」(2^30)。" + +#: src/xz/util.c:132 +#, c-format +msgid "Value of the option `%s' must be in the range [%, %]" +msgstr "選項「%s」的數值必須在 [%, %] 範圍內" + +#: src/xz/util.c:269 +msgid "Compressed data cannot be read from a terminal" +msgstr "不能從終端機讀入已壓縮資料" + +#: src/xz/util.c:282 +msgid "Compressed data cannot be written to a terminal" +msgstr "不能將已壓縮資料寫入終端機" + +#: src/common/tuklib_exit.c:40 +msgid "Writing to standard output failed" +msgstr "寫入標準輸出失敗" + +#: src/common/tuklib_exit.c:43 +msgid "Unknown error" +msgstr "未知錯誤" + +#~ msgid "Sandbox is disabled due to incompatible command line arguments" +#~ msgstr "由於指定不相容的指令列參數,已停用沙盒" + +#~ msgid "Sandbox was successfully enabled" +#~ msgstr "已成功啟用沙盒" + +#~ msgid "Memory usage limit for compression: " +#~ msgstr "壓縮記憶體限制: " + +#, c-format +#~ msgid " Streams: %s\n" +#~ msgstr " 串流:         %s\n" + +#, c-format +#~ msgid " Blocks: %s\n" +#~ msgstr " 區塊:         %s\n" + +#, c-format +#~ msgid " Ratio: %s\n" +#~ msgstr " 壓縮比:        %s\n" + +#, c-format +#~ msgid " Check: %s\n" +#~ msgstr " 檢驗碼:        %s\n" + +# 下方的文字因排版有一些障礙,因此暫時不理他。 +#~ msgid "" +#~ " Streams:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" +#~ msgstr "" +#~ " 串流:\n" +#~ " Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" + +# 下方的文字因排版有一些障礙,因此暫時不理他。 +#, c-format +#~ msgid "" +#~ " Blocks:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" +#~ msgstr "" +#~ " 區塊:\n" +#~ " Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" + +# 下方的文字因排版有一些障礙,因此暫時不理他。 +#, c-format +#~ msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" +#~ msgstr " CheckVal %*s Header Flags CompSize MemUsage Filters" + +#, c-format +#~ msgid "The selected match finder requires at least nice=%" +#~ msgstr "選取的符合搜尋工具需要至少 nice=%" diff --git a/po4a/.gitignore b/po4a/.gitignore new file mode 100644 index 0000000..5bcfa04 --- /dev/null +++ b/po4a/.gitignore @@ -0,0 +1,2 @@ +/man +/xz-man.pot diff --git a/po4a/de.po b/po4a/de.po new file mode 100644 index 0000000..0cbc3b6 --- /dev/null +++ b/po4a/de.po @@ -0,0 +1,3710 @@ +# XZ Utils man pages German translation +# This file is put in the public domain. +# +# Mario Blättermann , 2015, 2019-2020, 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz-man 5.4.0-pre2\n" +"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" +"POT-Creation-Date: 2022-12-01 21:23+0200\n" +"PO-Revision-Date: 2022-12-07 20:17+0100\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 22.08.3\n" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "XZ" +msgstr "XZ" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "2022-12-01" +msgstr "1. Dezember 2022" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "Tukaani" +msgstr "Tukaani" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZ Utils" +msgstr "XZ-Dienstprogramme" + +#. type: SH +#: ../src/xz/xz.1:10 ../src/xzdec/xzdec.1:8 ../src/lzmainfo/lzmainfo.1:8 +#: ../src/scripts/xzdiff.1:10 ../src/scripts/xzgrep.1:10 +#: ../src/scripts/xzless.1:11 ../src/scripts/xzmore.1:8 +#, no-wrap +msgid "NAME" +msgstr "BEZEICHNUNG" + +#. type: Plain text +#: ../src/xz/xz.1:12 +msgid "xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma files" +msgstr "xz, unxz, xzcat, lzma, unlzma, lzcat - .xz- und .lzma-Dateien komprimieren oder dekomprimieren" + +#. type: SH +#: ../src/xz/xz.1:13 ../src/xzdec/xzdec.1:10 ../src/lzmainfo/lzmainfo.1:10 +#: ../src/scripts/xzdiff.1:12 ../src/scripts/xzgrep.1:12 +#: ../src/scripts/xzless.1:13 ../src/scripts/xzmore.1:10 +#, no-wrap +msgid "SYNOPSIS" +msgstr "ÜBERSICHT" + +#. type: Plain text +#: ../src/xz/xz.1:17 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: SH +#: ../src/xz/xz.1:18 +#, no-wrap +msgid "COMMAND ALIASES" +msgstr "BEFEHLSALIASE" + +#. type: Plain text +#: ../src/xz/xz.1:22 +msgid "B is equivalent to B." +msgstr "B ist gleichbedeutend mit B." + +#. type: Plain text +#: ../src/xz/xz.1:26 +msgid "B is equivalent to B." +msgstr "B ist gleichbedeutend mit B." + +#. type: Plain text +#: ../src/xz/xz.1:30 +msgid "B is equivalent to B." +msgstr "B ist gleichbedeutend mit B." + +#. type: Plain text +#: ../src/xz/xz.1:34 +msgid "B is equivalent to B." +msgstr "B ist gleichbedeutend mit B." + +#. type: Plain text +#: ../src/xz/xz.1:38 +msgid "B is equivalent to B." +msgstr "B ist gleichbedeutend mit B." + +#. type: Plain text +#: ../src/xz/xz.1:50 +msgid "When writing scripts that need to decompress files, it is recommended to always use the name B with appropriate arguments (B or B) instead of the names B and B." +msgstr "Wenn Sie Skripte schreiben, die Dateien dekomprimieren, sollten Sie stets den Namen B mit den entsprechenden Argumenten (B oder B) anstelle der Namen B und B verwenden." + +#. type: SH +#: ../src/xz/xz.1:51 ../src/xzdec/xzdec.1:18 ../src/lzmainfo/lzmainfo.1:15 +#: ../src/scripts/xzdiff.1:24 ../src/scripts/xzgrep.1:33 +#: ../src/scripts/xzless.1:19 ../src/scripts/xzmore.1:16 +#, no-wrap +msgid "DESCRIPTION" +msgstr "BESCHREIBUNG" + +#. type: Plain text +#: ../src/xz/xz.1:70 +msgid "B is a general-purpose data compression tool with command line syntax similar to B(1) and B(1). The native file format is the B<.xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw compressed streams with no container format headers are also supported. In addition, decompression of the B<.lz> format used by B is supported." +msgstr "B ist ein Allzweckwerkzeug zur Datenkompression, dessen Befehlszeilensyntax denen von B(1) und B(1) ähnelt. Das native Dateiformat ist das B<.xz>-Format, aber das veraltete, von den LZMA-Dienstprogrammen verwendete Format sowie komprimierte Rohdatenströme ohne Containerformat-Header werden ebenfalls unterstützt. Außerdem wird die Dekompression des von B verwendeten B<.lz>-Formats unterstützt." + +#. type: Plain text +#: ../src/xz/xz.1:92 +msgid "B compresses or decompresses each I according to the selected operation mode. If no I are given or I is B<->, B reads from standard input and writes the processed data to standard output. B will refuse (display an error and skip the I) to write compressed data to standard output if it is a terminal. Similarly, B will refuse to read compressed data from standard input if it is a terminal." +msgstr "B komprimiert oder dekomprimierte jede I entsprechend des gewählten Vorgangsmodus. Falls entweder B<-> oder keine Datei angegeben ist, liest B aus der Standardeingabe und leitet die verarbeiteten Dateien in die Standardausgabe. Wenn die Standardausgabe kein Terminal ist, verweigert B das Schreiben komprimierter Daten in die Standardausgabe. Dabei wird eine Fehlermeldung angezeigt und die I übersprungen. Ebenso verweigert B das Lesen komprimierter Daten aus der Standardeingabe, wenn diese ein Terminal ist." + +#. type: Plain text +#: ../src/xz/xz.1:102 +msgid "Unless B<--stdout> is specified, I other than B<-> are written to a new file whose name is derived from the source I name:" +msgstr "I, die nicht als B<-> angegeben sind, werden in eine neue Datei geschrieben, deren Name aus den Namen der Quell-I abgeleitet wird (außer wenn B<--stdout> angegeben ist):" + +#. type: IP +#: ../src/xz/xz.1:102 ../src/xz/xz.1:108 ../src/xz/xz.1:133 ../src/xz/xz.1:138 +#: ../src/xz/xz.1:141 ../src/xz/xz.1:144 ../src/xz/xz.1:160 ../src/xz/xz.1:421 +#: ../src/xz/xz.1:424 ../src/xz/xz.1:431 ../src/xz/xz.1:676 ../src/xz/xz.1:678 +#: ../src/xz/xz.1:777 ../src/xz/xz.1:788 ../src/xz/xz.1:797 ../src/xz/xz.1:805 +#: ../src/xz/xz.1:1033 ../src/xz/xz.1:1042 ../src/xz/xz.1:1054 +#: ../src/xz/xz.1:1729 ../src/xz/xz.1:1735 ../src/xz/xz.1:1853 +#: ../src/xz/xz.1:1857 ../src/xz/xz.1:1860 ../src/xz/xz.1:1863 +#: ../src/xz/xz.1:1867 ../src/xz/xz.1:1874 ../src/xz/xz.1:1876 +#, no-wrap +msgid "\\(bu" +msgstr "\\(bu" + +#. type: Plain text +#: ../src/xz/xz.1:108 +msgid "When compressing, the suffix of the target file format (B<.xz> or B<.lzma>) is appended to the source filename to get the target filename." +msgstr "Bei der Kompression wird das Suffix des Formats der Zieldatei (B<.xz> oder B<.lzma>) an den Namen der Quelldatei angehängt und so der Name der Zieldatei gebildet." + +#. type: Plain text +#: ../src/xz/xz.1:123 +msgid "When decompressing, the B<.xz>, B<.lzma>, or B<.lz> suffix is removed from the filename to get the target filename. B also recognizes the suffixes B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgstr "Bei der Dekompression wird das Suffix B<.xz>, B<.lzma> oder B<.lz> vom Dateinamen entfernt und so der Name der Zieldatei gebildet. Außerdem erkennt B die Suffixe B<.txz> und B<.tlz> und ersetzt diese durch B<.tar>." + +#. type: Plain text +#: ../src/xz/xz.1:127 +msgid "If the target file already exists, an error is displayed and the I is skipped." +msgstr "Wenn die Zieldatei bereits existiert, wird eine Fehlermeldung angezeigt und die I übersprungen." + +#. type: Plain text +#: ../src/xz/xz.1:133 +msgid "Unless writing to standard output, B will display a warning and skip the I if any of the following applies:" +msgstr "Außer beim Schreiben in die Standardausgabe zeigt B eine Warnung an und überspringt die I, wenn eine der folgenden Bedingungen zutreffend ist:" + +#. type: Plain text +#: ../src/xz/xz.1:138 +msgid "I is not a regular file. Symbolic links are not followed, and thus they are not considered to be regular files." +msgstr "Die I ist keine reguläre Datei. Symbolischen Verknüpfungen wird nicht gefolgt und daher nicht zu den regulären Dateien gezählt." + +#. type: Plain text +#: ../src/xz/xz.1:141 +msgid "I has more than one hard link." +msgstr "Die I hat mehr als eine harte Verknüpfung." + +#. type: Plain text +#: ../src/xz/xz.1:144 +msgid "I has setuid, setgid, or sticky bit set." +msgstr "Für die I ist das »setuid«-, »setgid«- oder »sticky«-Bit gesetzt." + +#. type: Plain text +#: ../src/xz/xz.1:160 +msgid "The operation mode is set to compress and the I already has a suffix of the target file format (B<.xz> or B<.txz> when compressing to the B<.xz> format, and B<.lzma> or B<.tlz> when compressing to the B<.lzma> format)." +msgstr "Der Aktionsmodus wird auf Kompression gesetzt und die I hat bereits das Suffix des Zieldateiformats (B<.xz> oder B<.txz> beim Komprimieren in das B<.xz>-Format und B<.lzma> oder B<.tlz> beim Komprimieren in das B<.lzma>-Format)." + +#. type: Plain text +#: ../src/xz/xz.1:170 +msgid "The operation mode is set to decompress and the I doesn't have a suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz>)." +msgstr "Der Aktionsmodus wird auf Dekompression gesetzt und die I hat nicht das Suffix eines der unterstützten Zieldateiformate (B<.xz>, B<.txz>, B<.lzma>, B<.tlz> oder B<.lz>)." + +#. type: Plain text +#: ../src/xz/xz.1:185 +msgid "After successfully compressing or decompressing the I, B copies the owner, group, permissions, access time, and modification time from the source I to the target file. If copying the group fails, the permissions are modified so that the target file doesn't become accessible to users who didn't have permission to access the source I. B doesn't support copying other metadata like access control lists or extended attributes yet." +msgstr "Nach erfolgreicher Kompression oder Dekompression der I kopiert B Eigentümer, Gruppe, Zugriffsrechte, Zugriffszeit und Änderungszeit aus der Ursprungs-I in die Zieldatei. Sollte das Kopieren der Gruppe fehlschlagen, werden die Zugriffsrechte so angepasst, dass jenen Benutzern der Zugriff auf die Zieldatei verwehrt bleibt, die auch keinen Zugriff auf die Ursprungs-I hatten. Das Kopieren anderer Metadaten wie Zugriffssteuerlisten oder erweiterter Attribute wird von B noch nicht unterstützt." + +#. type: Plain text +#: ../src/xz/xz.1:195 +msgid "Once the target file has been successfully closed, the source I is removed unless B<--keep> was specified. The source I is never removed if the output is written to standard output or if an error occurs." +msgstr "Sobald die Zieldatei erfolgreich geschlossen wurde, wird die Ursprungs-I entfernt. Dies wird durch die Option B<--keep> verhindert. Die Ursprungs-I wird niemals entfernt, wenn die Ausgabe in die Standardausgabe geschrieben wird oder falls ein Fehler auftritt." + +#. type: Plain text +#: ../src/xz/xz.1:207 +msgid "Sending B or B to the B process makes it print progress information to standard error. This has only limited use since when standard error is a terminal, using B<--verbose> will display an automatically updating progress indicator." +msgstr "Durch Senden der Signale B oder B an den B-Prozess werden Fortschrittsinformationen in den Fehlerkanal der Standardausgabe geleitet. Dies ist nur eingeschränkt hilfreich, wenn die Standardfehlerausgabe ein Terminal ist. Mittels B<--verbose> wird ein automatisch aktualisierter Fortschrittsanzeiger angezeigt." + +#. type: SS +#: ../src/xz/xz.1:208 +#, no-wrap +msgid "Memory usage" +msgstr "Speicherbedarf" + +#. type: Plain text +#: ../src/xz/xz.1:224 +msgid "The memory usage of B varies from a few hundred kilobytes to several gigabytes depending on the compression settings. The settings used when compressing a file determine the memory requirements of the decompressor. Typically the decompressor needs 5\\ % to 20\\ % of the amount of memory that the compressor needed when creating the file. For example, decompressing a file created with B currently requires 65\\ MiB of memory. Still, it is possible to have B<.xz> files that require several gigabytes of memory to decompress." +msgstr "In Abhängigkeit von den gewählten Kompressionseinstellungen bewegt sich der Speicherverbrauch zwischen wenigen hundert Kilobyte und mehreren Gigabyte. Die Einstellungen bei der Kompression einer Datei bestimmen dabei den Speicherbedarf bei der Dekompression. Die Dekompression benötigt üblicherweise zwischen 5\\ % und 20\\ % des Speichers, der bei der Kompression der Datei erforderlich war. Beispielsweise benötigt die Dekompression einer Datei, die mit B komprimiert wurde, gegenwärtig etwa 65\\ MiB Speicher. Es ist jedoch auch möglich, dass B<.xz>-Dateien mehrere Gigabyte an Speicher zur Dekompression erfordern." + +# cripple → lahmlegen...? War mir hier zu sehr Straßenslang. +#. type: Plain text +#: ../src/xz/xz.1:236 +msgid "Especially users of older systems may find the possibility of very large memory usage annoying. To prevent uncomfortable surprises, B has a built-in memory usage limiter, which is disabled by default. While some operating systems provide ways to limit the memory usage of processes, relying on it wasn't deemed to be flexible enough (for example, using B(1) to limit virtual memory tends to cripple B(2))." +msgstr "Insbesondere für Benutzer älterer Systeme wird eventuell ein sehr großer Speicherbedarf ärgerlich sein. Um unangenehme Überraschungen zu vermeiden, verfügt B über eine eingebaute Begrenzung des Speicherbedarfs, die allerdings in der Voreinstellung deaktiviert ist. Zwar verfügen einige Betriebssysteme über eingebaute Möglichkeiten zur prozessabhängigen Speicherbegrenzung, doch diese sind zu unflexibel (zum Beispiel kann B(1) beim Begrenzen des virtuellen Speichers B(2) beeinträchtigen)." + +#. type: Plain text +#: ../src/xz/xz.1:258 +msgid "The memory usage limiter can be enabled with the command line option B<--memlimit=>I. Often it is more convenient to enable the limiter by default by setting the environment variable B, for example, B. It is possible to set the limits separately for compression and decompression by using B<--memlimit-compress=>I and B<--memlimit-decompress=>I. Using these two options outside B is rarely useful because a single run of B cannot do both compression and decompression and B<--memlimit=>I (or B<-M> I) is shorter to type on the command line." +msgstr "Die Begrenzung des Speicherbedarfs kann mit der Befehlszeilenoption B<--memlimit=>I aktiviert werden. Oft ist es jedoch bequemer, die Begrenzung durch Setzen der Umgebungsvariable B standardmäßig zu aktivieren, zum Beispiel B. Die Begrenzungen können getrennt für Kompression und Dekompression mittels B<--memlimit-compress=>I und B<--memlimit-decompress=>I festgelegt werden. Die Verwendung einer solchen Option außerhalb der Variable B ist kaum sinnvoll, da B in einer einzelnen Aktion nicht gleichzeitig Kompression und Dekompression ausführen kann und B<--memlimit=>I (oder B<-M> I) lässt sich einfacher in der Befehlszeile eingeben." + +#. type: Plain text +#: ../src/xz/xz.1:277 +msgid "If the specified memory usage limit is exceeded when decompressing, B will display an error and decompressing the file will fail. If the limit is exceeded when compressing, B will try to scale the settings down so that the limit is no longer exceeded (except when using B<--format=raw> or B<--no-adjust>). This way the operation won't fail unless the limit is very small. The scaling of the settings is done in steps that don't match the compression level presets, for example, if the limit is only slightly less than the amount required for B, the settings will be scaled down only a little, not all the way down to B." +msgstr "Wenn die angegebene Speicherbegrenzung bei der Dekompression überschritten wird, schlägt der Vorgang fehl und B zeigt eine Fehlermeldung an. Wird die Begrenzung bei der Kompression überschritten, dann versucht B die Einstellungen entsprechend anzupassen, außer wenn B<--format=raw> oder B<--no-adjust> angegeben ist. Auf diese Weise schlägt die Aktion nicht fehl, es sei denn, die Begrenzung wurde sehr niedrig angesetzt. Die Anpassung der Einstellungen wird schrittweise vorgenommen, allerdings entsprechen die Schritte nicht den Voreinstellungen der Kompressionsstufen. Das bedeutet, wenn beispielsweise die Begrenzung nur geringfügig unter den Anforderungen für B liegt, werden auch die Einstellungen nur wenig angepasst und nicht vollständig herunter zu den Werten für B" + +#. type: SS +#: ../src/xz/xz.1:278 +#, no-wrap +msgid "Concatenation and padding with .xz files" +msgstr "Verkettung und Auffüllung von .xz-Dateien" + +#. type: Plain text +#: ../src/xz/xz.1:286 +msgid "It is possible to concatenate B<.xz> files as is. B will decompress such files as if they were a single B<.xz> file." +msgstr "Es ist möglich, B<.xz>-Dateien direkt zu verketten. Solche Dateien werden von B genauso dekomprimiert wie eine einzelne B<.xz>-Datei." + +#. type: Plain text +#: ../src/xz/xz.1:295 +msgid "It is possible to insert padding between the concatenated parts or after the last part. The padding must consist of null bytes and the size of the padding must be a multiple of four bytes. This can be useful, for example, if the B<.xz> file is stored on a medium that measures file sizes in 512-byte blocks." +msgstr "Es ist weiterhin möglich, eine Auffüllung zwischen den verketteten Teilen oder nach dem letzten Teil einzufügen. Die Auffüllung muss aus Null-Bytes bestehen und deren Größe muss ein Vielfaches von vier Byte sein. Dies kann zum Beispiel dann vorteilhaft sein, wenn die B<.xz>-Datei auf einem Datenträger gespeichert wird, dessen Dateisystem die Dateigrößen in 512-Byte-Blöcken speichert." + +#. type: Plain text +#: ../src/xz/xz.1:299 +msgid "Concatenation and padding are not allowed with B<.lzma> files or raw streams." +msgstr "Verkettung und Auffüllung sind für B<.lzma>-Dateien oder Rohdatenströme nicht erlaubt." + +#. type: SH +#: ../src/xz/xz.1:300 ../src/xzdec/xzdec.1:61 +#, no-wrap +msgid "OPTIONS" +msgstr "OPTIONEN" + +#. type: SS +#: ../src/xz/xz.1:302 +#, no-wrap +msgid "Integer suffixes and special values" +msgstr "Ganzzahlige Suffixe und spezielle Werte" + +#. type: Plain text +#: ../src/xz/xz.1:306 +msgid "In most places where an integer argument is expected, an optional suffix is supported to easily indicate large integers. There must be no space between the integer and the suffix." +msgstr "An den meisten Stellen, wo ein ganzzahliges Argument akzeptiert wird, kann ein optionales Suffix große Ganzzahlwerte einfacher darstellen. Zwischen Ganzzahl und dem Suffix dürfen sich keine Leerzeichen befinden." + +#. type: TP +#: ../src/xz/xz.1:306 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:317 +msgid "Multiply the integer by 1,024 (2^10). B, B, B, B, and B are accepted as synonyms for B." +msgstr "multipliziert die Ganzzahl mit 1.024 (2^10). B, B, B, B und B werden als Synonyme für B akzeptiert." + +#. type: TP +#: ../src/xz/xz.1:317 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:327 +msgid "Multiply the integer by 1,048,576 (2^20). B, B, B, and B are accepted as synonyms for B." +msgstr "multipliziert die Ganzzahl mit 1.048.576 (2^20). B, B, B und B werden als Synonyme für B akzeptiert." + +#. type: TP +#: ../src/xz/xz.1:327 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:337 +msgid "Multiply the integer by 1,073,741,824 (2^30). B, B, B, and B are accepted as synonyms for B." +msgstr "multipliziert die Ganzzahl mit 1.073.741.824 (2^30). B, B, B und B werden als Synonyme für B akzeptiert." + +#. type: Plain text +#: ../src/xz/xz.1:342 +msgid "The special value B can be used to indicate the maximum integer value supported by the option." +msgstr "Der spezielle Wert B kann dazu verwendet werden, um den von der jeweiligen Option akzeptierten maximalen Ganzzahlwert anzugeben." + +#. type: SS +#: ../src/xz/xz.1:343 +#, no-wrap +msgid "Operation mode" +msgstr "Aktionsmodus" + +#. type: Plain text +#: ../src/xz/xz.1:346 +msgid "If multiple operation mode options are given, the last one takes effect." +msgstr "Falls mehrere Aktionsmodi angegeben sind, wird der zuletzt angegebene verwendet." + +#. type: TP +#: ../src/xz/xz.1:346 +#, no-wrap +msgid "B<-z>, B<--compress>" +msgstr "B<-z>, B<--compress>" + +#. type: Plain text +#: ../src/xz/xz.1:355 +msgid "Compress. This is the default operation mode when no operation mode option is specified and no other operation mode is implied from the command name (for example, B implies B<--decompress>)." +msgstr "Kompression. Dies ist der voreingestellte Aktionsmodus, sofern keiner angegeben ist und auch kein bestimmter Modus aus dem Befehlsnamen abgeleitet werden kann (der Befehl B impliziert zum Beispiel B<--decompress>)." + +#. type: TP +#: ../src/xz/xz.1:355 ../src/xzdec/xzdec.1:62 +#, no-wrap +msgid "B<-d>, B<--decompress>, B<--uncompress>" +msgstr "B<-d>, B<--decompress>, B<--uncompress>" + +#. type: Plain text +#: ../src/xz/xz.1:358 +msgid "Decompress." +msgstr "dekomprimpiert." + +#. type: TP +#: ../src/xz/xz.1:358 +#, no-wrap +msgid "B<-t>, B<--test>" +msgstr "B<-t>, B<--test>" + +#. type: Plain text +#: ../src/xz/xz.1:367 +msgid "Test the integrity of compressed I. This option is equivalent to B<--decompress --stdout> except that the decompressed data is discarded instead of being written to standard output. No files are created or removed." +msgstr "prüft die Integrität der komprimierten I. Diese Option ist gleichbedeutend mit B<--decompress --stdout>, außer dass die dekomprimierten Daten verworfen werden, anstatt sie in die Standardausgabe zu leiten. Es werden keine Dateien erstellt oder entfernt." + +#. type: TP +#: ../src/xz/xz.1:367 +#, no-wrap +msgid "B<-l>, B<--list>" +msgstr "B<-l>, B<--list>" + +#. type: Plain text +#: ../src/xz/xz.1:376 +msgid "Print information about compressed I. No uncompressed output is produced, and no files are created or removed. In list mode, the program cannot read the compressed data from standard input or from other unseekable sources." +msgstr "gibt Informationen zu den komprimierten I aus. Es werden keine unkomprimierten Dateien ausgegeben und keine Dateien angelegt oder entfernt. Im Listenmodus kann das Programm keine komprimierten Daten aus der Standardeingabe oder anderen nicht durchsuchbaren Quellen lesen." + +#. type: Plain text +#: ../src/xz/xz.1:391 +msgid "The default listing shows basic information about I, one file per line. To get more detailed information, use also the B<--verbose> option. For even more information, use B<--verbose> twice, but note that this may be slow, because getting all the extra information requires many seeks. The width of verbose output exceeds 80 characters, so piping the output to, for example, B may be convenient if the terminal isn't wide enough." +msgstr "Die Liste zeigt in der Standardeinstellung grundlegende Informationen zu den I an, zeilenweise pro Datei. Detailliertere Informationen erhalten Sie mit der Option B<--verbose>. Wenn Sie diese Option zweimal angeben, werden noch ausführlichere Informationen ausgegeben. Das kann den Vorgang allerdings deutlich verlangsamen, da die Ermittlung der zusätzlichen Informationen zahlreiche Suchvorgänge erfordert. Die Breite der ausführlichen Ausgabe ist breiter als 80 Zeichen, daher könnte die Weiterleitung in beispielsweise\\& B sinnvoll sein, falls das Terminal nicht breit genug ist." + +#. type: Plain text +#: ../src/xz/xz.1:398 +msgid "The exact output may vary between B versions and different locales. For machine-readable output, B<--robot --list> should be used." +msgstr "Die exakte Ausgabe kann in verschiedenen B-Versionen und Spracheinstellungen unterschiedlich sein. Wenn eine maschinell auswertbare Ausgabe gewünscht ist, dann sollten Sie B<--robot --list> verwenden." + +#. type: SS +#: ../src/xz/xz.1:399 +#, no-wrap +msgid "Operation modifiers" +msgstr "Aktionsattribute" + +#. type: TP +#: ../src/xz/xz.1:400 ../src/xzdec/xzdec.1:69 +#, no-wrap +msgid "B<-k>, B<--keep>" +msgstr "B<-k>, B<--keep>" + +#. type: Plain text +#: ../src/xz/xz.1:403 +msgid "Don't delete the input files." +msgstr "verhindert das Löschen der Eingabedateien." + +#. type: Plain text +#: ../src/xz/xz.1:417 +msgid "Since B 5.2.6, this option also makes B compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file. In earlier versions this was only done with B<--force>." +msgstr "Seit der B-Version 5.2.6 wird die Kompression oder Dekompression auch dann ausgeführt, wenn die Eingabe ein symbolischer Link zu einer regulären Datei ist, mehr als einen harten Link hat oder das »setuid«-, »setgid«- oder »sticky«-Bit gesetzt ist. Die genannten Bits werden nicht in die Zieldatei kopiert. In früheren Versionen geschah dies nur mit B<--force>." + +#. type: TP +#: ../src/xz/xz.1:417 +#, no-wrap +msgid "B<-f>, B<--force>" +msgstr "B<-f>, B<--force>" + +#. type: Plain text +#: ../src/xz/xz.1:420 +msgid "This option has several effects:" +msgstr "Diese Option hat verschiedene Auswirkungen:" + +#. type: Plain text +#: ../src/xz/xz.1:424 +msgid "If the target file already exists, delete it before compressing or decompressing." +msgstr "Wenn die Zieldatei bereits existiert, wird diese vor der Kompression oder Dekompression gelöscht." + +#. type: Plain text +#: ../src/xz/xz.1:431 +msgid "Compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file." +msgstr "Die Kompression oder Dekompression wird auch dann ausgeführt, wenn die Eingabe ein symbolischer Link zu einer regulären Datei ist, mehr als einen harten Link hat oder das »setuid«-, »setgid«- oder »sticky«-Bit gesetzt ist. Die genannten Bits werden nicht in die Zieldatei kopiert." + +#. type: Plain text +#: ../src/xz/xz.1:456 +msgid "When used with B<--decompress> B<--stdout> and B cannot recognize the type of the source file, copy the source file as is to standard output. This allows B B<--force> to be used like B(1) for files that have not been compressed with B. Note that in future, B might support new compressed file formats, which may make B decompress more types of files instead of copying them as is to standard output. B<--format=>I can be used to restrict B to decompress only a single file format." +msgstr "Wenn es zusammen mit B<--decompress> und B<--stdout> verwendet wird und B den Typ der Quelldatei nicht ermitteln kann, wird die Quelldatei unverändert in die Standardausgabe kopiert. Dadurch kann B B<--force> für Dateien, die nicht mit B komprimiert wurden, wie B(1) verwendet werden. Zukünftig könnte B neue Dateikompressionsformate unterstützen, wodurch B mehr Dateitypen dekomprimieren kann, anstatt sie unverändert in die Standardausgabe zu kopieren. Mit der Option B<--format=>I können Sie B anweisen, nur ein einzelnes Dateiformat zu dekomprimieren." + +#. type: TP +#: ../src/xz/xz.1:457 ../src/xzdec/xzdec.1:76 +#, no-wrap +msgid "B<-c>, B<--stdout>, B<--to-stdout>" +msgstr "B<-c>, B<--stdout>, B<--to-stdout>" + +#. type: Plain text +#: ../src/xz/xz.1:463 +msgid "Write the compressed or decompressed data to standard output instead of a file. This implies B<--keep>." +msgstr "schreibt die komprimierten oder dekomprimierten Daten in die Standardausgabe anstatt in eine Datei. Dies impliziert B<--keep>." + +#. type: TP +#: ../src/xz/xz.1:463 +#, no-wrap +msgid "B<--single-stream>" +msgstr "B<--single-stream>" + +#. type: Plain text +#: ../src/xz/xz.1:472 +msgid "Decompress only the first B<.xz> stream, and silently ignore possible remaining input data following the stream. Normally such trailing garbage makes B display an error." +msgstr "dekomprimiert nur den ersten B<.xz>-Datenstrom und ignoriert stillschweigend weitere Eingabedaten, die möglicherweise dem Datenstrom folgen. Normalerweise führt solcher anhängender Datenmüll dazu, dass B eine Fehlermeldung ausgibt." + +#. type: Plain text +#: ../src/xz/xz.1:481 +msgid "B never decompresses more than one stream from B<.lzma> files or raw streams, but this option still makes B ignore the possible trailing data after the B<.lzma> file or raw stream." +msgstr "B dekomprimiert niemals mehr als einen Datenstrom aus B<.lzma>-Dateien oder Rohdatenströmen, aber dennoch wird durch diese Option möglicherweise vorhandener Datenmüll nach der B<.lzma>-Datei oder dem Rohdatenstrom ignoriert." + +#. type: Plain text +#: ../src/xz/xz.1:486 +msgid "This option has no effect if the operation mode is not B<--decompress> or B<--test>." +msgstr "Diese Option ist wirkungslos, wenn der Aktionsmodus nicht B<--decompress> oder B<--test> ist." + +#. type: TP +#: ../src/xz/xz.1:486 +#, no-wrap +msgid "B<--no-sparse>" +msgstr "B<--no-sparse>" + +#. type: Plain text +#: ../src/xz/xz.1:498 +msgid "Disable creation of sparse files. By default, if decompressing into a regular file, B tries to make the file sparse if the decompressed data contains long sequences of binary zeros. It also works when writing to standard output as long as standard output is connected to a regular file and certain additional conditions are met to make it safe. Creating sparse files may save disk space and speed up the decompression by reducing the amount of disk I/O." +msgstr "verhindert die Erzeugung von Sparse-Dateien. In der Voreinstellung versucht B, bei der Dekompression in eine reguläre Datei eine Sparse-Datei zu erzeugen, wenn die dekomprimierten Daten lange Abfolgen von binären Nullen enthalten. Dies funktioniert auch beim Schreiben in die Standardausgabe, sofern diese in eine reguläre Datei weitergeleitet wird und bestimmte Zusatzbedingungen erfüllt sind, die die Aktion absichern. Die Erzeugung von Sparse-Dateien kann Plattenplatz sparen und beschleunigt die Dekompression durch Verringerung der Ein-/Ausgaben der Platte." + +#. type: TP +#: ../src/xz/xz.1:498 +#, no-wrap +msgid "B<-S> I<.suf>, B<--suffix=>I<.suf>" +msgstr "B<-S> I<.suf>, B<--suffix=>I<.suf>" + +#. type: Plain text +#: ../src/xz/xz.1:510 +msgid "When compressing, use I<.suf> as the suffix for the target file instead of B<.xz> or B<.lzma>. If not writing to standard output and the source file already has the suffix I<.suf>, a warning is displayed and the file is skipped." +msgstr "verwendet I<.suf> bei der Dekompression anstelle von B<.xz> oder B<.lzma> als Suffix für die Zieldatei. Falls nicht in die Standardausgabe geschrieben wird und die Quelldatei bereits das Suffix I<.suf> hat, wird eine Warnung angezeigt und die Datei übersprungen." + +#. type: Plain text +#: ../src/xz/xz.1:524 +msgid "When decompressing, recognize files with the suffix I<.suf> in addition to files with the B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz> suffix. If the source file has the suffix I<.suf>, the suffix is removed to get the target filename." +msgstr "berücksichtigt bei der Dekompression zusätzlich zu Dateien mit den Suffixen B<.xz>, B<.txz>, B<.lzma>, B<.tlz> oder B<.lz> auch jene mit dem Suffix I<.suf>. Falls die Quelldatei das Suffix I<.suf> hat, wird dieses entfernt und so der Name der Zieldatei abgeleitet." + +#. type: Plain text +#: ../src/xz/xz.1:530 +msgid "When compressing or decompressing raw streams (B<--format=raw>), the suffix must always be specified unless writing to standard output, because there is no default suffix for raw streams." +msgstr "Beim Komprimieren oder Dekomprimieren von Rohdatenströmen mit B<--format=raw> muss das Suffix stets angegeben werden, außer wenn die Ausgabe in die Standardausgabe erfolgt. Der Grund dafür ist, dass es kein vorgegebenes Suffix für Rohdatenströme gibt." + +#. type: TP +#: ../src/xz/xz.1:530 +#, no-wrap +msgid "B<--files>[B<=>I]" +msgstr "B<--files>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:544 +msgid "Read the filenames to process from I; if I is omitted, filenames are read from standard input. Filenames must be terminated with the newline character. A dash (B<->) is taken as a regular filename; it doesn't mean standard input. If filenames are given also as command line arguments, they are processed before the filenames read from I." +msgstr "liest die zu verarbeitenden Dateinamen aus I. Falls keine I angegeben ist, werden die Dateinamen aus der Standardeingabe gelesen. Dateinamen müssen mit einem Zeilenumbruch beendet werden. Ein Bindestrich (B<->) wird als regulärer Dateiname angesehen und nicht als Standardeingabe interpretiert. Falls Dateinamen außerdem als Befehlszeilenargumente angegeben sind, werden diese vor den Dateinamen aus der I verarbeitet." + +#. type: TP +#: ../src/xz/xz.1:544 +#, no-wrap +msgid "B<--files0>[B<=>I]" +msgstr "B<--files0>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:548 +msgid "This is identical to B<--files>[B<=>I] except that each filename must be terminated with the null character." +msgstr "Dies ist gleichbedeutend mit B<--files>[B<=>I], außer dass jeder Dateiname mit einem Null-Zeichen abgeschlossen werden muss." + +#. type: SS +#: ../src/xz/xz.1:549 +#, no-wrap +msgid "Basic file format and compression options" +msgstr "Grundlegende Dateiformat- und Kompressionsoptionen" + +#. type: TP +#: ../src/xz/xz.1:550 +#, no-wrap +msgid "B<-F> I, B<--format=>I" +msgstr "B<-F> I, B<--format=>I" + +#. type: Plain text +#: ../src/xz/xz.1:555 +msgid "Specify the file I to compress or decompress:" +msgstr "gibt das I der zu komprimierenden oder dekomprimierenden Datei an:" + +#. type: TP +#: ../src/xz/xz.1:556 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:568 +msgid "This is the default. When compressing, B is equivalent to B. When decompressing, the format of the input file is automatically detected. Note that raw streams (created with B<--format=raw>) cannot be auto-detected." +msgstr "Dies ist die Voreinstellung. Bei der Kompression ist B gleichbedeutend mit B. Bei der Dekompression wird das Format der Eingabedatei automatisch erkannt. Beachten Sie, dass Rohdatenströme, wie sie mit B<--format=raw> erzeugt werden, nicht automatisch erkannt werden können." + +#. type: TP +#: ../src/xz/xz.1:568 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:575 +msgid "Compress to the B<.xz> file format, or accept only B<.xz> files when decompressing." +msgstr "Die Kompression erfolgt in das B<.xz>-Dateiformat oder akzeptiert nur B<.xz>-Dateien bei der Dekompression." + +#. type: TP +#: ../src/xz/xz.1:575 +#, no-wrap +msgid "B, B" +msgstr "B, B" + +#. type: Plain text +#: ../src/xz/xz.1:585 +msgid "Compress to the legacy B<.lzma> file format, or accept only B<.lzma> files when decompressing. The alternative name B is provided for backwards compatibility with LZMA Utils." +msgstr "Die Kompression erfolgt in das veraltete B<.lzma>-Dateiformat oder akzeptiert nur B<.lzma>-Dateien bei der Dekompression. Der alternative Name B dient der Abwärtskompatibilität zu den LZMA-Dienstprogrammen." + +#. type: TP +#: ../src/xz/xz.1:585 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:591 +msgid "Accept only B<.lz> files when decompressing. Compression is not supported." +msgstr "Akzeptiert nur B<.lz>-Dateien bei der Dekompression. Kompression wird nicht unterstützt." + +#. type: Plain text +#: ../src/xz/xz.1:604 +msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B 1.18." +msgstr "Das B<.lz>-Format wird in Version 0 und der unerweiterten Version 1 unterstützt. Dateien der Version 0 wurden B 1.3 und älter erstellt. Solche Dateien sind nicht sehr weit verbreitet, können aber in Dateiarchiven gefunden werden, da einige Quellpakete in diesem Format veröffentlicht wurden. Es ist auch möglich, dass Benutzer alte persönliche Dateien in diesem Format haben. Die Dekompressionsunterstützung für das Format der Version 0 wurde mit der Version 1.18 aus B entfernt." + +#. type: Plain text +#: ../src/xz/xz.1:613 +msgid "B 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B 1.6. This extension is rarely used and isn't supported by B (diagnosed as corrupt input)." +msgstr "B-Versionen ab 1.4 erstellen Dateien im Format der Version 0. Die Erweiterung »Sync Flush Marker« zur Formatversion 1 wurde in B 1.6 hinzugefügt. Diese Erweiterung wird sehr selten verwendet und wird von B nicht unterstützt (die Eingabe wird als beschädigt erkannt)." + +#. type: TP +#: ../src/xz/xz.1:613 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:621 +msgid "Compress or uncompress a raw stream (no headers). This is meant for advanced users only. To decode raw streams, you need use B<--format=raw> and explicitly specify the filter chain, which normally would have been stored in the container headers." +msgstr "Komprimiert oder dekomprimiert einen Rohdatenstrom (ohne Header). Diese Option ist nur für fortgeschrittene Benutzer bestimmt. Zum Dekodieren von Rohdatenströmen müssen Sie die Option B<--format=raw> verwenden und die Filterkette ausdrücklich angeben, die normalerweise in den (hier fehlenden) Container-Headern gespeichert worden wäre." + +#. type: TP +#: ../src/xz/xz.1:622 +#, no-wrap +msgid "B<-C> I, B<--check=>I" +msgstr "B<-C> I, B<--check=>I" + +#. type: Plain text +#: ../src/xz/xz.1:637 +msgid "Specify the type of the integrity check. The check is calculated from the uncompressed data and stored in the B<.xz> file. This option has an effect only when compressing into the B<.xz> format; the B<.lzma> format doesn't support integrity checks. The integrity check (if any) is verified when the B<.xz> file is decompressed." +msgstr "gibt den Typ der Integritätsprüfung an. Die Prüfsumme wird aus den unkomprimierten Daten berechnet und in der B<.xz>-Datei gespeichert. Diese Option wird nur bei der Kompression in das B<.xz>-Format angewendet, da das B<.lzma>-Format keine Integritätsprüfungen unterstützt. Die eigentliche Integritätsprüfung erfolgt (falls möglich), wenn die B<.xz>-Datei dekomprimiert wird." + +#. type: Plain text +#: ../src/xz/xz.1:641 +msgid "Supported I types:" +msgstr "Folgende Typen von I werden unterstützt:" + +#. type: TP +#: ../src/xz/xz.1:642 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:648 +msgid "Don't calculate an integrity check at all. This is usually a bad idea. This can be useful when integrity of the data is verified by other means anyway." +msgstr "führt keine Integritätsprüfung aus. Dies ist eine eher schlechte Idee. Dennoch kann es nützlich sein, wenn die Integrität der Daten auf andere Weise sichergestellt werden kann." + +#. type: TP +#: ../src/xz/xz.1:648 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:651 +msgid "Calculate CRC32 using the polynomial from IEEE-802.3 (Ethernet)." +msgstr "berechnet die CRC32-Prüfsumme anhand des Polynoms aus IEEE-802.3 (Ethernet)." + +#. type: TP +#: ../src/xz/xz.1:651 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:656 +msgid "Calculate CRC64 using the polynomial from ECMA-182. This is the default, since it is slightly better than CRC32 at detecting damaged files and the speed difference is negligible." +msgstr "berechnet die CRC64-Prüfsumme anhand des Polynoms aus ECMA-182. Dies ist die Voreinstellung, da beschädigte Dateien etwas besser als mit CRC32 erkannt werden und die Geschwindigkeitsdifferenz unerheblich ist." + +#. type: TP +#: ../src/xz/xz.1:656 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:660 +msgid "Calculate SHA-256. This is somewhat slower than CRC32 and CRC64." +msgstr "berechnet die SHA-256-Prüfsumme. Dies ist etwas langsamer als CRC32 und CRC64." + +#. type: Plain text +#: ../src/xz/xz.1:666 +msgid "Integrity of the B<.xz> headers is always verified with CRC32. It is not possible to change or disable it." +msgstr "Die Integrität der B<.xz>-Header wird immer mit CRC32 geprüft. Es ist nicht möglich, dies zu ändern oder zu deaktivieren." + +#. type: TP +#: ../src/xz/xz.1:666 +#, no-wrap +msgid "B<--ignore-check>" +msgstr "B<--ignore-check>" + +#. type: Plain text +#: ../src/xz/xz.1:672 +msgid "Don't verify the integrity check of the compressed data when decompressing. The CRC32 values in the B<.xz> headers will still be verified normally." +msgstr "verifiziert die Integritätsprüfsumme der komprimierten Daten bei der Dekompression nicht. Die CRC32-Werte in den B<.xz>-Headern werden weiterhin normal verifiziert." + +#. type: Plain text +#: ../src/xz/xz.1:675 +msgid "B Possible reasons to use this option:" +msgstr "B Mögliche Gründe, diese Option zu verwenden:" + +#. type: Plain text +#: ../src/xz/xz.1:678 +msgid "Trying to recover data from a corrupt .xz file." +msgstr "Versuchen, Daten aus einer beschädigten .xz-Datei wiederherzustellen." + +# Irgendwie ist mir »extrem gut komprimiert« hier zu diffus. Was soll »gut« hier bedeuten? Besonders stark, besonders clever, was auch immer... +#. type: Plain text +#: ../src/xz/xz.1:684 +msgid "Speeding up decompression. This matters mostly with SHA-256 or with files that have compressed extremely well. It's recommended to not use this option for this purpose unless the file integrity is verified externally in some other way." +msgstr "Erhöhung der Geschwindigkeit bei der Dekompression. Dies macht sich meist mit SHA-256 bemerkbar, oder mit Dateien, die extrem stark komprimiert sind. Wir empfehlen, diese Option nicht für diesen Zweck zu verwenden, es sei denn, die Integrität der Datei wird extern auf andere Weise überprüft." + +#. type: TP +#: ../src/xz/xz.1:685 +#, no-wrap +msgid "B<-0> ... B<-9>" +msgstr "B<-0> … B<-9>" + +#. type: Plain text +#: ../src/xz/xz.1:694 +msgid "Select a compression preset level. The default is B<-6>. If multiple preset levels are specified, the last one takes effect. If a custom filter chain was already specified, setting a compression preset level clears the custom filter chain." +msgstr "wählt eine der voreingestellten Kompressionsstufen, standardmäßig B<-6>. Wenn mehrere Voreinstellungsstufen angegeben sind, ist nur die zuletzt angegebene wirksam. Falls bereits eine benutzerdefinierte Filterkette angegeben wurde, wird diese durch die Festlegung der Voreinstellung geleert." + +#. type: Plain text +#: ../src/xz/xz.1:709 +msgid "The differences between the presets are more significant than with B(1) and B(1). The selected compression settings determine the memory requirements of the decompressor, thus using a too high preset level might make it painful to decompress the file on an old system with little RAM. Specifically, B like it often is with B(1) and B(1)." +msgstr "Die Unterschiede zwischen den Voreinstellungsstufen sind deutlicher als bei B(1) und B(1). Die gewählten Kompressionseinstellungen bestimmen den Speicherbedarf bei der Dekompression, daher ist es auf älteren Systemen mit wenig Speicher bei einer zu hoch gewählten Voreinstellung schwer, eine Datei zu dekomprimieren. Insbesondere B zu verwenden, wie dies häufig mit B(1) und B(1) gehandhabt wird." + +#. type: TP +#: ../src/xz/xz.1:710 +#, no-wrap +msgid "B<-0> ... B<-3>" +msgstr "B<-0> … B<-3>" + +#. type: Plain text +#: ../src/xz/xz.1:722 +msgid "These are somewhat fast presets. B<-0> is sometimes faster than B while compressing much better. The higher ones often have speed comparable to B(1) with comparable or better compression ratio, although the results depend a lot on the type of data being compressed." +msgstr "Diese Voreinstellungen sind recht schnell. B<-0> ist manchmal schneller als B, wobei aber die Kompression wesentlich besser ist. Die schnelleren Voreinstellungen sind im Hinblick auf die Geschwindigkeit mit B(1) vergleichbar , mit einem ähnlichen oder besseren Kompressionsverhältnis, wobei das Ergebnis aber stark vom Typ der zu komprimierenden Daten abhängig ist." + +#. type: TP +#: ../src/xz/xz.1:722 +#, no-wrap +msgid "B<-4> ... B<-6>" +msgstr "B<-4> … B<-6>" + +#. type: Plain text +#: ../src/xz/xz.1:736 +msgid "Good to very good compression while keeping decompressor memory usage reasonable even for old systems. B<-6> is the default, which is usually a good choice for distributing files that need to be decompressible even on systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth considering too. See B<--extreme>.)" +msgstr "Gute bis sehr gute Kompression, wobei der Speicherbedarf für die Dekompression selbst auf alten Systemen akzeptabel ist. B<-6> ist die Voreinstellung, welche üblicherweise eine gute Wahl für die Verteilung von Dateien ist, die selbst noch auf Systemen mit nur 16\\ MiB Arbeitsspeicher dekomprimiert werden müssen (B<-5e> oder B<-6e> sind ebenfalls eine Überlegung wert. Siehe B<--extreme>)." + +#. type: TP +#: ../src/xz/xz.1:736 +#, no-wrap +msgid "B<-7 ... -9>" +msgstr "B<-7 … -9>" + +#. type: Plain text +#: ../src/xz/xz.1:743 +msgid "These are like B<-6> but with higher compressor and decompressor memory requirements. These are useful only when compressing files bigger than 8\\ MiB, 16\\ MiB, and 32\\ MiB, respectively." +msgstr "Ähnlich wie B<-6>, aber mit einem höheren Speicherbedarf für die Kompression und Dekompression. Sie sind nur nützlich, wenn Dateien komprimiert werden sollen, die größer als 8\\ MiB, 16\\ MiB beziehungsweise 32\\ MiB sind." + +#. type: Plain text +#: ../src/xz/xz.1:751 +msgid "On the same hardware, the decompression speed is approximately a constant number of bytes of compressed data per second. In other words, the better the compression, the faster the decompression will usually be. This also means that the amount of uncompressed output produced per second can vary a lot." +msgstr "Auf der gleichen Hardware ist die Dekompressionsgeschwindigkeit ein nahezu konstanter Wert in Bytes komprimierter Daten pro Sekunde. Anders ausgedrückt: Je besser die Kompression, umso schneller wird üblicherweise die Dekompression sein. Das bedeutet auch, dass die Menge der pro Sekunde ausgegebenen unkomprimierten Daten stark variieren kann." + +#. type: Plain text +#: ../src/xz/xz.1:753 +msgid "The following table summarises the features of the presets:" +msgstr "Die folgende Tabelle fasst die Eigenschaften der Voreinstellungen zusammen:" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "Preset" +msgstr "Voreinst." + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DictSize" +msgstr "Wörtb.Gr" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "CompCPU" +msgstr "KomprCPU" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "CompMem" +msgstr "KompSpeich" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DecMem" +msgstr "DekompSpeich" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#: ../src/xz/xz.1:2840 +#, no-wrap +msgid "-0" +msgstr "-0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:842 ../src/xz/xz.1:2450 +#, no-wrap +msgid "256 KiB" +msgstr "256 KiB" + +#. type: TP +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2840 ../src/scripts/xzgrep.1:82 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:763 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2475 +#, no-wrap +msgid "3 MiB" +msgstr "3 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:762 ../src/xz/xz.1:842 ../src/xz/xz.1:843 +#: ../src/xz/xz.1:2451 ../src/xz/xz.1:2452 ../src/xz/xz.1:2454 +#, no-wrap +msgid "1 MiB" +msgstr "1 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:2451 ../src/xz/xz.1:2476 +#: ../src/xz/xz.1:2841 +#, no-wrap +msgid "-1" +msgstr "-1" + +#. type: TP +#: ../src/xz/xz.1:762 ../src/xz/xz.1:1758 ../src/xz/xz.1:2841 +#: ../src/scripts/xzgrep.1:86 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2476 +#, no-wrap +msgid "9 MiB" +msgstr "9 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:763 ../src/xz/xz.1:843 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2452 ../src/xz/xz.1:2455 ../src/xz/xz.1:2476 +#, no-wrap +msgid "2 MiB" +msgstr "2 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:2452 ../src/xz/xz.1:2477 +#: ../src/xz/xz.1:2842 +#, no-wrap +msgid "-2" +msgstr "-2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:1760 ../src/xz/xz.1:2842 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:768 ../src/xz/xz.1:849 +#: ../src/xz/xz.1:2477 +#, no-wrap +msgid "17 MiB" +msgstr "17 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2453 ../src/xz/xz.1:2478 +#: ../src/xz/xz.1:2843 +#, no-wrap +msgid "-3" +msgstr "-3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:842 ../src/xz/xz.1:845 +#: ../src/xz/xz.1:846 ../src/xz/xz.1:2453 ../src/xz/xz.1:2454 +#: ../src/xz/xz.1:2456 +#, no-wrap +msgid "4 MiB" +msgstr "4 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2843 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2459 ../src/xz/xz.1:2478 +#, no-wrap +msgid "32 MiB" +msgstr "32 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#, no-wrap +msgid "5 MiB" +msgstr "5 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:2454 ../src/xz/xz.1:2479 +#: ../src/xz/xz.1:2844 +#, no-wrap +msgid "-4" +msgstr "-4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:1759 ../src/xz/xz.1:1761 +#: ../src/xz/xz.1:1762 ../src/xz/xz.1:1764 ../src/xz/xz.1:2844 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:2479 +#, no-wrap +msgid "48 MiB" +msgstr "48 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2455 ../src/xz/xz.1:2480 +#: ../src/xz/xz.1:2845 +#, no-wrap +msgid "-5" +msgstr "-5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2455 ../src/xz/xz.1:2456 ../src/xz/xz.1:2457 +#, no-wrap +msgid "8 MiB" +msgstr "8 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2845 +#, no-wrap +msgid "5" +msgstr "5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2480 ../src/xz/xz.1:2481 +#, no-wrap +msgid "94 MiB" +msgstr "94 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:2456 ../src/xz/xz.1:2481 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "-6" +msgstr "-6" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:768 ../src/xz/xz.1:769 ../src/xz/xz.1:770 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "6" +msgstr "6" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:2457 ../src/xz/xz.1:2482 +#, no-wrap +msgid "-7" +msgstr "-7" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2457 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2479 +#, no-wrap +msgid "16 MiB" +msgstr "16 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2482 +#, no-wrap +msgid "186 MiB" +msgstr "186 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:2458 ../src/xz/xz.1:2483 +#, no-wrap +msgid "-8" +msgstr "-8" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2483 +#, no-wrap +msgid "370 MiB" +msgstr "370 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#, no-wrap +msgid "33 MiB" +msgstr "33 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:2459 ../src/xz/xz.1:2484 +#, no-wrap +msgid "-9" +msgstr "-9" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2459 +#, no-wrap +msgid "64 MiB" +msgstr "64 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2484 +#, no-wrap +msgid "674 MiB" +msgstr "674 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 +#, no-wrap +msgid "65 MiB" +msgstr "65 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:776 +msgid "Column descriptions:" +msgstr "Spaltenbeschreibungen:" + +#. type: Plain text +#: ../src/xz/xz.1:788 +msgid "DictSize is the LZMA2 dictionary size. It is waste of memory to use a dictionary bigger than the size of the uncompressed file. This is why it is good to avoid using the presets B<-7> ... B<-9> when there's no real need for them. At B<-6> and lower, the amount of memory wasted is usually low enough to not matter." +msgstr "Wörtb.Größe ist die Größe des LZMA2-Wörterbuchs. Es ist Speicherverschwendung, ein Wörterbuch zu verwenden, das größer als die unkomprimierte Datei ist. Daher ist es besser, die Voreinstellungen B<-7> … B<-9> zu vermeiden, falls es keinen wirklichen Bedarf dafür gibt. Mit B<-6> und weniger wird üblicherweise so wenig Speicher verschwendet, dass dies nicht ins Gewicht fällt." + +#. type: Plain text +#: ../src/xz/xz.1:797 +msgid "CompCPU is a simplified representation of the LZMA2 settings that affect compression speed. The dictionary size affects speed too, so while CompCPU is the same for levels B<-6> ... B<-9>, higher levels still tend to be a little slower. To get even slower and thus possibly better compression, see B<--extreme>." +msgstr "KomprCPU ist eine vereinfachte Repräsentation der LZMA2-Einstellungen, welche die Kompressionsgeschwindigkeit beeinflussen. Die Wörterbuchgröße wirkt sich ebenfalls auf die Geschwindigkeit aus. Während KompCPU für die Stufen B<-6> bis B<-9> gleich ist, tendieren höhere Stufen dazu, etwas langsamer zu sein. Um eine noch langsamere, aber möglicherweise bessere Kompression zu erhalten, siehe B<--extreme>." + +#. type: Plain text +#: ../src/xz/xz.1:805 +msgid "CompMem contains the compressor memory requirements in the single-threaded mode. It may vary slightly between B versions. Memory requirements of some of the future multithreaded modes may be dramatically higher than that of the single-threaded mode." +msgstr "KompSpeich enthält den Speicherbedarf des Kompressors im Einzel-Thread-Modus. Dieser kann zwischen den B-Versionen leicht variieren. Der Speicherbedarf einiger der zukünftigen Multithread-Modi kann dramatisch höher sein als im Einzel-Thread-Modus." + +#. type: Plain text +#: ../src/xz/xz.1:812 +msgid "DecMem contains the decompressor memory requirements. That is, the compression settings determine the memory requirements of the decompressor. The exact decompressor memory usage is slightly more than the LZMA2 dictionary size, but the values in the table have been rounded up to the next full MiB." +msgstr "DekompSpeich enthält den Speicherbedarf für die Dekompression. Das bedeutet, dass die Kompressionseinstellungen den Speicherbedarf bei der Dekompression bestimmen. Der exakte Speicherbedarf bei der Dekompression ist geringfügig größer als die Größe des LZMA2-Wörterbuchs, aber die Werte in der Tabelle wurden auf ganze MiB aufgerundet." + +#. type: TP +#: ../src/xz/xz.1:813 +#, no-wrap +msgid "B<-e>, B<--extreme>" +msgstr "B<-e>, B<--extreme>" + +#. type: Plain text +#: ../src/xz/xz.1:822 +msgid "Use a slower variant of the selected compression preset level (B<-0> ... B<-9>) to hopefully get a little bit better compression ratio, but with bad luck this can also make it worse. Decompressor memory usage is not affected, but compressor memory usage increases a little at preset levels B<-0> ... B<-3>." +msgstr "verwendet eine langsamere Variante der gewählten Kompressions-Voreinstellungsstufe (B<-0> … B<-9>), um hoffentlich ein etwas besseres Kompressionsverhältnis zu erreichen, das aber in ungünstigen Fällen auch schlechter werden kann. Der Speicherverbrauch bei der Dekompression wird dabei nicht beeinflusst, aber der Speicherverbrauch der Kompression steigt in den Voreinstellungsstufen B<-0> bis B<-3> geringfügig an." + +#. type: Plain text +#: ../src/xz/xz.1:834 +msgid "Since there are two presets with dictionary sizes 4\\ MiB and 8\\ MiB, the presets B<-3e> and B<-5e> use slightly faster settings (lower CompCPU) than B<-4e> and B<-6e>, respectively. That way no two presets are identical." +msgstr "Da es zwei Voreinstellungen mit den Wörterbuchgrößen 4\\ MiB und 8\\ MiB gibt, verwenden die Voreinstellungsstufen B<-3e> und B<-5e> etwas schnellere Einstellungen (niedrigere KompCPU) als B<-4e> beziehungsweise B<-6e>. Auf diese Weise sind zwei Voreinstellungen nie identisch." + +#. type: tbl table +#: ../src/xz/xz.1:842 +#, no-wrap +msgid "-0e" +msgstr "-0e" + +#. type: tbl table +#: ../src/xz/xz.1:842 ../src/xz/xz.1:843 ../src/xz/xz.1:844 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:849 ../src/xz/xz.1:850 ../src/xz/xz.1:851 +#: ../src/xz/xz.1:2848 +#, no-wrap +msgid "8" +msgstr "8" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "-1e" +msgstr "-1e" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "13 MiB" +msgstr "13 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "-2e" +msgstr "-2e" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "25 MiB" +msgstr "25 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:845 +#, no-wrap +msgid "-3e" +msgstr "-3e" + +#. type: tbl table +#: ../src/xz/xz.1:845 ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "7" +msgstr "7" + +#. type: tbl table +#: ../src/xz/xz.1:846 +#, no-wrap +msgid "-4e" +msgstr "-4e" + +#. type: tbl table +#: ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "-5e" +msgstr "-5e" + +#. type: tbl table +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2848 +#, no-wrap +msgid "-6e" +msgstr "-6e" + +#. type: tbl table +#: ../src/xz/xz.1:849 +#, no-wrap +msgid "-7e" +msgstr "-7e" + +#. type: tbl table +#: ../src/xz/xz.1:850 +#, no-wrap +msgid "-8e" +msgstr "-8e" + +#. type: tbl table +#: ../src/xz/xz.1:851 +#, no-wrap +msgid "-9e" +msgstr "-9e" + +#. type: Plain text +#: ../src/xz/xz.1:863 +msgid "For example, there are a total of four presets that use 8\\ MiB dictionary, whose order from the fastest to the slowest is B<-5>, B<-6>, B<-5e>, and B<-6e>." +msgstr "Zum Beispiel gibt es insgesamt vier Voreinstellungen, die ein 8\\ MiB großes Wörterbuch verwenden, deren Reihenfolge von der schnellsten zur langsamsten B<-5>, B<-6>, B<-5e> und B<-6e> ist." + +#. type: TP +#: ../src/xz/xz.1:863 +#, no-wrap +msgid "B<--fast>" +msgstr "B<--fast>" + +#. type: TP +#: ../src/xz/xz.1:866 +#, no-wrap +msgid "B<--best>" +msgstr "B<--best>" + +#. type: Plain text +#: ../src/xz/xz.1:877 +msgid "These are somewhat misleading aliases for B<-0> and B<-9>, respectively. These are provided only for backwards compatibility with LZMA Utils. Avoid using these options." +msgstr "sind etwas irreführende Aliase für B<-0> beziehungsweise B<-9>. Sie werden nur zwecks Abwärtskompatibilität zu den LZMA-Dienstprogrammen bereitgestellt. Sie sollten diese Optionen besser nicht verwenden." + +#. type: TP +#: ../src/xz/xz.1:877 +#, no-wrap +msgid "B<--block-size=>I" +msgstr "B<--block-size=>I" + +# CHECK multi-threading and makes limited random-access +#. type: Plain text +#: ../src/xz/xz.1:890 +msgid "When compressing to the B<.xz> format, split the input data into blocks of I bytes. The blocks are compressed independently from each other, which helps with multi-threading and makes limited random-access decompression possible. This option is typically used to override the default block size in multi-threaded mode, but this option can be used in single-threaded mode too." +msgstr "teilt beim Komprimieren in das B<.xz>-Format die Eingabedaten in Blöcke der angegebenen I in Byte. Die Blöcke werden unabhängig voneinander komprimiert, was dem Multi-Threading entgegen kommt und Zufallszugriffe bei der Dekompression begrenzt. Diese Option wird typischerweise eingesetzt, um die vorgegebene Blockgröße im Multi-Thread-Modus außer Kraft zu setzen, aber sie kann auch im Einzel-Thread-Modus angewendet werden." + +#. type: Plain text +#: ../src/xz/xz.1:908 +msgid "In multi-threaded mode about three times I bytes will be allocated in each thread for buffering input and output. The default I is three times the LZMA2 dictionary size or 1 MiB, whichever is more. Typically a good value is 2\\(en4 times the size of the LZMA2 dictionary or at least 1 MiB. Using I less than the LZMA2 dictionary size is waste of RAM because then the LZMA2 dictionary buffer will never get fully used. The sizes of the blocks are stored in the block headers, which a future version of B will use for multi-threaded decompression." +msgstr "Im Multi-Thread-Modus wird etwa die dreifache I in jedem Thread zur Pufferung der Ein- und Ausgabe belegt. Die vorgegebene I ist das Dreifache der Größe des LZMA2-Wörterbuchs oder 1 MiB, je nachdem, was mehr ist. Typischerweise ist das Zwei- bis Vierfache der Größe des LZMA2-Wörterbuchs oder wenigstens 1 MB ein guter Wert. Eine I, die geringer ist als die des LZMA2-Wörterbuchs, ist Speicherverschwendung, weil dann der LZMA2-Wörterbuchpuffer niemals vollständig genutzt werden würde. Die Größe der Blöcke wird in den Block-Headern gespeichert, die von einer zukünftigen Version von B für eine Multi-Thread-Dekompression genutzt wird." + +#. type: Plain text +#: ../src/xz/xz.1:917 +msgid "In single-threaded mode no block splitting is done by default. Setting this option doesn't affect memory usage. No size information is stored in block headers, thus files created in single-threaded mode won't be identical to files created in multi-threaded mode. The lack of size information also means that a future version of B won't be able decompress the files in multi-threaded mode." +msgstr "Im Einzel-Thread-Modus werden die Blöcke standardmäßig nicht geteilt. Das Setzen dieser Option wirkt sich nicht auf den Speicherbedarf aus. In den Block-Headern werden keine Größeninformationen gespeichert, daher werden im Einzel-Thread-Modus erzeugte Dateien nicht zu den im Multi-Thread-Modus erzeugten Dateien identisch sein. Das Fehlen der Größeninformation bedingt auch, dass eine zukünftige Version von B nicht in der Lage sein wird, die Dateien im Multi-Thread-Modus zu dekomprimieren." + +#. type: TP +#: ../src/xz/xz.1:917 +#, no-wrap +msgid "B<--block-list=>I" +msgstr "B<--block-list=>I" + +#. type: Plain text +#: ../src/xz/xz.1:923 +msgid "When compressing to the B<.xz> format, start a new block after the given intervals of uncompressed data." +msgstr "beginnt bei der Kompression in das B<.xz>-Format nach den angegebenen Intervallen unkomprimierter Daten einen neuen Block." + +#. type: Plain text +#: ../src/xz/xz.1:929 +msgid "The uncompressed I of the blocks are specified as a comma-separated list. Omitting a size (two or more consecutive commas) is a shorthand to use the size of the previous block." +msgstr "Die unkomprimierte I der Blöcke wird in einer durch Kommata getrennten Liste angegeben. Auslassen einer Größe (zwei oder mehr aufeinander folgende Kommata) ist ein Kürzel dafür, die Größe des vorherigen Blocks zu verwenden." + +#. type: Plain text +#: ../src/xz/xz.1:939 +msgid "If the input file is bigger than the sum of I, the last value in I is repeated until the end of the file. A special value of B<0> may be used as the last value to indicate that the rest of the file should be encoded as a single block." +msgstr "Falls die Eingabedatei größer ist als die Summe der I, dann wird der letzte in I angegebene Wert bis zum Ende der Datei wiederholt. Mit dem speziellen Wert B<0> können Sie angeben, dass der Rest der Datei als einzelner Block kodiert werden soll." + +# FIXME encoder → compressor +#. type: Plain text +#: ../src/xz/xz.1:954 +msgid "If one specifies I that exceed the encoder's block size (either the default value in threaded mode or the value specified with B<--block-size=>I), the encoder will create additional blocks while keeping the boundaries specified in I. For example, if one specifies B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> and the input file is 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10, and 1 MiB." +msgstr "Falls Sie I angeben, welche die Blockgröße des Encoders übersteigen (entweder den Vorgabewert im Thread-Modus oder den mit B<--block-size=>I angegebenen Wert), wird der Encoder zusätzliche Blöcke erzeugen, wobei die in den I angegebenen Grenzen eingehalten werden. Wenn Sie zum Beispiel B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> angeben und die Eingabedatei 80 MiB groß ist, erhalten Sie 11 Blöcke: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10 und 1 MiB." + +#. type: Plain text +#: ../src/xz/xz.1:960 +msgid "In multi-threaded mode the sizes of the blocks are stored in the block headers. This isn't done in single-threaded mode, so the encoded output won't be identical to that of the multi-threaded mode." +msgstr "Im Multi-Thread-Modus werden die Blockgrößen in den Block-Headern gespeichert. Dies geschieht im Einzel-Thread-Modus nicht, daher wird die kodierte Ausgabe zu der im Multi-Thread-Modus nicht identisch sein." + +#. type: TP +#: ../src/xz/xz.1:960 +#, no-wrap +msgid "B<--flush-timeout=>I" +msgstr "B<--flush-timeout=>I" + +#. type: Plain text +#: ../src/xz/xz.1:977 +msgid "When compressing, if more than I milliseconds (a positive integer) has passed since the previous flush and reading more input would block, all the pending input data is flushed from the encoder and made available in the output stream. This can be useful if B is used to compress data that is streamed over a network. Small I values make the data available at the receiving end with a small delay, but large I values give better compression ratio." +msgstr "löscht bei der Kompression die ausstehenden Daten aus dem Encoder und macht sie im Ausgabedatenstrom verfügbar, wenn mehr als die angegebene I in Millisekunden (als positive Ganzzahl) seit dem vorherigen Löschen vergangen ist und das Lesen weiterer Eingaben blockieren würde. Dies kann nützlich sein, wenn B zum Komprimieren von über das Netzwerk eingehenden Daten verwendet wird. Kleine I-Werte machen die Daten unmittelbar nach dem Empfang nach einer kurzen Verzögerung verfügbar, während große I-Werte ein besseres Kompressionsverhältnis bewirken." + +#. type: Plain text +#: ../src/xz/xz.1:985 +msgid "This feature is disabled by default. If this option is specified more than once, the last one takes effect. The special I value of B<0> can be used to explicitly disable this feature." +msgstr "Dieses Funktionsmerkmal ist standardmäßig deaktiviert. Wenn diese Option mehrfach angegeben wird, ist die zuletzt angegebene wirksam. Für die Angabe der I kann der spezielle Wert B<0> verwendet werden, um dieses Funktionsmerkmal explizit zu deaktivieren." + +#. type: Plain text +#: ../src/xz/xz.1:987 +msgid "This feature is not available on non-POSIX systems." +msgstr "Dieses Funktionsmerkmal ist außerhalb von POSIX-Systemen nicht verfügbar." + +#. FIXME +#. type: Plain text +#: ../src/xz/xz.1:995 +msgid "B Currently B is unsuitable for decompressing the stream in real time due to how B does buffering." +msgstr "B Gegenwärtig ist B aufgrund der Art und Weise, wie B puffert, für Dekompression in Echtzeit ungeeignet." + +#. type: TP +#: ../src/xz/xz.1:995 +#, no-wrap +msgid "B<--memlimit-compress=>I" +msgstr "B<--memlimit-compress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1000 +msgid "Set a memory usage limit for compression. If this option is specified multiple times, the last one takes effect." +msgstr "legt eine Grenze für die Speichernutzung bei der Kompression fest. Wenn diese Option mehrmals angegeben wird, ist die zuletzt angegebene wirksam." + +#. type: Plain text +#: ../src/xz/xz.1:1013 +msgid "If the compression settings exceed the I, B will attempt to adjust the settings downwards so that the limit is no longer exceeded and display a notice that automatic adjustment was done. The adjustments are done in this order: reducing the number of threads, switching to single-threaded mode if even one thread in multi-threaded mode exceeds the I, and finally reducing the LZMA2 dictionary size." +msgstr "Falls die Kompressionseinstellungen die I überschreiten, versucht B, die Einstellungen nach unten anzupassen, so dass die Grenze nicht mehr überschritten wird und zeigt einen Hinweis an, dass eine automatische Anpassung vorgenommen wurde. Die Anpassungen werden in folgender Reihenfolge angewendet: Reduzierung der Anzahl der Threads, Wechsel in den Einzelthread-Modus, falls sogar ein einziger Thread im Multithread-Modus die I überschreitet, und schlussendlich die Reduzierung der Größe des LZMA2-Wörterbuchs." + +#. type: Plain text +#: ../src/xz/xz.1:1021 +msgid "When compressing with B<--format=raw> or if B<--no-adjust> has been specified, only the number of threads may be reduced since it can be done without affecting the compressed output." +msgstr "Beim Komprimieren mit B<--format=raw> oder falls B<--no-adjust> angegeben wurde, wird nur die Anzahl der Threads reduziert, da nur so die komprimierte Ausgabe nicht beeinflusst wird." + +#. type: Plain text +#: ../src/xz/xz.1:1028 +msgid "If the I cannot be met even with the adjustments described above, an error is displayed and B will exit with exit status 1." +msgstr "Falls die I nicht anhand der vorstehend beschriebenen Anpassungen gesetzt werden kann, wird ein Fehler angezeigt und B wird mit dem Exit-Status 1 beendet." + +#. type: Plain text +#: ../src/xz/xz.1:1032 +msgid "The I can be specified in multiple ways:" +msgstr "Die I kann auf verschiedene Arten angegeben werden:" + +# FIXME integer suffix +#. type: Plain text +#: ../src/xz/xz.1:1042 +msgid "The I can be an absolute value in bytes. Using an integer suffix like B can be useful. Example: B<--memlimit-compress=80MiB>" +msgstr "Die I kann ein absoluter Wert in Byte sein. Ein Suffix wie B kann dabei hilfreich sein. Beispiel: B<--memlimit-compress=80MiB>." + +#. type: Plain text +#: ../src/xz/xz.1:1054 +msgid "The I can be specified as a percentage of total physical memory (RAM). This can be useful especially when setting the B environment variable in a shell initialization script that is shared between different computers. That way the limit is automatically bigger on systems with more memory. Example: B<--memlimit-compress=70%>" +msgstr "Die I kann als Prozentsatz des physischen Gesamtspeichers (RAM) angegeben werden. Dies ist insbesondere nützlich, wenn in einem Shell-Initialisierungsskript, das mehrere unterschiedliche Rechner gemeinsam verwenden, die Umgebungsvariable B gesetzt ist. Auf diese Weise ist die Grenze auf Systemen mit mehr Speicher höher. Beispiel: B<--memlimit-compress=70%>" + +#. type: Plain text +#: ../src/xz/xz.1:1064 +msgid "The I can be reset back to its default value by setting it to B<0>. This is currently equivalent to setting the I to B (no memory usage limit)." +msgstr "Mit B<0> kann die I auf den Standardwert zurückgesetzt werden. Dies ist gegenwärtig gleichbedeutend mit dem Setzen der I auf B (keine Speicherbegrenzung)." + +#. type: Plain text +#: ../src/xz/xz.1:1088 +msgid "For 32-bit B there is a special case: if the I would be over B<4020\\ MiB>, the I is set to B<4020\\ MiB>. On MIPS32 B<2000\\ MiB> is used instead. (The values B<0> and B aren't affected by this. A similar feature doesn't exist for decompression.) This can be helpful when a 32-bit executable has access to 4\\ GiB address space (2 GiB on MIPS32) while hopefully doing no harm in other situations." +msgstr "Für die 32-Bit-Version von B gibt es einen Spezialfall: Falls die Grenze über B<4020\\ MiB> liegt, wird die I auf B<4020\\ MiB> gesetzt. Auf MIPS32 wird stattdessen B<2000\\ MB> verwendet (die Werte B<0> und B werden hiervon nicht beeinflusst; für die Dekompression gibt es keine vergleichbare Funktion). Dies kann hilfreich sein, wenn ein 32-Bit-Executable auf einen 4\\ GiB großen Adressraum (2 GiB auf MIPS32) zugreifen kann, wobei wir hoffen wollen, dass es in anderen Situationen keine negativen Effekte hat." + +#. type: Plain text +#: ../src/xz/xz.1:1091 +msgid "See also the section B." +msgstr "Siehe auch den Abschnitt B." + +#. type: TP +#: ../src/xz/xz.1:1091 +#, no-wrap +msgid "B<--memlimit-decompress=>I" +msgstr "B<--memlimit-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1105 +msgid "Set a memory usage limit for decompression. This also affects the B<--list> mode. If the operation is not possible without exceeding the I, B will display an error and decompressing the file will fail. See B<--memlimit-compress=>I for possible ways to specify the I." +msgstr "legt eine Begrenzung des Speicherverbrauchs für die Dekompression fest. Dies beeinflusst auch den Modus B<--list>. Falls die Aktion nicht ausführbar ist, ohne die I zu überschreiten, gibt B eine Fehlermeldung aus und die Dekompression wird fehlschlagen. Siehe B<--memlimit-compress=>I zu möglichen Wegen, die I anzugeben." + +#. type: TP +#: ../src/xz/xz.1:1105 +#, no-wrap +msgid "B<--memlimit-mt-decompress=>I" +msgstr "B<--memlimit-mt-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1127 +msgid "Set a memory usage limit for multi-threaded decompression. This can only affect the number of threads; this will never make B refuse to decompress a file. If I is too low to allow any multi-threading, the I is ignored and B will continue in single-threaded mode. Note that if also B<--memlimit-decompress> is used, it will always apply to both single-threaded and multi-threaded modes, and so the effective I for multi-threading will never be higher than the limit set with B<--memlimit-decompress>." +msgstr "legt eine Begrenzung des Speicherverbrauchs für Multithread-Dekompression fest. Dies beeinflusst lediglich die Anzahl der Threads; B wird dadurch niemals die Dekompression einer Datei verweigern. Falls die I für jegliches Multithreading zu niedrig ist, wird sie ignoriert und B setzt im Einzelthread-modus fort. Beachten Sie auch, dass bei der Verwendung von B<--memlimit-decompress> dies stets sowohl auf den Einzelthread-als auch auf den Multithread-Modus angewendet wird und so die effektive I für den Multithread-Modus niemals höher sein wird als die mit B<--memlimit-decompress> gesetzte Grenze." + +#. type: Plain text +#: ../src/xz/xz.1:1134 +msgid "In contrast to the other memory usage limit options, B<--memlimit-mt-decompress=>I has a system-specific default I. B can be used to see the current value." +msgstr "Im Gegensatz zu anderen Optionen zur Begrenzung des Speicherverbrauchs hat B<--memlimit-mt-decompress=>I eine systemspezifisch vorgegebene I. Mit B können Sie deren aktuellen Wert anzeigen lassen." + +#. type: Plain text +#: ../src/xz/xz.1:1150 +msgid "This option and its default value exist because without any limit the threaded decompressor could end up allocating an insane amount of memory with some input files. If the default I is too low on your system, feel free to increase the I but never set it to a value larger than the amount of usable RAM as with appropriate input files B will attempt to use that amount of memory even with a low number of threads. Running out of memory or swapping will not improve decompression performance." +msgstr "Diese Option und ihr Standardwert existieren, weil die unbegrenzte threadbezogene Dekompression bei einigen Eingabedateien zu unglaublich großem Speicherverbrauch führen würde. Falls die vorgegebene I auf Ihrem System zu niedrig ist, können Sie die I durchaus erhöhen, aber setzen Sie sie niemals auf einen Wert größer als die Menge des nutzbaren Speichers, da B bei entsprechenden Eingabedateien versuchen wird, diese Menge an Speicher auch bei einer geringen Anzahl von Threads zu verwnden. Speichermangel oder Auslagerung verbessern die Dekomprimierungsleistung nicht." + +#. type: Plain text +#: ../src/xz/xz.1:1162 +msgid "See B<--memlimit-compress=>I for possible ways to specify the I. Setting I to B<0> resets the I to the default system-specific value." +msgstr "Siehe B<--memlimit-compress=>I für mögliche Wege zur Angabe der I. Sezen der I auf B<0> setzt die I auf den vorgegebenen systemspezifischen Wert zurück." + +#. type: TP +#: ../src/xz/xz.1:1163 +#, no-wrap +msgid "B<-M> I, B<--memlimit=>I, B<--memory=>I" +msgstr "B<-M> I, B<--memlimit=>I, B<--memory=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1169 +msgid "This is equivalent to specifying B<--memlimit-compress=>I B<--memlimit-decompress=>I B<--memlimit-mt-decompress=>I." +msgstr "Dies ist gleichbedeutend mit B<--memlimit-compress=>I B<--memlimit-decompress=>I B<--memlimit-mt-decompress=>I." + +#. type: TP +#: ../src/xz/xz.1:1169 +#, no-wrap +msgid "B<--no-adjust>" +msgstr "B<--no-adjust>" + +#. type: Plain text +#: ../src/xz/xz.1:1179 +msgid "Display an error and exit if the memory usage limit cannot be met without adjusting settings that affect the compressed output. That is, this prevents B from switching the encoder from multi-threaded mode to single-threaded mode and from reducing the LZMA2 dictionary size. Even when this option is used the number of threads may be reduced to meet the memory usage limit as that won't affect the compressed output." +msgstr "zeigt einen Fehler an und beendet, falls die Grenze der Speichernutzung nicht ohne Änderung der Einstellungen, welche die komprimierte Ausgabe beeinflussen, berücksichtigt werden kann. Das bedeutet, dass B daran gehindert wird, den Encoder vom Multithread-Modus in den Einzelthread-Modus zu versetzen und die Größe des LZMA2-Wörterbuchs zu reduzieren. Allerdings kann bei Verwendung dieser Option dennoch die Anzahl der Threads reduziert werden, um die Grenze der Speichernutzung zu halten, sofern dies die komprimierte Ausgabe nicht beeinflusst." + +#. type: Plain text +#: ../src/xz/xz.1:1182 +msgid "Automatic adjusting is always disabled when creating raw streams (B<--format=raw>)." +msgstr "Die automatische Anpassung ist beim Erzeugen von Rohdatenströmen (B<--format=raw>) immer deaktiviert." + +#. type: TP +#: ../src/xz/xz.1:1182 +#, no-wrap +msgid "B<-T> I, B<--threads=>I" +msgstr "B<-T> I, B<--threads=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1197 +msgid "Specify the number of worker threads to use. Setting I to a special value B<0> makes B use up to as many threads as the processor(s) on the system support. The actual number of threads can be fewer than I if the input file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit." +msgstr "gibt die Anzahl der zu verwendenden Arbeits-Threads an. Wenn Sie I auf einen speziellen Wert B<0> setzen, verwendet B maximal so viele Threads, wie der/die Prozessor(en) im System untestützen. Die tatsächliche Anzahl kann geringer sein als die angegebenen I, wenn die Eingabedatei nicht groß genug für Threading mit den gegebenen Einstellungen ist oder wenn mehr Threads die Speicherbegrenzung übersteigen würden." + +#. type: Plain text +#: ../src/xz/xz.1:1216 +msgid "The single-threaded and multi-threaded compressors produce different output. Single-threaded compressor will give the smallest file size but only the output from the multi-threaded compressor can be decompressed using multiple threads. Setting I to B<1> will use the single-threaded mode. Setting I to any other value, including B<0>, will use the multi-threaded compressor even if the system supports only one hardware thread. (B 5.2.x used single-threaded mode in this situation.)" +msgstr "Die Multithread- bzw. Einzelthread-Kompressoren erzeugen unterschiedliche Ausgaben. Der Einzelthread-Kompressor erzeugt die geringste Dateigröße, aber nur die Ausgabe des Multithread-Kompressors kann mit mehreren Threads wieder dekomprimiert werden. Das Setzen der Anzahl der I auf B<1> wird den Einzelthread-Modus verwenden. Das Setzen der Anzahl der I auf einen anderen Wert einschließlich B<0> verwendet den Multithread-Kompressor, und zwar sogar dann, wenn das System nur einen einzigen Hardware-Thread unterstützt (B 5.2.x verwendete in diesem Fall noch den Einzelthread-Modus)." + +#. type: Plain text +#: ../src/xz/xz.1:1235 +msgid "To use multi-threaded mode with only one thread, set I to B<+1>. The B<+> prefix has no effect with values other than B<1>. A memory usage limit can still make B switch to single-threaded mode unless B<--no-adjust> is used. Support for the B<+> prefix was added in B 5.4.0." +msgstr "Um den Multithread-Modus mit nur einem einzigen Thread zu verwenden, setzen Sie die Anzahl der I auf B<+1>. Das Präfix B<+> hat mit Werten verschieden von B<1> keinen Effekt. Eine Begrenzung des Speicherverbrauchs kann B dennoch veranlassen, den Einzelthread-Modus zu verwenden, außer wenn B<--no-adjust> verwendet wird. Die Unterstützung für das Präfix B<+> wurde in B 5.4.0 hinzugefügt." + +#. type: Plain text +#: ../src/xz/xz.1:1250 +msgid "If an automatic number of threads has been requested and no memory usage limit has been specified, then a system-specific default soft limit will be used to possibly limit the number of threads. It is a soft limit in sense that it is ignored if the number of threads becomes one, thus a soft limit will never stop B from compressing or decompressing. This default soft limit will not make B switch from multi-threaded mode to single-threaded mode. The active limits can be seen with B." +msgstr "Falls das automatische Setzen der Anzahl der Threads angefordert und keine Speicherbegrenzung angegeben wurde, dann wird eine systemspezifisch vorgegebene weiche Grenze verwendet, um eventuell die Anzahl der Threads zu begrenzen. Es ist eine weiche Grenze im Sinne davon, dass sie ignoriert wird, falls die Anzahl der Threads 1 ist; daher wird eine weiche Grenze B niemals an der Kompression oder Dekompression hindern. Diese vorgegebene weiche Grenze veranlasst B nicht, vom Multithread-Modus in den Einzelthread-Modus zu wechseln. Die aktiven Grenzen können Sie mit dem Befehl B anzeigen lassen." + +#. type: Plain text +#: ../src/xz/xz.1:1257 +msgid "Currently the only threading method is to split the input into blocks and compress them independently from each other. The default block size depends on the compression level and can be overridden with the B<--block-size=>I option." +msgstr "Die gegenwärtig einzige Threading-Methode teilt die Eingabe in Blöcke und komprimiert diese unabhängig voneinander. Die vorgegebene Blockgröße ist von der Kompressionsstufe abhängig und kann mit der Option B<--block-size=>I außer Kraft gesetzt werden." + +#. type: Plain text +#: ../src/xz/xz.1:1265 +msgid "Threaded decompression only works on files that contain multiple blocks with size information in block headers. All large enough files compressed in multi-threaded mode meet this condition, but files compressed in single-threaded mode don't even if B<--block-size=>I has been used." +msgstr "Eine thread-basierte Dekompression wird nur bei Dateien funktionieren, die mehrere Blöcke mit Größeninformationen in deren Headern enthalten. Alle im Multi-Thread-Modus komprimierten Dateien, die groß genug sind, erfüllen diese Bedingung, im Einzel-Thread-Modus komprimierte Dateien dagegen nicht, selbst wenn B<--block-size=>I verwendet wurde." + +#. type: SS +#: ../src/xz/xz.1:1266 ../src/xz/xz.1:2819 +#, no-wrap +msgid "Custom compressor filter chains" +msgstr "Benutzerdefinierte Filterketten für die Kompression" + +#. type: Plain text +#: ../src/xz/xz.1:1282 +msgid "A custom filter chain allows specifying the compression settings in detail instead of relying on the settings associated to the presets. When a custom filter chain is specified, preset options (B<-0> \\&...\\& B<-9> and B<--extreme>) earlier on the command line are forgotten. If a preset option is specified after one or more custom filter chain options, the new preset takes effect and the custom filter chain options specified earlier are forgotten." +msgstr "Eine benutzerdefinierte Filterkette ermöglicht die Angabe detaillierter Kompressionseinstellungen, anstatt von den Voreinstellungen auszugehen. Wenn eine benutzerdefinierte Filterkette angegeben wird, werden die vorher in der Befehlszeile angegebenen Voreinstellungsoptionen (B<-0> … B<-9> und B<--extreme>) außer Kraft gesetzt. Wenn eine Voreinstellungsoption nach einer oder mehreren benutzerdefinierten Filterkettenoptionen angegeben wird, dann wird die neue Voreinstellung wirksam und die zuvor angegebenen Filterkettenoptionen werden außer Kraft gesetzt." + +#. type: Plain text +#: ../src/xz/xz.1:1289 +msgid "A filter chain is comparable to piping on the command line. When compressing, the uncompressed input goes to the first filter, whose output goes to the next filter (if any). The output of the last filter gets written to the compressed file. The maximum number of filters in the chain is four, but typically a filter chain has only one or two filters." +msgstr "Eine Filterkette ist mit dem Piping (der Weiterleitung) in der Befehlszeile vergleichbar. Bei der Kompression gelangt die unkomprimierte Eingabe in den ersten Filter, dessen Ausgabe wiederum in den zweiten Filter geleitet wird (sofern ein solcher vorhanden ist). Die Ausgabe des letzten Filters wird in die komprimierte Datei geschrieben. In einer Filterkette sind maximal vier Filter zulässig, aber typischerweise besteht eine Filterkette nur aus einem oder zwei Filtern." + +#. type: Plain text +#: ../src/xz/xz.1:1297 +msgid "Many filters have limitations on where they can be in the filter chain: some filters can work only as the last filter in the chain, some only as a non-last filter, and some work in any position in the chain. Depending on the filter, this limitation is either inherent to the filter design or exists to prevent security issues." +msgstr "Bei vielen Filtern ist die Positionierung in der Filterkette eingeschränkt: Einige Filter sind nur als letzte in der Kette verwendbar, einige können nicht als letzte Filter gesetzt werden, und andere funktionieren an beliebiger Stelle. Abhängig von dem Filter ist diese Beschränkung entweder auf das Design des Filters selbst zurückzuführen oder ist aus Sicherheitsgründen vorhanden." + +#. type: Plain text +#: ../src/xz/xz.1:1305 +msgid "A custom filter chain is specified by using one or more filter options in the order they are wanted in the filter chain. That is, the order of filter options is significant! When decoding raw streams (B<--format=raw>), the filter chain is specified in the same order as it was specified when compressing." +msgstr "Eine benutzerdefinierte Filterkette wird durch eine oder mehrere Filteroptionen in der Reihenfolge angegeben, in der sie in der Filterkette wirksam werden sollen. Daher ist die Reihenfolge der Filteroptionen von signifikanter Bedeutung! Beim Dekodieren von Rohdatenströmen (B<--format=raw>) wird die Filterkette in der gleichen Reihenfolge angegeben wie bei der Kompression." + +#. type: Plain text +#: ../src/xz/xz.1:1314 +msgid "Filters take filter-specific I as a comma-separated list. Extra commas in I are ignored. Every option has a default value, so you need to specify only those you want to change." +msgstr "Filter akzeptieren filterspezifische I in einer durch Kommata getrennten Liste. Zusätzliche Kommata in den I werden ignoriert. Jede Option hat einen Standardwert, daher brauchen Sie nur jene anzugeben, die Sie ändern wollen." + +#. type: Plain text +#: ../src/xz/xz.1:1323 +msgid "To see the whole filter chain and I, use B (that is, use B<--verbose> twice). This works also for viewing the filter chain options used by presets." +msgstr "Um die gesamte Filterkette und die I anzuzeigen, rufen Sie B auf (was gleichbedeutend mit der zweimaligen Angabe von B<--verbose> ist). Dies funktioniert auch zum Betrachten der von den Voreinstellungen verwendeten Filterkettenoptionen." + +#. type: TP +#: ../src/xz/xz.1:1323 +#, no-wrap +msgid "B<--lzma1>[B<=>I]" +msgstr "B<--lzma1>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1326 +#, no-wrap +msgid "B<--lzma2>[B<=>I]" +msgstr "B<--lzma2>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1331 +msgid "Add LZMA1 or LZMA2 filter to the filter chain. These filters can be used only as the last filter in the chain." +msgstr "fügt LZMA1- oder LZMA2-Filter zur Filterkette hinzu. Diese Filter können nur als letzte Filter in der Kette verwendet werden." + +#. type: Plain text +#: ../src/xz/xz.1:1343 +msgid "LZMA1 is a legacy filter, which is supported almost solely due to the legacy B<.lzma> file format, which supports only LZMA1. LZMA2 is an updated version of LZMA1 to fix some practical issues of LZMA1. The B<.xz> format uses LZMA2 and doesn't support LZMA1 at all. Compression speed and ratios of LZMA1 and LZMA2 are practically the same." +msgstr "LZMA1 ist ein veralteter Filter, welcher nur wegen des veralteten B<.lzma>-Dateiformats unterstützt wird, welches nur LZMA1 unterstützt. LZMA2 ist eine aktualisierte Version von LZMA1, welche einige praktische Probleme von LZMA1 behebt. Das B<.xz>-Format verwendet LZMA2 und unterstützt LZMA1 gar nicht. Kompressionsgeschwindigkeit und -verhältnis sind bei LZMA1 und LZMA2 praktisch gleich." + +#. type: Plain text +#: ../src/xz/xz.1:1346 +msgid "LZMA1 and LZMA2 share the same set of I:" +msgstr "LZMA1 und LZMA2 haben die gleichen I:" + +#. type: TP +#: ../src/xz/xz.1:1347 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1374 +msgid "Reset all LZMA1 or LZMA2 I to I. I consist of an integer, which may be followed by single-letter preset modifiers. The integer can be from B<0> to B<9>, matching the command line options B<-0> \\&...\\& B<-9>. The only supported modifier is currently B, which matches B<--extreme>. If no B is specified, the default values of LZMA1 or LZMA2 I are taken from the preset B<6>." +msgstr "setzt alle LZMA1- oder LZMA2-I auf die I zurück. Diese I wird in Form einer Ganzzahl angegeben, der ein aus einem einzelnen Buchstaben bestehender Voreinstellungsmodifikator folgen kann. Die Ganzzahl kann B<0> bis B<9> sein, entsprechend den Befehlszeilenoptionen B<-0> … B<-9>. Gegenwärtig ist B der einzige unterstützte Modifikator, was B<--extreme> entspricht. Wenn keine B angegeben ist, werden die Standardwerte der LZMA1- oder LZMA2-I der Voreinstellung B<6> entnommen." + +#. type: TP +#: ../src/xz/xz.1:1374 +#, no-wrap +msgid "BI" +msgstr "BI" + +# FIXME Dezimaltrenner in 1.5 GB +#. type: Plain text +#: ../src/xz/xz.1:1389 +msgid "Dictionary (history buffer) I indicates how many bytes of the recently processed uncompressed data is kept in memory. The algorithm tries to find repeating byte sequences (matches) in the uncompressed data, and replace them with references to the data currently in the dictionary. The bigger the dictionary, the higher is the chance to find a match. Thus, increasing dictionary I usually improves compression ratio, but a dictionary bigger than the uncompressed file is waste of memory." +msgstr "Die I des Wörterbuchs (Chronikpuffers) gibt an, wie viel Byte der kürzlich verarbeiteten unkomprimierten Daten im Speicher behalten werden sollen. Der Algorithmus versucht, sich wiederholende Byte-Abfolgen (Übereinstimmungen) in den unkomprimierten Daten zu finden und diese durch Referenzen zu den Daten zu ersetzen, die sich gegenwärtig im Wörterbuch befinden. Je größer das Wörterbuch, umso größer ist die Chance, eine Übereinstimmung zu finden. Daher bewirkt eine Erhöhung der I des Wörterbuchs üblicherweise ein besseres Kompressionsverhältnis, aber ein Wörterbuch, das größer ist als die unkomprimierte Datei, wäre Speicherverschwendung." + +#. type: Plain text +#: ../src/xz/xz.1:1398 +msgid "Typical dictionary I is from 64\\ KiB to 64\\ MiB. The minimum is 4\\ KiB. The maximum for compression is currently 1.5\\ GiB (1536\\ MiB). The decompressor already supports dictionaries up to one byte less than 4\\ GiB, which is the maximum for the LZMA1 and LZMA2 stream formats." +msgstr "Typische Wörterbuch-I liegen im Bereich von 64\\ KiB bis 64\\ MiB. Das Minimum ist 4\\ KiB. Das Maximum für die Kompression ist gegenwärtig 1.5\\ GiB (1536\\ MiB). Bei der Dekompression wird bereits eine Wörterbuchgröße bis zu 4\\ GiB minus 1 Byte unterstützt, welche das Maximum für die LZMA1- und LZMA2-Datenstromformate ist." + +#. type: Plain text +#: ../src/xz/xz.1:1425 +msgid "Dictionary I and match finder (I) together determine the memory usage of the LZMA1 or LZMA2 encoder. The same (or bigger) dictionary I is required for decompressing that was used when compressing, thus the memory usage of the decoder is determined by the dictionary size used when compressing. The B<.xz> headers store the dictionary I either as 2^I or 2^I + 2^(I-1), so these I are somewhat preferred for compression. Other I will get rounded up when stored in the B<.xz> headers." +msgstr "Die I des Wörterbuchs und der Übereinstimmungsfinder (I<Üf>) bestimmen zusammen den Speicherverbrauch des LZMA1- oder LZMA2-Kodierers. Bei der Dekompression ist ein Wörterbuch der gleichen I (oder ein noch größeres) wie bei der Kompression erforderlich, daher wird der Speicherverbrauch des Dekoders durch die Größe des bei der Kompression verwendeten Wörterbuchs bestimmt. Die B<.xz>-Header speichern die I des Wörterbuchs entweder als 2^I oder 2^I + 2^(I-1), so dass diese I für die Kompression etwas bevorzugt werden. Andere I werden beim Speichern in den B<.xz>-Headern aufgerundet." + +#. type: TP +#: ../src/xz/xz.1:1425 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1434 +msgid "Specify the number of literal context bits. The minimum is 0 and the maximum is 4; the default is 3. In addition, the sum of I and I must not exceed 4." +msgstr "gibt die Anzahl der literalen Kontextbits an. Das Minimum ist 0 und das Maximum 4; der Standardwert ist 3. Außerdem darf die Summe von I und I nicht größer als 4 sein." + +#. type: Plain text +#: ../src/xz/xz.1:1439 +msgid "All bytes that cannot be encoded as matches are encoded as literals. That is, literals are simply 8-bit bytes that are encoded one at a time." +msgstr "Alle Bytes, die nicht als Übereinstimmungen kodiert werden können, werden als Literale kodiert. Solche Literale sind einfache 8-bit-Bytes, die jeweils für sich kodiert werden." + +#. type: Plain text +#: ../src/xz/xz.1:1453 +msgid "The literal coding makes an assumption that the highest I bits of the previous uncompressed byte correlate with the next byte. For example, in typical English text, an upper-case letter is often followed by a lower-case letter, and a lower-case letter is usually followed by another lower-case letter. In the US-ASCII character set, the highest three bits are 010 for upper-case letters and 011 for lower-case letters. When I is at least 3, the literal coding can take advantage of this property in the uncompressed data." +msgstr "Bei der Literalkodierung wird angenommen, dass die höchsten I-Bits des zuvor unkomprimierten Bytes mit dem nächsten Byte in Beziehung stehen. Zum Beispiel folgt in typischen englischsprachigen Texten auf einen Großbuchstaben ein Kleinbuchstabe und auf einen Kleinbuchstaben üblicherweise wieder ein Kleinbuchstabe. Im US-ASCII-Zeichensatz sind die höchsten drei Bits 010 für Großbuchstaben und 011 für Kleinbuchstaben. Wenn I mindestens 3 ist, kann die literale Kodierung diese Eigenschaft der unkomprimierten Daten ausnutzen." + +#. type: Plain text +#: ../src/xz/xz.1:1462 +msgid "The default value (3) is usually good. If you want maximum compression, test B. Sometimes it helps a little, and sometimes it makes compression worse. If it makes it worse, test B too." +msgstr "Der Vorgabewert (3) ist üblicherweise gut. Wenn Sie die maximale Kompression erreichen wollen, versuchen Sie B. Manchmal hilft es ein wenig, doch manchmal verschlechtert es die Kompression. Im letzteren Fall versuchen Sie zum Beispiel auch\\& B." + +#. type: TP +#: ../src/xz/xz.1:1462 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1466 +msgid "Specify the number of literal position bits. The minimum is 0 and the maximum is 4; the default is 0." +msgstr "gibt die Anzahl der literalen Positionsbits an. Das Minimum ist 0 und das Maximum 4; die Vorgabe ist 0." + +#. type: Plain text +#: ../src/xz/xz.1:1473 +msgid "I affects what kind of alignment in the uncompressed data is assumed when encoding literals. See I below for more information about alignment." +msgstr "I beeinflusst, welche Art der Ausrichtung der unkomprimierten Daten beim Kodieren von Literalen angenommen wird. Siehe I weiter unten für weitere Informationen zur Ausrichtung." + +#. type: TP +#: ../src/xz/xz.1:1473 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1477 +msgid "Specify the number of position bits. The minimum is 0 and the maximum is 4; the default is 2." +msgstr "legt die Anzahl der Positions-Bits fest. Das Minimum ist 0 und das Maximum 4; Standard ist 2." + +#. type: Plain text +#: ../src/xz/xz.1:1484 +msgid "I affects what kind of alignment in the uncompressed data is assumed in general. The default means four-byte alignment (2^I=2^2=4), which is often a good choice when there's no better guess." +msgstr "I beeinflusst, welche Art der Ausrichtung der unkomprimierten Daten generell angenommen wird. Standardmäßig wird eine Vier-Byte-Ausrichtung angenommen (2^I=2^2=4), was oft eine gute Wahl ist, wenn es keine bessere Schätzung gibt." + +#. type: Plain text +#: ../src/xz/xz.1:1498 +msgid "When the alignment is known, setting I accordingly may reduce the file size a little. For example, with text files having one-byte alignment (US-ASCII, ISO-8859-*, UTF-8), setting B can improve compression slightly. For UTF-16 text, B is a good choice. If the alignment is an odd number like 3 bytes, B might be the best choice." +msgstr "Wenn die Ausrichtung bekannt ist, kann das entsprechende Setzen von I die Dateigröße ein wenig verringern. Wenn Textdateien zum Beispiel eine Ein-Byte-Ausrichtung haben (US-ASCII, ISO-8859-*, UTF-8), kann das Setzen von B die Kompression etwas verbessern. Für UTF-16-Text ist B eine gute Wahl. Wenn die Ausrichtung eine ungerade Zahl wie beispielsweise 3 Byte ist, könnte B die beste Wahl sein." + +#. type: Plain text +#: ../src/xz/xz.1:1506 +msgid "Even though the assumed alignment can be adjusted with I and I, LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth taking into account when designing file formats that are likely to be often compressed with LZMA1 or LZMA2." +msgstr "Obwohl die angenommene Ausrichtung mit I und I angepasst werden kann, bevorzugen LZMA1 und LZMA2 noch etwas die 16-Byte-Ausrichtung. Das sollten Sie vielleicht beim Design von Dateiformaten berücksichtigen, die wahrscheinlich oft mit LZMA1 oder LZMA2 komprimiert werden." + +#. type: TP +#: ../src/xz/xz.1:1506 +#, no-wrap +msgid "BI" +msgstr "BI<Üf>" + +#. type: Plain text +#: ../src/xz/xz.1:1521 +msgid "Match finder has a major effect on encoder speed, memory usage, and compression ratio. Usually Hash Chain match finders are faster than Binary Tree match finders. The default depends on the I: 0 uses B, 1\\(en3 use B, and the rest use B." +msgstr "Der Übereinstimmungsfinder hat einen großen Einfluss auf die Geschwindigkeit des Kodierers, den Speicherbedarf und das Kompressionsverhältnis. Üblicherweise sind auf Hash-Ketten basierende Übereinstimmungsfinder schneller als jene, die mit Binärbäumen arbeiten. Die Vorgabe hängt von der I ab: 0 verwendet B, 1-3 verwenden B und der Rest verwendet B." + +#. type: Plain text +#: ../src/xz/xz.1:1527 +msgid "The following match finders are supported. The memory usage formulas below are rough approximations, which are closest to the reality when I is a power of two." +msgstr "Die folgenden Übereinstimmungsfinder werden unterstützt. Die Formeln zur Ermittlung des Speicherverbrauchs sind grobe Schätzungen, die der Realität am nächsten kommen, wenn I eine Zweierpotenz ist." + +#. type: TP +#: ../src/xz/xz.1:1528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1531 +msgid "Hash Chain with 2- and 3-byte hashing" +msgstr "Hash-Kette mit 2- und 3-Byte-Hashing" + +#. type: Plain text +#: ../src/xz/xz.1:1535 ../src/xz/xz.1:1584 +msgid "Minimum value for I: 3" +msgstr "Minimalwert für I: 3" + +#. type: Plain text +#: ../src/xz/xz.1:1537 ../src/xz/xz.1:1556 ../src/xz/xz.1:1586 +#: ../src/xz/xz.1:1605 +msgid "Memory usage:" +msgstr "Speicherbedarf:" + +#. type: Plain text +#: ../src/xz/xz.1:1542 +msgid "I * 7.5 (if I E= 16 MiB);" +msgstr "I * 7,5 (falls I E= 16 MiB);" + +#. type: Plain text +#: ../src/xz/xz.1:1547 +msgid "I * 5.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 5,5 + 64 MiB (falls I E 16 MiB)" + +#. type: TP +#: ../src/xz/xz.1:1547 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1550 +msgid "Hash Chain with 2-, 3-, and 4-byte hashing" +msgstr "Hash-Kette mit 2-, 3- und 4-Byte-Hashing" + +#. type: Plain text +#: ../src/xz/xz.1:1554 ../src/xz/xz.1:1603 +msgid "Minimum value for I: 4" +msgstr "Minimaler Wert für I: 4" + +#. type: Plain text +#: ../src/xz/xz.1:1561 +msgid "I * 7.5 (if I E= 32 MiB);" +msgstr "I * 7,5 (falls I E= 32 MiB ist);" + +#. type: Plain text +#: ../src/xz/xz.1:1566 +msgid "I * 6.5 (if I E 32 MiB)" +msgstr "I * 6,5 (falls I E 32 MiB ist)" + +#. type: TP +#: ../src/xz/xz.1:1566 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1569 +msgid "Binary Tree with 2-byte hashing" +msgstr "Binärbaum mit 2-Byte-Hashing" + +#. type: Plain text +#: ../src/xz/xz.1:1573 +msgid "Minimum value for I: 2" +msgstr "Minimaler Wert für I: 2" + +#. type: Plain text +#: ../src/xz/xz.1:1577 +msgid "Memory usage: I * 9.5" +msgstr "Speicherverbrauch: I * 9.5" + +#. type: TP +#: ../src/xz/xz.1:1577 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1580 +msgid "Binary Tree with 2- and 3-byte hashing" +msgstr "Binärbaum mit 2- und 3-Byte-Hashing" + +#. type: Plain text +#: ../src/xz/xz.1:1591 +msgid "I * 11.5 (if I E= 16 MiB);" +msgstr "I * 11,5 (falls I E= 16 MiB ist);" + +#. type: Plain text +#: ../src/xz/xz.1:1596 +msgid "I * 9.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 9,5 + 64 MiB (falls I E 16 MiB ist)" + +#. type: TP +#: ../src/xz/xz.1:1596 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1599 +msgid "Binary Tree with 2-, 3-, and 4-byte hashing" +msgstr "Binärbaum mit 2-, 3- und 4-Byte-Hashing" + +#. type: Plain text +#: ../src/xz/xz.1:1610 +msgid "I * 11.5 (if I E= 32 MiB);" +msgstr "I * 11,5 (falls I E= 32 MiB ist);" + +#. type: Plain text +#: ../src/xz/xz.1:1615 +msgid "I * 10.5 (if I E 32 MiB)" +msgstr "I * 10,5 (falls I E 32 MiB ist)" + +#. type: TP +#: ../src/xz/xz.1:1616 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1637 +msgid "Compression I specifies the method to analyze the data produced by the match finder. Supported I are B and B. The default is B for I 0\\(en3 and B for I 4\\(en9." +msgstr "gibt die Methode zum Analysieren der vom Übereinstimmungsfinder gelieferten Daten an. Als I werden B und B unterstützt. Die Vorgabe ist B für die I 0-3 und B für die I 4-9." + +#. type: Plain text +#: ../src/xz/xz.1:1646 +msgid "Usually B is used with Hash Chain match finders and B with Binary Tree match finders. This is also what the I do." +msgstr "Üblicherweise wird B mit Hashketten-basierten Übereinstimmungsfindern und B mit Binärbaum-basierten Übereinstimmungsfindern verwendet. So machen es auch die I." + +#. type: TP +#: ../src/xz/xz.1:1646 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1653 +msgid "Specify what is considered to be a nice length for a match. Once a match of at least I bytes is found, the algorithm stops looking for possibly better matches." +msgstr "gibt an, was als annehmbarer Wert für eine Übereinstimmung angesehen werden kann. Wenn eine Übereinstimmung gefunden wird, die mindestens diesen I-Wert hat, sucht der Algorithmus nicht weiter nach besseren Übereinstimmungen." + +#. type: Plain text +#: ../src/xz/xz.1:1660 +msgid "I can be 2\\(en273 bytes. Higher values tend to give better compression ratio at the expense of speed. The default depends on the I." +msgstr "Der I-Wert kann 2-273 Byte sein. Höhere Werte tendieren zu einem besseren Kompressionsverhältnis, aber auf Kosten der Geschwindigkeit. Die Vorgabe hängt von der I ab." + +#. type: TP +#: ../src/xz/xz.1:1660 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1670 +msgid "Specify the maximum search depth in the match finder. The default is the special value of 0, which makes the compressor determine a reasonable I from I and I." +msgstr "legt die maximale Suchtiefe im Übereinstimmungsfinder fest. Vorgegeben ist der spezielle Wert 0, der den Kompressor veranlasst, einen annehmbaren Wert für I aus I<Üf> und I-Wert zu bestimmen." + +#. type: Plain text +#: ../src/xz/xz.1:1681 +msgid "Reasonable I for Hash Chains is 4\\(en100 and 16\\(en1000 for Binary Trees. Using very high values for I can make the encoder extremely slow with some files. Avoid setting the I over 1000 unless you are prepared to interrupt the compression in case it is taking far too long." +msgstr "Die angemessene I für Hash-Ketten ist 4-100 und 16-1000 für Binärbäume. Hohe Werte für die I können den Kodierer bei einigen Dateien extrem verlangsamen. Vermeiden Sie es, die I über einen Wert von 100 zu setzen, oder stellen Sie sich darauf ein, die Kompression abzubrechen, wenn sie zu lange dauert." + +#. type: Plain text +#: ../src/xz/xz.1:1692 +msgid "When decoding raw streams (B<--format=raw>), LZMA2 needs only the dictionary I. LZMA1 needs also I, I, and I." +msgstr "Beim Dekodieren von Rohdatenströmen (B<--format=raw>) benötigt LZMA2 nur die Wörterbuch-I. LZMA1 benötigt außerdem I, I und I." + +#. type: TP +#: ../src/xz/xz.1:1692 +#, no-wrap +msgid "B<--x86>[B<=>I]" +msgstr "B<--x86>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1695 +#, no-wrap +msgid "B<--arm>[B<=>I]" +msgstr "B<--arm>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1697 +#, no-wrap +msgid "B<--armthumb>[B<=>I]" +msgstr "B<--armthumb>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1699 +#, no-wrap +msgid "B<--arm64>[B<=>I]" +msgstr "B<--arm64>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1701 +#, no-wrap +msgid "B<--powerpc>[B<=>I]" +msgstr "B<--powerpc>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1703 +#, no-wrap +msgid "B<--ia64>[B<=>I]" +msgstr "B<--ia64>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1705 +#, no-wrap +msgid "B<--sparc>[B<=>I]" +msgstr "B<--sparc>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1711 +msgid "Add a branch/call/jump (BCJ) filter to the filter chain. These filters can be used only as a non-last filter in the filter chain." +msgstr "fügt ein »Branch/Call/Jump«-(BCJ-)Filter zur Filterkette hinzu. Diese Filter können nicht als letzter Filter in der Filterkette verwendet werden." + +#. type: Plain text +#: ../src/xz/xz.1:1725 +msgid "A BCJ filter converts relative addresses in the machine code to their absolute counterparts. This doesn't change the size of the data but it increases redundancy, which can help LZMA2 to produce 0\\(en15\\ % smaller B<.xz> file. The BCJ filters are always reversible, so using a BCJ filter for wrong type of data doesn't cause any data loss, although it may make the compression ratio slightly worse. The BCJ filters are very fast and use an insignificant amount of memory." +msgstr "Ein BCJ-Filter wandelt relative Adressen im Maschinencode in deren absolute Gegenstücke um. Die Datengröße wird dadurch nicht geändert, aber die Redundanz erhöht, was LZMA2 dabei helfen kann, eine um 10 bis 15% kleinere B<.xz>-Datei zu erstellen. Die BCJ-Filter sind immer reversibel, daher verursacht die Anwendung eines BCJ-Filters auf den falschen Datentyp keinen Datenverlust, wobei aber das Kompressionsverhältnis etwas schlechter werden könnte. Die BCJ-Filter sind sehr schnell und verbrauchen nur wenig mehr Speicher." + +#. type: Plain text +#: ../src/xz/xz.1:1728 +msgid "These BCJ filters have known problems related to the compression ratio:" +msgstr "Diese BCJ-Filter haben bekannte Probleme mit dem Kompressionsverhältnis:" + +#. type: Plain text +#: ../src/xz/xz.1:1735 +msgid "Some types of files containing executable code (for example, object files, static libraries, and Linux kernel modules) have the addresses in the instructions filled with filler values. These BCJ filters will still do the address conversion, which will make the compression worse with these files." +msgstr "In einigen Dateitypen, die ausführbaren Code enthalten (zum Beispiel Objektdateien, statische Bibliotheken und Linux-Kernelmodule), sind die Adressen in den Anweisungen mit Füllwerten gefüllt. Diese BCJ-Filter führen dennoch die Adressumwandlung aus, wodurch die Kompression bei diesen Dateien schlechter wird." + +#. type: Plain text +#: ../src/xz/xz.1:1745 +msgid "If a BCJ filter is applied on an archive, it is possible that it makes the compression ratio worse than not using a BCJ filter. For example, if there are similar or even identical executables then filtering will likely make the files less similar and thus compression is worse. The contents of non-executable files in the same archive can matter too. In practice one has to try with and without a BCJ filter to see which is better in each situation." +msgstr "Falls ein BCJ-Filter auf ein Archiv angewendet wird, ist es möglich, dass das Kompressionsverhältnis schlechter als ohne Filter wird. Falls es beispielsweise ähnliche oder sogar identische ausführbare Dateien gibt, dann werden diese durch die Filterung wahrscheinlich »unähnlicher« und verschlechtern dadurch das Kompressionsverhältnis. Der Inhalt nicht-ausführbarer Dateien im gleichen Archiv kann sich ebenfalls darauf auswirken. In der Praxis werden Sie durch Versuche mit oder ohne BCJ-Filter selbst herausfinden müssen, was situationsbezogen besser ist." + +#. type: Plain text +#: ../src/xz/xz.1:1750 +msgid "Different instruction sets have different alignment: the executable file must be aligned to a multiple of this value in the input data to make the filter work." +msgstr "Verschiedene Befehlssätze haben unterschiedliche Ausrichtungen: Die ausführbare Datei muss in den Eingabedateien einem Vielfachen dieses Wertes entsprechen, damit dieser Filter funktioniert." + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Filter" +msgstr "Filter" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Alignment" +msgstr "Ausrichtung" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Notes" +msgstr "Hinweise" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "x86" +msgstr "x86" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "32-bit or 64-bit x86" +msgstr "32-Bit oder 64-Bit x86" + +#. type: tbl table +#: ../src/xz/xz.1:1759 +#, no-wrap +msgid "ARM" +msgstr "ARM" + +#. type: tbl table +#: ../src/xz/xz.1:1760 +#, no-wrap +msgid "ARM-Thumb" +msgstr "ARM-Thumb" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "ARM64" +msgstr "ARM64" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "4096-byte alignment is best" +msgstr "4096-Byte-Ausrichtung ist optimal" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "PowerPC" +msgstr "PowerPC" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "Big endian only" +msgstr "Nur Big Endian" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "IA-64" +msgstr "IA-64" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "16" +msgstr "16" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "Itanium" +msgstr "Itanium" + +#. type: tbl table +#: ../src/xz/xz.1:1764 +#, no-wrap +msgid "SPARC" +msgstr "SPARC" + +#. type: Plain text +#: ../src/xz/xz.1:1781 +msgid "Since the BCJ-filtered data is usually compressed with LZMA2, the compression ratio may be improved slightly if the LZMA2 options are set to match the alignment of the selected BCJ filter. For example, with the IA-64 filter, it's good to set B or even B with LZMA2 (2^4=16). The x86 filter is an exception; it's usually good to stick to LZMA2's default four-byte alignment when compressing x86 executables." +msgstr "Da die BCJ-gefilterten Daten üblicherweise mit LZMA2 komprimiert sind, kann das Kompressionsverhältnis dadurch etwas verbessert werden, dass die LZMA2-Optionen so gesetzt werden, dass sie der Ausrichtung des gewählten BCJ-Filters entsprechen. Zum Beispiel ist es beim IA-64-Filter eine gute Wahl, B oder sogar B mit LZMA2 zu setzen (2^4=16). Der x86-Filter bildet dabei eine Ausnahme; Sie sollten bei der für LZMA2 voreingestellten 4-Byte-Ausrichtung bleiben, wenn Sie x86-Binärdateien komprimieren." + +#. type: Plain text +#: ../src/xz/xz.1:1784 +msgid "All BCJ filters support the same I:" +msgstr "Alle BCJ-Filter unterstützen die gleichen I:" + +#. type: TP +#: ../src/xz/xz.1:1785 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1799 +msgid "Specify the start I that is used when converting between relative and absolute addresses. The I must be a multiple of the alignment of the filter (see the table above). The default is zero. In practice, the default is good; specifying a custom I is almost never useful." +msgstr "gibt den Start-I an, der bei der Umwandlung zwischen relativen und absoluten Adressen verwendet wird. Der I muss ein Vielfaches der Filterausrichtung sein (siehe die Tabelle oben). Der Standardwert ist 0. In der Praxis ist dieser Standardwert gut; die Angabe eines benutzerdefinierten I ist fast immer unnütz." + +#. type: TP +#: ../src/xz/xz.1:1800 +#, no-wrap +msgid "B<--delta>[B<=>I]" +msgstr "B<--delta>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1805 +msgid "Add the Delta filter to the filter chain. The Delta filter can be only used as a non-last filter in the filter chain." +msgstr "fügt den Delta-Filter zur Filterkette hinzu. Der Delta-Filter kann nicht als letzter Filter in der Filterkette verwendet werden." + +#. type: Plain text +#: ../src/xz/xz.1:1814 +msgid "Currently only simple byte-wise delta calculation is supported. It can be useful when compressing, for example, uncompressed bitmap images or uncompressed PCM audio. However, special purpose algorithms may give significantly better results than Delta + LZMA2. This is true especially with audio, which compresses faster and better, for example, with B(1)." +msgstr "Gegenwärtig wird nur eine einfache, Byte-bezogene Delta-Berechnung unterstützt. Beim Komprimieren von zum Beispiel unkomprimierten Bitmap-Bildern oder unkomprimierten PCM-Audiodaten kann es jedoch sinnvoll sein. Dennoch können für spezielle Zwecke entworfene Algorithmen deutlich bessere Ergebnisse als Delta und LZMA2 liefern. Dies trifft insbesondere auf Audiodaten zu, die sich zum Beispiel mit B(1) schneller und besser komprimieren lassen." + +#. type: Plain text +#: ../src/xz/xz.1:1817 +msgid "Supported I:" +msgstr "Unterstützte I:" + +#. type: TP +#: ../src/xz/xz.1:1818 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1826 +msgid "Specify the I of the delta calculation in bytes. I must be 1\\(en256. The default is 1." +msgstr "gibt den I der Delta-Berechnung in Byte an. Zulässige Werte für den I sind 1 bis 256. Der Vorgabewert ist 1." + +#. type: Plain text +#: ../src/xz/xz.1:1831 +msgid "For example, with B and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02." +msgstr "Zum Beispiel wird mit B und der 8-Byte-Eingabe A1 B1 A2 B3 A3 B5 A4 B7 die Ausgabe A1 B1 01 02 01 02 01 02 sein." + +#. type: SS +#: ../src/xz/xz.1:1833 +#, no-wrap +msgid "Other options" +msgstr "Andere Optionen" + +#. type: TP +#: ../src/xz/xz.1:1834 ../src/xzdec/xzdec.1:83 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../src/xz/xz.1:1841 +msgid "Suppress warnings and notices. Specify this twice to suppress errors too. This option has no effect on the exit status. That is, even if a warning was suppressed, the exit status to indicate a warning is still used." +msgstr "unterdrückt Warnungen und Hinweise. Geben Sie dies zweimal an, um auch Fehlermeldungen zu unterdrücken. Diese Option wirkt sich nicht auf den Exit-Status aus. Das bedeutet, das selbst bei einer unterdrückten Warnung der Exit-Status zur Anzeige einer Warnung dennoch verwendet wird." + +#. type: TP +#: ../src/xz/xz.1:1841 +#, no-wrap +msgid "B<-v>, B<--verbose>" +msgstr "B<-v>, B<--verbose>" + +#. type: Plain text +#: ../src/xz/xz.1:1850 +msgid "Be verbose. If standard error is connected to a terminal, B will display a progress indicator. Specifying B<--verbose> twice will give even more verbose output." +msgstr "bewirkt ausführliche Ausgaben. Wenn die Standardfehlerausgabe mit einem Terminal verbunden ist, zeigt B den Fortschritt an. Durch zweimalige Angabe von B<--verbose> wird die Ausgabe noch ausführlicher." + +#. type: Plain text +#: ../src/xz/xz.1:1852 +msgid "The progress indicator shows the following information:" +msgstr "Der Fortschrittsanzeiger stellt die folgenden Informationen dar:" + +#. type: Plain text +#: ../src/xz/xz.1:1857 +msgid "Completion percentage is shown if the size of the input file is known. That is, the percentage cannot be shown in pipes." +msgstr "Der Prozentsatz des Fortschritts wird angezeigt, wenn die Größe der Eingabedatei bekannt ist. Das bedeutet, dass der Prozentsatz in Weiterleitungen (Pipes) nicht angezeigt werden kann." + +#. type: Plain text +#: ../src/xz/xz.1:1860 +msgid "Amount of compressed data produced (compressing) or consumed (decompressing)." +msgstr "Menge der erzeugten komprimierten Daten (bei der Kompression) oder der verarbeiteten Daten (bei der Dekompression)." + +#. type: Plain text +#: ../src/xz/xz.1:1863 +msgid "Amount of uncompressed data consumed (compressing) or produced (decompressing)." +msgstr "Menge der verarbeiteten unkomprimierten Daten (bei der Kompression) oder der erzeugten Daten (bei der Dekompression)." + +#. type: Plain text +#: ../src/xz/xz.1:1867 +msgid "Compression ratio, which is calculated by dividing the amount of compressed data processed so far by the amount of uncompressed data processed so far." +msgstr "Kompressionsverhältnis, das mittels Dividieren der Menge der bisher komprimierten Daten durch die Menge der bisher verarbeiteten unkomprimierten Daten ermittelt wird." + +#. type: Plain text +#: ../src/xz/xz.1:1874 +msgid "Compression or decompression speed. This is measured as the amount of uncompressed data consumed (compression) or produced (decompression) per second. It is shown after a few seconds have passed since B started processing the file." +msgstr "Kompressions- oder Dekompressionsgeschwindigkeit. Diese wird anhand der Menge der unkomprimierten verarbeiteten Daten (bei der Kompression) oder der Menge der erzeugten Daten (bei der Dekompression) pro Sekunde gemessen. Die Anzeige startet einige Sekunden nachdem B mit der Verarbeitung der Datei begonnen hat." + +#. type: Plain text +#: ../src/xz/xz.1:1876 +msgid "Elapsed time in the format M:SS or H:MM:SS." +msgstr "Die vergangene Zeit im Format M:SS oder H:MM:SS." + +#. type: Plain text +#: ../src/xz/xz.1:1884 +msgid "Estimated remaining time is shown only when the size of the input file is known and a couple of seconds have already passed since B started processing the file. The time is shown in a less precise format which never has any colons, for example, 2 min 30 s." +msgstr "Die geschätzte verbleibende Zeit wird nur angezeigt, wenn die Größe der Eingabedatei bekannt ist und bereits einige Sekunden vergangen sind, nachdem B mit der Verarbeitung der Datei begonnen hat. Die Zeit wird in einem weniger präzisen Format ohne Doppelpunkte angezeigt, zum Beispiel 2 min 30 s." + +#. type: Plain text +#: ../src/xz/xz.1:1899 +msgid "When standard error is not a terminal, B<--verbose> will make B print the filename, compressed size, uncompressed size, compression ratio, and possibly also the speed and elapsed time on a single line to standard error after compressing or decompressing the file. The speed and elapsed time are included only when the operation took at least a few seconds. If the operation didn't finish, for example, due to user interruption, also the completion percentage is printed if the size of the input file is known." +msgstr "Wenn die Standardfehlerausgabe kein Terminal ist, schreibt B mit B<--verbose> nach dem Komprimieren oder Dekomprimieren der Datei in einer einzelnen Zeile den Dateinamen, die komprimierte Größe, die unkomprimierte Größe, das Kompressionsverhältnis und eventuell auch die Geschwindigkeit und die vergangene Zeit in die Standardfehlerausgabe. Die Geschwindigkeit und die vergangene Zeit werden nur angezeigt, wenn der Vorgang mindestens ein paar Sekunden gedauert hat. Wurde der Vorgang nicht beendet, zum Beispiel weil ihn der Benutzer abgebrochen hat, wird außerdem der Prozentsatz des erreichten Verarbeitungsfortschritts aufgenommen, sofern die Größe der Eingabedatei bekannt ist." + +#. type: TP +#: ../src/xz/xz.1:1899 ../src/xzdec/xzdec.1:89 +#, no-wrap +msgid "B<-Q>, B<--no-warn>" +msgstr "B<-Q>, B<--no-warn>" + +#. type: Plain text +#: ../src/xz/xz.1:1909 +msgid "Don't set the exit status to 2 even if a condition worth a warning was detected. This option doesn't affect the verbosity level, thus both B<--quiet> and B<--no-warn> have to be used to not display warnings and to not alter the exit status." +msgstr "setzt den Exit-Status nicht auf 2, selbst wenn eine Bedingung erfüllt ist, die eine Warnung gerechtfertigt hätte. Diese Option wirkt sich nicht auf die Ausführlichkeitsstufe aus, daher müssen sowohl B<--quiet> als auch B<--no-warn> angegeben werden, um einerseits keine Warnungen anzuzeigen und andererseits auch den Exit-Status nicht zu ändern." + +#. type: TP +#: ../src/xz/xz.1:1909 +#, no-wrap +msgid "B<--robot>" +msgstr "B<--robot>" + +#. type: Plain text +#: ../src/xz/xz.1:1921 +msgid "Print messages in a machine-parsable format. This is intended to ease writing frontends that want to use B instead of liblzma, which may be the case with various scripts. The output with this option enabled is meant to be stable across B releases. See the section B for details." +msgstr "gibt Meldungen in einem maschinenlesbaren Format aus. Dadurch soll das Schreiben von Frontends erleichtert werden, die B anstelle von Liblzma verwenden wollen, was in verschiedenen Skripten der Fall sein kann. Die Ausgabe mit dieser aktivierten Option sollte über mehrere B-Veröffentlichungen stabil sein. Details hierzu finden Sie im Abschnitt B." + +#. type: TP +#: ../src/xz/xz.1:1921 +#, no-wrap +msgid "B<--info-memory>" +msgstr "B<--info-memory>" + +#. type: Plain text +#: ../src/xz/xz.1:1928 +msgid "Display, in human-readable format, how much physical memory (RAM) and how many processor threads B thinks the system has and the memory usage limits for compression and decompression, and exit successfully." +msgstr "zeigt in einem menschenlesbaren Format an, wieviel physischen Speicher (RAM) und wie viele Prozessor-Threads das System nach Annahme von B hat, sowie die Speicherbedarfsbegrenzung für Kompression und Dekompression, und beendet das Programm erfolgreich." + +#. type: TP +#: ../src/xz/xz.1:1928 ../src/xzdec/xzdec.1:96 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../src/xz/xz.1:1932 +msgid "Display a help message describing the most commonly used options, and exit successfully." +msgstr "zeigt eine Hilfemeldung mit den am häufigsten genutzten Optionen an und beendet das Programm erfolgreich." + +#. type: TP +#: ../src/xz/xz.1:1932 +#, no-wrap +msgid "B<-H>, B<--long-help>" +msgstr "B<-H>, B<--long-help>" + +# FIXME Satzpunkt fehlt +#. type: Plain text +#: ../src/xz/xz.1:1937 +msgid "Display a help message describing all features of B, and exit successfully" +msgstr "zeigt eine Hilfemeldung an, die alle Funktionsmerkmale von B beschreibt und beendet das Programm erfolgreich." + +#. type: TP +#: ../src/xz/xz.1:1937 ../src/xzdec/xzdec.1:99 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../src/xz/xz.1:1946 +msgid "Display the version number of B and liblzma in human readable format. To get machine-parsable output, specify B<--robot> before B<--version>." +msgstr "zeigt die Versionsnummer von B und Liblzma in einem menschenlesbaren Format an. Um eine maschinell auswertbare Ausgabe zu erhalten, geben Sie B<--robot> vor B<--version> an." + +#. type: SH +#: ../src/xz/xz.1:1947 +#, no-wrap +msgid "ROBOT MODE" +msgstr "ROBOTER-MODUS" + +#. type: Plain text +#: ../src/xz/xz.1:1963 +msgid "The robot mode is activated with the B<--robot> option. It makes the output of B easier to parse by other programs. Currently B<--robot> is supported only together with B<--version>, B<--info-memory>, and B<--list>. It will be supported for compression and decompression in the future." +msgstr "Der Roboter-Modus wird mit der Option B<--robot> aktiviert. Er bewirkt, dass die Ausgabe von B leichter von anderen Programmen ausgewertet werden kann. Gegenwärtig wird B<--robot> nur zusammen mit B<--version>, B<--info-memory> und B<--list> unterstützt. In der Zukunft wird dieser Modus auch für Kompression und Dekompression unterstützt." + +#. type: SS +#: ../src/xz/xz.1:1964 +#, no-wrap +msgid "Version" +msgstr "Version" + +#. type: Plain text +#: ../src/xz/xz.1:1969 +msgid "B will print the version number of B and liblzma in the following format:" +msgstr "B gibt die Versionsnummern von B und Liblzma im folgenden Format aus:" + +#. type: Plain text +#: ../src/xz/xz.1:1971 +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1973 +msgid "BI" +msgstr "BI" + +#. type: TP +#: ../src/xz/xz.1:1973 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1976 +msgid "Major version." +msgstr "Hauptversion." + +#. type: TP +#: ../src/xz/xz.1:1976 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1981 +msgid "Minor version. Even numbers are stable. Odd numbers are alpha or beta versions." +msgstr "Unterversion. Gerade Zahlen bezeichnen eine stabile Version. Ungerade Zahlen bezeichnen Alpha- oder Betaversionen." + +#. type: TP +#: ../src/xz/xz.1:1981 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1985 +msgid "Patch level for stable releases or just a counter for development releases." +msgstr "Patch-Stufe für stabile Veröffentlichungen oder einfach nur ein Zähler für Entwicklungsversionen." + +#. type: TP +#: ../src/xz/xz.1:1985 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1993 +msgid "Stability. 0 is alpha, 1 is beta, and 2 is stable. I should be always 2 when I is even." +msgstr "Stabilität. 0 ist Alpha, 1 ist Beta und 2 ist stabil. I sollte immer 2 sein, wenn I eine gerade Zahl ist." + +#. type: Plain text +#: ../src/xz/xz.1:1998 +msgid "I are the same on both lines if B and liblzma are from the same XZ Utils release." +msgstr "I sind in beiden Zeilen gleich, sofern B und Liblzma aus der gleichen Veröffentlichung der XZ-Utils stammen." + +#. type: Plain text +#: ../src/xz/xz.1:2004 +msgid "Examples: 4.999.9beta is B<49990091> and 5.0.0 is B<50000002>." +msgstr "Beispiele: 4.999.9beta ist B<49990091> und 5.0.0 is B<50000002>." + +#. type: SS +#: ../src/xz/xz.1:2005 +#, no-wrap +msgid "Memory limit information" +msgstr "Informationen zur Speicherbedarfsbegrenzung" + +#. type: Plain text +#: ../src/xz/xz.1:2008 +msgid "B prints a single line with three tab-separated columns:" +msgstr "B gibt eine einzelne Zeile mit drei durch Tabulatoren getrennten Spalten aus:" + +#. type: IP +#: ../src/xz/xz.1:2008 +#, no-wrap +msgid "1." +msgstr "1." + +#. type: Plain text +#: ../src/xz/xz.1:2010 +msgid "Total amount of physical memory (RAM) in bytes." +msgstr "Gesamter physischer Speicher (RAM) in Byte." + +#. type: IP +#: ../src/xz/xz.1:2010 ../src/xz/xz.1:2125 ../src/xz/xz.1:2162 +#: ../src/xz/xz.1:2188 ../src/xz/xz.1:2258 ../src/xz/xz.1:2285 +#, no-wrap +msgid "2." +msgstr "2." + +#. type: Plain text +#: ../src/xz/xz.1:2017 +msgid "Memory usage limit for compression in bytes (B<--memlimit-compress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Speicherbedarfsbegrenzung für die Kompression in Byte (B<--memlimit-compress>). Ein spezieller Wert von B<0> bezeichnet die Standardeinstellung, die im Einzelthread-Modus bedeutet, dass keine Begrenzung vorhanden ist." + +#. type: IP +#: ../src/xz/xz.1:2017 ../src/xz/xz.1:2127 ../src/xz/xz.1:2164 +#: ../src/xz/xz.1:2190 ../src/xz/xz.1:2263 ../src/xz/xz.1:2287 +#, no-wrap +msgid "3." +msgstr "3." + +#. type: Plain text +#: ../src/xz/xz.1:2024 +msgid "Memory usage limit for decompression in bytes (B<--memlimit-decompress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Speicherbedarfsbegrenzung für die Dekompression in Byte (B<--memlimit-decompress>). Ein spezieller Wert von B<0> bezeichnet die Standardeinstellung, die im Einzelthread-Modus bedeutet, dass keine Begrenzung vorhanden ist." + +#. type: IP +#: ../src/xz/xz.1:2024 ../src/xz/xz.1:2129 ../src/xz/xz.1:2166 +#: ../src/xz/xz.1:2193 ../src/xz/xz.1:2273 ../src/xz/xz.1:2289 +#, no-wrap +msgid "4." +msgstr "4." + +#. type: Plain text +#: ../src/xz/xz.1:2036 +msgid "Since B 5.3.4alpha: Memory usage for multi-threaded decompression in bytes (B<--memlimit-mt-decompress>). This is never zero because a system-specific default value shown in the column 5 is used if no limit has been specified explicitly. This is also never greater than the value in the column 3 even if a larger value has been specified with B<--memlimit-mt-decompress>." +msgstr "Seit B 5.3.4alpha: Die Speichernutzung für Multithread-Dekompression in Byte (B<--memlimit-mt-decompress>). Dies ist niemals B<0>, da ein systemspezifischer Vorgabewert (gezeigt in Spalte 5) verwendet wird, falls keine Grenze ausdrücklich angegeben wurde. Dies ist außerdem niemals größer als der Wert in in Spalte 3, selbst wenn mit B<--memlimit-mt-decompress> ein größerer Wert angegeben wurde." + +#. type: IP +#: ../src/xz/xz.1:2036 ../src/xz/xz.1:2131 ../src/xz/xz.1:2168 +#: ../src/xz/xz.1:2195 ../src/xz/xz.1:2291 +#, no-wrap +msgid "5." +msgstr "5." + +#. type: Plain text +#: ../src/xz/xz.1:2048 +msgid "Since B 5.3.4alpha: A system-specific default memory usage limit that is used to limit the number of threads when compressing with an automatic number of threads (B<--threads=0>) and no memory usage limit has been specified (B<--memlimit-compress>). This is also used as the default value for B<--memlimit-mt-decompress>." +msgstr "Seit B 5.3.4alpha: Eine systemspezifisch vorgegebene Begrenzung des Speicherverbrauchs, die zur Begrenzung der Anzahl der Threads beim Komprimieren mit automatischer Anzahl der Threads (B<--threads=0>) und wenn keine Speicherbedarfsbegrenzung angegeben wurde (B<--memlimit-compress>) verwendet wird. Dies wird auch als Standardwert für B<--memlimit-mt-decompress> verwendet." + +#. type: IP +#: ../src/xz/xz.1:2048 ../src/xz/xz.1:2133 ../src/xz/xz.1:2170 +#: ../src/xz/xz.1:2197 ../src/xz/xz.1:2293 +#, no-wrap +msgid "6." +msgstr "6." + +#. type: Plain text +#: ../src/xz/xz.1:2053 +msgid "Since B 5.3.4alpha: Number of available processor threads." +msgstr "Seit B 5.3.4alpha: Anzahl der verfügbaren Prozessorthreads." + +#. type: Plain text +#: ../src/xz/xz.1:2057 +msgid "In the future, the output of B may have more columns, but never more than a single line." +msgstr "In der Zukunft könnte die Ausgabe von B weitere Spalten enthalten, aber niemals mehr als eine einzelne Zeile." + +#. type: SS +#: ../src/xz/xz.1:2058 +#, no-wrap +msgid "List mode" +msgstr "Listenmodus" + +#. type: Plain text +#: ../src/xz/xz.1:2063 +msgid "B uses tab-separated output. The first column of every line has a string that indicates the type of the information found on that line:" +msgstr "B verwendet eine durch Tabulatoren getrennte Ausgabe. In der ersten Spalte jeder Zeile bezeichnet eine Zeichenkette den Typ der Information, die in dieser Zeile enthalten ist:" + +#. type: TP +#: ../src/xz/xz.1:2063 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2067 +msgid "This is always the first line when starting to list a file. The second column on the line is the filename." +msgstr "Dies ist stets die erste Zeile, wenn eine Datei aufgelistet wird. Die zweite Spalte in der Zeile enthält den Dateinamen." + +#. type: TP +#: ../src/xz/xz.1:2067 +#, no-wrap +msgid "B" +msgstr "B" + +# CHECK overall +#. type: Plain text +#: ../src/xz/xz.1:2075 +msgid "This line contains overall information about the B<.xz> file. This line is always printed after the B line." +msgstr "Diese Zeile enthält allgemeine Informationen zur B<.xz>-Datei. Diese Zeile wird stets nach der B-Zeile ausgegeben." + +#. type: TP +#: ../src/xz/xz.1:2075 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2085 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are streams in the B<.xz> file." +msgstr "Dieser Zeilentyp wird nur verwendet, wenn B<--verbose> angegeben wurde. Es gibt genau so viele B-Zeilen, wie Datenströme in der B<.xz>-Datei enthalten sind." + +#. type: TP +#: ../src/xz/xz.1:2085 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2100 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are blocks in the B<.xz> file. The B lines are shown after all the B lines; different line types are not interleaved." +msgstr "Dieser Zeilentyp wird nur verwendet, wenn B<--verbose> angegeben wurde. Es gibt so viele B-Zeilen, wie Blöcke in der B<.xz>-Datei. Die B-Zeilen werden nach allen B-Zeilen angezeigt; verschiedene Zeilentypen werden nicht verschachtelt." + +#. type: TP +#: ../src/xz/xz.1:2100 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2115 +msgid "This line type is used only when B<--verbose> was specified twice. This line is printed after all B lines. Like the B line, the B line contains overall information about the B<.xz> file." +msgstr "Dieser Zeilentyp wird nur verwendet, wenn B<--verbose> zwei Mal angegeben wurde. Diese Zeile wird nach allen B-Zeilen ausgegeben. Wie die B-Zeile enthält die B-Zeile allgemeine Informationen zur B<.xz>-Datei." + +#. type: TP +#: ../src/xz/xz.1:2115 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2119 +msgid "This line is always the very last line of the list output. It shows the total counts and sizes." +msgstr "Diese Zeile ist immer die letzte der Listenausgabe. Sie zeigt die Gesamtanzahlen und -größen an." + +#. type: Plain text +#: ../src/xz/xz.1:2123 +msgid "The columns of the B lines:" +msgstr "Die Spalten der B-Zeilen:" + +#. type: Plain text +#: ../src/xz/xz.1:2127 +msgid "Number of streams in the file" +msgstr "Anzahl der Datenströme in der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2129 +msgid "Total number of blocks in the stream(s)" +msgstr "Gesamtanzahl der Blöcke in den Datenströmen" + +#. type: Plain text +#: ../src/xz/xz.1:2131 +msgid "Compressed size of the file" +msgstr "Komprimierte Größe der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2133 +msgid "Uncompressed size of the file" +msgstr "Unkomprimierte Größe der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2139 +msgid "Compression ratio, for example, B<0.123>. If ratio is over 9.999, three dashes (B<--->) are displayed instead of the ratio." +msgstr "Das Kompressionsverhältnis, zum Beispiel B<0.123>. Wenn das Verhältnis über 9.999 liegt, werden drei Minuszeichen (B<--->) anstelle des Kompressionsverhältnisses angezeigt." + +#. type: IP +#: ../src/xz/xz.1:2139 ../src/xz/xz.1:2172 ../src/xz/xz.1:2199 +#: ../src/xz/xz.1:2295 +#, no-wrap +msgid "7." +msgstr "7." + +#. type: Plain text +#: ../src/xz/xz.1:2152 +msgid "Comma-separated list of integrity check names. The following strings are used for the known check types: B, B, B, and B. For unknown check types, BI is used, where I is the Check ID as a decimal number (one or two digits)." +msgstr "Durch Kommata getrennte Liste der Namen der Integritätsprüfungen. Für die bekannten Überprüfungstypen werden folgende Zeichenketten verwendet: B, B, B und B. BI wird verwendet, wobei I die Kennung der Überprüfung als Dezimalzahl angibt (ein- oder zweistellig)." + +#. type: IP +#: ../src/xz/xz.1:2152 ../src/xz/xz.1:2174 ../src/xz/xz.1:2201 +#: ../src/xz/xz.1:2298 +#, no-wrap +msgid "8." +msgstr "8." + +#. type: Plain text +#: ../src/xz/xz.1:2154 +msgid "Total size of stream padding in the file" +msgstr "Gesamtgröße der Datenstromauffüllung in der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2160 +msgid "The columns of the B lines:" +msgstr "Die Spalten der B-Zeilen:" + +#. type: Plain text +#: ../src/xz/xz.1:2164 +msgid "Stream number (the first stream is 1)" +msgstr "Datenstromnummer (der erste Datenstrom ist 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2166 +msgid "Number of blocks in the stream" +msgstr "Anzahl der Blöcke im Datenstrom" + +#. type: Plain text +#: ../src/xz/xz.1:2168 +msgid "Compressed start offset" +msgstr "Komprimierte Startposition" + +#. type: Plain text +#: ../src/xz/xz.1:2170 +msgid "Uncompressed start offset" +msgstr "Unkomprimierte Startposition" + +#. type: Plain text +#: ../src/xz/xz.1:2172 +msgid "Compressed size (does not include stream padding)" +msgstr "Komprimierte Größe (schließt die Datenstromauffüllung nicht mit ein)" + +#. type: Plain text +#: ../src/xz/xz.1:2174 ../src/xz/xz.1:2203 ../src/xz/xz.1:2293 +msgid "Uncompressed size" +msgstr "Unkomprimierte Größe" + +#. type: Plain text +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2205 +msgid "Compression ratio" +msgstr "Kompressionsverhältnis" + +#. type: IP +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2203 ../src/xz/xz.1:2300 +#, no-wrap +msgid "9." +msgstr "9." + +#. type: Plain text +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2207 +msgid "Name of the integrity check" +msgstr "Name der Integritätsprüfung" + +#. type: IP +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2205 ../src/xz/xz.1:2316 +#, no-wrap +msgid "10." +msgstr "10." + +#. type: Plain text +#: ../src/xz/xz.1:2180 +msgid "Size of stream padding" +msgstr "Größe der Datenstromauffüllung" + +#. type: Plain text +#: ../src/xz/xz.1:2186 +msgid "The columns of the B lines:" +msgstr "Die Spalten der B-Zeilen:" + +#. type: Plain text +#: ../src/xz/xz.1:2190 +msgid "Number of the stream containing this block" +msgstr "Anzahl der in diesem Block enthaltenen Datenströme" + +#. type: Plain text +#: ../src/xz/xz.1:2193 +msgid "Block number relative to the beginning of the stream (the first block is 1)" +msgstr "Blocknummer relativ zum Anfang des Datenstroms (der erste Block ist 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2195 +msgid "Block number relative to the beginning of the file" +msgstr "Blocknummer relativ zum Anfang der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2197 +msgid "Compressed start offset relative to the beginning of the file" +msgstr "Komprimierter Startversatz relativ zum Beginn der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2199 +msgid "Uncompressed start offset relative to the beginning of the file" +msgstr "Unkomprimierter Startversatz relativ zum Beginn der Datei" + +#. type: Plain text +#: ../src/xz/xz.1:2201 +msgid "Total compressed size of the block (includes headers)" +msgstr "Komprimierte Gesamtgröße des Blocks (einschließlich Header)" + +#. type: Plain text +#: ../src/xz/xz.1:2219 +msgid "If B<--verbose> was specified twice, additional columns are included on the B lines. These are not displayed with a single B<--verbose>, because getting this information requires many seeks and can thus be slow:" +msgstr "Wenn B<--verbose> zwei Mal angegeben wurde, werden zusätzliche Spalten in die B-Zeilen eingefügt. Diese werden mit einem einfachen B<--verbose> nicht angezeigt, da das Ermitteln dieser Informationen viele Suchvorgänge erfordert und daher recht langsam sein kann:" + +#. type: IP +#: ../src/xz/xz.1:2221 ../src/xz/xz.1:2321 +#, no-wrap +msgid "11." +msgstr "11." + +#. type: Plain text +#: ../src/xz/xz.1:2223 +msgid "Value of the integrity check in hexadecimal" +msgstr "Wert der Integritätsprüfung in hexadezimaler Notation" + +#. type: IP +#: ../src/xz/xz.1:2223 ../src/xz/xz.1:2331 +#, no-wrap +msgid "12." +msgstr "12." + +#. type: Plain text +#: ../src/xz/xz.1:2225 +msgid "Block header size" +msgstr "Block-Header-Größe" + +#. type: IP +#: ../src/xz/xz.1:2225 +#, no-wrap +msgid "13." +msgstr "13." + +#. type: Plain text +#: ../src/xz/xz.1:2235 +msgid "Block flags: B indicates that compressed size is present, and B indicates that uncompressed size is present. If the flag is not set, a dash (B<->) is shown instead to keep the string length fixed. New flags may be added to the end of the string in the future." +msgstr "Block-Schalter: B gibt an, dass die komprimierte Größe verfügbar ist, und B gibt an, dass die unkomprimierte Größe verfügbar ist. Falls der Schalter nicht gesetzt ist, wird stattdessen ein Bindestrich (B<->) angezeigt, um die Länge der Zeichenkette beizubehalten. In Zukunft könnten neue Schalter am Ende der Zeichenkette hinzugefügt werden." + +#. type: IP +#: ../src/xz/xz.1:2235 +#, no-wrap +msgid "14." +msgstr "14." + +#. type: Plain text +#: ../src/xz/xz.1:2238 +msgid "Size of the actual compressed data in the block (this excludes the block header, block padding, and check fields)" +msgstr "Größe der tatsächlichen komprimierten Daten im Block. Ausgeschlossen sind hierbei die Block-Header, die Blockauffüllung und die Prüffelder." + +#. type: IP +#: ../src/xz/xz.1:2238 +#, no-wrap +msgid "15." +msgstr "15." + +#. type: Plain text +#: ../src/xz/xz.1:2243 +msgid "Amount of memory (in bytes) required to decompress this block with this B version" +msgstr "Größe des Speichers (in Byte), der zum Dekomprimieren dieses Blocks mit dieser B-Version benötigt wird." + +#. type: IP +#: ../src/xz/xz.1:2243 +#, no-wrap +msgid "16." +msgstr "16." + +#. type: Plain text +#: ../src/xz/xz.1:2250 +msgid "Filter chain. Note that most of the options used at compression time cannot be known, because only the options that are needed for decompression are stored in the B<.xz> headers." +msgstr "Filterkette. Beachten Sie, dass die meisten der bei der Kompression verwendeten Optionen nicht bekannt sein können, da in den B<.xz>-Headern nur die für die Dekompression erforderlichen Optionen gespeichert sind." + +#. type: Plain text +#: ../src/xz/xz.1:2256 +msgid "The columns of the B lines:" +msgstr "Die Spalten der B-Zeilen:" + +#. type: Plain text +#: ../src/xz/xz.1:2263 +msgid "Amount of memory (in bytes) required to decompress this file with this B version" +msgstr "Größe des Speichers (in Byte), der zum Dekomprimieren dieser Datei mit dieser B-Version benötigt wird." + +#. type: Plain text +#: ../src/xz/xz.1:2269 ../src/xz/xz.1:2327 +msgid "B or B indicating if all block headers have both compressed size and uncompressed size stored in them" +msgstr "B oder B geben an, ob in allen Block-Headern sowohl die komprimierte als auch die unkomprimierte Größe gespeichert ist." + +#. type: Plain text +#: ../src/xz/xz.1:2273 ../src/xz/xz.1:2331 +msgid "I B I<5.1.2alpha:>" +msgstr "I B I<5.1.2alpha:>" + +#. type: Plain text +#: ../src/xz/xz.1:2277 ../src/xz/xz.1:2335 +msgid "Minimum B version required to decompress the file" +msgstr "Minimale B-Version, die zur Dekompression der Datei erforderlich ist" + +#. type: Plain text +#: ../src/xz/xz.1:2283 +msgid "The columns of the B line:" +msgstr "Die Spalten der B-Zeile:" + +#. type: Plain text +#: ../src/xz/xz.1:2287 +msgid "Number of streams" +msgstr "Anzahl der Datenströme" + +#. type: Plain text +#: ../src/xz/xz.1:2289 +msgid "Number of blocks" +msgstr "Anzahl der Blöcke" + +#. type: Plain text +#: ../src/xz/xz.1:2291 +msgid "Compressed size" +msgstr "Komprimierte Größe" + +#. type: Plain text +#: ../src/xz/xz.1:2295 +msgid "Average compression ratio" +msgstr "Durchschnittliches Kompressionsverhältnis" + +#. type: Plain text +#: ../src/xz/xz.1:2298 +msgid "Comma-separated list of integrity check names that were present in the files" +msgstr "Durch Kommata getrennte Liste der Namen der Integritätsprüfungen, die in den Dateien präsent waren." + +#. type: Plain text +#: ../src/xz/xz.1:2300 +msgid "Stream padding size" +msgstr "Größe der Datenstromauffüllung" + +#. type: Plain text +#: ../src/xz/xz.1:2306 +msgid "Number of files. This is here to keep the order of the earlier columns the same as on B lines." +msgstr "Anzahl der Dateien. Dies dient dazu, die Reihenfolge der vorigen Spalten an die in den B-Zeilen anzugleichen." + +#. type: Plain text +#: ../src/xz/xz.1:2314 +msgid "If B<--verbose> was specified twice, additional columns are included on the B line:" +msgstr "Wenn B<--verbose> zwei Mal angegeben wird, werden zusätzliche Spalten in die B-Zeile eingefügt:" + +#. type: Plain text +#: ../src/xz/xz.1:2321 +msgid "Maximum amount of memory (in bytes) required to decompress the files with this B version" +msgstr "Maximale Größe des Speichers (in Byte), der zum Dekomprimieren der Dateien mit dieser B-Version benötigt wird." + +#. type: Plain text +#: ../src/xz/xz.1:2341 +msgid "Future versions may add new line types and new columns can be added to the existing line types, but the existing columns won't be changed." +msgstr "Zukünftige Versionen könnten neue Zeilentypen hinzufügen, weiterhin könnten auch in den vorhandenen Zeilentypen weitere Spalten hinzugefügt werden, aber die existierenden Spalten werden nicht geändert." + +#. type: SH +#: ../src/xz/xz.1:2342 ../src/xzdec/xzdec.1:104 ../src/lzmainfo/lzmainfo.1:44 +#: ../src/scripts/xzgrep.1:81 +#, no-wrap +msgid "EXIT STATUS" +msgstr "EXIT-STATUS" + +#. type: TP +#: ../src/xz/xz.1:2343 ../src/xzdec/xzdec.1:105 ../src/lzmainfo/lzmainfo.1:45 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../src/xz/xz.1:2346 ../src/lzmainfo/lzmainfo.1:48 +msgid "All is good." +msgstr "Alles ist in Ordnung." + +#. type: TP +#: ../src/xz/xz.1:2346 ../src/xzdec/xzdec.1:108 ../src/lzmainfo/lzmainfo.1:48 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../src/xz/xz.1:2349 ../src/xzdec/xzdec.1:111 ../src/lzmainfo/lzmainfo.1:51 +msgid "An error occurred." +msgstr "Ein Fehler ist aufgetreten." + +#. type: TP +#: ../src/xz/xz.1:2349 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:2353 +msgid "Something worth a warning occurred, but no actual errors occurred." +msgstr "Es ist etwas passiert, das eine Warnung rechtfertigt, aber es sind keine tatsächlichen Fehler aufgetreten." + +#. type: Plain text +#: ../src/xz/xz.1:2356 +msgid "Notices (not warnings or errors) printed on standard error don't affect the exit status." +msgstr "In die Standardausgabe geschriebene Hinweise (keine Warnungen oder Fehler), welche den Exit-Status nicht beeinflussen." + +#. type: SH +#: ../src/xz/xz.1:2357 ../src/scripts/xzgrep.1:94 ../src/scripts/xzless.1:52 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "UMGEBUNGSVARIABLEN" + +#. type: Plain text +#: ../src/xz/xz.1:2370 +msgid "B parses space-separated lists of options from the environment variables B and B, in this order, before parsing the options from the command line. Note that only options are parsed from the environment variables; all non-options are silently ignored. Parsing is done with B(3) which is used also for the command line arguments." +msgstr "B wertet eine durch Leerzeichen getrennte Liste von Optionen in den Umgebungsvariablen B und B aus (in dieser Reihenfolge), bevor die Optionen aus der Befehlszeile ausgewertet werden. Beachten Sie, dass beim Auswerten der Umgebungsvariablen nur Optionen berücksichtigt werden; alle Einträge, die keine Optionen sind, werden stillschweigend ignoriert. Die Auswertung erfolgt mit B(3), welches auch für die Befehlszeilenargumente verwendet wird." + +#. type: TP +#: ../src/xz/xz.1:2370 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2379 +msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B's memory usage limiter by default. Excluding shell initialization scripts and similar special cases, scripts must never set or unset B." +msgstr "Benutzerspezifische oder systemweite Standardoptionen. Typischerweise werden diese in einem Shell-Initialisierungsskript gesetzt, um die Speicherbedarfsbegrenzung von B standardmäßig zu aktivieren. Außer bei Shell-Initialisierungsskripten und in ähnlichen Spezialfällen darf die Variable B in Skripten niemals gesetzt oder außer Kraft gesetzt werden." + +#. type: TP +#: ../src/xz/xz.1:2379 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2390 +msgid "This is for passing options to B when it is not possible to set the options directly on the B command line. This is the case when B is run by a script or tool, for example, GNU B(1):" +msgstr "Dies dient der Übergabe von Optionen an B, wenn es nicht möglich ist, die Optionen direkt in der Befehlszeile von B zu übergeben. Dies ist der Fall, wenn B von einem Skript oder Dienstprogramm ausgeführt wird, zum Beispiel GNU B(1):" + +#. type: Plain text +#: ../src/xz/xz.1:2396 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2410 +msgid "Scripts may use B, for example, to set script-specific default compression options. It is still recommended to allow users to override B if that is reasonable. For example, in B(1) scripts one may use something like this:" +msgstr "Skripte können B zum Beispiel zum Setzen skriptspezifischer Standard-Kompressionsoptionen verwenden. Es ist weiterhin empfehlenswert, Benutzern die Außerkraftsetzung von B zu erlauben, falls dies angemessen ist. Zum Beispiel könnte in B(1)-Skripten Folgendes stehen:" + +#. type: Plain text +#: ../src/xz/xz.1:2417 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: SH +#: ../src/xz/xz.1:2422 +#, no-wrap +msgid "LZMA UTILS COMPATIBILITY" +msgstr "KOMPATIBILITÄT ZU DEN LZMA-UTILS" + +#. type: Plain text +#: ../src/xz/xz.1:2435 +msgid "The command line syntax of B is practically a superset of B, B, and B as found from LZMA Utils 4.32.x. In most cases, it is possible to replace LZMA Utils with XZ Utils without breaking existing scripts. There are some incompatibilities though, which may sometimes cause problems." +msgstr "Die Befehlszeilensyntax von B ist praktisch eine Obermenge der von B, B und B in den LZMA-Utils der Versionen 4.32.x. In den meisten Fällen sollte es möglich sein, die LZMA-Utils durch die XZ-Utils zu ersetzen, ohne vorhandene Skripte ändern zu müssen. Dennoch gibt es einige Inkompatibilitäten, die manchmal Probleme verursachen können." + +#. type: SS +#: ../src/xz/xz.1:2436 +#, no-wrap +msgid "Compression preset levels" +msgstr "Voreinstellungsstufen zur Kompression" + +#. type: Plain text +#: ../src/xz/xz.1:2443 +msgid "The numbering of the compression level presets is not identical in B and LZMA Utils. The most important difference is how dictionary sizes are mapped to different presets. Dictionary size is roughly equal to the decompressor memory usage." +msgstr "Die Nummerierung der Voreinstellungsstufen der Kompression ist in B und den LZMA-Utils unterschiedlich. Der wichtigste Unterschied ist die Zuweisung der Wörterbuchgrößen zu den verschiedenen Voreinstellungsstufen. Die Wörterbuchgröße ist etwa gleich dem Speicherbedarf bei der Dekompression." + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "Level" +msgstr "Stufe" + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "xz" +msgstr "xz" + +#. type: tbl table +#: ../src/xz/xz.1:2449 +#, no-wrap +msgid "LZMA Utils" +msgstr "LZMA-Utils" + +#. type: tbl table +#: ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#, no-wrap +msgid "N/A" +msgstr "nicht verfügbar" + +#. type: tbl table +#: ../src/xz/xz.1:2451 +#, no-wrap +msgid "64 KiB" +msgstr "64 KiB" + +#. type: tbl table +#: ../src/xz/xz.1:2453 +#, no-wrap +msgid "512 KiB" +msgstr "512 KiB" + +#. type: Plain text +#: ../src/xz/xz.1:2468 +msgid "The dictionary size differences affect the compressor memory usage too, but there are some other differences between LZMA Utils and XZ Utils, which make the difference even bigger:" +msgstr "Die Unterschiede in der Wörterbuchgröße beeinflussen auch den Speicherbedarf bei der Kompression, aber es gibt noch einige andere Unterschiede zwischen den LZMA-Utils und den XZ-Utils, die die Kluft noch vergrößern:" + +#. type: tbl table +#: ../src/xz/xz.1:2474 +#, no-wrap +msgid "LZMA Utils 4.32.x" +msgstr "LZMA-Utils 4.32.x" + +#. type: tbl table +#: ../src/xz/xz.1:2477 ../src/xz/xz.1:2478 +#, no-wrap +msgid "12 MiB" +msgstr "12 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2480 +#, no-wrap +msgid "26 MiB" +msgstr "26 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2481 +#, no-wrap +msgid "45 MiB" +msgstr "45 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2482 +#, no-wrap +msgid "83 MiB" +msgstr "83 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2483 +#, no-wrap +msgid "159 MiB" +msgstr "159 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2484 +#, no-wrap +msgid "311 MiB" +msgstr "311 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:2493 +msgid "The default preset level in LZMA Utils is B<-7> while in XZ Utils it is B<-6>, so both use an 8 MiB dictionary by default." +msgstr "Die standardmäßige Voreinstellungsstufe in den LZMA-Utils ist B<-7>, während diese in den XZ-Utils B<-6> ist, daher verwenden beide standardmäßig ein 8 MiB großes Wörterbuch." + +#. type: SS +#: ../src/xz/xz.1:2494 +#, no-wrap +msgid "Streamed vs. non-streamed .lzma files" +msgstr "Vor- und Nachteile von .lzma-Dateien als Datenströme" + +#. type: Plain text +#: ../src/xz/xz.1:2504 +msgid "The uncompressed size of the file can be stored in the B<.lzma> header. LZMA Utils does that when compressing regular files. The alternative is to mark that uncompressed size is unknown and use end-of-payload marker to indicate where the decompressor should stop. LZMA Utils uses this method when uncompressed size isn't known, which is the case, for example, in pipes." +msgstr "Die unkomprimierte Größe der Datei kann in den B<.lzma>-Headern gespeichert werden. Die LZMA-Utils tun das beim Komprimieren gewöhnlicher Dateien. Als Alternative kann die unkomprimierte Größe als unbekannt markiert und eine Nutzdatenende-Markierung (end-of-payload) verwendet werden, um anzugeben, wo der Dekompressor stoppen soll. Die LZMA-Utils verwenden diese Methode, wenn die unkomprimierte Größe unbekannt ist, was beispielsweise in Pipes (Befehlsverkettungen) der Fall ist." + +#. type: Plain text +#: ../src/xz/xz.1:2525 +msgid "B supports decompressing B<.lzma> files with or without end-of-payload marker, but all B<.lzma> files created by B will use end-of-payload marker and have uncompressed size marked as unknown in the B<.lzma> header. This may be a problem in some uncommon situations. For example, a B<.lzma> decompressor in an embedded device might work only with files that have known uncompressed size. If you hit this problem, you need to use LZMA Utils or LZMA SDK to create B<.lzma> files with known uncompressed size." +msgstr "B unterstützt die Dekompression von B<.lzma>-Dateien mit oder ohne Nutzdatenende-Markierung, aber alle von B erstellten B<.lzma>-Dateien verwenden diesen Nutzdatenende-Markierung, wobei die unkomprimierte Größe in den B<.lzma>-Headern als unbekannt markiert wird. Das könnte in einigen unüblichen Situationen ein Problem sein. Zum Beispiel könnte ein B<.lzma>-Dekompressor in einem Gerät mit eingebettetem System nur mit Dateien funktionieren, deren unkomprimierte Größe bekannt ist. Falls Sie auf dieses Problem stoßen, müssen Sie die LZMA-Utils oder das LZMA-SDK verwenden, um B<.lzma>-Dateien mit bekannter unkomprimierter Größe zu erzeugen." + +#. type: SS +#: ../src/xz/xz.1:2526 +#, no-wrap +msgid "Unsupported .lzma files" +msgstr "Nicht unterstützte .lzma-Dateien" + +#. type: Plain text +#: ../src/xz/xz.1:2549 +msgid "The B<.lzma> format allows I values up to 8, and I values up to 4. LZMA Utils can decompress files with any I and I, but always creates files with B and B. Creating files with other I and I is possible with B and with LZMA SDK." +msgstr "Das B<.lzma>-Format erlaubt I-Werte bis zu 8 und I-Werte bis zu 4. Die LZMA-Utils können Dateien mit beliebigem I und I dekomprimieren, aber erzeugen immer Dateien mit B und B. Das Erzeugen von Dateien mit anderem I und I ist mit B und mit dem LZMA-SDK möglich." + +#. type: Plain text +#: ../src/xz/xz.1:2560 +msgid "The implementation of the LZMA1 filter in liblzma requires that the sum of I and I must not exceed 4. Thus, B<.lzma> files, which exceed this limitation, cannot be decompressed with B." +msgstr "Die Implementation des LZMA-Filters in liblzma setzt voraus, dass die Summe von I und I nicht größer als 4 ist. Daher können B<.lzma>-Dateien, welche diese Begrenzung überschreiten, mit B nicht dekomprimiert werden." + +#. type: Plain text +#: ../src/xz/xz.1:2575 +msgid "LZMA Utils creates only B<.lzma> files which have a dictionary size of 2^I (a power of 2) but accepts files with any dictionary size. liblzma accepts only B<.lzma> files which have a dictionary size of 2^I or 2^I + 2^(I-1). This is to decrease false positives when detecting B<.lzma> files." +msgstr "Die LZMA-Utils erzeugen nur B<.lzma>-Dateien mit einer Wörterbuchgröße von 2^I (einer Zweierpotenz), aber akzeptieren Dateien mit einer beliebigen Wörterbuchgröße. Liblzma akzeptiert nur B<.lzma>-Dateien mit einer Wörterbuchgröße von 2^I oder 2^I + 2^(I-1). Dies dient zum Verringern von Fehlalarmen beim Erkennen von B<.lzma>-Dateien." + +#. type: Plain text +#: ../src/xz/xz.1:2580 +msgid "These limitations shouldn't be a problem in practice, since practically all B<.lzma> files have been compressed with settings that liblzma will accept." +msgstr "Diese Einschränkungen sollten in der Praxis kein Problem sein, da praktisch alle B<.lzma>-Dateien mit Einstellungen komprimiert wurden, die Liblzma akzeptieren wird." + +#. type: SS +#: ../src/xz/xz.1:2581 +#, no-wrap +msgid "Trailing garbage" +msgstr "Angehängter Datenmüll" + +#. type: Plain text +#: ../src/xz/xz.1:2591 +msgid "When decompressing, LZMA Utils silently ignore everything after the first B<.lzma> stream. In most situations, this is a bug. This also means that LZMA Utils don't support decompressing concatenated B<.lzma> files." +msgstr "Bei der Dekompression ignorieren die LZMA-Utils stillschweigend alles nach dem ersten B<.lzma>-Datenstrom. In den meisten Situationen ist das ein Fehler. Das bedeutet auch, dass die LZMA-Utils die Dekompression verketteter B<.lzma>-Dateien nicht unterstützen." + +#. type: Plain text +#: ../src/xz/xz.1:2601 +msgid "If there is data left after the first B<.lzma> stream, B considers the file to be corrupt unless B<--single-stream> was used. This may break obscure scripts which have assumed that trailing garbage is ignored." +msgstr "Wenn nach dem ersten B<.lzma>-Datenstrom Daten verbleiben, erachtet B die Datei als beschädigt, es sei denn, die Option B<--single-stream> wurde verwendet. Dies könnte die Ausführung von Skripten beeinflussen, die davon ausgehen, dass angehängter Datenmüll ignoriert wird." + +#. type: SH +#: ../src/xz/xz.1:2602 ../src/xzdec/xzdec.1:117 +#, no-wrap +msgid "NOTES" +msgstr "ANMERKUNGEN" + +#. type: SS +#: ../src/xz/xz.1:2604 +#, no-wrap +msgid "Compressed output may vary" +msgstr "Die komprimierte Ausgabe kann variieren" + +#. type: Plain text +#: ../src/xz/xz.1:2615 +msgid "The exact compressed output produced from the same uncompressed input file may vary between XZ Utils versions even if compression options are identical. This is because the encoder can be improved (faster or better compression) without affecting the file format. The output can vary even between different builds of the same XZ Utils version, if different build options are used." +msgstr "Die exakte komprimierte Ausgabe, die aus der gleichen unkomprimierten Eingabedatei erzeugt wird, kann zwischen den Versionen der XZ-Utils unterschiedlich sein, selbst wenn die Kompressionsoptionen identisch sind. Das kommt daher, weil der Kodierer verbessert worden sein könnte (hinsichtlich schnellerer oder besserer Kompression), ohne das Dateiformat zu beeinflussen. Die Ausgabe kann sogar zwischen verschiedenen Programmen der gleichen Version der XZ-Utils variieren, wenn bei der Erstellung des Binärprogramms unterschiedliche Optionen verwendet wurden." + +#. type: Plain text +#: ../src/xz/xz.1:2625 +msgid "The above means that once B<--rsyncable> has been implemented, the resulting files won't necessarily be rsyncable unless both old and new files have been compressed with the same xz version. This problem can be fixed if a part of the encoder implementation is frozen to keep rsyncable output stable across xz versions." +msgstr "Sobald B<--rsyncable> implementiert wurde, bedeutet das, dass die sich ergebenden Dateien nicht notwendigerweise mit Rsync abgeglichen werden können, außer wenn die alte und neue Datei mit der gleichen B-Version erzeugt wurden. Das Problem kann beseitigt werden, wenn ein Teil der Encoder-Implementierung eingefroren wird, um die mit Rsync abgleichbare Ausgabe über B-Versionsgrenzen hinweg stabil zu halten." + +#. type: SS +#: ../src/xz/xz.1:2626 +#, no-wrap +msgid "Embedded .xz decompressors" +msgstr "Eingebettete .xz-Dekompressoren" + +#. type: Plain text +#: ../src/xz/xz.1:2643 +msgid "Embedded B<.xz> decompressor implementations like XZ Embedded don't necessarily support files created with integrity I types other than B and B. Since the default is B<--check=crc64>, you must use B<--check=none> or B<--check=crc32> when creating files for embedded systems." +msgstr "Eingebettete B<.xz>-Dekompressor-Implementierungen wie XZ Embedded unterstützen nicht unbedingt Dateien, die mit anderen Integritätsprüfungen (I-Typen) als B und B erzeugt wurden. Da B<--check=crc64> die Voreinstellung ist, müssen Sie B<--check=none> oder B<--check=crc32> verwenden, wenn Sie Dateien für eingebettete Systeme erstellen." + +#. type: Plain text +#: ../src/xz/xz.1:2653 +msgid "Outside embedded systems, all B<.xz> format decompressors support all the I types, or at least are able to decompress the file without verifying the integrity check if the particular I is not supported." +msgstr "Außerhalb eingebetteter Systeme unterstützen die Dekompressoren des B<.xz>-Formats alle I-Typen oder sind mindestens in der Lage, die Datei zu dekomprimieren, ohne deren Integrität zu prüfen, wenn die bestimmte I nicht verfügbar ist." + +#. type: Plain text +#: ../src/xz/xz.1:2656 +msgid "XZ Embedded supports BCJ filters, but only with the default start offset." +msgstr "XZ Embedded unterstützt BCJ-Filter, aber nur mit dem vorgegebenen Startversatz." + +#. type: SH +#: ../src/xz/xz.1:2657 +#, no-wrap +msgid "EXAMPLES" +msgstr "BEISPIELE" + +#. type: SS +#: ../src/xz/xz.1:2659 +#, no-wrap +msgid "Basics" +msgstr "Grundlagen" + +#. type: Plain text +#: ../src/xz/xz.1:2669 +msgid "Compress the file I into I using the default compression level (B<-6>), and remove I if compression is successful:" +msgstr "Komprimiert die Datei I mit der Standard-Kompressionsstufe (B<-6>) zu I und entfernt I nach erfolgreicher Kompression:" + +#. type: Plain text +#: ../src/xz/xz.1:2674 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2685 +msgid "Decompress I into I and don't remove I even if decompression is successful:" +msgstr "I in I dekomprimieren und I selbst dann nicht löschen, wenn die Dekompression erfolgreich war:" + +#. type: Plain text +#: ../src/xz/xz.1:2690 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2703 +msgid "Create I with the preset B<-4e> (B<-4 --extreme>), which is slower than the default B<-6>, but needs less memory for compression and decompression (48\\ MiB and 5\\ MiB, respectively):" +msgstr "I mit der Voreinstellung B<-4e> (B<-4 --extreme>) erzeugen, was langsamer ist als die Vorgabe B<-6>, aber weniger Speicher für Kompression und Dekompression benötigt (48\\ MiB beziehungsweise 5\\ MiB):" + +#. type: Plain text +#: ../src/xz/xz.1:2708 +#, no-wrap +msgid "CW baz.tar.xz>\n" +msgstr "CW baz.tar.xz>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2714 +msgid "A mix of compressed and uncompressed files can be decompressed to standard output with a single command:" +msgstr "Eine Mischung aus komprimierten und unkomprimierten Dateien kann mit einem einzelnen Befehl dekomprimiert in die Standardausgabe geschrieben werden:" + +#. type: Plain text +#: ../src/xz/xz.1:2719 +#, no-wrap +msgid "CW abcd.txt>\n" +msgstr "CW abcd.txt>\n" + +#. type: SS +#: ../src/xz/xz.1:2723 +#, no-wrap +msgid "Parallel compression of many files" +msgstr "Parallele Kompression von vielen Dateien" + +#. type: Plain text +#: ../src/xz/xz.1:2729 +msgid "On GNU and *BSD, B(1) and B(1) can be used to parallelize compression of many files:" +msgstr "Auf GNU- und *BSD-Systemen können B(1) und B(1) zum Parallelisieren der Kompression vieler Dateien verwendet werden:" + +#. type: Plain text +#: ../src/xz/xz.1:2735 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2757 +msgid "The B<-P> option to B(1) sets the number of parallel B processes. The best value for the B<-n> option depends on how many files there are to be compressed. If there are only a couple of files, the value should probably be 1; with tens of thousands of files, 100 or even more may be appropriate to reduce the number of B processes that B(1) will eventually create." +msgstr "Die Option B<-P> von B(1) legt die Anzahl der parallelen B-Prozesse fest. Der beste Wert für die Option B<-n> hängt davon ab, wie viele Dateien komprimiert werden sollen. Wenn es sich nur um wenige Dateien handelt, sollte der Wert wahrscheinlich 1 sein; bei Zehntausenden von Dateien kann 100 oder noch mehr angemessener sein, um die Anzahl der B-Prozesse zu beschränken, die B(1) schließlich erzeugen wird." + +#. type: Plain text +#: ../src/xz/xz.1:2765 +msgid "The option B<-T1> for B is there to force it to single-threaded mode, because B(1) is used to control the amount of parallelization." +msgstr "Die Option B<-T1> für B dient dazu, den Einzelthread-Modus zu erzwingen, da B(1) zur Steuerung des Umfangs der Parallelisierung verwendet wird." + +#. type: SS +#: ../src/xz/xz.1:2766 +#, no-wrap +msgid "Robot mode" +msgstr "Roboter-Modus" + +#. type: Plain text +#: ../src/xz/xz.1:2769 +msgid "Calculate how many bytes have been saved in total after compressing multiple files:" +msgstr "Berechnen, wie viel Byte nach der Kompression mehrerer Dateien insgesamt eingespart wurden:" + +#. type: Plain text +#: ../src/xz/xz.1:2774 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2789 +msgid "A script may want to know that it is using new enough B. The following B(1) script checks that the version number of the B tool is at least 5.0.0. This method is compatible with old beta versions, which didn't support the B<--robot> option:" +msgstr "Ein Skript könnte abfragen wollen, ob es ein B verwendet, das aktuell genug ist. Das folgende B(1)-Skript prüft, ob die Versionsnummer des Dienstprogramms B mindestens 5.0.0 ist. Diese Methode ist zu alten Beta-Versionen kompatibel, welche die Option B<--robot> nicht unterstützen:" + +#. type: Plain text +#: ../src/xz/xz.1:2798 +#, no-wrap +msgid "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" +msgstr "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Ihre Version von Xz ist zu alt.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2805 +msgid "Set a memory usage limit for decompression using B, but if a limit has already been set, don't increase it:" +msgstr "Eine Speicherbedarfsbegrenzung für die Dekompression mit B setzen, aber eine bereits gesetzte Begrenzung nicht erhöhen:" + +#. type: Plain text +#: ../src/xz/xz.1:2815 +#, no-wrap +msgid "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" +msgstr "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2825 +msgid "The simplest use for custom filter chains is customizing a LZMA2 preset. This can be useful, because the presets cover only a subset of the potentially useful combinations of compression settings." +msgstr "Der einfachste Anwendungsfall für benutzerdefinierte Filterketten ist die Anpassung von LZMA2-Voreinstellungsstufen. Das kann nützlich sein, weil die Voreinstellungen nur einen Teil der potenziell sinnvollen Kombinationen aus Kompressionseinstellungen abdecken." + +#. type: Plain text +#: ../src/xz/xz.1:2833 +msgid "The CompCPU columns of the tables from the descriptions of the options B<-0> ... B<-9> and B<--extreme> are useful when customizing LZMA2 presets. Here are the relevant parts collected from those two tables:" +msgstr "Die KompCPU-Spalten der Tabellen aus den Beschreibungen der Optionen B<-0> … B<-9> und B<--extreme> sind beim Anpassen der LZMA2-Voreinstellungen nützlich. Diese sind die relevanten Teile aus diesen zwei Tabellen:" + +#. type: Plain text +#: ../src/xz/xz.1:2858 +msgid "If you know that a file requires somewhat big dictionary (for example, 32\\ MiB) to compress well, but you want to compress it quicker than B would do, a preset with a low CompCPU value (for example, 1) can be modified to use a bigger dictionary:" +msgstr "Wenn Sie wissen, dass eine Datei für eine gute Kompression ein etwas größeres Wörterbuch benötigt (zum Beispiel 32 MiB), aber Sie sie schneller komprimieren wollen, als dies mit B geschehen würde, kann eine Voreinstellung mit einem niedrigen KompCPU-Wert (zum Beispiel 1) dahingehend angepasst werden, ein größeres Wörterbuch zu verwenden:" + +#. type: Plain text +#: ../src/xz/xz.1:2863 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2879 +msgid "With certain files, the above command may be faster than B while compressing significantly better. However, it must be emphasized that only some files benefit from a big dictionary while keeping the CompCPU value low. The most obvious situation, where a big dictionary can help a lot, is an archive containing very similar files of at least a few megabytes each. The dictionary size has to be significantly bigger than any individual file to allow LZMA2 to take full advantage of the similarities between consecutive files." +msgstr "Mit bestimmten Dateien kann der obige Befehl schneller sein als B, wobei die Kompression deutlich besser wird. Dennoch muss betont werden, dass nur wenige Dateien von einem größeren Wörterbuch profitieren, wenn der KompCPU-Wert niedrig bleibt. Der offensichtlichste Fall, in dem ein größeres Wörterbuch sehr hilfreich sein kann, ist ein Archiv, das einander sehr ähnliche Dateien enthält, die jeweils wenigstens einige Megabyte groß sind. Das Wörterbuch muss dann deutlich größer sein als die einzelne Datei, damit LZMA2 den größtmöglichen Vorteil aus den Ähnlichkeiten der aufeinander folgenden Dateien zieht." + +#. type: Plain text +#: ../src/xz/xz.1:2886 +msgid "If very high compressor and decompressor memory usage is fine, and the file being compressed is at least several hundred megabytes, it may be useful to use an even bigger dictionary than the 64 MiB that B would use:" +msgstr "Wenn hoher Speicherbedarf für Kompression und Dekompression kein Problem ist und die zu komprimierende Datei mindestens einige Hundert Megabyte groß ist, kann es sinnvoll sein, ein noch größeres Wörterbuch zu verwenden, als die 64 MiB, die mit B verwendet werden würden:" + +#. type: Plain text +#: ../src/xz/xz.1:2891 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2904 +msgid "Using B<-vv> (B<--verbose --verbose>) like in the above example can be useful to see the memory requirements of the compressor and decompressor. Remember that using a dictionary bigger than the size of the uncompressed file is waste of memory, so the above command isn't useful for small files." +msgstr "Die Verwendung von B<-vv> (B<--verbose --verbose>) wie im obigen Beispiel kann nützlich sein, um den Speicherbedarf für Kompressor und Dekompressor zu sehen. Denken Sie daran, dass ein Wörterbuch, das größer als die unkomprimierte Datei ist, Speicherverschwendung wäre. Daher ist der obige Befehl für kleine Dateien nicht sinnvoll." + +#. type: Plain text +#: ../src/xz/xz.1:2916 +msgid "Sometimes the compression time doesn't matter, but the decompressor memory usage has to be kept low, for example, to make it possible to decompress the file on an embedded system. The following command uses B<-6e> (B<-6 --extreme>) as a base and sets the dictionary to only 64\\ KiB. The resulting file can be decompressed with XZ Embedded (that's why there is B<--check=crc32>) using about 100\\ KiB of memory." +msgstr "Manchmal spielt die Kompressionszeit keine Rolle, aber der Speicherbedarf bei der Dekompression muss gering gehalten werden, zum Beispiel um die Datei auf eingebetteten Systemen dekomprimieren zu können. Der folgende Befehl verwendet B<-6e> (B<-6 --extreme>) als Basis und setzt die Wörterbuchgröße auf nur 64\\ KiB. Die sich ergebende Datei kann mit XZ Embedded (aus diesem Grund ist dort B<--check=crc32>) mit nur etwa 100\\ KiB Speicher dekomprimiert werden." + +#. type: Plain text +#: ../src/xz/xz.1:2921 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2944 +msgid "If you want to squeeze out as many bytes as possible, adjusting the number of literal context bits (I) and number of position bits (I) can sometimes help. Adjusting the number of literal position bits (I) might help too, but usually I and I are more important. For example, a source code archive contains mostly US-ASCII text, so something like the following might give slightly (like 0.1\\ %) smaller file than B (try also without B):" +msgstr "Wenn Sie so viele Byte wie möglich herausquetschen wollen, kann die Anpassung der Anzahl der literalen Kontextbits (I) und der Anzahl der Positionsbits (I) manchmal hilfreich sein. Auch die Anpassung der Anzahl der literalen Positionsbits (I) könnte helfen, aber üblicherweise sind I und I wichtiger. Wenn ein Quellcode-Archiv zum Beispiel hauptsächlich ASCII-Text enthält, könnte ein Aufruf wie der folgende eine etwas kleinere Datei (etwa 0,1\\ %) ergeben als mit B (versuchen Sie es auch B):" + +#. type: Plain text +#: ../src/xz/xz.1:2949 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2957 +msgid "Using another filter together with LZMA2 can improve compression with certain file types. For example, to compress a x86-32 or x86-64 shared library using the x86 BCJ filter:" +msgstr "Die Verwendung eines anderen Filters mit LZMA2 kann die Kompression bei verschiedenen Dateitypen verbessern. So könnten Sie eine gemeinsam genutzte Bibliothek der Architekturen x86-32 oder x86-64 mit dem BCJ-Filter für x86 komprimieren:" + +#. type: Plain text +#: ../src/xz/xz.1:2962 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2976 +msgid "Note that the order of the filter options is significant. If B<--x86> is specified after B<--lzma2>, B will give an error, because there cannot be any filter after LZMA2, and also because the x86 BCJ filter cannot be used as the last filter in the chain." +msgstr "Beachten Sie, dass die Reihenfolge der Filteroptionen von Bedeutung ist. Falls B<--x86> nach B<--lzma2> angegeben wird, gibt B einen Fehler aus, weil nach LZMA2 kein weiterer Filter sein darf und auch weil der BCJ-Filter für x86 nicht als letzter Filter in der Filterkette gesetzt werden darf." + +#. type: Plain text +#: ../src/xz/xz.1:2982 +msgid "The Delta filter together with LZMA2 can give good results with bitmap images. It should usually beat PNG, which has a few more advanced filters than simple delta but uses Deflate for the actual compression." +msgstr "Der Delta-Filter zusammen mit LZMA2 kann bei Bitmap-Bildern gute Ergebnisse liefern. Er sollte üblicherweise besser sein als PNG, welches zwar einige fortgeschrittene Filter als ein simples delta bietet, aber für die eigentliche Kompression »Deflate« verwendet." + +#. type: Plain text +#: ../src/xz/xz.1:2992 +msgid "The image has to be saved in uncompressed format, for example, as uncompressed TIFF. The distance parameter of the Delta filter is set to match the number of bytes per pixel in the image. For example, 24-bit RGB bitmap needs B, and it is also good to pass B to LZMA2 to accommodate the three-byte alignment:" +msgstr "Das Bild muss in einem unkomprimierten Format gespeichert werden, zum Beispiel als unkomprimiertes TIFF. Der Abstandsparameter des Delta-Filters muss so gesetzt werden, dass er der Anzahl der Bytes pro Pixel im Bild entspricht. Zum Beispiel erfordert ein 24-Bit-RGB-Bitmap B, außerdem ist es gut, B an LZMA2 zu übergeben, um die 3-Byte-Ausrichtung zu berücksichtigen:" + +#. type: Plain text +#: ../src/xz/xz.1:2997 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:3005 +msgid "If multiple images have been put into a single archive (for example, B<.tar>), the Delta filter will work on that too as long as all images have the same number of bytes per pixel." +msgstr "Wenn sich mehrere Bilder in einem einzelnen Archiv befinden (zum Beispiel\\& B<.tar>), funktioniert der Delta-Filter damit auch, sofern alle Bilder im Archiv die gleiche Anzahl Bytes pro Pixel haben." + +#. type: SH +#: ../src/xz/xz.1:3006 ../src/xzdec/xzdec.1:143 ../src/lzmainfo/lzmainfo.1:59 +#: ../src/scripts/xzdiff.1:65 ../src/scripts/xzgrep.1:106 +#: ../src/scripts/xzless.1:65 ../src/scripts/xzmore.1:51 +#, no-wrap +msgid "SEE ALSO" +msgstr "SIEHE AUCH" + +#. type: Plain text +#: ../src/xz/xz.1:3015 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" + +#. type: Plain text +#: ../src/xz/xz.1:3017 +msgid "XZ Utils: Ehttps://tukaani.org/xz/E" +msgstr "XZ Utils: Ehttps://tukaani.org/xz/E" + +#. type: Plain text +#: ../src/xz/xz.1:3019 ../src/xzdec/xzdec.1:146 +msgid "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" +msgstr "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" + +#. type: Plain text +#: ../src/xz/xz.1:3020 +msgid "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" +msgstr "LZMA-SDK: Ehttp://7-zip.org/sdk.htmlE" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "XZDEC" +msgstr "XZDEC" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "2017-04-19" +msgstr "19. April 2017" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:10 +msgid "xzdec, lzmadec - Small .xz and .lzma decompressors" +msgstr "xzdec, lzmadec - Kleine Dekompressoren für .xz und .lzma" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:14 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:18 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:44 +msgid "B is a liblzma-based decompression-only tool for B<.xz> (and only B<.xz>) files. B is intended to work as a drop-in replacement for B(1) in the most common situations where a script has been written to use B (and possibly a few other commonly used options) to decompress B<.xz> files. B is identical to B except that B supports B<.lzma> files instead of B<.xz> files." +msgstr "B ist ein auf Liblzma basierendes Nur-Dekompressionswerkzeug für B<.xz>-Dateien (und B für B<.xz>-Dateien). B ist als direkter Ersatz für B(1) in jenen Situationen konzipiert, wo ein Skript B (und eventuelle einige andere höufig genutzte Optionen) zum Dekomprimieren von B<.xz>-Dateien. B ist weitgehend identisch zu B, mit der Ausnahme, dass B B<.lzma>-Dateien anstelle von B<.xz>-Dateien unterstützt." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:61 +msgid "To reduce the size of the executable, B doesn't support multithreading or localization, and doesn't read options from B and B environment variables. B doesn't support displaying intermediate progress information: sending B to B does nothing, but sending B terminates the process instead of displaying progress information." +msgstr "Um die Größe der ausführbaren Datei zu reduzieren, unterstützt B weder Multithreading noch Lokalisierung. Außerdem liest es keine Optionen aus den Umgebungsvariablen B und B. B unterstützt keine zwischenzeitlichen Fortschrittsinformationen: Das Senden von B an B hat keine Auswirkungen, jedoch beendet B den Prozess, anstatt Fortschrittsinformationen anzuzeigen." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:69 +msgid "Ignored for B(1) compatibility. B supports only decompression." +msgstr "ist zwecks Kompatibilität zu B(1) vorhanden; wird ignoriert. B unterstützt nur Dekompression." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:76 +msgid "Ignored for B(1) compatibility. B never creates or removes any files." +msgstr "ist zwecks Kompatibilität zu B(1) vorhanden; wird ignoriert. B erzeugt oder entfernt niemals Dateien." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:83 +msgid "Ignored for B(1) compatibility. B always writes the decompressed data to standard output." +msgstr "ist zwecks Kompatibilität zu B(1) vorhanden; wird ignoriert. B schreibt die dekomprimierten Daten immer in die Standardausgabe." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:89 +msgid "Specifying this once does nothing since B never displays any warnings or notices. Specify this twice to suppress errors." +msgstr "hat bei einmaliger Angabe keine Wirkung, da B niemals Warnungen oder sonstige Meldungen anzeigt. Wenn Sie dies zweimal angeben, werden Fehlermeldungen unterdrückt." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:96 +msgid "Ignored for B(1) compatibility. B never uses the exit status 2." +msgstr "ist zwecks Kompatibilität zu B(1) vorhanden; wird ignoriert. B verwendet niemals den Exit-Status 2." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:99 +msgid "Display a help message and exit successfully." +msgstr "zeigt eine Hilfemeldung an und beendet das Programm erfolgreich." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:104 +msgid "Display the version number of B and liblzma." +msgstr "zeigt die Versionsnummer von B und liblzma an." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:108 +msgid "All was good." +msgstr "Alles ist in Ordnung." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:117 +msgid "B doesn't have any warning messages like B(1) has, thus the exit status 2 is not used by B." +msgstr "B gibt keine Warnmeldungen wie B(1) aus, daher wird der Exit-Status 2 von B nicht verwendet." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:131 +msgid "Use B(1) instead of B or B for normal everyday use. B or B are meant only for situations where it is important to have a smaller decompressor than the full-featured B(1)." +msgstr "Verwenden Sie B(1) anstelle von B oder B im normalen täglichen Gebrauch. B oder B sind nur für Situationen gedacht, in denen ein kleinerer Dekompressor statt des voll ausgestatteten B(1) wichtig ist." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:143 +msgid "B and B are not really that small. The size can be reduced further by dropping features from liblzma at compile time, but that shouldn't usually be done for executables distributed in typical non-embedded operating system distributions. If you need a truly small B<.xz> decompressor, consider using XZ Embedded." +msgstr "B und B sind nicht wirklich extrem klein. Die Größe kann durch Deaktivieren von Funktionen bei der Kompilierung von Liblzma weiter verringert werden, aber das sollte nicht für ausführbare Dateien getan werden, die in typischen Betriebssystemen ausgeliefert werden, außer in den Distributionen für eingebettete Systeme. Wenn Sie einen wirklich winzigen Dekompressor für B<.xz>-Dateien brauchen, sollten Sie stattdessen XZ Embedded in Erwägung ziehen." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:145 ../src/lzmainfo/lzmainfo.1:60 +msgid "B(1)" +msgstr "B(1)" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 +#, no-wrap +msgid "LZMAINFO" +msgstr "LZMAINFO" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "2013-06-30" +msgstr "30. Juni 2013" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:10 +msgid "lzmainfo - show information stored in the .lzma file header" +msgstr "lzmainfo - im .lzma-Dateikopf enthaltene Informationen anzeigen" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:15 +msgid "B [B<--help>] [B<--version>] [I]" +msgstr "B [B<--help>] [B<--version>] [I]" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:31 +msgid "B shows information stored in the B<.lzma> file header. It reads the first 13 bytes from the specified I, decodes the header, and prints it to standard output in human readable format. If no I are given or I is B<->, standard input is read." +msgstr "B zeigt die im B<.lzma>-Dateikopf enthaltenen Informationen an. Es liest die ersten 13 Bytes aus der angegebenen I, dekodiert den Dateikopf und gibt das Ergebnis in die Standardausgabe in einem menschenlesbaren Format aus. Falls keine Ien angegeben werden oder die I als B<-> übergeben wird, dann wird aus der Standardeingabe gelesen." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:40 +msgid "Usually the most interesting information is the uncompressed size and the dictionary size. Uncompressed size can be shown only if the file is in the non-streamed B<.lzma> format variant. The amount of memory required to decompress the file is a few dozen kilobytes plus the dictionary size." +msgstr "In der Regel sind die unkomprimierte Größe der Daten und die Größe des Wörterbuchs am bedeutsamsten. Die unkomprimierte Größe kann nur dann angezeigt werden, wenn die Datei im B<.lzma>-Format kein Datenstrom ist. Die Größe des für die Dekompression nötigen Speichers beträgt einige Dutzend Kilobyte zuzüglich der Größe des Inhaltsverzeichnisses." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:44 +msgid "B is included in XZ Utils primarily for backward compatibility with LZMA Utils." +msgstr "B ist in den XZ-Dienstprogrammen hauptsächlich zur Kompatibilität zu den LZMA-Dienstprogrammen enthalten." + +#. type: SH +#: ../src/lzmainfo/lzmainfo.1:51 ../src/scripts/xzdiff.1:74 +#, no-wrap +msgid "BUGS" +msgstr "FEHLER" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:59 +msgid "B uses B while the correct suffix would be B (2^20 bytes). This is to keep the output compatible with LZMA Utils." +msgstr "B verwendet B, während das korrekte Suffix B (2^20 Bytes) wäre. Damit wird die Kompatibilität zu den LZMA-Dienstprogrammen gewährleistet." + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "XZDIFF" +msgstr "XZDIFF" + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "2021-06-04" +msgstr "4. Juni 2021" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:12 +msgid "xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files" +msgstr "xzcmp, xzdiff, lzcmp, lzdiff - komprimierte Dateien vergleichen" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:15 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:18 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:21 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:24 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:59 +msgid "B and B invoke B(1) or B(1) on files compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1) or B(1). If only one file is specified, then the files compared are I (which must have a suffix of a supported compression format) and I from which the compression format suffix has been stripped. If two files are specified, then they are uncompressed if necessary and fed to B(1) or B(1). The exit status from B(1) or B(1) is preserved unless a decompression error occurs; then exit status is 2." +msgstr "Die Dienstprogramme B und B führen die Programme B(1) beziehungsweise B(1) mit Dateien aus, die mittels B(1), B(1), B(1), B(1), B(1) oder B komprimiert wurden. Alle angegebenen Optionen werden direkt an B(1) oder B(1) übergeben. Wird nur eine Datei angegeben, wird diese I (die eine Endung entsprechend eines der unterstützten Kompressionsformate haben muss) mit der I verglichen, von der die Kompressionsformat-Endung entfernt wird. Werden zwei Dateien angegeben, dann werden deren Inhalte (falls nötig, unkomprimiert) an B(1) oder B(1) weitergeleitet. Der Exit-Status von B(1) oder B(1) wird dabei bewahrt (sofern kein Dekompressionsfehler auftrat; in diesem Fall ist der Exit-Status 2)." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:65 +msgid "The names B and B are provided for backward compatibility with LZMA Utils." +msgstr "Die Namen B und B dienen der Abwärtskompatibilität zu den LZMA-Dienstprogrammen." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:74 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:79 +msgid "Messages from the B(1) or B(1) programs refer to temporary filenames instead of those specified." +msgstr "Die Meldungen der Programme B(1) oder B(1) können auf temporäre Dateinamen verweisen anstatt auf die tatsächlich angegebenen Dateinamen." + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "XZGREP" +msgstr "XZGREP" + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "2022-07-19" +msgstr "19. Juli 2022" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:12 +msgid "xzgrep - search compressed files for a regular expression" +msgstr "xzgrep - komprimierte Dateien nach einem regulären Ausdruck durchsuchen" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:18 +msgid "B [I] [B<-e>] I [I]" +msgstr "B [I] [B<-e>] I [I]" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:21 +msgid "B \\&..." +msgstr "B …" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:24 +msgid "B \\&..." +msgstr "B …" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:27 +msgid "B \\&..." +msgstr "B …" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:30 +msgid "B \\&..." +msgstr "B …" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:33 +msgid "B \\&..." +msgstr "B …" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:49 +msgid "B invokes B(1) on I which may be either uncompressed or compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1)." +msgstr "B wendet B(1) auf I an, die entweder unkomprimiert oder mit B(1), B(1), B(1), B(1), B(1) oder B komprimiert sein können. Alle angegebenen Optionen werden direkt an B(1) übergeben." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:62 +msgid "If no I is specified, then standard input is decompressed if necessary and fed to B(1). When reading from standard input, B(1), B(1), B(1), and B(1) compressed files are not supported." +msgstr "Wenn keine I angegeben ist, wird die Standardeingabe dekomprimiert (falls nötig) und an B übergeben. Beim Lesen aus der Standardeingabe keine Dateien unterstützt, die mit B(1), B(1), B(1) oder B komprimiert sind." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:81 +msgid "If B is invoked as B or B then B or B is used instead of B(1). The same applies to names B, B, and B, which are provided for backward compatibility with LZMA Utils." +msgstr "Wenn B als B oder B aufgerufen wird, dann wird B oder B anstelle von B(1) verwendet. Genauso verhalten sich die Befehle B, B und B, die die Abwärtskompatibilität zu den LZMA-Dienstprogrammen gewährleisten." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:86 +msgid "At least one match was found from at least one of the input files. No errors occurred." +msgstr "In mindestens einer der Eingabedateien wurde mindestens ein Treffer gefunden. Es sind keine Fehler aufgetreten." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:90 +msgid "No matches were found from any of the input files. No errors occurred." +msgstr "In keiner der Eingabedateien wurde ein Treffer gefunden. Es sind keine Fehler aufgetreten." + +#. type: TP +#: ../src/scripts/xzgrep.1:90 +#, no-wrap +msgid "E1" +msgstr "E1" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:94 +msgid "One or more errors occurred. It is unknown if matches were found." +msgstr "Ein oder mehrere Fehler sind aufgetreten. Es ist unbekannt, ob Treffer gefunden wurden." + +#. type: TP +#: ../src/scripts/xzgrep.1:95 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:106 +msgid "If the B environment variable is set, B uses it instead of B(1), B, or B." +msgstr "Wenn die Umgebungsvariable B gesetzt ist, verwendet B deren Inhalt anstelle von B(1), B oder B." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:113 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "XZLESS" +msgstr "XZLESS" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "2010-09-27" +msgstr "27. September 2010" + +#. type: Plain text +#: ../src/scripts/xzless.1:13 +msgid "xzless, lzless - view xz or lzma compressed (text) files" +msgstr "xzless, lzless - mit xz oder lzma komprimierte (Text-)Dateien betrachten" + +#. type: Plain text +#: ../src/scripts/xzless.1:16 +msgid "B [I...]" +msgstr "B [I …]" + +#. type: Plain text +#: ../src/scripts/xzless.1:19 +msgid "B [I...]" +msgstr "B [I …]" + +#. type: Plain text +#: ../src/scripts/xzless.1:31 +msgid "B is a filter that displays text from compressed files to a terminal. It works on files compressed with B(1) or B(1). If no I are given, B reads from standard input." +msgstr "B ist ein Filter, der Text aus komprimierten Dateien in einem Terminal anzeigt. Es funktioniert mit Dateien, die mit B(1) oder B(1) komprimiert sind. Falls keine I angegeben sind, liest B aus der Standardeingabe." + +#. type: Plain text +#: ../src/scripts/xzless.1:48 +msgid "B uses B(1) to present its output. Unlike B, its choice of pager cannot be altered by setting an environment variable. Commands are based on both B(1) and B(1) and allow back and forth movement and searching. See the B(1) manual for more information." +msgstr "B verwendet B(1) zur Darstellung der Ausgabe. Im Gegensatz zu B können Sie das zu verwendende Textanzeigeprogramm nicht durch Setzen einer Umgebungsvariable ändern. Die Befehle basieren auf B(1) und B(1) und ermöglichen Vorwärts- und Rückwärtssprünge sowie Suchvorgänge. In der Handbuchseite zu B(1) finden Sie weiter Information." + +#. type: Plain text +#: ../src/scripts/xzless.1:52 +msgid "The command named B is provided for backward compatibility with LZMA Utils." +msgstr "Der Befehl B dient der Abwärtskompatibilität zu den LZMA-Dienstprogrammen." + +#. type: TP +#: ../src/scripts/xzless.1:53 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:59 +msgid "A list of characters special to the shell. Set by B unless it is already set in the environment." +msgstr "Dies enthält eine Zeichenliste mit Bezug zur Shell. Wenn diese Variable nicht bereits gesetzt ist, wird sie durch B gesetzt." + +#. type: TP +#: ../src/scripts/xzless.1:59 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:65 +msgid "Set to a command line to invoke the B(1) decompressor for preprocessing the input files to B(1)." +msgstr "Dies ist auf die Befehlszeile zum Aufruf von B(1) gesetzt, die zur Vorverarbeitung der Eingabedateien für B(1) nötig ist." + +#. type: Plain text +#: ../src/scripts/xzless.1:69 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZMORE" +msgstr "XZMORE" + +#. type: Plain text +#: ../src/scripts/xzmore.1:10 +msgid "xzmore, lzmore - view xz or lzma compressed (text) files" +msgstr "xzmore, lzmore - mit xz oder lzma komprimierte (Text-)Dateien lesen" + +#. type: Plain text +#: ../src/scripts/xzmore.1:13 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:16 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:24 +msgid "B is a filter which allows examination of B(1) or B(1) compressed text files one screenful at a time on a soft-copy terminal." +msgstr "B ist ein Filter zur seitenweisen Anzeige von Textdateien in einem Terminal, die mit B(1) oder B(1) komprimiert wurden." + +#. type: Plain text +#: ../src/scripts/xzmore.1:33 +msgid "To use a pager other than the default B set environment variable B to the name of the desired program. The name B is provided for backward compatibility with LZMA Utils." +msgstr "Um ein anderes Textanzeigeprogramm als den voreingestellten B zu verwenden, setzen Sie die Umgebungsvariable B auf das gewünschte Programm. Der Name B dient der Abwärtskompatibilität zu den LZMA-Dienstprogrammen." + +#. type: TP +#: ../src/scripts/xzmore.1:33 +#, no-wrap +msgid "B or B" +msgstr "B oder B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:40 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to exit." +msgstr "Wenn die Zeile --Mehr--(Nächste Datei: I) angezeigt wird, wird B mit diesem Befehl beendet." + +#. type: TP +#: ../src/scripts/xzmore.1:40 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:47 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to skip the next file and continue." +msgstr "Wenn die Zeile --Mehr--(Nächste Datei: I) angezeigt wird, springt B zur nächsten Datei und zeigt diese an." + +#. type: Plain text +#: ../src/scripts/xzmore.1:51 +msgid "For list of keyboard commands supported while actually viewing the content of a file, refer to manual of the pager you use, usually B(1)." +msgstr "Eine Liste der bei der Betrachtung von Dateiinhalten verfügbaren Tastaturbefehle finden Sie in der Handbuchseite des verwendeten Textanzeigeprogramms, meist B(1)." + +#. type: Plain text +#: ../src/scripts/xzmore.1:55 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#~ msgid "2020-02-01" +#~ msgstr "1. Februar 2020" + +#~ msgid "Display an error and exit if the compression settings exceed the memory usage limit. The default is to adjust the settings downwards so that the memory usage limit is not exceeded. Automatic adjusting is always disabled when creating raw streams (B<--format=raw>)." +#~ msgstr "zeigt einen Fehler an und bricht die Ausführung ab, falls die Kompressionseinstellungen die Begrenzung der Speichernutzung überschreiten. Standardmäßig werden die Einstellungen nach unten korrigiert, so dass diese Grenze nicht überschritten wird. Bei der Erzeugung von Rohdatenströmen (B<--format=raw>) ist die automatische Korrektur stets deaktiviert." + +#~ msgid "It is fine to apply a BCJ filter on a whole executable; there's no need to apply it only on the executable section. Applying a BCJ filter on an archive that contains both executable and non-executable files may or may not give good results, so it generally isn't good to blindly apply a BCJ filter when compressing binary packages for distribution." +#~ msgstr "Es ist in Ordnung, einen BCJ-Filter auf eine gesamte Binärdatei anzuwenden; es ist nicht nötig, dies nur auf den binären Bereich zu beschränken. Die Anwendung eines BCJ-Filters auf ein Archiv, das sowohl binäre als auch nicht-binäre Dateien enthält, kann gute Ergebnisse liefern, muss es aber nicht. Daher ist es generell nicht gut, einen BCJ-Filter blindlings anzuwenden, wenn Sie Binärpakete zwecks Weitergabe komprimieren wollen." + +#~ msgid "These BCJ filters are very fast and use insignificant amount of memory. If a BCJ filter improves compression ratio of a file, it can improve decompression speed at the same time. This is because, on the same hardware, the decompression speed of LZMA2 is roughly a fixed number of bytes of compressed data per second." +#~ msgstr "Diese BCJ-Filter sind sehr schnell und erhöhen den Speicherbedarf nur unerheblich. Wenn ein BCJ-Filter das Kompressionsverhältnis einer Datei verbessert, kann er auch gleichzeitig die Dekompressionsgeschwindigkeit verbessern. Das kommt daher, dass auf der gleichen Hardware die Dekompressionsgeschwindigkeit von LZMA2 ungefähr eine feste Anzahl Byte an komprimierten Daten pro Sekunde ist." + +#~ msgid "Applying a BCJ filter on an archive containing multiple similar executables can make the compression ratio worse than not using a BCJ filter. This is because the BCJ filter doesn't detect the boundaries of the executable files, and doesn't reset the address conversion counter for each executable." +#~ msgstr "Bei der Anwendung eines BCJ-Filters auf ein Archiv, das mehrere ähnliche Binärdateien enthält, kann das Kompressionsverhältnis schlechter sein als ohne BCJ-Filter. Das kommt daher, weil der BCJ-Filter die Grenzen der Binärdateien nicht erkennt und den Zähler der Adressumwandlung für jede Binärdatei nicht zurücksetzt." + +#~ msgid "Both of the above problems will be fixed in the future in a new filter. The old BCJ filters will still be useful in embedded systems, because the decoder of the new filter will be bigger and use more memory." +#~ msgstr "Beide der oben genannten Probleme werden in der Zukunft in einem neuen Filter nicht mehr auftreten. Die alten BCJ-Filter werden noch in eingebetteten Systemen von Nutzen sein, weil der Dekoder des neuen Filters größer sein und mehr Speicher beanspruchen wird." + +# FIXME have have +#~ msgid "Different instruction sets have different alignment:" +#~ msgstr "Verschiedene Befehlssätze haben unterschiedliche Ausrichtungen:" + +#~ msgid "Little endian only" +#~ msgstr "Nur Little Endian" + +#~ msgid "Big or little endian" +#~ msgstr "Big oder Little Endian" diff --git a/po4a/fr.po b/po4a/fr.po new file mode 100644 index 0000000..7aec5b2 --- /dev/null +++ b/po4a/fr.po @@ -0,0 +1,6191 @@ +# french translation of XZ Utils man +# Copyright (C) 2021 Debian French l10n team +# This file is put in the public domain. +# This file is distributed under the same license as the XZ Utils package. +# +# Translator +# bubu , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: XZ Utils 5.2.5\n" +"POT-Creation-Date: 2023-01-11 18:54+0200\n" +"PO-Revision-Date: 2021-12-01 15:17+0100\n" +"Last-Translator: bubu \n" +"Language-Team: French \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "XZ" +msgstr "XZ" + +#. type: TH +#: ../src/xz/xz.1:8 +#, fuzzy, no-wrap +#| msgid "2020-02-01" +msgid "2022-12-01" +msgstr "1er février 2020" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "Tukaani" +msgstr "Tukaani" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZ Utils" +msgstr "Utilitaires XZ" + +#. type: SH +#: ../src/xz/xz.1:10 ../src/xzdec/xzdec.1:8 ../src/lzmainfo/lzmainfo.1:8 +#: ../src/scripts/xzdiff.1:10 ../src/scripts/xzgrep.1:10 +#: ../src/scripts/xzless.1:11 ../src/scripts/xzmore.1:8 +#, no-wrap +msgid "NAME" +msgstr "NOM" + +#. type: Plain text +#: ../src/xz/xz.1:12 +msgid "" +"xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma " +"files" +msgstr "" +"xz, unxz, xzcat, lzma, unlzma, lzcat - Compresser ou décompresser des " +"fichiers .xz et .lzma" + +#. type: SH +#: ../src/xz/xz.1:13 ../src/xzdec/xzdec.1:10 ../src/lzmainfo/lzmainfo.1:10 +#: ../src/scripts/xzdiff.1:12 ../src/scripts/xzgrep.1:12 +#: ../src/scripts/xzless.1:13 ../src/scripts/xzmore.1:10 +#, no-wrap +msgid "SYNOPSIS" +msgstr "SYNOPSIS" + +#. type: Plain text +#: ../src/xz/xz.1:17 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: SH +#: ../src/xz/xz.1:18 +#, no-wrap +msgid "COMMAND ALIASES" +msgstr "ALIAS DES COMMANDES" + +#. type: Plain text +#: ../src/xz/xz.1:22 +msgid "B is equivalent to B." +msgstr "B est équivalent à B." + +#. type: Plain text +#: ../src/xz/xz.1:26 +msgid "B is equivalent to B." +msgstr "B est équivalent à B" + +#. type: Plain text +#: ../src/xz/xz.1:30 +msgid "B is equivalent to B." +msgstr "B est équivalent à B" + +#. type: Plain text +#: ../src/xz/xz.1:34 +msgid "B is equivalent to B." +msgstr "B est équivalent à B" + +#. type: Plain text +#: ../src/xz/xz.1:38 +msgid "B is equivalent to B." +msgstr "B est équivalent à B" + +#. type: Plain text +#: ../src/xz/xz.1:50 +msgid "" +"When writing scripts that need to decompress files, it is recommended to " +"always use the name B with appropriate arguments (B or B) instead of the names B and B." +msgstr "" +"Lors de l'écriture de scripts qui nécessitent de décompresser des fichiers, " +"il est recommandé de toujours utiliser la commande B avec les arguments " +"appropriés (B ou B) au lieu des commandes B et B." + +#. type: SH +#: ../src/xz/xz.1:51 ../src/xzdec/xzdec.1:18 ../src/lzmainfo/lzmainfo.1:15 +#: ../src/scripts/xzdiff.1:24 ../src/scripts/xzgrep.1:33 +#: ../src/scripts/xzless.1:19 ../src/scripts/xzmore.1:16 +#, no-wrap +msgid "DESCRIPTION" +msgstr "DESCRIPTION" + +#. type: Plain text +#: ../src/xz/xz.1:70 +#, fuzzy +#| msgid "" +#| "B is a general-purpose data compression tool with command line syntax " +#| "similar to B(1) and B(1). The native file format is the B<." +#| "xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw " +#| "compressed streams with no container format headers are also supported." +msgid "" +"B is a general-purpose data compression tool with command line syntax " +"similar to B(1) and B(1). The native file format is the B<." +"xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw " +"compressed streams with no container format headers are also supported. In " +"addition, decompression of the B<.lz> format used by B is supported." +msgstr "" +"B est un outil de compression de données polyvalent avec une syntaxe de " +"ligne de commandes similaire à B(1) et B(1). Le format de " +"fichier natif est le format B<.xz>, mais le format historique B<.lzma> " +"utilisé par les outils LZMA et les flux bruts compressés sans conteneur d'en-" +"têtes de format sont aussi pris en charge. " + +#. type: Plain text +#: ../src/xz/xz.1:92 +msgid "" +"B compresses or decompresses each I according to the selected " +"operation mode. If no I are given or I is B<->, B reads " +"from standard input and writes the processed data to standard output. B " +"will refuse (display an error and skip the I) to write compressed " +"data to standard output if it is a terminal. Similarly, B will refuse " +"to read compressed data from standard input if it is a terminal." +msgstr "" +"B compresse ou décompresse chaque I en fonction du mode " +"d'opération choisi. Si aucun I n'est donné ou I est B<->, " +"B lit depuis l'entrée standard et écrit les données traitées sur la " +"sortie standard. B refusera (affichera une erreur et ignorera le " +"I) d'écrire les données compressées sur la sortie standard si c'est " +"un terminal. De même, B refusera de lire des données compressées depuis " +"l'entrée standard si c'est un terminal." + +#. type: Plain text +#: ../src/xz/xz.1:102 +msgid "" +"Unless B<--stdout> is specified, I other than B<-> are written to a " +"new file whose name is derived from the source I name:" +msgstr "" +"A moins que B<--sdout> ne soit indiqué, les I autres que B<-> sont " +"écrits dans un nouveau fichier dont le nom est dérivé du nom de I " +"source :" + +#. type: IP +#: ../src/xz/xz.1:102 ../src/xz/xz.1:108 ../src/xz/xz.1:133 ../src/xz/xz.1:138 +#: ../src/xz/xz.1:141 ../src/xz/xz.1:144 ../src/xz/xz.1:160 ../src/xz/xz.1:421 +#: ../src/xz/xz.1:424 ../src/xz/xz.1:431 ../src/xz/xz.1:676 ../src/xz/xz.1:678 +#: ../src/xz/xz.1:777 ../src/xz/xz.1:788 ../src/xz/xz.1:797 ../src/xz/xz.1:805 +#: ../src/xz/xz.1:1033 ../src/xz/xz.1:1042 ../src/xz/xz.1:1054 +#: ../src/xz/xz.1:1729 ../src/xz/xz.1:1735 ../src/xz/xz.1:1853 +#: ../src/xz/xz.1:1857 ../src/xz/xz.1:1860 ../src/xz/xz.1:1863 +#: ../src/xz/xz.1:1867 ../src/xz/xz.1:1874 ../src/xz/xz.1:1876 +#, no-wrap +msgid "\\(bu" +msgstr "\\(bu" + +#. type: Plain text +#: ../src/xz/xz.1:108 +msgid "" +"When compressing, the suffix of the target file format (B<.xz> or B<.lzma>) " +"is appended to the source filename to get the target filename." +msgstr "" +"Lors de la compression, le suffixe du format de fichier cible (B<.xz> ou B<." +"lzma>) est ajouté au nom de fichier source pour obtenir le nom de fichier " +"cible." + +#. type: Plain text +#: ../src/xz/xz.1:123 +#, fuzzy +#| msgid "" +#| "When decompressing, the B<.xz> or B<.lzma> suffix is removed from the " +#| "filename to get the target filename. B also recognizes the suffixes " +#| "B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgid "" +"When decompressing, the B<.xz>, B<.lzma>, or B<.lz> suffix is removed from " +"the filename to get the target filename. B also recognizes the suffixes " +"B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgstr "" +"Lors de la décompression, le suffixe B<.xz> ou B<.lzma> est enlevé du nom de " +"fichier pour obtenir le nom de fichier cible. B reconnaît aussi les " +"suffixes B<.txz> et B<.tlz> et les remplace par le suffixe B<.tar>." + +#. type: Plain text +#: ../src/xz/xz.1:127 +msgid "" +"If the target file already exists, an error is displayed and the I is " +"skipped." +msgstr "" +"Si le fichier cible existe déjà, une erreur est affichée et le I " +"est ignoré." + +#. type: Plain text +#: ../src/xz/xz.1:133 +msgid "" +"Unless writing to standard output, B will display a warning and skip the " +"I if any of the following applies:" +msgstr "" +"Sauf s'il écrit dans la sortie standard, B affichera un avertissement et " +"ignorera le I dans les cas suivants :" + +#. type: Plain text +#: ../src/xz/xz.1:138 +msgid "" +"I is not a regular file. Symbolic links are not followed, and thus " +"they are not considered to be regular files." +msgstr "" +"I n'est pas un fichier normal. Les liens symboliques ne sont pas " +"suivis et donc ne sont pas considérés comme des fichiers normaux." + +#. type: Plain text +#: ../src/xz/xz.1:141 +msgid "I has more than one hard link." +msgstr "I a plusieurs liens physiques." + +#. type: Plain text +#: ../src/xz/xz.1:144 +msgid "I has setuid, setgid, or sticky bit set." +msgstr "I a un setuid, setgid ou sticky bit positionné." + +#. type: Plain text +#: ../src/xz/xz.1:160 +msgid "" +"The operation mode is set to compress and the I already has a suffix " +"of the target file format (B<.xz> or B<.txz> when compressing to the B<.xz> " +"format, and B<.lzma> or B<.tlz> when compressing to the B<.lzma> format)." +msgstr "" +"Le mode d'opération est défini pour compresser et le I a déjà un " +"suffixe du format de fichier cible (B<.xz> ou B<.txz> lors d'une compression " +"en format B<.xz>, et B<.lzma> ou B<.tlz> lors d'une compression en format B<." +"lzma>)." + +#. type: Plain text +#: ../src/xz/xz.1:170 +#, fuzzy +#| msgid "" +#| "The operation mode is set to decompress and the I doesn't have a " +#| "suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, " +#| "or B<.tlz>)." +msgid "" +"The operation mode is set to decompress and the I doesn't have a " +"suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, B<." +"tlz>, or B<.lz>)." +msgstr "" +"Le mode d'opération est défini pour décompresser et le I n'a pas de " +"suffixe correspondant aux formats de fichier pris en charge (B<.xz>, B<." +"txz>, B<.lzma>, ou B<.tlz>)." + +#. type: Plain text +#: ../src/xz/xz.1:185 +msgid "" +"After successfully compressing or decompressing the I, B copies " +"the owner, group, permissions, access time, and modification time from the " +"source I to the target file. If copying the group fails, the " +"permissions are modified so that the target file doesn't become accessible " +"to users who didn't have permission to access the source I. B " +"doesn't support copying other metadata like access control lists or extended " +"attributes yet." +msgstr "" +"Après la compression ou la décompression réussie du I, B copie " +"les permissions du propriétaire, du groupe, la date d'accès, et les " +"modifications d'heure depuis le I source du fichier cible. Si la " +"copie du groupe échoue, les permissions sont modifiées pour que le fichier " +"cible ne soit pas accessible aux utilisateurs qui n'ont pas les droits " +"d'accès au I source. B ne prend actuellement pas en charge la " +"copie d'autres métadonnées telles que les listes de contrôle d'accès ou les " +"attributs étendus." + +#. type: Plain text +#: ../src/xz/xz.1:195 +#, fuzzy +#| msgid "" +#| "Once the target file has been successfully closed, the source I is " +#| "removed unless B<--keep> was specified. The source I is never " +#| "removed if the output is written to standard output." +msgid "" +"Once the target file has been successfully closed, the source I is " +"removed unless B<--keep> was specified. The source I is never removed " +"if the output is written to standard output or if an error occurs." +msgstr "" +"Une fois que le fichier cible a été fermé avec succès, le I source " +"est supprimé à moins que B<--keep> n'ait été spécifié. Le I source " +"n'est jamais supprimé si la sortie est écrite sur la sortie standard." + +#. type: Plain text +#: ../src/xz/xz.1:207 +msgid "" +"Sending B or B to the B process makes it print " +"progress information to standard error. This has only limited use since " +"when standard error is a terminal, using B<--verbose> will display an " +"automatically updating progress indicator." +msgstr "" +"Envoyer B ou B au processus B, lui fait afficher " +"l'information de progression sur l'erreur standard. Cela a un intérêt limité " +"car lorsque l'erreur standard est un terminal, utiliser B<--verbose> " +"affichera automatiquement un indicateur de progression du processus." + +#. type: SS +#: ../src/xz/xz.1:208 +#, no-wrap +msgid "Memory usage" +msgstr "Utilisation de la mémoire" + +#. type: Plain text +#: ../src/xz/xz.1:224 +msgid "" +"The memory usage of B varies from a few hundred kilobytes to several " +"gigabytes depending on the compression settings. The settings used when " +"compressing a file determine the memory requirements of the decompressor. " +"Typically the decompressor needs 5\\ % to 20\\ % of the amount of memory " +"that the compressor needed when creating the file. For example, " +"decompressing a file created with B currently requires 65\\ MiB of " +"memory. Still, it is possible to have B<.xz> files that require several " +"gigabytes of memory to decompress." +msgstr "" +"L'utilisation de la mémoire par B varie de quelques centaines de kilo-" +"octets à plusieurs gigaoctects en fonction des paramètres de compression. " +"Les réglages utilisés lors de la compression d'un fichier déterminent les " +"besoins en mémoire pour la décompression. Habituellement la décompression " +"nécessite 5\\% à 20\\% de la quantité de mémoire utilisée pour la " +"compression du fichier. Par exemple, décompresser un fichier créé avec " +"B recquiert habituellement 65\\ Mio de mémoire. Bien qu'il soit " +"possible d'avoir des fichiers B<.xz> nécessitant plusieurs gigaoctets de " +"mémoire pour être décompressés." + +#. type: Plain text +#: ../src/xz/xz.1:236 +#, fuzzy +#| msgid "" +#| "Especially users of older systems may find the possibility of very large " +#| "memory usage annoying. To prevent uncomfortable surprises, B has a " +#| "built-in memory usage limiter, which is disabled by default. While some " +#| "operating systems provide ways to limit the memory usage of processes, " +#| "relying on it wasn't deemed to be flexible enough (e.g. using " +#| "B(1) to limit virtual memory tends to cripple B(2))." +msgid "" +"Especially users of older systems may find the possibility of very large " +"memory usage annoying. To prevent uncomfortable surprises, B has a " +"built-in memory usage limiter, which is disabled by default. While some " +"operating systems provide ways to limit the memory usage of processes, " +"relying on it wasn't deemed to be flexible enough (for example, using " +"B(1) to limit virtual memory tends to cripple B(2))." +msgstr "" +"En particulier, les utilisateurs de vieux systèmes peuvent trouver ennuyeux " +"l'utilisation de beaucoup de mémoire. Pour éviter les mauvaises surprises, " +"B a un limiteur d'utilisation mémoire intégré qui est désactivé par " +"défaut. Bien que quelques systèmes d'exploitation fournissent des moyens " +"pour limiter l'utilisation de la mémoire par les processus, leur utilisation " +"s'est avérée insuffisament flexible (par ex. en utilisant B(1) pour " +"limiter les tendances de la mémoire virtuelle à handicaper B(2))." + +#. type: Plain text +#: ../src/xz/xz.1:258 +#, fuzzy +#| msgid "" +#| "The memory usage limiter can be enabled with the command line option B<--" +#| "memlimit=>I. Often it is more convenient to enable the limiter by " +#| "default by setting the environment variable B, e.g.\\& " +#| "B. It is possible to set the limits " +#| "separately for compression and decompression by using B<--memlimit-" +#| "compress=>I and B<--memlimit-decompress=>I. Using these " +#| "two options outside B is rarely useful because a single run " +#| "of B cannot do both compression and decompression and B<--" +#| "memlimit=>I (or B<-M> I) is shorter to type on the command " +#| "line." +msgid "" +"The memory usage limiter can be enabled with the command line option B<--" +"memlimit=>I. Often it is more convenient to enable the limiter by " +"default by setting the environment variable B, for example, " +"B. It is possible to set the limits " +"separately for compression and decompression by using B<--memlimit-" +"compress=>I and B<--memlimit-decompress=>I. Using these two " +"options outside B is rarely useful because a single run of " +"B cannot do both compression and decompression and B<--" +"memlimit=>I (or B<-M> I) is shorter to type on the command " +"line." +msgstr "" +"Le limiteur d'utilisation de la mémoire peut être activé avec l'option B<--" +"memlimit=>I. Généralement il est plus pratique d'activer le limiteur " +"par défaut en réglant la variable d'environnement B, par " +"exemple \\&B. Il est possible de régler les " +"limites indépendamment pour la compression et la décompression en utilisant " +"B<--memlimit-compress=>I et B<--memlimit-decompress=>I. " +"Utiliser ces deux options hors de B est rarement utile car une " +"simple exécution de B ne peut pas à la fois compresser et décompresser " +"et B<--memlimit=>I (ou B I) est moins long à taper sur la " +"ligne de commandes." + +#. type: Plain text +#: ../src/xz/xz.1:277 +#, fuzzy +#| msgid "" +#| "If the specified memory usage limit is exceeded when decompressing, B " +#| "will display an error and decompressing the file will fail. If the limit " +#| "is exceeded when compressing, B will try to scale the settings down " +#| "so that the limit is no longer exceeded (except when using B<--" +#| "format=raw> or B<--no-adjust>). This way the operation won't fail unless " +#| "the limit is very small. The scaling of the settings is done in steps " +#| "that don't match the compression level presets, e.g. if the limit is only " +#| "slightly less than the amount required for B, the settings will be " +#| "scaled down only a little, not all the way down to B." +msgid "" +"If the specified memory usage limit is exceeded when decompressing, B " +"will display an error and decompressing the file will fail. If the limit is " +"exceeded when compressing, B will try to scale the settings down so that " +"the limit is no longer exceeded (except when using B<--format=raw> or B<--no-" +"adjust>). This way the operation won't fail unless the limit is very " +"small. The scaling of the settings is done in steps that don't match the " +"compression level presets, for example, if the limit is only slightly less " +"than the amount required for B, the settings will be scaled down only " +"a little, not all the way down to B." +msgstr "" +"Si la limite d'utilisation de la mémoire est dépassée lors de la " +"décompression, B affichera une erreur et la décompression échouera. Si " +"la limite est dépassée lors de la compression, B essaiera d'adapter les " +"réglages pour que la limite ne soit plus dépassée (sauf lors de " +"l'utilisation de B<--format=raw> ou de B<--no-adjust>). De cette façon, " +"l'opération n'échouera pas sauf si la limite est très petite. L'adaptation " +"des réglages est faite par paliers et n'aboutira pas forcément aux réglages " +"prédéfinis du niveau de compression, par ex. si la limite est seulement " +"légèrement plus petite que la quantité requise par B, les réglages " +"seront réduits un tout petit peu, mais pas jusqu'à B." + +#. type: SS +#: ../src/xz/xz.1:278 +#, no-wrap +msgid "Concatenation and padding with .xz files" +msgstr "Concaténation et remplissage avec des fichiers .xz" + +#. type: Plain text +#: ../src/xz/xz.1:286 +msgid "" +"It is possible to concatenate B<.xz> files as is. B will decompress " +"such files as if they were a single B<.xz> file." +msgstr "" +"Il est possible de concaténer les fichiers B<.xz> tels quel. B " +"décompressera de tels fichiers comme s'ils étaient un unique fichier B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:295 +#, fuzzy +#| msgid "" +#| "It is possible to insert padding between the concatenated parts or after " +#| "the last part. The padding must consist of null bytes and the size of " +#| "the padding must be a multiple of four bytes. This can be useful e.g. if " +#| "the B<.xz> file is stored on a medium that measures file sizes in 512-" +#| "byte blocks." +msgid "" +"It is possible to insert padding between the concatenated parts or after the " +"last part. The padding must consist of null bytes and the size of the " +"padding must be a multiple of four bytes. This can be useful, for example, " +"if the B<.xz> file is stored on a medium that measures file sizes in 512-" +"byte blocks." +msgstr "" +"Il est possible d'insérer du remplissage entre les parties concaténées ou " +"après la dernière partie. Le remplissage doit se composer d'octets nuls et " +"la taille du remplissage doit être un multiple de quatre octets. Cela peut " +"être utile par exemple si le fichier <.xz> est stocké sur un média qui " +"mesure la taille des fichiers en blocs de 512 octets." + +#. type: Plain text +#: ../src/xz/xz.1:299 +msgid "" +"Concatenation and padding are not allowed with B<.lzma> files or raw streams." +msgstr "" +"La concaténation et le remplissage ne sont pas autorisés avec les fichiers " +"B<.lzma> ou les flux bruts." + +#. type: SH +#: ../src/xz/xz.1:300 ../src/xzdec/xzdec.1:61 +#, no-wrap +msgid "OPTIONS" +msgstr "OPTIONS" + +#. type: SS +#: ../src/xz/xz.1:302 +#, no-wrap +msgid "Integer suffixes and special values" +msgstr "Suffixes entiers et valeurs spéciales." + +#. type: Plain text +#: ../src/xz/xz.1:306 +msgid "" +"In most places where an integer argument is expected, an optional suffix is " +"supported to easily indicate large integers. There must be no space between " +"the integer and the suffix." +msgstr "" +"Dans la plupart des endroits où un argument entier est attendu, un suffixe " +"optionel permet d'indiquer facilement les grands entiers. Il ne doit pas y " +"avoir d'espace entre l'entier et le suffixe." + +#. type: TP +#: ../src/xz/xz.1:306 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:317 +msgid "" +"Multiply the integer by 1,024 (2^10). B, B, B, B, and B " +"are accepted as synonyms for B." +msgstr "" +"Multiplier l'entier par 1024 (2^10). B, B, B, B et B sont " +"acceptés comme synonymes de B." + +#. type: TP +#: ../src/xz/xz.1:317 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:327 +msgid "" +"Multiply the integer by 1,048,576 (2^20). B, B, B, and B are " +"accepted as synonyms for B." +msgstr "" +"Multiplier l'entier par 1 048 576 (2^20). B, B, B et B sont " +"acceptés comme synonymes de B." + +#. type: TP +#: ../src/xz/xz.1:327 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:337 +msgid "" +"Multiply the integer by 1,073,741,824 (2^30). B, B, B, and B " +"are accepted as synonyms for B." +msgstr "" +"Multiplier l'entier par 1 073 741 824 (2^30). B, B, B et B " +"sont acceptés comme synonymes de B." + +#. type: Plain text +#: ../src/xz/xz.1:342 +msgid "" +"The special value B can be used to indicate the maximum integer value " +"supported by the option." +msgstr "" +"La valeur spéciale B peut être utilisée pour indiquer la valeur " +"maximale de l'entier prise en charge par l'option." + +#. type: SS +#: ../src/xz/xz.1:343 +#, no-wrap +msgid "Operation mode" +msgstr "Mode d'opération" + +#. type: Plain text +#: ../src/xz/xz.1:346 +msgid "" +"If multiple operation mode options are given, the last one takes effect." +msgstr "" +"Si plusieurs options de mode d'opération sont données, la dernière prend " +"effet." + +#. type: TP +#: ../src/xz/xz.1:346 +#, no-wrap +msgid "B<-z>, B<--compress>" +msgstr "B<-z>, B<--compress>" + +#. type: Plain text +#: ../src/xz/xz.1:355 +msgid "" +"Compress. This is the default operation mode when no operation mode option " +"is specified and no other operation mode is implied from the command name " +"(for example, B implies B<--decompress>)." +msgstr "" +"Compresser. C'est le mode d'opération par défaut lorsque aucune option de " +"mode opératoire n'est spécifiée ou qu'aucun autre mode d'opération n'est " +"sous-entendu par le nom de la commande (par exemple B sous-entend B<--" +"decompress>)." + +#. type: TP +#: ../src/xz/xz.1:355 ../src/xzdec/xzdec.1:62 +#, no-wrap +msgid "B<-d>, B<--decompress>, B<--uncompress>" +msgstr "B<-d>, B<--decompress>, B<--uncompress>" + +#. type: Plain text +#: ../src/xz/xz.1:358 +msgid "Decompress." +msgstr "Décompresser." + +#. type: TP +#: ../src/xz/xz.1:358 +#, no-wrap +msgid "B<-t>, B<--test>" +msgstr "B<-t>, B<--test>" + +#. type: Plain text +#: ../src/xz/xz.1:367 +msgid "" +"Test the integrity of compressed I. This option is equivalent to B<--" +"decompress --stdout> except that the decompressed data is discarded instead " +"of being written to standard output. No files are created or removed." +msgstr "" +"Tester l'intégrité des I compressés. Cette option est équivalente " +"à B<--decompress --stdout> sauf que les données décompressées sont rejetées " +"au lieu d'être écrites sur la sortie standard. Aucun fichier n'est créé ou " +"supprimé." + +#. type: TP +#: ../src/xz/xz.1:367 +#, no-wrap +msgid "B<-l>, B<--list>" +msgstr "B<-l>, B<--list>" + +#. type: Plain text +#: ../src/xz/xz.1:376 +msgid "" +"Print information about compressed I. No uncompressed output is " +"produced, and no files are created or removed. In list mode, the program " +"cannot read the compressed data from standard input or from other unseekable " +"sources." +msgstr "" +"Afficher l'information sur les I compressés. Aucune sortie non-" +"compressée n'est produite et aucun fichier n'est créé ou supprimé. En mode " +"liste, le programme ne peut pas lire les données compressées depuis l'entrée " +"standard ou depuis d'autres sources non adressables." + +#. type: Plain text +#: ../src/xz/xz.1:391 +#, fuzzy +#| msgid "" +#| "The default listing shows basic information about I, one file per " +#| "line. To get more detailed information, use also the B<--verbose> " +#| "option. For even more information, use B<--verbose> twice, but note that " +#| "this may be slow, because getting all the extra information requires many " +#| "seeks. The width of verbose output exceeds 80 characters, so piping the " +#| "output to e.g.\\& B may be convenient if the terminal isn't " +#| "wide enough." +msgid "" +"The default listing shows basic information about I, one file per " +"line. To get more detailed information, use also the B<--verbose> option. " +"For even more information, use B<--verbose> twice, but note that this may be " +"slow, because getting all the extra information requires many seeks. The " +"width of verbose output exceeds 80 characters, so piping the output to, for " +"example, B may be convenient if the terminal isn't wide enough." +msgstr "" +"Le listing par défaut montre les informations basiques des I, un " +"fichier par ligne. Pour des informations plus détaillées, utilisez aussi " +"l'option B<--verbose>. Pour encore plus d'informations, utilisez B<--" +"verbose> deux fois, mais prenez en compte que cela peut être lent, car " +"obtenir des informations supplémentaires nécessite de nombreuses recherches. " +"La largeur de la sortie «bavarde» dépasse 80 caractères, alors canaliser la " +"sortie (par exemple vers \\&B) peut être pratique si le terminal " +"n'est pas assez large." + +#. type: Plain text +#: ../src/xz/xz.1:398 +msgid "" +"The exact output may vary between B versions and different locales. For " +"machine-readable output, B<--robot --list> should be used." +msgstr "" +"La sortie exacte peut varier suivant les versions de B et les différents " +"paramètres régionaux. Pour une sortie lisible par la machine, utiliser B<--" +"robot --list>." + +#. type: SS +#: ../src/xz/xz.1:399 +#, no-wrap +msgid "Operation modifiers" +msgstr "Modificateurs d'opération" + +#. type: TP +#: ../src/xz/xz.1:400 ../src/xzdec/xzdec.1:69 +#, no-wrap +msgid "B<-k>, B<--keep>" +msgstr "B<-k>, B<--keep>" + +#. type: Plain text +#: ../src/xz/xz.1:403 +msgid "Don't delete the input files." +msgstr "Ne pas effacer les fichiers d'entrée." + +#. type: Plain text +#: ../src/xz/xz.1:417 +#, fuzzy +#| msgid "" +#| "Compress or decompress even if the input is a symbolic link to a regular " +#| "file, has more than one hard link, or has the setuid, setgid, or sticky " +#| "bit set. The setuid, setgid, and sticky bits are not copied to the " +#| "target file." +msgid "" +"Since B 5.2.6, this option also makes B compress or decompress even " +"if the input is a symbolic link to a regular file, has more than one hard " +"link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and " +"sticky bits are not copied to the target file. In earlier versions this was " +"only done with B<--force>." +msgstr "" +"Compresser ou décompresser même si l'entrée est un lien symbolique vers un " +"fichier normal, a plus qu'un lien physique, ou a le bit setuid, setgid ou " +"sticky défini. Les bits setuid, setgid et sticky bits ne sont pas copiés " +"dans le fichier cible." + +#. type: TP +#: ../src/xz/xz.1:417 +#, no-wrap +msgid "B<-f>, B<--force>" +msgstr "B<-f>, B<--force>" + +#. type: Plain text +#: ../src/xz/xz.1:420 +msgid "This option has several effects:" +msgstr "Cette option a plusieurs effets :" + +#. type: Plain text +#: ../src/xz/xz.1:424 +msgid "" +"If the target file already exists, delete it before compressing or " +"decompressing." +msgstr "" +"Si le fichier cible existe déjà, l'effacer avant de compresser ou " +"décompresser." + +#. type: Plain text +#: ../src/xz/xz.1:431 +msgid "" +"Compress or decompress even if the input is a symbolic link to a regular " +"file, has more than one hard link, or has the setuid, setgid, or sticky bit " +"set. The setuid, setgid, and sticky bits are not copied to the target file." +msgstr "" +"Compresser ou décompresser même si l'entrée est un lien symbolique vers un " +"fichier normal, a plus qu'un lien physique, ou a le bit setuid, setgid ou " +"sticky défini. Les bits setuid, setgid et sticky bits ne sont pas copiés " +"dans le fichier cible." + +#. type: Plain text +#: ../src/xz/xz.1:456 +msgid "" +"When used with B<--decompress> B<--stdout> and B cannot recognize the " +"type of the source file, copy the source file as is to standard output. " +"This allows B B<--force> to be used like B(1) for files that " +"have not been compressed with B. Note that in future, B might " +"support new compressed file formats, which may make B decompress more " +"types of files instead of copying them as is to standard output. B<--" +"format=>I can be used to restrict B to decompress only a single " +"file format." +msgstr "" +"Lorsque B est utilisé avec B<--decompress> B<--stdout> et qu'il ne peut " +"pas reconnaitre le type du fichier source, copier le fichier source tel quel " +"dans la sortie standard. Celà permet à B B<--force> d'être utilisé " +"comme B(1) pour les fichiers qui n'ont pas été compressé avec B. " +"Remarquez que dans le futur, B devrait prendre en charge de nouveaux " +"formats de fichiers compressés, ce qui permettra à B de décompresser " +"plus de types de fichiers au lieu de les copier tels quels dans la sortie " +"standard. B<--format=>I peut être utilisé pour contraindre B à " +"décompresser seulement un format de fichier." + +#. type: TP +#: ../src/xz/xz.1:457 ../src/xzdec/xzdec.1:76 +#, no-wrap +msgid "B<-c>, B<--stdout>, B<--to-stdout>" +msgstr "B<-c>, B<--stdout>, B<--to-stdout>" + +#. type: Plain text +#: ../src/xz/xz.1:463 +msgid "" +"Write the compressed or decompressed data to standard output instead of a " +"file. This implies B<--keep>." +msgstr "" +"Écrire les données compressées ou décompressées sur la sortie standard " +"plutôt que dans un fichier. Cela necessite B<--keep>." + +#. type: TP +#: ../src/xz/xz.1:463 +#, no-wrap +msgid "B<--single-stream>" +msgstr "B<--single-stream>" + +#. type: Plain text +#: ../src/xz/xz.1:472 +msgid "" +"Decompress only the first B<.xz> stream, and silently ignore possible " +"remaining input data following the stream. Normally such trailing garbage " +"makes B display an error." +msgstr "" +"Décompresser seulement le premier flux B<.xz> et ignorer silencieusement les " +"possibles données d'entrée résiduelles qui suivent le flux. Normalement ces " +"déchets excédentaires provoquent l'affichage d'une erreur par B." + +#. type: Plain text +#: ../src/xz/xz.1:481 +msgid "" +"B never decompresses more than one stream from B<.lzma> files or raw " +"streams, but this option still makes B ignore the possible trailing data " +"after the B<.lzma> file or raw stream." +msgstr "" +"B ne décompresse jamais plus d'un flux à partir de fichiers B<.lzma> ou " +"de flux bruts, mais cette option fait aussi que B ignorera les données " +"résiduelles après le fichier B<.lzma> ou le flux brut." + +#. type: Plain text +#: ../src/xz/xz.1:486 +msgid "" +"This option has no effect if the operation mode is not B<--decompress> or " +"B<--test>." +msgstr "" +"Cette option n'a aucun effet si le mode d'opération n'est pas B<--" +"decompress> ou B<--test>." + +#. type: TP +#: ../src/xz/xz.1:486 +#, no-wrap +msgid "B<--no-sparse>" +msgstr "B<--no-sparse>" + +#. type: Plain text +#: ../src/xz/xz.1:498 +msgid "" +"Disable creation of sparse files. By default, if decompressing into a " +"regular file, B tries to make the file sparse if the decompressed data " +"contains long sequences of binary zeros. It also works when writing to " +"standard output as long as standard output is connected to a regular file " +"and certain additional conditions are met to make it safe. Creating sparse " +"files may save disk space and speed up the decompression by reducing the " +"amount of disk I/O." +msgstr "" +"Désactiver la création de fichiers peu denses. Par défaut, lors de la " +"décompression en un fichier normal, B essaie d'en faire un fichier creux " +"si les données décompressées contiennent de longues séquences de zéros " +"binaires. Cela fonctionne aussi lors de l'écriture sur la sortie standard " +"aussi longtemps que la sortie standard est connectée à un fichier normal et " +"que certaines conditions supplémentaires sont satisfaites pour le faire de " +"manière sécurisée. Créer des fichiers creux peut épargner de l'espace disque " +"et accélérer la décompression en réduisant la quantité d'entrées/sorties sur " +"le disque." + +#. type: TP +#: ../src/xz/xz.1:498 +#, no-wrap +msgid "B<-S> I<.suf>, B<--suffix=>I<.suf>" +msgstr "B<-S> I<.suf>, B<--suffix=>I<.suf>" + +#. type: Plain text +#: ../src/xz/xz.1:510 +msgid "" +"When compressing, use I<.suf> as the suffix for the target file instead of " +"B<.xz> or B<.lzma>. If not writing to standard output and the source file " +"already has the suffix I<.suf>, a warning is displayed and the file is " +"skipped." +msgstr "" +"Lors de la compression, utiliser B<.suf> comme suffixe du fichier cible au " +"lieu de B<.xz> ou B<.lzma>. Si B n'écrit pas sur la sortie standard et " +"si le fichier source a déja le suffixe B<.suf>, un avertissement est affiché " +"et le fichier est ignoré." + +#. type: Plain text +#: ../src/xz/xz.1:524 +#, fuzzy +#| msgid "" +#| "When decompressing, recognize files with the suffix I<.suf> in addition " +#| "to files with the B<.xz>, B<.txz>, B<.lzma>, or B<.tlz> suffix. If the " +#| "source file has the suffix I<.suf>, the suffix is removed to get the " +#| "target filename." +msgid "" +"When decompressing, recognize files with the suffix I<.suf> in addition to " +"files with the B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz> suffix. If the " +"source file has the suffix I<.suf>, the suffix is removed to get the target " +"filename." +msgstr "" +"Lors de la décompression, reconnaître les fichiers avec le suffixe B<.suf> " +"en complément des fichiers avec le suffixe B<.xz>, B<.txz>, B<.lzma> ou B<." +"tlz>. Si le fichier source a le suffixe B<.suf>, le suffixe est enlevé pour " +"obtenir le nom de fichier cible." + +#. type: Plain text +#: ../src/xz/xz.1:530 +msgid "" +"When compressing or decompressing raw streams (B<--format=raw>), the suffix " +"must always be specified unless writing to standard output, because there is " +"no default suffix for raw streams." +msgstr "" +"Lors de la compression ou décompression de flux bruts (B<--fomat=raw>), le " +"suffixe doit toujours être spécifié à moins d'écrire sur la sortie standard, " +"car il n'y a pas de suffixe par défaut pour les flux bruts." + +#. type: TP +#: ../src/xz/xz.1:530 +#, no-wrap +msgid "B<--files>[B<=>I]" +msgstr "B<--files>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:544 +msgid "" +"Read the filenames to process from I; if I is omitted, filenames " +"are read from standard input. Filenames must be terminated with the newline " +"character. A dash (B<->) is taken as a regular filename; it doesn't mean " +"standard input. If filenames are given also as command line arguments, they " +"are processed before the filenames read from I." +msgstr "" +"Lire les noms de fichier à traiter depuis I ; si I est " +"omis , les noms de fichier sont lus sur l'entrée standard. Les noms de " +"fichier doivent se terminer avec le caractère de nouvelle ligne. Un tiret " +"(B<->) est considéré comme un nom de fichier normal ; ce qui ne signifie pas " +"entrée standard. Si les noms de fichier sont aussi donnés comme arguments de " +"ligne de commande, ils sont traités avant les noms de fichier lus depuis " +"I." + +#. type: TP +#: ../src/xz/xz.1:544 +#, no-wrap +msgid "B<--files0>[B<=>I]" +msgstr "B<--files0>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:548 +msgid "" +"This is identical to B<--files>[B<=>I] except that each filename must " +"be terminated with the null character." +msgstr "" +"Cela est identique à B<--files>[B<=>I] sauf que chaque nom de " +"fichier doit se terminer par le caractère null." + +#. type: SS +#: ../src/xz/xz.1:549 +#, no-wrap +msgid "Basic file format and compression options" +msgstr "Format de fichier basique et options de compression" + +#. type: TP +#: ../src/xz/xz.1:550 +#, no-wrap +msgid "B<-F> I, B<--format=>I" +msgstr "B<-F> I, B<--format=>I" + +#. type: Plain text +#: ../src/xz/xz.1:555 +msgid "Specify the file I to compress or decompress:" +msgstr "Indiquer le I de fichier à compresser ou décompresser :" + +#. type: TP +#: ../src/xz/xz.1:556 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:568 +msgid "" +"This is the default. When compressing, B is equivalent to B. " +"When decompressing, the format of the input file is automatically detected. " +"Note that raw streams (created with B<--format=raw>) cannot be auto-" +"detected." +msgstr "" +"C'est celui par défaut. Lors de la compression, B est équivalent à " +"B. Lors de la décompression, le format du fichier en entrée est détecté " +"automatiquement. Notez que les flux bruts (créés avec B<--format=raw>) ne " +"peuvent pas être détectés automatiquement." + +#. type: TP +#: ../src/xz/xz.1:568 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:575 +msgid "" +"Compress to the B<.xz> file format, or accept only B<.xz> files when " +"decompressing." +msgstr "" +"Compresser dans le format de fichier B<.xz> ou n'accepter que les fichiers " +"B<.xz> à décompresser." + +#. type: TP +#: ../src/xz/xz.1:575 +#, no-wrap +msgid "B, B" +msgstr "B, B" + +#. type: Plain text +#: ../src/xz/xz.1:585 +msgid "" +"Compress to the legacy B<.lzma> file format, or accept only B<.lzma> files " +"when decompressing. The alternative name B is provided for backwards " +"compatibility with LZMA Utils." +msgstr "" +"Compresser au format de fichier B<.lzma> historique, ou n'accepter que les " +"fichiers B<.lzma> lors de la décompression. Le nom alternatif B est " +"fourni pour la rétrocompatibilité avec les utilitaires LZMA." + +#. type: TP +#: ../src/xz/xz.1:585 +#, fuzzy, no-wrap +#| msgid "B ..." +msgid "B" +msgstr "B ..." + +#. type: Plain text +#: ../src/xz/xz.1:591 +msgid "" +"Accept only B<.lz> files when decompressing. Compression is not supported." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:604 +msgid "" +"The B<.lz> format version 0 and the unextended version 1 are supported. " +"Version 0 files were produced by B 1.3 and older. Such files aren't " +"common but may be found from file archives as a few source packages were " +"released in this format. People might have old personal files in this " +"format too. Decompression support for the format version 0 was removed in " +"B 1.18." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:613 +msgid "" +"B 1.4 and later create files in the format version 1. The sync flush " +"marker extension to the format version 1 was added in B 1.6. This " +"extension is rarely used and isn't supported by B (diagnosed as corrupt " +"input)." +msgstr "" + +#. type: TP +#: ../src/xz/xz.1:613 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:621 +msgid "" +"Compress or uncompress a raw stream (no headers). This is meant for " +"advanced users only. To decode raw streams, you need use B<--format=raw> " +"and explicitly specify the filter chain, which normally would have been " +"stored in the container headers." +msgstr "" +"Compresser ou décompresser un flux brut (sans en-têtes). Cela est réservé " +"seulement aux utilisateurs aguerris. Pour décoder des flux bruts, vous devez " +"utiliser B<--format=raw> et spécifier explicitement la chaîne de filtre, qui " +"normalement aurait du être stockée dans les en-têtes du conteneur." + +#. type: TP +#: ../src/xz/xz.1:622 +#, no-wrap +msgid "B<-C> I, B<--check=>I" +msgstr "B<-C> I, B<--check=>I" + +#. type: Plain text +#: ../src/xz/xz.1:637 +msgid "" +"Specify the type of the integrity check. The check is calculated from the " +"uncompressed data and stored in the B<.xz> file. This option has an effect " +"only when compressing into the B<.xz> format; the B<.lzma> format doesn't " +"support integrity checks. The integrity check (if any) is verified when the " +"B<.xz> file is decompressed." +msgstr "" +"Spécifier le type d'intégrité à vérifier. La vérification est calculée à " +"partir des données non-compressées et stockées dans le fichier B<.xz>. Cette " +"option n'a effet que si la compression a été faite dans le format B<.xz> ; " +"le format B<.lzma> ne gère pas les vérifications d'intégrité. Le contrôle " +"d'intégrité (s'il y en a) est vérifié lorsque le fichier B<.xz> est " +"décompressé." + +#. type: Plain text +#: ../src/xz/xz.1:641 +msgid "Supported I types:" +msgstr "Types de I pris en charge :" + +#. type: TP +#: ../src/xz/xz.1:642 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:648 +msgid "" +"Don't calculate an integrity check at all. This is usually a bad idea. " +"This can be useful when integrity of the data is verified by other means " +"anyway." +msgstr "" +"Ne pas calculer de vérification d'intégrité du tout. C'est généralement une " +"mauvaise idée. Cela peut être utile lorsque l'intégrité des données est " +"vérifiée de toute façon par d'autres manières." + +#. type: TP +#: ../src/xz/xz.1:648 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:651 +msgid "Calculate CRC32 using the polynomial from IEEE-802.3 (Ethernet)." +msgstr "Calculer CRC32 en utilisant le polynôme de IEEE-802.3 (Ethernet)." + +#. type: TP +#: ../src/xz/xz.1:651 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:656 +msgid "" +"Calculate CRC64 using the polynomial from ECMA-182. This is the default, " +"since it is slightly better than CRC32 at detecting damaged files and the " +"speed difference is negligible." +msgstr "" +"Calculer CRC64 en utilisant le polynôme de ECMA-182. C'est la manière " +"utilisée par défaut, car c'est légèrement mieux que CRC32 pour détecter les " +"fichiers endommagés et la différence de vitesse est négligeable." + +#. type: TP +#: ../src/xz/xz.1:656 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:660 +msgid "Calculate SHA-256. This is somewhat slower than CRC32 and CRC64." +msgstr "Calculer SHA-256. C'est quelque peu plus lent que CRC32 et CRC64." + +#. type: Plain text +#: ../src/xz/xz.1:666 +msgid "" +"Integrity of the B<.xz> headers is always verified with CRC32. It is not " +"possible to change or disable it." +msgstr "" +"L'intégrité des en-têtes B<.xz> est toujours vérifiée avec CRC32. Il n'est " +"pas possible de le changer ou de le désactiver." + +#. type: TP +#: ../src/xz/xz.1:666 +#, no-wrap +msgid "B<--ignore-check>" +msgstr "B<--ignore-check>" + +#. type: Plain text +#: ../src/xz/xz.1:672 +msgid "" +"Don't verify the integrity check of the compressed data when decompressing. " +"The CRC32 values in the B<.xz> headers will still be verified normally." +msgstr "" +"Ne pas contrôler la vérification d'intégrité des données lors de la " +"décompression. Les valeurs CRC32 dans les en-têtes B<.xz> seront normalement " +"toujours vérifiées." + +#. type: Plain text +#: ../src/xz/xz.1:675 +msgid "" +"B Possible " +"reasons to use this option:" +msgstr "" +"B Les " +"raisons possibles pour utiliser cette option :" + +#. type: Plain text +#: ../src/xz/xz.1:678 +msgid "Trying to recover data from a corrupt .xz file." +msgstr "Essayer de récupérer des données d'un fichier .xz corrompu." + +#. type: Plain text +#: ../src/xz/xz.1:684 +msgid "" +"Speeding up decompression. This matters mostly with SHA-256 or with files " +"that have compressed extremely well. It's recommended to not use this " +"option for this purpose unless the file integrity is verified externally in " +"some other way." +msgstr "" +"Accélérer la décompression. Cela importe surtout avec SHA-256 ou avec les " +"fichiers qui ont été compressés extrêmement bien. Il est recommandé de ne " +"pas utiliser cette option dans ce but à moins que l'intégrité du fichier ne " +"soit vérifiée extérieurement d'une autre manière." + +#. type: TP +#: ../src/xz/xz.1:685 +#, no-wrap +msgid "B<-0> ... B<-9>" +msgstr "B<-0> ... B<-9>" + +#. type: Plain text +#: ../src/xz/xz.1:694 +msgid "" +"Select a compression preset level. The default is B<-6>. If multiple " +"preset levels are specified, the last one takes effect. If a custom filter " +"chain was already specified, setting a compression preset level clears the " +"custom filter chain." +msgstr "" +"Choisir un niveau de compression prédéfini. La valeur par défaut est B<6>. " +"Si plusieurs niveaux de préréglage sont spécifiés, c'est le dernier qui sera " +"pris en compte. Si une chaîne de filtres personnalisée a déjà été choisie, " +"définir un niveau de compression préréglé efface la chaîne de filtres " +"personnalisée." + +#. type: Plain text +#: ../src/xz/xz.1:709 +msgid "" +"The differences between the presets are more significant than with " +"B(1) and B(1). The selected compression settings determine " +"the memory requirements of the decompressor, thus using a too high preset " +"level might make it painful to decompress the file on an old system with " +"little RAM. Specifically, B like it often is with B(1) and B(1)." +msgstr "" +"Les différences entre les préréglages sont plus significatives qu'avec " +"B(1) et B(1). les réglages de compression sélectionnés " +"déterminent les exigences en mémoire pour la décompression, ainsi, utiliser " +"un niveau de préréglage trop élevé peut rendre difficile à décompresser un " +"fichier sur un vieux système avec peu de RAM. Clairement, B comme ça l'est souvent avec " +"B(1) et B(1)." + +#. type: TP +#: ../src/xz/xz.1:710 +#, no-wrap +msgid "B<-0> ... B<-3>" +msgstr "B<-0> ... B<-3>" + +#. type: Plain text +#: ../src/xz/xz.1:722 +msgid "" +"These are somewhat fast presets. B<-0> is sometimes faster than B " +"while compressing much better. The higher ones often have speed comparable " +"to B(1) with comparable or better compression ratio, although the " +"results depend a lot on the type of data being compressed." +msgstr "" +"Ce sont des préréglages relativement rapides. B<0> est parfois plus rapide " +"que B tout en compressant bien mieux. Les réglages plus élevés ont " +"souvent une rapidité comparable à celle de B(1) avec un taux de " +"compression comparable ou meilleur, même si les résultats dépendent beaucoup " +"du genre de données compressées." + +#. type: TP +#: ../src/xz/xz.1:722 +#, no-wrap +msgid "B<-4> ... B<-6>" +msgstr "B<-4> ... B<-6>" + +#. type: Plain text +#: ../src/xz/xz.1:736 +#, fuzzy +#| msgid "" +#| "Good to very good compression while keeping decompressor memory usage " +#| "reasonable even for old systems. B<-6> is the default, which is usually " +#| "a good choice e.g. for distributing files that need to be decompressible " +#| "even on systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth " +#| "considering too. See B<--extreme>.)" +msgid "" +"Good to very good compression while keeping decompressor memory usage " +"reasonable even for old systems. B<-6> is the default, which is usually a " +"good choice for distributing files that need to be decompressible even on " +"systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth considering " +"too. See B<--extreme>.)" +msgstr "" +"Bonne à très bonne compression tout en gardant un usage raisonnable de la " +"mémoire lors de la décompression même pour de vieux systèmes. La valeur par " +"défaut est B<-6>, ce qui est habituellement un bon choix (par exemple pour " +"distribuer des fichiers nécessitants d'être décompressibles même sur de " +"vieux systèmes avec seulement 16\\Mio de RAM). (Il peut aussi être " +"intéressant d'utiliser B<-5e> ou B<-6e>. Voir B<--extreme>.)" + +#. type: TP +#: ../src/xz/xz.1:736 +#, no-wrap +msgid "B<-7 ... -9>" +msgstr "B<-7 ... -9>" + +#. type: Plain text +#: ../src/xz/xz.1:743 +msgid "" +"These are like B<-6> but with higher compressor and decompressor memory " +"requirements. These are useful only when compressing files bigger than 8\\ " +"MiB, 16\\ MiB, and 32\\ MiB, respectively." +msgstr "" +"C'est comme B<-6> mais avec des besoins en mémoire plus élevés pour la " +"compression et la décompression. Ce n'est utile que lorsque les fichiers " +"sont plus gros que 8\\ Mio, 16\\ Mio et 32\\ Mio respectivement." + +#. type: Plain text +#: ../src/xz/xz.1:751 +msgid "" +"On the same hardware, the decompression speed is approximately a constant " +"number of bytes of compressed data per second. In other words, the better " +"the compression, the faster the decompression will usually be. This also " +"means that the amount of uncompressed output produced per second can vary a " +"lot." +msgstr "" +"Sur le même matériel, la vitesse de décompression est sensiblement un nombre " +"constant d'octets de données compressées par seconde. En d'autres termes, " +"meilleure est la compression, plus rapide sera en général la décompression. " +"Cela signifie aussi que la quantité de sortie non compressée produite par " +"seconde peut varier beaucoup." + +#. type: Plain text +#: ../src/xz/xz.1:753 +msgid "The following table summarises the features of the presets:" +msgstr "Le tableau suivant résume les caractéristiques des préréglages :" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "Preset" +msgstr "Préréglage" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DictSize" +msgstr "DictSize" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "CompCPU" +msgstr "CompCPU" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "CompMem" +msgstr "CompMem" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DecMem" +msgstr "DecMem" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#: ../src/xz/xz.1:2840 +#, no-wrap +msgid "-0" +msgstr "-0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:842 ../src/xz/xz.1:2450 +#, no-wrap +msgid "256 KiB" +msgstr "256 KiB" + +#. type: TP +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2840 ../src/scripts/xzgrep.1:82 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:763 ../src/xz/xz.1:844 ../src/xz/xz.1:2475 +#, no-wrap +msgid "3 MiB" +msgstr "3 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:762 ../src/xz/xz.1:842 ../src/xz/xz.1:843 +#: ../src/xz/xz.1:2451 ../src/xz/xz.1:2452 ../src/xz/xz.1:2454 +#, no-wrap +msgid "1 MiB" +msgstr "1 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:2451 ../src/xz/xz.1:2476 +#: ../src/xz/xz.1:2841 +#, no-wrap +msgid "-1" +msgstr "-1" + +#. type: TP +#: ../src/xz/xz.1:762 ../src/xz/xz.1:1758 ../src/xz/xz.1:2841 +#: ../src/scripts/xzgrep.1:86 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2476 +#, no-wrap +msgid "9 MiB" +msgstr "9 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:763 ../src/xz/xz.1:843 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2452 ../src/xz/xz.1:2455 ../src/xz/xz.1:2476 +#, no-wrap +msgid "2 MiB" +msgstr "2 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:2452 ../src/xz/xz.1:2477 +#: ../src/xz/xz.1:2842 +#, no-wrap +msgid "-2" +msgstr "-2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:1760 ../src/xz/xz.1:2842 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2477 +#, no-wrap +msgid "17 MiB" +msgstr "17 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2453 ../src/xz/xz.1:2478 +#: ../src/xz/xz.1:2843 +#, no-wrap +msgid "-3" +msgstr "-3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:842 ../src/xz/xz.1:845 +#: ../src/xz/xz.1:846 ../src/xz/xz.1:2453 ../src/xz/xz.1:2454 +#: ../src/xz/xz.1:2456 +#, no-wrap +msgid "4 MiB" +msgstr "4 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2843 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2458 +#: ../src/xz/xz.1:2459 ../src/xz/xz.1:2478 +#, no-wrap +msgid "32 MiB" +msgstr "32 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#, no-wrap +msgid "5 MiB" +msgstr "5 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:2454 ../src/xz/xz.1:2479 +#: ../src/xz/xz.1:2844 +#, no-wrap +msgid "-4" +msgstr "-4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:1759 ../src/xz/xz.1:1761 +#: ../src/xz/xz.1:1762 ../src/xz/xz.1:1764 ../src/xz/xz.1:2844 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 ../src/xz/xz.1:2479 +#, no-wrap +msgid "48 MiB" +msgstr "48 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2455 ../src/xz/xz.1:2480 +#: ../src/xz/xz.1:2845 +#, no-wrap +msgid "-5" +msgstr "-5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2455 ../src/xz/xz.1:2456 ../src/xz/xz.1:2457 +#, no-wrap +msgid "8 MiB" +msgstr "8 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2845 +#, no-wrap +msgid "5" +msgstr "5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2480 ../src/xz/xz.1:2481 +#, no-wrap +msgid "94 MiB" +msgstr "94 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:2456 ../src/xz/xz.1:2481 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "-6" +msgstr "-6" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:768 ../src/xz/xz.1:769 ../src/xz/xz.1:770 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "6" +msgstr "6" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:2457 ../src/xz/xz.1:2482 +#, no-wrap +msgid "-7" +msgstr "-7" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2457 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2479 +#, no-wrap +msgid "16 MiB" +msgstr "16 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2482 +#, no-wrap +msgid "186 MiB" +msgstr "186 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:2458 ../src/xz/xz.1:2483 +#, no-wrap +msgid "-8" +msgstr "-8" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2483 +#, no-wrap +msgid "370 MiB" +msgstr "370 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#, no-wrap +msgid "33 MiB" +msgstr "33 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:2459 ../src/xz/xz.1:2484 +#, no-wrap +msgid "-9" +msgstr "-9" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2459 +#, no-wrap +msgid "64 MiB" +msgstr "64 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2484 +#, no-wrap +msgid "674 MiB" +msgstr "674 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 +#, no-wrap +msgid "65 MiB" +msgstr "65 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:776 +msgid "Column descriptions:" +msgstr "Descriptions des colonnes :" + +#. type: Plain text +#: ../src/xz/xz.1:788 +msgid "" +"DictSize is the LZMA2 dictionary size. It is waste of memory to use a " +"dictionary bigger than the size of the uncompressed file. This is why it is " +"good to avoid using the presets B<-7> ... B<-9> when there's no real need " +"for them. At B<-6> and lower, the amount of memory wasted is usually low " +"enough to not matter." +msgstr "" +"DictSize est la taille du dictionnaire de LZMA2. Utiliser un dictionnaire " +"plus gros que la taille du fichier non compressé est un gaspillage de " +"mémoire. C'est pourquoi il est bon d'éviter d'utiliser les préréglages de " +"B<-7> à B<-9> lorsqu'il n'y en a pas vraiment besoin. A B<-6> et plus bas, " +"la quantité de mémoire gaspillée est généralement assez basse pour ne pas " +"être un problème." + +#. type: Plain text +#: ../src/xz/xz.1:797 +msgid "" +"CompCPU is a simplified representation of the LZMA2 settings that affect " +"compression speed. The dictionary size affects speed too, so while CompCPU " +"is the same for levels B<-6> ... B<-9>, higher levels still tend to be a " +"little slower. To get even slower and thus possibly better compression, see " +"B<--extreme>." +msgstr "" +"CompCPU est une représentation des préréglages de LZMA2 qui affectent la " +"vitesse de compression. La taille du dictionnaire aussi affecte la vitesse, " +"alors comme CompCPU est le même pour les niveaux de B<-6> à B<-9>, les plus " +"haut niveaux tendent à être un peu moins rapides. Pour être encore moins " +"rapide et du coup obtenir peut être une meilleure compression, consultez B<--" +"extreme>." + +#. type: Plain text +#: ../src/xz/xz.1:805 +msgid "" +"CompMem contains the compressor memory requirements in the single-threaded " +"mode. It may vary slightly between B versions. Memory requirements of " +"some of the future multithreaded modes may be dramatically higher than that " +"of the single-threaded mode." +msgstr "" +"CompMem contient les besoins en mémoire du compresseur en mode mono-thread . " +"Cela devrait à peine varier entre les versions de B. Les besoins en " +"mémoire de quelques uns des futurs modes multi-thread devraient sensiblement " +"augmenter par rapport au mode mono-thread." + +#. type: Plain text +#: ../src/xz/xz.1:812 +msgid "" +"DecMem contains the decompressor memory requirements. That is, the " +"compression settings determine the memory requirements of the decompressor. " +"The exact decompressor memory usage is slightly more than the LZMA2 " +"dictionary size, but the values in the table have been rounded up to the " +"next full MiB." +msgstr "" +"DecMem contient les besoins en mémoire du décompresseur. Ce sont les " +"réglages de la compression qui déterminent les besoins en mémoire de la " +"décompression. L'exacte utilisation de la mémoire est légèrement supérieure " +"à la taille du dictionnaire LZMA2, mais les valeurs dans la table ont été " +"arrondies au prochain Mio supérieur." + +#. type: TP +#: ../src/xz/xz.1:813 +#, no-wrap +msgid "B<-e>, B<--extreme>" +msgstr "B<-e>, B<--extreme>" + +#. type: Plain text +#: ../src/xz/xz.1:822 +msgid "" +"Use a slower variant of the selected compression preset level (B<-0> ... " +"B<-9>) to hopefully get a little bit better compression ratio, but with bad " +"luck this can also make it worse. Decompressor memory usage is not " +"affected, but compressor memory usage increases a little at preset levels " +"B<-0> ... B<-3>." +msgstr "" +"Utilisez un variant plus lent que les préréglages (B<-0> à B<-9>) pour " +"espérer avoir un taux de compression légèrement meilleur, mais en cas de " +"malchance cela peut être pire. L'utilisation mémoire du décompresseur n'est " +"pas affectée, mais l'utilisation mémoire du compresseur augmente un peu aux " +"niveaux de préréglages de B<-0> à B<-3>." + +#. type: Plain text +#: ../src/xz/xz.1:834 +msgid "" +"Since there are two presets with dictionary sizes 4\\ MiB and 8\\ MiB, the " +"presets B<-3e> and B<-5e> use slightly faster settings (lower CompCPU) than " +"B<-4e> and B<-6e>, respectively. That way no two presets are identical." +msgstr "" +"Depuis qu'il y a deux préréglages avec des tailles de dictionnaire de 4\\ " +"Mio et 8 \\Mio, les préréglages B<-3e> et B<-5e> utilisent des réglages " +"légèrement plus rapides que B<-4e> et B<-6e>, respectivement. De cette " +"manière, il n'y a pas deux préréglages identiques." + +#. type: tbl table +#: ../src/xz/xz.1:842 +#, no-wrap +msgid "-0e" +msgstr "-0e" + +#. type: tbl table +#: ../src/xz/xz.1:842 ../src/xz/xz.1:843 ../src/xz/xz.1:844 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:849 ../src/xz/xz.1:850 ../src/xz/xz.1:851 +#: ../src/xz/xz.1:2848 +#, no-wrap +msgid "8" +msgstr "8" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "-1e" +msgstr "-1e" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "13 MiB" +msgstr "13 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "-2e" +msgstr "-2e" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "25 MiB" +msgstr "25 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:845 +#, no-wrap +msgid "-3e" +msgstr "-3e" + +#. type: tbl table +#: ../src/xz/xz.1:845 ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "7" +msgstr "7" + +#. type: tbl table +#: ../src/xz/xz.1:846 +#, no-wrap +msgid "-4e" +msgstr "-4e" + +#. type: tbl table +#: ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "-5e" +msgstr "-5e" + +#. type: tbl table +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2848 +#, no-wrap +msgid "-6e" +msgstr "-6e" + +#. type: tbl table +#: ../src/xz/xz.1:849 +#, no-wrap +msgid "-7e" +msgstr "-7e" + +#. type: tbl table +#: ../src/xz/xz.1:850 +#, no-wrap +msgid "-8e" +msgstr "-8e" + +#. type: tbl table +#: ../src/xz/xz.1:851 +#, no-wrap +msgid "-9e" +msgstr "-9e" + +#. type: Plain text +#: ../src/xz/xz.1:863 +msgid "" +"For example, there are a total of four presets that use 8\\ MiB dictionary, " +"whose order from the fastest to the slowest is B<-5>, B<-6>, B<-5e>, and " +"B<-6e>." +msgstr "" +"Par exemple, il y a un total de quatre préréglages qui utilisent un " +"dictionnaire de 8 Mio et qui sont dans l'ordre du plus rapide au plus lent : " +"B<-5>, B<-6>, B<-5e> et B<-6e>." + +#. type: TP +#: ../src/xz/xz.1:863 +#, no-wrap +msgid "B<--fast>" +msgstr "B<--fast>" + +#. type: TP +#: ../src/xz/xz.1:866 +#, no-wrap +msgid "B<--best>" +msgstr "B<--best>" + +#. type: Plain text +#: ../src/xz/xz.1:877 +msgid "" +"These are somewhat misleading aliases for B<-0> and B<-9>, respectively. " +"These are provided only for backwards compatibility with LZMA Utils. Avoid " +"using these options." +msgstr "" +"Il y a néanmoins des alias trompeurs pour B<-0> et B<-9>, respectivement. " +"Ils ne sont fournis que pour des besoins de rétro-compatibilité avec les " +"utilitaires LZMA. Evitez d'utiliser ces options." + +#. type: TP +#: ../src/xz/xz.1:877 +#, no-wrap +msgid "B<--block-size=>I" +msgstr "B<--block-size=>I" + +#. type: Plain text +#: ../src/xz/xz.1:890 +msgid "" +"When compressing to the B<.xz> format, split the input data into blocks of " +"I bytes. The blocks are compressed independently from each other, " +"which helps with multi-threading and makes limited random-access " +"decompression possible. This option is typically used to override the " +"default block size in multi-threaded mode, but this option can be used in " +"single-threaded mode too." +msgstr "" +"Lors de la compression dans le format B<.xz>, les données de l'entrée sont " +"réparties en blocs de I octets. Les blocs sont compressés " +"indépendamment les un des autres, ce qui aide avec le mode multithread " +"(multi-threading) et rend possible la décompression à accès aléatoire " +"limité. Cette option est typiquement utilisée pour outrepasser la taille de " +"bloc en mode multithread, mais cette option peut aussi être utilisée en mode " +"single-thread." + +#. type: Plain text +#: ../src/xz/xz.1:908 +#, fuzzy +#| msgid "" +#| "In multi-threaded mode about three times I bytes will be allocated " +#| "in each thread for buffering input and output. The default I is " +#| "three times the LZMA2 dictionary size or 1 MiB, whichever is more. " +#| "Typically a good value is 2-4 times the size of the LZMA2 dictionary or " +#| "at least 1 MiB. Using I less than the LZMA2 dictionary size is " +#| "waste of RAM because then the LZMA2 dictionary buffer will never get " +#| "fully used. The sizes of the blocks are stored in the block headers, " +#| "which a future version of B will use for multi-threaded decompression." +msgid "" +"In multi-threaded mode about three times I bytes will be allocated in " +"each thread for buffering input and output. The default I is three " +"times the LZMA2 dictionary size or 1 MiB, whichever is more. Typically a " +"good value is 2\\(en4 times the size of the LZMA2 dictionary or at least 1 " +"MiB. Using I less than the LZMA2 dictionary size is waste of RAM " +"because then the LZMA2 dictionary buffer will never get fully used. The " +"sizes of the blocks are stored in the block headers, which a future version " +"of B will use for multi-threaded decompression." +msgstr "" +"En mode multithread, environ trois fois la I octets seront alloués à " +"chaque thread pour mettre en mémoire tampon les entrées et sorties. Par " +"défaut, la I est trois fois la taille du dictionnaire LZMA2 ou 1 " +"Mio, en fonction de ce qui convient le mieux. Habituellement, une bonne " +"valeur est deux à quatre fois la taille du dictionnaire LZMA2 ou au moins 1 " +"Mio. Utiliser une I moindre que celle du dictionnaire LZMA2 est un " +"gaspillage de RAM car alors la mémoire tampon du dictionnaire LZMA2 ne sera " +"jamais entièrement utilisée. Les tailles des blocs sont stockées dans les en-" +"têtes de blocs, qui seront utilisés dans une future version de B pour la " +"décompression multithreadée." + +#. type: Plain text +#: ../src/xz/xz.1:917 +msgid "" +"In single-threaded mode no block splitting is done by default. Setting this " +"option doesn't affect memory usage. No size information is stored in block " +"headers, thus files created in single-threaded mode won't be identical to " +"files created in multi-threaded mode. The lack of size information also " +"means that a future version of B won't be able decompress the files in " +"multi-threaded mode." +msgstr "" +"Par défaut, il n'y a pas de répartition de bloc en mode mono-thread. Régler " +"cette option n'affecte pas l'utilisation de la mémoire. Aucune information " +"de taille n'est stockée dans l'en-tête de bloc, par conséquent les fichiers " +"créés en mode single-thread ne seront pas identiques aux fichiers créés en " +"mode multi-thread. Le manque d'information de taille signifie aussi qu'une " +"future version de B ne sera pas capable de décompresser les fichiers en " +"mode multi-thread." + +#. type: TP +#: ../src/xz/xz.1:917 +#, no-wrap +msgid "B<--block-list=>I" +msgstr "B<--block-list=>I" + +#. type: Plain text +#: ../src/xz/xz.1:923 +msgid "" +"When compressing to the B<.xz> format, start a new block after the given " +"intervals of uncompressed data." +msgstr "" +"Lors de la compression dans le format B<.xz>, commencer un nouveau bloc " +"après les intervalles donnés des données non compressées." + +#. type: Plain text +#: ../src/xz/xz.1:929 +msgid "" +"The uncompressed I of the blocks are specified as a comma-separated " +"list. Omitting a size (two or more consecutive commas) is a shorthand to " +"use the size of the previous block." +msgstr "" +"Les I non-compressées des blocs sont spécifiées sous forme de liste " +"séparée par des virgules. Omettre une taille (deux ou plus virgules " +"consécutives) est un raccourci pour utiliser la taille du bloc précédent." + +#. type: Plain text +#: ../src/xz/xz.1:939 +msgid "" +"If the input file is bigger than the sum of I, the last value in " +"I is repeated until the end of the file. A special value of B<0> may " +"be used as the last value to indicate that the rest of the file should be " +"encoded as a single block." +msgstr "" +"Si le fichier en entrée est plus grand que la somme des I, la " +"dernière valeur est répétée jusqu'à la fin du fichier. Une valeur spéciale " +"de B<0> peut être utilisée comme étant la dernière valeur pour indiquer que " +"le reste du fichier devrait être encodé comme un simple bloc." + +#. type: Plain text +#: ../src/xz/xz.1:954 +msgid "" +"If one specifies I that exceed the encoder's block size (either the " +"default value in threaded mode or the value specified with B<--block-" +"size=>I), the encoder will create additional blocks while keeping the " +"boundaries specified in I. For example, if one specifies B<--block-" +"size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> and the input file " +"is 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10, and 1 " +"MiB." +msgstr "" +"Si on spécifie des I qui excèdent la taille du bloc de l'encodeur " +"(soit la valeur en mode threadé, soit la valeur spécifiée avec B<--block-" +"size=>I), l'encodeur créera des blocs supplémentaires tout en " +"gardant les limites indiquées dans I. Par exemple, si on indique " +"B<--block-size=10MiB>B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> et que le " +"fichier fait 80Mio, on aura 11 blocs de 5, 10, 8, 2, 10, 10, 4, 10, 10, et " +"1 Mio." + +#. type: Plain text +#: ../src/xz/xz.1:960 +msgid "" +"In multi-threaded mode the sizes of the blocks are stored in the block " +"headers. This isn't done in single-threaded mode, so the encoded output " +"won't be identical to that of the multi-threaded mode." +msgstr "" +"En mode multi-threadé les tailles de blocs sont stockées dans les en-têtes " +"du bloc. Cela ne se fait pas en mode mono-threadé, la sortie encodée ne sera " +"donc pas identique à celle faite en mode multi-threadé." + +#. type: TP +#: ../src/xz/xz.1:960 +#, no-wrap +msgid "B<--flush-timeout=>I" +msgstr "B<--flush-timeout=>I" + +#. type: Plain text +#: ../src/xz/xz.1:977 +msgid "" +"When compressing, if more than I milliseconds (a positive integer) " +"has passed since the previous flush and reading more input would block, all " +"the pending input data is flushed from the encoder and made available in the " +"output stream. This can be useful if B is used to compress data that is " +"streamed over a network. Small I values make the data available at " +"the receiving end with a small delay, but large I values give " +"better compression ratio." +msgstr "" +"Lors de la compression, si plus que I millisecondes (un " +"entier positif) se sont écoulées depuis le précédent vidage et que lire plus " +"de données bloquerait, toutes les données d'entrée en attente sont vidées de " +"l'encodeur et mises à disposition dans le flux de sortie. Cela peut être " +"utile si B est utilisé pour compresser les données qui sont diffusées " +"sur un réseau. Des petites valeurs de I rendent les données " +"disponibles à l'extrémité réceptrice avec un léger retard, mais les grandes " +"valeurs de I donnent un meilleur taux de compression." + +#. type: Plain text +#: ../src/xz/xz.1:985 +msgid "" +"This feature is disabled by default. If this option is specified more than " +"once, the last one takes effect. The special I value of B<0> can " +"be used to explicitly disable this feature." +msgstr "" +"Cette option est désactivée par défaut. Si cette option est indiquée plus " +"d'une fois, la dernière prend effet. La valeur spéciale de " +"I de B<0> peut être utilisée pour explicitement désactiver " +"cette option." + +#. type: Plain text +#: ../src/xz/xz.1:987 +msgid "This feature is not available on non-POSIX systems." +msgstr "" +"Cette option n'est pas disponible sur les systèmes qui ne sont pas POSIX." + +#. FIXME +#. type: Plain text +#: ../src/xz/xz.1:995 +msgid "" +"B Currently B is unsuitable for " +"decompressing the stream in real time due to how B does buffering." +msgstr "" +"B Actuellement, B ne convient " +"pas pour décompresser le flux en temps réel en raison de la façon dont B " +"effectue la mise en mémoire tampon." + +#. type: TP +#: ../src/xz/xz.1:995 +#, no-wrap +msgid "B<--memlimit-compress=>I" +msgstr "B<--memlimit-compress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1000 +msgid "" +"Set a memory usage limit for compression. If this option is specified " +"multiple times, the last one takes effect." +msgstr "" +"Indiquer une limite d'utilisation de la mémoire pour la compression. Si " +"cette option est indiquée plusieurs fois, c'est la dernière qui est prise en " +"compte." + +#. type: Plain text +#: ../src/xz/xz.1:1013 +#, fuzzy +#| msgid "" +#| "If the compression settings exceed the I, B will adjust the " +#| "settings downwards so that the limit is no longer exceeded and display a " +#| "notice that automatic adjustment was done. Such adjustments are not made " +#| "when compressing with B<--format=raw> or if B<--no-adjust> has been " +#| "specified. In those cases, an error is displayed and B will exit " +#| "with exit status 1." +msgid "" +"If the compression settings exceed the I, B will attempt to " +"adjust the settings downwards so that the limit is no longer exceeded and " +"display a notice that automatic adjustment was done. The adjustments are " +"done in this order: reducing the number of threads, switching to single-" +"threaded mode if even one thread in multi-threaded mode exceeds the " +"I, and finally reducing the LZMA2 dictionary size." +msgstr "" +"Si les paramètres de compression dépassent la I, B ajustera les " +"paramètres à la baisse pour que la limite ne soit plus dépassée et affichera " +"un avis indiquant que l'ajustement automatique a été effectué. De tels " +"ajustements ne sont pas effectués lors de la compression avec B<--" +"format=raw> ou si B<--no-adjust> a été spécifié. Dans ces cas, une erreur " +"est affichée et B se termine avec l'état de sortie B<1>." + +#. type: Plain text +#: ../src/xz/xz.1:1021 +msgid "" +"When compressing with B<--format=raw> or if B<--no-adjust> has been " +"specified, only the number of threads may be reduced since it can be done " +"without affecting the compressed output." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1028 +msgid "" +"If the I cannot be met even with the adjustments described above, an " +"error is displayed and B will exit with exit status 1." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1032 +msgid "The I can be specified in multiple ways:" +msgstr "La I peut être indiquée de plusieurs façons :" + +#. type: Plain text +#: ../src/xz/xz.1:1042 +msgid "" +"The I can be an absolute value in bytes. Using an integer suffix " +"like B can be useful. Example: B<--memlimit-compress=80MiB>" +msgstr "" +"La I peut être une valeur absolue en octets. Utiliser un suffixe " +"d'entier comme B peut être utile. Exemple : B<--memlimit-compress=80MiB>" + +#. type: Plain text +#: ../src/xz/xz.1:1054 +msgid "" +"The I can be specified as a percentage of total physical memory " +"(RAM). This can be useful especially when setting the B " +"environment variable in a shell initialization script that is shared between " +"different computers. That way the limit is automatically bigger on systems " +"with more memory. Example: B<--memlimit-compress=70%>" +msgstr "" +"La I peut être indiquée sous forme d'un pourcentage de la mémoire " +"physique totale (RAM). Cela peut être particulièrement utile quand la " +"variable d'environnement B est indiquée dans un script " +"d'initialisation de l'interpréteur partagé entre différents ordinateurs. De " +"cette façon la limite est automatiquement plus grande sur les systèmes avec " +"plus de mémoire. Exemple : B<--memlimit=70%>" + +#. type: Plain text +#: ../src/xz/xz.1:1064 +#, fuzzy +#| msgid "" +#| "The I can be reset back to its default value by setting it to " +#| "B<0>. This is currently equivalent to setting the I to B (no " +#| "memory usage limit). Once multithreading support has been implemented, " +#| "there may be a difference between B<0> and B for the multithreaded " +#| "case, so it is recommended to use B<0> instead of B until the " +#| "details have been decided." +msgid "" +"The I can be reset back to its default value by setting it to B<0>. " +"This is currently equivalent to setting the I to B (no memory " +"usage limit)." +msgstr "" +"La I peut être réinitialisée à sa valeur par défaut en la réglant " +"sur B<0>. Cela équivaut actuellement à régler la I sur B " +"(aucune limite d'utilisation de la mémoire). Quand la prise en charge du " +"mode multi-thread (multi-threading) sera implémentée, il devrait y avoir une " +"différence entre B<0> et B en mode multithreadé, il est donc recommandé " +"d'utiliser B<0> au lieu de B tant que les détails n'ont pas été décidés." + +#. type: Plain text +#: ../src/xz/xz.1:1088 +#, fuzzy +#| msgid "" +#| "For 32-bit B there is a special case: if the I would be over " +#| "B<4020\\ MiB>, the I is set to B<4020\\ MiB>. (The values B<0> " +#| "and B aren't affected by this. A similar feature doesn't exist for " +#| "decompression.) This can be helpful when a 32-bit executable has access " +#| "to 4\\ GiB address space while hopefully doing no harm in other " +#| "situations." +msgid "" +"For 32-bit B there is a special case: if the I would be over " +"B<4020\\ MiB>, the I is set to B<4020\\ MiB>. On MIPS32 B<2000\\ " +"MiB> is used instead. (The values B<0> and B aren't affected by this. " +"A similar feature doesn't exist for decompression.) This can be helpful " +"when a 32-bit executable has access to 4\\ GiB address space (2 GiB on " +"MIPS32) while hopefully doing no harm in other situations." +msgstr "" +"Pour le B en 32 bits, il y a un cas particulier : si la I est " +"supérieure à B<4020\\Mio>, elle est rabaissée à B<4020\\Mio>. (Les valeurs " +"B<0> et B ne sont pas affectées par cela. Il n'y a pas d'option " +"similaire pour la décompression). Celà peut s'avérer utile lorsqu'un " +"exécutable 32-bits a accès à un espace d'adresse de 4\\ Gio sans s'avérer " +"néfaste dans les autres situations. " + +#. type: Plain text +#: ../src/xz/xz.1:1091 +msgid "See also the section B." +msgstr "Voir aussi la section B." + +#. type: TP +#: ../src/xz/xz.1:1091 +#, no-wrap +msgid "B<--memlimit-decompress=>I" +msgstr "B<--memlimit-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1105 +msgid "" +"Set a memory usage limit for decompression. This also affects the B<--list> " +"mode. If the operation is not possible without exceeding the I, " +"B will display an error and decompressing the file will fail. See B<--" +"memlimit-compress=>I for possible ways to specify the I." +msgstr "" +"Régler une limite d'utilisation de la mémoire pour la décompression. Cela a " +"un effet sur le mode B<--list>. Si l'opération n'est pas possible sans " +"dépasser la I, B affichera une erreur et la décompression " +"échouera. Voir B<--memlimit-compress=>I pour les manières possibles " +"d'indiquer la I." + +#. type: TP +#: ../src/xz/xz.1:1105 +#, fuzzy, no-wrap +#| msgid "B<--memlimit-decompress=>I" +msgid "B<--memlimit-mt-decompress=>I" +msgstr "B<--memlimit-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1127 +msgid "" +"Set a memory usage limit for multi-threaded decompression. This can only " +"affect the number of threads; this will never make B refuse to " +"decompress a file. If I is too low to allow any multi-threading, the " +"I is ignored and B will continue in single-threaded mode. Note " +"that if also B<--memlimit-decompress> is used, it will always apply to both " +"single-threaded and multi-threaded modes, and so the effective I for " +"multi-threading will never be higher than the limit set with B<--memlimit-" +"decompress>." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1134 +msgid "" +"In contrast to the other memory usage limit options, B<--memlimit-mt-" +"decompress=>I has a system-specific default I. B can be used to see the current value." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1150 +msgid "" +"This option and its default value exist because without any limit the " +"threaded decompressor could end up allocating an insane amount of memory " +"with some input files. If the default I is too low on your system, " +"feel free to increase the I but never set it to a value larger than " +"the amount of usable RAM as with appropriate input files B will attempt " +"to use that amount of memory even with a low number of threads. Running out " +"of memory or swapping will not improve decompression performance." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1162 +msgid "" +"See B<--memlimit-compress=>I for possible ways to specify the " +"I. Setting I to B<0> resets the I to the default " +"system-specific value." +msgstr "" + +#. type: TP +#: ../src/xz/xz.1:1163 +#, no-wrap +msgid "B<-M> I, B<--memlimit=>I, B<--memory=>I" +msgstr "B<-M> I, B<--memlimit=>I, B<--memory=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1169 +#, fuzzy +#| msgid "" +#| "This is equivalent to specifying B<--memlimit-compress=>IB<--" +#| "memlimit-decompress=>I." +msgid "" +"This is equivalent to specifying B<--memlimit-compress=>I B<--" +"memlimit-decompress=>I B<--memlimit-mt-decompress=>I." +msgstr "" +"C'est équivalent à indiquer B<--memlimit-compress=>IB<--memlimit-" +"decompress=>I." + +#. type: TP +#: ../src/xz/xz.1:1169 +#, no-wrap +msgid "B<--no-adjust>" +msgstr "B<--no-adjust>" + +#. type: Plain text +#: ../src/xz/xz.1:1179 +msgid "" +"Display an error and exit if the memory usage limit cannot be met without " +"adjusting settings that affect the compressed output. That is, this " +"prevents B from switching the encoder from multi-threaded mode to single-" +"threaded mode and from reducing the LZMA2 dictionary size. Even when this " +"option is used the number of threads may be reduced to meet the memory usage " +"limit as that won't affect the compressed output." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1182 +msgid "" +"Automatic adjusting is always disabled when creating raw streams (B<--" +"format=raw>)." +msgstr "" + +#. type: TP +#: ../src/xz/xz.1:1182 +#, no-wrap +msgid "B<-T> I, B<--threads=>I" +msgstr "B<-T> I, B<--threads=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1197 +#, fuzzy +#| msgid "" +#| "Specify the number of worker threads to use. Setting I to a " +#| "special value B<0> makes B use as many threads as there are CPU cores " +#| "on the system. The actual number of threads can be less than I " +#| "if the input file is not big enough for threading with the given settings " +#| "or if using more threads would exceed the memory usage limit." +msgid "" +"Specify the number of worker threads to use. Setting I to a " +"special value B<0> makes B use up to as many threads as the processor(s) " +"on the system support. The actual number of threads can be fewer than " +"I if the input file is not big enough for threading with the given " +"settings or if using more threads would exceed the memory usage limit." +msgstr "" +"Indiquer le nombre de threads à utiliser. Régler I à la valeur " +"spéciale B<0> fait que B utilisera autant de threads qu'il y a de cœurs " +"de CPU sur le système. Le nombre effectif de threads peut être moins que " +"I si le fichier en entrée n'est pas assez gros pour la threading " +"avec les réglages donnés ou si l'utilisation de plusieurs threads " +"dépasserait la limite d'utilisation mémoire." + +#. type: Plain text +#: ../src/xz/xz.1:1216 +msgid "" +"The single-threaded and multi-threaded compressors produce different " +"output. Single-threaded compressor will give the smallest file size but " +"only the output from the multi-threaded compressor can be decompressed using " +"multiple threads. Setting I to B<1> will use the single-threaded " +"mode. Setting I to any other value, including B<0>, will use the " +"multi-threaded compressor even if the system supports only one hardware " +"thread. (B 5.2.x used single-threaded mode in this situation.)" +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1235 +msgid "" +"To use multi-threaded mode with only one thread, set I to B<+1>. " +"The B<+> prefix has no effect with values other than B<1>. A memory usage " +"limit can still make B switch to single-threaded mode unless B<--no-" +"adjust> is used. Support for the B<+> prefix was added in B 5.4.0." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1250 +msgid "" +"If an automatic number of threads has been requested and no memory usage " +"limit has been specified, then a system-specific default soft limit will be " +"used to possibly limit the number of threads. It is a soft limit in sense " +"that it is ignored if the number of threads becomes one, thus a soft limit " +"will never stop B from compressing or decompressing. This default soft " +"limit will not make B switch from multi-threaded mode to single-threaded " +"mode. The active limits can be seen with B." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1257 +msgid "" +"Currently the only threading method is to split the input into blocks and " +"compress them independently from each other. The default block size depends " +"on the compression level and can be overridden with the B<--block-" +"size=>I option." +msgstr "" +"Actuellement, la seule méthode de gestion avec des threads consiste à " +"séparer l'entrée en blocs et de les compresser indépendamment les uns des " +"autres. La taille par défaut des blocs dépend du niveau de compression et " +"peut-être remplacée avec l'option B<--block-size=>I." + +#. type: Plain text +#: ../src/xz/xz.1:1265 +#, fuzzy +#| msgid "" +#| "Threaded decompression hasn't been implemented yet. It will only work on " +#| "files that contain multiple blocks with size information in block " +#| "headers. All files compressed in multi-threaded mode meet this " +#| "condition, but files compressed in single-threaded mode don't even if B<--" +#| "block-size=>I is used." +msgid "" +"Threaded decompression only works on files that contain multiple blocks with " +"size information in block headers. All large enough files compressed in " +"multi-threaded mode meet this condition, but files compressed in single-" +"threaded mode don't even if B<--block-size=>I has been used." +msgstr "" +"La décompression threadée n'a pas encore été implémentée. Cela ne " +"fonctionnera qu'avec des fichiers contenant de multiples blocs avec une " +"information sur la taille dans les en-têtes de bloc. Tous les fichiers " +"compressés en mode multithread sattisfont cette condition, mais pas les " +"fichiers compressés en mode single-thread même si l'option B<--block-" +"size=>I est utilisée." + +#. type: SS +#: ../src/xz/xz.1:1266 ../src/xz/xz.1:2819 +#, no-wrap +msgid "Custom compressor filter chains" +msgstr "Chaînes de filtres de compresseur personnalisées" + +#. type: Plain text +#: ../src/xz/xz.1:1282 +#, fuzzy +#| msgid "" +#| "A custom filter chain allows specifying the compression settings in " +#| "detail instead of relying on the settings associated to the presets. " +#| "When a custom filter chain is specified, preset options (B<-0> ... B<-9> " +#| "and B<--extreme>) earlier on the command line are forgotten. If a " +#| "preset option is specified after one or more custom filter chain options, " +#| "the new preset takes effect and the custom filter chain options specified " +#| "earlier are forgotten." +msgid "" +"A custom filter chain allows specifying the compression settings in detail " +"instead of relying on the settings associated to the presets. When a custom " +"filter chain is specified, preset options (B<-0> \\&...\\& B<-9> and B<--" +"extreme>) earlier on the command line are forgotten. If a preset option is " +"specified after one or more custom filter chain options, the new preset " +"takes effect and the custom filter chain options specified earlier are " +"forgotten." +msgstr "" +"Une chaîne de filtres personnalisée permet d'indiquer les réglages de la " +"compression en détail au lieu de recourir aux préréglages. Lorsque une " +"chaîne de filtres personnalisée est indiquée, les options préréglées (B<0> à " +"B<9> et B<--extreme>) précédement sur la ligne de commande sont oubliées. Si " +"une option de préréglage est indiquée après une ou plusieurs options de " +"chaîne de filtre personnalisée, le nouveau préréglage prend effet et les " +"options de la chaîne de filtres personnalisée précédement indiquée sont " +"oubliées." + +#. type: Plain text +#: ../src/xz/xz.1:1289 +msgid "" +"A filter chain is comparable to piping on the command line. When " +"compressing, the uncompressed input goes to the first filter, whose output " +"goes to the next filter (if any). The output of the last filter gets " +"written to the compressed file. The maximum number of filters in the chain " +"is four, but typically a filter chain has only one or two filters." +msgstr "" +"Une chaîne de filtre est comparable à une redirection (pipe) sur la ligne de " +"commande. Lors de la compression, les entrées non compressées vont au " +"premier filtre, dont la sortie va au prochain filtre (s'il y en a). La " +"sortie du dernier filtre est écrite sur le fichier compressé. Le nombre " +"maximal de filtres dans la chaîne est quatre, mais habituellement, un chaîne " +"de filtre n'a qu'un ou deux filtres." + +#. type: Plain text +#: ../src/xz/xz.1:1297 +msgid "" +"Many filters have limitations on where they can be in the filter chain: some " +"filters can work only as the last filter in the chain, some only as a non-" +"last filter, and some work in any position in the chain. Depending on the " +"filter, this limitation is either inherent to the filter design or exists to " +"prevent security issues." +msgstr "" +"Beaucoup de filtres ont des limitations sur l'endroit où ils peuvent se " +"placer dans la chaîne de filtre : quelques filtres ne peuvent fonctionner " +"qu'en tant que dernier filtre dans la chaîne, quelques uns en tant que non " +"dernier filtre, et d'autres à n'importe quelle position dans la chaîne. " +"Suivant le filtre, cette limitation est soit inhérente au profil du filtre, " +"soit existe pour des raisons de sécurité. " + +#. type: Plain text +#: ../src/xz/xz.1:1305 +msgid "" +"A custom filter chain is specified by using one or more filter options in " +"the order they are wanted in the filter chain. That is, the order of filter " +"options is significant! When decoding raw streams (B<--format=raw>), the " +"filter chain is specified in the same order as it was specified when " +"compressing." +msgstr "" +"Une chaîne de filtres personnalisée est indiquée en utilisant une ou " +"plusieurs options de filtre dans l'ordre où elles sont souhaitées dans la " +"chaîne de filtres. Cela fait, l'ordre des options de filtre est " +"significatif! Lors du décodage des flux bruts (B<--format=raw>), le filtre " +"de chaîne est indiqué dans le même ordre qu'il fût indiqué lors de la " +"compression." + +#. type: Plain text +#: ../src/xz/xz.1:1314 +msgid "" +"Filters take filter-specific I as a comma-separated list. Extra " +"commas in I are ignored. Every option has a default value, so you " +"need to specify only those you want to change." +msgstr "" +"Les filtres prennent des I spécifiques aux filtres sous la forme " +"d'une liste séparée par des virgules. Les virgules supplémentaires dans les " +"I sont ignorées. Toutes les options ont une valeur par défaut, donc " +"vous ne devez indiquer que celles que vous voulez changer." + +#. type: Plain text +#: ../src/xz/xz.1:1323 +msgid "" +"To see the whole filter chain and I, use B (that is, use " +"B<--verbose> twice). This works also for viewing the filter chain options " +"used by presets." +msgstr "" +"Pour voir l'entièreté de la chaîne de filtres et ses I, utilisez " +"B (ce qui est comme utiliser B<--verbose> deux fois). Cela " +"fonctionne aussi pour voir les options de chaîne de filtres utilisées par " +"les préréglages." + +#. type: TP +#: ../src/xz/xz.1:1323 +#, no-wrap +msgid "B<--lzma1>[B<=>I]" +msgstr "B<--lzma1>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1326 +#, no-wrap +msgid "B<--lzma2>[B<=>I]" +msgstr "B<--lzma2>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1331 +msgid "" +"Add LZMA1 or LZMA2 filter to the filter chain. These filters can be used " +"only as the last filter in the chain." +msgstr "" +"Ajouter le filtre LZMA1 ou LZMA2 à la chaîne de filtres. Ces filtres ne " +"peuvent être utilisés que comme dernier filtre dans la chaîne." + +#. type: Plain text +#: ../src/xz/xz.1:1343 +msgid "" +"LZMA1 is a legacy filter, which is supported almost solely due to the legacy " +"B<.lzma> file format, which supports only LZMA1. LZMA2 is an updated " +"version of LZMA1 to fix some practical issues of LZMA1. The B<.xz> format " +"uses LZMA2 and doesn't support LZMA1 at all. Compression speed and ratios " +"of LZMA1 and LZMA2 are practically the same." +msgstr "" +"LZMA1 est un filtre historique, qui n'est pris en charge presque uniquement " +"à cause de l'ancien format de fichier B<.lzma>, qui ne prend en charge que " +"LZMA1. LZMA2 est une version mise à jour de LZMA1 pour régler certains " +"problèmes pratiques de LZMA1. Le format B utilise LZMA2 et ne prend pas " +"du tout en charge LZMA1. Les taux et vitesses de compression de LZMA1 et " +"LZMA2 sont pratiquement identiques." + +#. type: Plain text +#: ../src/xz/xz.1:1346 +msgid "LZMA1 and LZMA2 share the same set of I:" +msgstr "LZMA1 et LZMA2 partagent le même ensemble d'I :" + +#. type: TP +#: ../src/xz/xz.1:1347 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1374 +#, fuzzy +#| msgid "" +#| "Reset all LZMA1 or LZMA2 I to I. I consist of " +#| "an integer, which may be followed by single-letter preset modifiers. The " +#| "integer can be from B<0> to B<9>, matching the command line options " +#| "B<-0> ... B<-9>. The only supported modifier is currently B, which " +#| "matches B<--extreme>. If no B is specified, the default values " +#| "of LZMA1 or LZMA2 I are taken from the preset B<6>." +msgid "" +"Reset all LZMA1 or LZMA2 I to I. I consist of an " +"integer, which may be followed by single-letter preset modifiers. The " +"integer can be from B<0> to B<9>, matching the command line options B<-0> " +"\\&...\\& B<-9>. The only supported modifier is currently B, which " +"matches B<--extreme>. If no B is specified, the default values of " +"LZMA1 or LZMA2 I are taken from the preset B<6>." +msgstr "" +"Réinitialiser toutes les I de LZMA1 ou de LZMA2 à I. " +"I consiste en un entier, qui peut être suivi de modificateurs de " +"préréglage à une lettre. L'entier peut être de B<0> à B<9>, correspondant " +"aux options B<-0> à B<-9> de la ligne de commandes. Le seul modificateur " +"pris en charge est actuellement B, qui correspond à B<--extreme>. Si " +"B n'est pas indiqué, Les valeurs par défaut des I LZMA1 ou " +"LZMA2 sont prises du préréglage B<6>." + +#. type: TP +#: ../src/xz/xz.1:1374 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1389 +msgid "" +"Dictionary (history buffer) I indicates how many bytes of the " +"recently processed uncompressed data is kept in memory. The algorithm tries " +"to find repeating byte sequences (matches) in the uncompressed data, and " +"replace them with references to the data currently in the dictionary. The " +"bigger the dictionary, the higher is the chance to find a match. Thus, " +"increasing dictionary I usually improves compression ratio, but a " +"dictionary bigger than the uncompressed file is waste of memory." +msgstr "" +"La I du dictionnaire (historique du tampon) indique combien d'octets " +"des données récement décompressées sont gardés en mémoire. L'algorithme " +"essaie de trouver les séquences d'octets répétées (identiques) dans les " +"données décompressées et les remplace par les données actuellement dans le " +"dictionnaire. Plus gros est le dictionnaire, plus grande est la chance de " +"trouver une correspondance. Ainsi, l'augmentation de la I du " +"dictionnaire augmente habituellement le taux de compression, mais un " +"dictionnaire plus gros que le fichier non compressé est un gachis de mémoire." + +#. type: Plain text +#: ../src/xz/xz.1:1398 +msgid "" +"Typical dictionary I is from 64\\ KiB to 64\\ MiB. The minimum is 4\\ " +"KiB. The maximum for compression is currently 1.5\\ GiB (1536\\ MiB). The " +"decompressor already supports dictionaries up to one byte less than 4\\ GiB, " +"which is the maximum for the LZMA1 and LZMA2 stream formats." +msgstr "" +"Généralement la I du dictionnaire est entre 64\\ Kio et 64\\ Mio. Le " +"minimum étant 4\\ Kio. La I maximale pour la compression est " +"habituellement 1,5\\ Gio (1536\\ Mio). Le décompresseur prend en charge les " +"dictionnaires jusqu'à un octet de moins que 4\\ Gio, ce qui est le maximum " +"pour les formats de flux LZMA1 et LZMA2." + +#. type: Plain text +#: ../src/xz/xz.1:1425 +msgid "" +"Dictionary I and match finder (I) together determine the memory " +"usage of the LZMA1 or LZMA2 encoder. The same (or bigger) dictionary " +"I is required for decompressing that was used when compressing, thus " +"the memory usage of the decoder is determined by the dictionary size used " +"when compressing. The B<.xz> headers store the dictionary I either as " +"2^I or 2^I + 2^(I-1), so these I are somewhat preferred for " +"compression. Other I will get rounded up when stored in the B<.xz> " +"headers." +msgstr "" +"La I du dictionnaire et le chercheur de correspondance (match " +"finder) (I) déterminent ensemble l'utilisation de la mémoire de " +"l'encodeur LZMA1 ou LZMA2. La même (ou une plus grosse) I de " +"dictionnaire est requise pour décompresser que ce qui a été utilisé pour la " +"compression, ainsi l'utilisation de la mémoire du décodeur est déterminée " +"par la taille du dictionnaire utilisée lors de la compression. Les en-têtes " +"de B<.xz> stockent la I de dictionnaire sous la forme 2^I ou " +"2^I + 2^(I-1), de sorte que ces I sont quelque peu préférées " +"pour la compression. Les autres I seront arrondies à la hausse " +"lorsque stockées dans les en-têtes de B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:1425 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1434 +msgid "" +"Specify the number of literal context bits. The minimum is 0 and the " +"maximum is 4; the default is 3. In addition, the sum of I and I " +"must not exceed 4." +msgstr "" +"Spécifiez le nombre d'octets de contexte littéraux. Le minimum est B<0> et " +"le maximum est B<4>. La valeur par défaut est B<3>. En plus, la somme de " +"I et I ne doit pas excéder B<4>." + +#. type: Plain text +#: ../src/xz/xz.1:1439 +msgid "" +"All bytes that cannot be encoded as matches are encoded as literals. That " +"is, literals are simply 8-bit bytes that are encoded one at a time." +msgstr "" +"Tous les octets qui ne peuvent pas être codés comme des correspondances sont " +"codés comme des littéraux. C'est à dire que les littéraux sont simplement " +"des octets 8 bits encodés un à la fois." + +#. type: Plain text +#: ../src/xz/xz.1:1453 +#, fuzzy +#| msgid "" +#| "The literal coding makes an assumption that the highest I bits of the " +#| "previous uncompressed byte correlate with the next byte. E.g. in typical " +#| "English text, an upper-case letter is often followed by a lower-case " +#| "letter, and a lower-case letter is usually followed by another lower-case " +#| "letter. In the US-ASCII character set, the highest three bits are 010 " +#| "for upper-case letters and 011 for lower-case letters. When I is at " +#| "least 3, the literal coding can take advantage of this property in the " +#| "uncompressed data." +msgid "" +"The literal coding makes an assumption that the highest I bits of the " +"previous uncompressed byte correlate with the next byte. For example, in " +"typical English text, an upper-case letter is often followed by a lower-case " +"letter, and a lower-case letter is usually followed by another lower-case " +"letter. In the US-ASCII character set, the highest three bits are 010 for " +"upper-case letters and 011 for lower-case letters. When I is at least " +"3, the literal coding can take advantage of this property in the " +"uncompressed data." +msgstr "" +"Le codage littéral part du principe que les bits I les plus élevés de " +"l'octet décompressé précédent sont en corrélation avec l'octet suivant. Par " +"exemple dans un texte anglais typique, une lettre majuscule est souvent " +"suivie d'une lettre minuscule, et une lettre minuscule est généralement " +"suivie d'une autre lettre minuscule. Dans le jeu de caractères US-ASCII, les " +"trois bits les plus haut sont 010 pour les lettres majuscules et 011 pour " +"les minuscules. Lorsque I est au final B<3>, le codage littéral peut " +"tirer avantage de cette propriété dans les données décompressées." + +#. type: Plain text +#: ../src/xz/xz.1:1462 +#, fuzzy +#| msgid "" +#| "The default value (3) is usually good. If you want maximum compression, " +#| "test B. Sometimes it helps a little, and sometimes it makes " +#| "compression worse. If it makes it worse, test e.g.\\& B too." +msgid "" +"The default value (3) is usually good. If you want maximum compression, " +"test B. Sometimes it helps a little, and sometimes it makes " +"compression worse. If it makes it worse, test B too." +msgstr "" +"La valeur par défaut (3) est généralement la bonne. Si vous voulez une " +"compression maximale, essayez B. Cela aide parfois un petit peu, et " +"parfois cela empire la compression. Si cela l'empire, essayez par exemple\\& " +"B aussi." + +#. type: TP +#: ../src/xz/xz.1:1462 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1466 +msgid "" +"Specify the number of literal position bits. The minimum is 0 and the " +"maximum is 4; the default is 0." +msgstr "" +"Indiquer le nombre de bits de position littérale. Le minimum est B<0> et le " +"maximum B<4>; par défaut c'est B<0>." + +#. type: Plain text +#: ../src/xz/xz.1:1473 +msgid "" +"I affects what kind of alignment in the uncompressed data is assumed " +"when encoding literals. See I below for more information about " +"alignment." +msgstr "" +"I affecte le type d'alignement dans les données décompressées qui est " +"présumé lors de l'encodage des littéraux. Voir I ci dessous pour plus " +"d'information sur l'alignement." + +#. type: TP +#: ../src/xz/xz.1:1473 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1477 +msgid "" +"Specify the number of position bits. The minimum is 0 and the maximum is 4; " +"the default is 2." +msgstr "" +"Indiquer le nombre de bits de position. Le minimum est B<0> et le maximum " +"B<4>; par défaut B<2>." + +#. type: Plain text +#: ../src/xz/xz.1:1484 +msgid "" +"I affects what kind of alignment in the uncompressed data is assumed in " +"general. The default means four-byte alignment (2^I=2^2=4), which is " +"often a good choice when there's no better guess." +msgstr "" +"I affecte quel genre d'alignement est présumé en général dans les " +"données non compressées. Par défaut c'est un alignement de quatre octets " +"(2^I=2^2=4), ce qui est généralement un bon choix lorsqu'il n'y a pas de " +"meilleure estimation." + +#. type: Plain text +#: ../src/xz/xz.1:1498 +#, fuzzy +#| msgid "" +#| "When the aligment is known, setting I accordingly may reduce the file " +#| "size a little. E.g. with text files having one-byte alignment (US-ASCII, " +#| "ISO-8859-*, UTF-8), setting B can improve compression slightly. " +#| "For UTF-16 text, B is a good choice. If the alignment is an odd " +#| "number like 3 bytes, B might be the best choice." +msgid "" +"When the alignment is known, setting I accordingly may reduce the file " +"size a little. For example, with text files having one-byte alignment (US-" +"ASCII, ISO-8859-*, UTF-8), setting B can improve compression " +"slightly. For UTF-16 text, B is a good choice. If the alignment is " +"an odd number like 3 bytes, B might be the best choice." +msgstr "" +"Quand l'alignement est connu, régler en conséquence I pourrait réduire " +"un peu la taille du fichier. Par ex. avec les fichiers texte ayant un " +"alignement d'un octet (US-ASCII, ISO-8859-*, UTF-8), indiquer B peut " +"légèrement améliorer la compression. Pour les textes UTF-16, B est un " +"bon choix. Si l'alignement est un nombre impair comme 3 octets, B " +"pourrait être le meilleur choix." + +#. type: Plain text +#: ../src/xz/xz.1:1506 +msgid "" +"Even though the assumed alignment can be adjusted with I and I, " +"LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth " +"taking into account when designing file formats that are likely to be often " +"compressed with LZMA1 or LZMA2." +msgstr "" +"Même si l'alignement présumé peut être ajusté avec I et I, LZMA1 et " +"LZMA2 favorisent toujours légèrement l'alignement sur 16 octets. Il peut " +"être utile d'en tenir compte lors de la conception de formats de fichiers " +"susceptibles d'être souvent compressés avec LZMA1 ou LZMA2." + +#. type: TP +#: ../src/xz/xz.1:1506 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1521 +#, fuzzy +#| msgid "" +#| "Match finder has a major effect on encoder speed, memory usage, and " +#| "compression ratio. Usually Hash Chain match finders are faster than " +#| "Binary Tree match finders. The default depends on the I: 0 uses " +#| "B, 1-3 use B, and the rest use B." +msgid "" +"Match finder has a major effect on encoder speed, memory usage, and " +"compression ratio. Usually Hash Chain match finders are faster than Binary " +"Tree match finders. The default depends on the I: 0 uses B, " +"1\\(en3 use B, and the rest use B." +msgstr "" +"La recherche de correspondance a un effet important sur la vitesse de " +"l'encodeur, l'utilisation de la mémoire et le taux de compression. En " +"général, les chercheurs de correspondance de chaîne de hachage sont plus " +"rapides que les chercheurs de correspondance d'un arbre binaire. Par défaut, " +"cela dépend du I : B<0> utilise B, B<1-3> utilise B, " +"et le reste utilise B." + +#. type: Plain text +#: ../src/xz/xz.1:1527 +msgid "" +"The following match finders are supported. The memory usage formulas below " +"are rough approximations, which are closest to the reality when I is a " +"power of two." +msgstr "" +"Les chercheurs de correspondance suivants sont pris en charge. Les formules " +"d'utilisation de la mémoire ci-dessous sont des approximations grossières " +"qui sont les plus proches de la réalité lorsque I est une puissance de " +"deux." + +#. type: TP +#: ../src/xz/xz.1:1528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1531 +msgid "Hash Chain with 2- and 3-byte hashing" +msgstr "Chaîne de hachage avec hachage de 2 et 3 octets" + +#. type: Plain text +#: ../src/xz/xz.1:1535 ../src/xz/xz.1:1584 +msgid "Minimum value for I: 3" +msgstr "Valeur minimale pour I : B<3>" + +#. type: Plain text +#: ../src/xz/xz.1:1537 ../src/xz/xz.1:1556 ../src/xz/xz.1:1586 +#: ../src/xz/xz.1:1605 +msgid "Memory usage:" +msgstr "Utilisation de la mémoire :" + +#. type: Plain text +#: ../src/xz/xz.1:1542 +msgid "I * 7.5 (if I E= 16 MiB);" +msgstr "I * 7.5 (if I E= 16 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1547 +msgid "I * 5.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 5.5 + 64 MiB (si I E 16 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1547 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1550 +msgid "Hash Chain with 2-, 3-, and 4-byte hashing" +msgstr "Chaîne de hachage avec hachage de 2, 3 et 4 octets" + +#. type: Plain text +#: ../src/xz/xz.1:1554 ../src/xz/xz.1:1603 +msgid "Minimum value for I: 4" +msgstr "Valeur minimale pour I : B<4>" + +#. type: Plain text +#: ../src/xz/xz.1:1561 +msgid "I * 7.5 (if I E= 32 MiB);" +msgstr "I * 7.5 (si I E= 32 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1566 +msgid "I * 6.5 (if I E 32 MiB)" +msgstr "I * 6.5 (si I E 32 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1566 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1569 +msgid "Binary Tree with 2-byte hashing" +msgstr "Arbre binaire avec hachage de 2 octets" + +#. type: Plain text +#: ../src/xz/xz.1:1573 +msgid "Minimum value for I: 2" +msgstr "Valeur minimale pour I : B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:1577 +msgid "Memory usage: I * 9.5" +msgstr "Utilisation de la mémoire : I * 9.5" + +#. type: TP +#: ../src/xz/xz.1:1577 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1580 +msgid "Binary Tree with 2- and 3-byte hashing" +msgstr "Arbre binaire avec hachage de 2 et 3 octets" + +#. type: Plain text +#: ../src/xz/xz.1:1591 +msgid "I * 11.5 (if I E= 16 MiB);" +msgstr "I * 11.5 (si I E= 16 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1596 +msgid "I * 9.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 9.5 + 64 MiB (si I E 16 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1596 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1599 +msgid "Binary Tree with 2-, 3-, and 4-byte hashing" +msgstr "Arbre binaire avec hachage 2, 3 et 4 octets" + +#. type: Plain text +#: ../src/xz/xz.1:1610 +msgid "I * 11.5 (if I E= 32 MiB);" +msgstr "I * 11.5 (si I E= 32 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1615 +msgid "I * 10.5 (if I E 32 MiB)" +msgstr "I * 10.5 (si I E 32 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1616 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1637 +#, fuzzy +#| msgid "" +#| "Compression I specifies the method to analyze the data produced by " +#| "the match finder. Supported I are B and B. The " +#| "default is B for I 0-3 and B for I 4-9." +msgid "" +"Compression I specifies the method to analyze the data produced by the " +"match finder. Supported I are B and B. The default is " +"B for I 0\\(en3 and B for I 4\\(en9." +msgstr "" +"Le I de compression indique la méthode pour analyser les données " +"produites par le chercheur de correspondance. Les I pris en charge " +"sont B et B. Par défaut c'est B pour les I " +"de B<0> à B<3> et B pour les préréglages de B<4> à B<9>." + +#. type: Plain text +#: ../src/xz/xz.1:1646 +msgid "" +"Usually B is used with Hash Chain match finders and B with " +"Binary Tree match finders. This is also what the I do." +msgstr "" +"Habituellement, B est utilisé avec les chercheurs de correspondance de " +"chaîne de hachage et B avec les chercheurs de correspondance d'arbre " +"binaire. C'est aussi ce que font les I." + +#. type: TP +#: ../src/xz/xz.1:1646 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1653 +msgid "" +"Specify what is considered to be a nice length for a match. Once a match of " +"at least I bytes is found, the algorithm stops looking for possibly " +"better matches." +msgstr "" +"Spécifier ce qui est considéré comme une bonne longueur pour une " +"correspondance. Une fois que la correspondance d'au moins I octets est " +"trouvée, l'algorithme arrête de chercher de meilleures correspondances " +"possibles." + +#. type: Plain text +#: ../src/xz/xz.1:1660 +#, fuzzy +#| msgid "" +#| "I can be 2-273 bytes. Higher values tend to give better " +#| "compression ratio at the expense of speed. The default depends on the " +#| "I." +msgid "" +"I can be 2\\(en273 bytes. Higher values tend to give better " +"compression ratio at the expense of speed. The default depends on the " +"I." +msgstr "" +"I peut être 2 273 octets. Des valeurs plus élevées ont tendance à " +"donner un meilleur taux de compression au détriment de la vitesse. La valeur " +"par défaut dépend du I." + +#. type: TP +#: ../src/xz/xz.1:1660 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1670 +msgid "" +"Specify the maximum search depth in the match finder. The default is the " +"special value of 0, which makes the compressor determine a reasonable " +"I from I and I." +msgstr "" +"Spécifier la profondeur de recherche maximale dans l'outil de recherche de " +"correspondances. La valeur par défaut est B<0>, ce qui fait que le " +"compresseur détermine une I raisonnable en fonction de I et " +"I." + +#. type: Plain text +#: ../src/xz/xz.1:1681 +#, fuzzy +#| msgid "" +#| "Reasonable I for Hash Chains is 4-100 and 16-1000 for Binary " +#| "Trees. Using very high values for I can make the encoder " +#| "extremely slow with some files. Avoid setting the I over 1000 " +#| "unless you are prepared to interrupt the compression in case it is taking " +#| "far too long." +msgid "" +"Reasonable I for Hash Chains is 4\\(en100 and 16\\(en1000 for Binary " +"Trees. Using very high values for I can make the encoder extremely " +"slow with some files. Avoid setting the I over 1000 unless you are " +"prepared to interrupt the compression in case it is taking far too long." +msgstr "" +"Une I raisonnable pour les chaînes de hachage est 4-100 et " +"16-1000 pour les arbres binaires. Utiliser des valeurs beaucoup plus grandes " +"pour I peut rendre l'encodeur extrèmement lent avec quelques " +"fichiers. Évitez de fixer la I à plus de 1000, sauf si vous êtes " +"prêt à interrompre la compression au cas où elle prendrait beaucoup trop de " +"temps." + +#. type: Plain text +#: ../src/xz/xz.1:1692 +msgid "" +"When decoding raw streams (B<--format=raw>), LZMA2 needs only the dictionary " +"I. LZMA1 needs also I, I, and I." +msgstr "" +"Lors du décodage des flux bruts (B<--format=raw>), LZMA2 nécessite seulement " +"la I du dictionnaire. LZMA1 nécessite aussi I, I et I." + +#. type: TP +#: ../src/xz/xz.1:1692 +#, no-wrap +msgid "B<--x86>[B<=>I]" +msgstr "B<--x86>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1695 +#, no-wrap +msgid "B<--arm>[B<=>I]" +msgstr "B<--arm>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1697 +#, no-wrap +msgid "B<--armthumb>[B<=>I]" +msgstr "B<--armthumb>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1699 +#, fuzzy, no-wrap +#| msgid "B<--arm>[B<=>I]" +msgid "B<--arm64>[B<=>I]" +msgstr "B<--arm>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1701 +#, no-wrap +msgid "B<--powerpc>[B<=>I]" +msgstr "B<--powerpc>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1703 +#, no-wrap +msgid "B<--ia64>[B<=>I]" +msgstr "B<--ia64>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1705 +#, no-wrap +msgid "B<--sparc>[B<=>I]" +msgstr "B<--sparc>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1711 +msgid "" +"Add a branch/call/jump (BCJ) filter to the filter chain. These filters can " +"be used only as a non-last filter in the filter chain." +msgstr "" +"Ajouter un filtre branch/call/jump (BCJ) à la chaîne de filtres. Ces filtres " +"ne peuvent être utilisés que s'ils ne sont pas le dernier filtre de la " +"chaîne de filtrage." + +#. type: Plain text +#: ../src/xz/xz.1:1725 +#, fuzzy +#| msgid "" +#| "A BCJ filter converts relative addresses in the machine code to their " +#| "absolute counterparts. This doesn't change the size of the data, but it " +#| "increases redundancy, which can help LZMA2 to produce 0-15\\ % smaller B<." +#| "xz> file. The BCJ filters are always reversible, so using a BCJ filter " +#| "for wrong type of data doesn't cause any data loss, although it may make " +#| "the compression ratio slightly worse." +msgid "" +"A BCJ filter converts relative addresses in the machine code to their " +"absolute counterparts. This doesn't change the size of the data but it " +"increases redundancy, which can help LZMA2 to produce 0\\(en15\\ % smaller " +"B<.xz> file. The BCJ filters are always reversible, so using a BCJ filter " +"for wrong type of data doesn't cause any data loss, although it may make the " +"compression ratio slightly worse. The BCJ filters are very fast and use an " +"insignificant amount of memory." +msgstr "" +"Un filtre BCJ convertit les adresses relatives du code machine en leurs " +"équivalents absolus. Cela ne change pas la taille des données, mais évite " +"les redondances, ce qui peut aider LZMA2 à produire un fichier B<.xz> 0 à " +"15\\ % plus petit. Les filtres BCJ sont toujours réversibles, ce qui fait " +"qu'utiliser un filtre BCJ pour le mauvais type de données n'occasionne pas " +"de perte de données, même si ça pourrait empirer légèrement le taux de " +"compression." + +#. type: Plain text +#: ../src/xz/xz.1:1728 +msgid "These BCJ filters have known problems related to the compression ratio:" +msgstr "" +"Ces filtres BCJ présentent des problèmes connus liés au taux de compression :" + +#. type: Plain text +#: ../src/xz/xz.1:1735 +#, fuzzy +#| msgid "" +#| "Some types of files containing executable code (e.g. object files, static " +#| "libraries, and Linux kernel modules) have the addresses in the " +#| "instructions filled with filler values. These BCJ filters will still do " +#| "the address conversion, which will make the compression worse with these " +#| "files." +msgid "" +"Some types of files containing executable code (for example, object files, " +"static libraries, and Linux kernel modules) have the addresses in the " +"instructions filled with filler values. These BCJ filters will still do the " +"address conversion, which will make the compression worse with these files." +msgstr "" +"Quelques types de fichier contiennent du code exécutable (par exemple les " +"fichiers objet, les bibliothèques statiques et les modules du noyau Linux) " +"ont rempli les adresses dans les instructions avec des valeurs de " +"remplissage. Ces filtres BCJ feront toujours la conversion d'adresse, ce qui " +"pourrait péjorer la compression avec ces fichiers." + +#. type: Plain text +#: ../src/xz/xz.1:1745 +msgid "" +"If a BCJ filter is applied on an archive, it is possible that it makes the " +"compression ratio worse than not using a BCJ filter. For example, if there " +"are similar or even identical executables then filtering will likely make " +"the files less similar and thus compression is worse. The contents of non-" +"executable files in the same archive can matter too. In practice one has to " +"try with and without a BCJ filter to see which is better in each situation." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:1750 +msgid "" +"Different instruction sets have different alignment: the executable file " +"must be aligned to a multiple of this value in the input data to make the " +"filter work." +msgstr "" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Filter" +msgstr "Filtre" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Alignment" +msgstr "Alignement" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Notes" +msgstr "Notes" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "x86" +msgstr "x86" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "32-bit or 64-bit x86" +msgstr "32 bits ou 64 bits x86" + +#. type: tbl table +#: ../src/xz/xz.1:1759 +#, no-wrap +msgid "ARM" +msgstr "ARM" + +#. type: tbl table +#: ../src/xz/xz.1:1760 +#, no-wrap +msgid "ARM-Thumb" +msgstr "ARM-Thumb" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "ARM64" +msgstr "" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "4096-byte alignment is best" +msgstr "" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "PowerPC" +msgstr "PowerPC" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "Big endian only" +msgstr "Grand boutiste seulement" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "IA-64" +msgstr "IA-64" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "16" +msgstr "16" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "Itanium" +msgstr "" + +#. type: tbl table +#: ../src/xz/xz.1:1764 +#, no-wrap +msgid "SPARC" +msgstr "SPARC" + +#. type: Plain text +#: ../src/xz/xz.1:1781 +#, fuzzy +#| msgid "" +#| "Since the BCJ-filtered data is usually compressed with LZMA2, the " +#| "compression ratio may be improved slightly if the LZMA2 options are set " +#| "to match the alignment of the selected BCJ filter. For example, with the " +#| "IA-64 filter, it's good to set B with LZMA2 (2^4=16). The x86 " +#| "filter is an exception; it's usually good to stick to LZMA2's default " +#| "four-byte alignment when compressing x86 executables." +msgid "" +"Since the BCJ-filtered data is usually compressed with LZMA2, the " +"compression ratio may be improved slightly if the LZMA2 options are set to " +"match the alignment of the selected BCJ filter. For example, with the IA-64 " +"filter, it's good to set B or even B with LZMA2 " +"(2^4=16). The x86 filter is an exception; it's usually good to stick to " +"LZMA2's default four-byte alignment when compressing x86 executables." +msgstr "" +"Dans la mesure où les données filtrées par BCJ sont généralement compressées " +"avec LZMA2, le taux de compression peut être légèrement amélioré si les " +"options de LZMA2 sont indiquées pour la correspondance d'alignement du " +"filtre BCJ sélectionné. Par exemple, avec le filtre IA-64, il est bon " +"d'indiquer B avec LZMA2 (2^4=16). Le filtre x86 est une exception ; il " +"est généralement approprié de coller à l'alignement quatre octets par défaut " +"de LZMA2 lors de la compression d'exécutables x86. " + +#. type: Plain text +#: ../src/xz/xz.1:1784 +msgid "All BCJ filters support the same I:" +msgstr "Tous les filtres BCJ prennent en charge les mêmes I :" + +#. type: TP +#: ../src/xz/xz.1:1785 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1799 +msgid "" +"Specify the start I that is used when converting between relative " +"and absolute addresses. The I must be a multiple of the alignment " +"of the filter (see the table above). The default is zero. In practice, the " +"default is good; specifying a custom I is almost never useful." +msgstr "" +"Spécifier le I de départ qui est utilisé lors de la conversion " +"entre les adresses relatives et absolues. Le I doit être un " +"multiple de l'alignement du filtre (voir la table ci-dessus). Sa valeur par " +"défaut est zéro. En pratique, cette dernière convient ; indiquer un " +"I personnalisé est la plupart du temps inutile." + +#. type: TP +#: ../src/xz/xz.1:1800 +#, no-wrap +msgid "B<--delta>[B<=>I]" +msgstr "B<--delta>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1805 +msgid "" +"Add the Delta filter to the filter chain. The Delta filter can be only used " +"as a non-last filter in the filter chain." +msgstr "" +"Ajouter le filtre Delta à la chaîne de filtres. Le filtre Delta ne peut être " +"utilisé que s'il n'est pas le dernier filtre dans la chaîne." + +#. type: Plain text +#: ../src/xz/xz.1:1814 +#, fuzzy +#| msgid "" +#| "Currently only simple byte-wise delta calculation is supported. It can " +#| "be useful when compressing e.g. uncompressed bitmap images or " +#| "uncompressed PCM audio. However, special purpose algorithms may give " +#| "significantly better results than Delta + LZMA2. This is true especially " +#| "with audio, which compresses faster and better e.g. with B(1)." +msgid "" +"Currently only simple byte-wise delta calculation is supported. It can be " +"useful when compressing, for example, uncompressed bitmap images or " +"uncompressed PCM audio. However, special purpose algorithms may give " +"significantly better results than Delta + LZMA2. This is true especially " +"with audio, which compresses faster and better, for example, with B(1)." +msgstr "" +"Actuellement, seul le calcul simple du delta par octet est pris en charge. " +"Il peut être utile lors de la compression, par exemple, des images bitmap " +"non compressées ou de l'audio PCM non compressé. Toutefois, des algorithmes " +"spécialisés peuvent donner des résultats nettement supérieurs à ceux de " +"Delta + de LZMA2. Cela est spécialement vrai avec le son qui est compressé " +"plus vite et mieux par exemple avec B(1)." + +#. type: Plain text +#: ../src/xz/xz.1:1817 +msgid "Supported I:" +msgstr "I prises en charge :" + +#. type: TP +#: ../src/xz/xz.1:1818 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1826 +#, fuzzy +#| msgid "" +#| "Specify the I of the delta calculation in bytes. I " +#| "must be 1-256. The default is 1." +msgid "" +"Specify the I of the delta calculation in bytes. I must " +"be 1\\(en256. The default is 1." +msgstr "" +"Indiquer la I du calcul delta en octets. La I doit être " +"comprise entre 1 et 256. La valeur par défaut est 1." + +#. type: Plain text +#: ../src/xz/xz.1:1831 +msgid "" +"For example, with B and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, " +"the output will be A1 B1 01 02 01 02 01 02." +msgstr "" +"Par exemple, avec B et une entrée huit octets A1 B1 A2 B3 A3 B5 A4 " +"B7, la sortie sera A1 B1 01 02 01 02 01 02." + +#. type: SS +#: ../src/xz/xz.1:1833 +#, no-wrap +msgid "Other options" +msgstr "Autres options" + +#. type: TP +#: ../src/xz/xz.1:1834 ../src/xzdec/xzdec.1:83 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../src/xz/xz.1:1841 +msgid "" +"Suppress warnings and notices. Specify this twice to suppress errors too. " +"This option has no effect on the exit status. That is, even if a warning " +"was suppressed, the exit status to indicate a warning is still used." +msgstr "" +"Supprimer les avertissements et les notifications. Indiquer cela deux fois " +"supprimera aussi les erreurs. Cette option n'a aucun effet sur le statut de " +"sortie. Cela dit, même si un avertissement était supprimé, le statut de " +"sortie indiquant un avertissement sera encore utilisé." + +#. type: TP +#: ../src/xz/xz.1:1841 +#, no-wrap +msgid "B<-v>, B<--verbose>" +msgstr "B<-v>, B<--verbose>" + +#. type: Plain text +#: ../src/xz/xz.1:1850 +msgid "" +"Be verbose. If standard error is connected to a terminal, B will " +"display a progress indicator. Specifying B<--verbose> twice will give even " +"more verbose output." +msgstr "" +"Être bavard. Si l'erreur standard est connectée à un terminal, B " +"affichera une barre de progression. Indiquer B<--verbose> deux fois donnera " +"une sortie encore plus bavarde." + +#. type: Plain text +#: ../src/xz/xz.1:1852 +msgid "The progress indicator shows the following information:" +msgstr "La barre de progression montre l'information suivante :" + +#. type: Plain text +#: ../src/xz/xz.1:1857 +msgid "" +"Completion percentage is shown if the size of the input file is known. That " +"is, the percentage cannot be shown in pipes." +msgstr "" +"Le pourcentage de complétion est montré si la taille du fichier en entrée " +"est connue. Néanmoins, le pourcentage ne peut pas être montré en cas de " +"redirection." + +#. type: Plain text +#: ../src/xz/xz.1:1860 +msgid "" +"Amount of compressed data produced (compressing) or consumed " +"(decompressing)." +msgstr "" +"Quantité de données compressées produites (compression) ou consommées " +"(décompression)." + +#. type: Plain text +#: ../src/xz/xz.1:1863 +msgid "" +"Amount of uncompressed data consumed (compressing) or produced " +"(decompressing)." +msgstr "" +"Quantité de données non compressées consommées (compression) ou produites " +"(décompression)." + +#. type: Plain text +#: ../src/xz/xz.1:1867 +msgid "" +"Compression ratio, which is calculated by dividing the amount of compressed " +"data processed so far by the amount of uncompressed data processed so far." +msgstr "" +"Le taux de compression, calculé en divisant la quantité de données " +"compréssées déjà traitées par la quantité de données décompressées déjà " +"traitées." + +#. type: Plain text +#: ../src/xz/xz.1:1874 +msgid "" +"Compression or decompression speed. This is measured as the amount of " +"uncompressed data consumed (compression) or produced (decompression) per " +"second. It is shown after a few seconds have passed since B started " +"processing the file." +msgstr "" +"Vitesse de compression ou de décompression. Elle correspond à la quantité de " +"données non compressées consommées (compression) ou produites " +"(décompression) par seconde. Elle apparait quelques secondes après le début " +"du traitement du fichier par B." + +#. type: Plain text +#: ../src/xz/xz.1:1876 +msgid "Elapsed time in the format M:SS or H:MM:SS." +msgstr "Temps écoulé dans le format M:SS ou H:MM:SS." + +#. type: Plain text +#: ../src/xz/xz.1:1884 +#, fuzzy +#| msgid "" +#| "Estimated remaining time is shown only when the size of the input file is " +#| "known and a couple of seconds have already passed since B started " +#| "processing the file. The time is shown in a less precise format which " +#| "never has any colons, e.g. 2 min 30 s." +msgid "" +"Estimated remaining time is shown only when the size of the input file is " +"known and a couple of seconds have already passed since B started " +"processing the file. The time is shown in a less precise format which never " +"has any colons, for example, 2 min 30 s." +msgstr "" +"Le temps estimé restant n'est montré que lorsque la taille du fichier en " +"entrée est connu et que quelques secondes se sont écoulées depuis que B " +"a commencé à traiter le fichier. Le temps est montré dans un format moins " +"précis qui n'a jamais de deux-point(B<:>), par exemple 2 min 30 s." + +#. type: Plain text +#: ../src/xz/xz.1:1899 +#, fuzzy +#| msgid "" +#| "When standard error is not a terminal, B<--verbose> will make B print " +#| "the filename, compressed size, uncompressed size, compression ratio, and " +#| "possibly also the speed and elapsed time on a single line to standard " +#| "error after compressing or decompressing the file. The speed and elapsed " +#| "time are included only when the operation took at least a few seconds. " +#| "If the operation didn't finish, e.g. due to user interruption, also the " +#| "completion percentage is printed if the size of the input file is known." +msgid "" +"When standard error is not a terminal, B<--verbose> will make B print " +"the filename, compressed size, uncompressed size, compression ratio, and " +"possibly also the speed and elapsed time on a single line to standard error " +"after compressing or decompressing the file. The speed and elapsed time are " +"included only when the operation took at least a few seconds. If the " +"operation didn't finish, for example, due to user interruption, also the " +"completion percentage is printed if the size of the input file is known." +msgstr "" +"Lorsque l'erreur standard n'est pas un terminal, B<--verbose> fera écrire à " +"B le nom de fichier, la taille compressée, la taille décompressée, le " +"taux de compression, et éventuellement aussi la vitesse et le temps écoulé " +"sur une seule ligne de l'erreur standard après avoir compressé ou " +"décompressé le fichier. La vitesse et le temps écoulé sont inclus seulement " +"lorsque l'opération ne prend pas plus que quelques secondes. Si l'opération " +"n'a pas fini, par exemple à cause d'une interruption faite par " +"l'utilisateur, le pourcentage de complétion aussi est écrit si la taille du " +"fichier en entrée est connue. " + +#. type: TP +#: ../src/xz/xz.1:1899 ../src/xzdec/xzdec.1:89 +#, no-wrap +msgid "B<-Q>, B<--no-warn>" +msgstr "B<-Q>, B<--no-warn>" + +#. type: Plain text +#: ../src/xz/xz.1:1909 +msgid "" +"Don't set the exit status to 2 even if a condition worth a warning was " +"detected. This option doesn't affect the verbosity level, thus both B<--" +"quiet> and B<--no-warn> have to be used to not display warnings and to not " +"alter the exit status." +msgstr "" +"Ne pas mettre l'état de sortie à B<2> même si une condition méritant un " +"avertissement a été détectée. Cette option n'affecte pas le niveau de " +"verbosité, néanmoins, les deux options B<--quiet> et B<--no-warn> doivent " +"être utilisées pour ne pas afficher d'avertissements, ni altérer le statut " +"de sortie." + +#. type: TP +#: ../src/xz/xz.1:1909 +#, no-wrap +msgid "B<--robot>" +msgstr "B<--robot>" + +#. type: Plain text +#: ../src/xz/xz.1:1921 +msgid "" +"Print messages in a machine-parsable format. This is intended to ease " +"writing frontends that want to use B instead of liblzma, which may be " +"the case with various scripts. The output with this option enabled is meant " +"to be stable across B releases. See the section B for " +"details." +msgstr "" +"Afficher les messages dans un format analysable par une machine. Ceci est " +"destiné à faciliter l'écriture des frontaux qui voudraient utiliser B " +"plutôt que liblzma, ce qui pourrait être le cas pour différents scripts. La " +"sortie avec cette option activée est destinée à rester stable sur les " +"différentes versions de B. Consulter le paragraphe B pour " +"les détails." + +#. type: TP +#: ../src/xz/xz.1:1921 +#, no-wrap +msgid "B<--info-memory>" +msgstr "B<--info-memory>" + +#. type: Plain text +#: ../src/xz/xz.1:1928 +#, fuzzy +#| msgid "" +#| "Display, in human-readable format, how much physical memory (RAM) B " +#| "thinks the system has and the memory usage limits for compression and " +#| "decompression, and exit successfully." +msgid "" +"Display, in human-readable format, how much physical memory (RAM) and how " +"many processor threads B thinks the system has and the memory usage " +"limits for compression and decompression, and exit successfully." +msgstr "" +"Afficher, dans un format lisible par l'humain, de combien de mémoire " +"physique (RAM) dispose le système selon B et les limites d'utilisation " +"de la mémoire pour la compression et décompression, et quitter." + +#. type: TP +#: ../src/xz/xz.1:1928 ../src/xzdec/xzdec.1:96 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../src/xz/xz.1:1932 +msgid "" +"Display a help message describing the most commonly used options, and exit " +"successfully." +msgstr "" +"Afficher un message d'aide décrivant les options les plus couramment " +"utilisées et quitter." + +#. type: TP +#: ../src/xz/xz.1:1932 +#, no-wrap +msgid "B<-H>, B<--long-help>" +msgstr "B<-H>, B<--long-help>" + +#. type: Plain text +#: ../src/xz/xz.1:1937 +msgid "" +"Display a help message describing all features of B, and exit " +"successfully" +msgstr "" +"Afficher un message d'aide décrivant toutes les options de B et quitter." + +#. type: TP +#: ../src/xz/xz.1:1937 ../src/xzdec/xzdec.1:99 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../src/xz/xz.1:1946 +msgid "" +"Display the version number of B and liblzma in human readable format. " +"To get machine-parsable output, specify B<--robot> before B<--version>." +msgstr "" +"Afficher le numéro de version de B et de liblzma dans un format lisible " +"par un humain. Pour obtenir une sortie analysable par la machine, spécifiez " +"B<--robot> avant B<--version>." + +#. type: SH +#: ../src/xz/xz.1:1947 +#, no-wrap +msgid "ROBOT MODE" +msgstr "MODE ROBOT" + +#. type: Plain text +#: ../src/xz/xz.1:1963 +msgid "" +"The robot mode is activated with the B<--robot> option. It makes the output " +"of B easier to parse by other programs. Currently B<--robot> is " +"supported only together with B<--version>, B<--info-memory>, and B<--list>. " +"It will be supported for compression and decompression in the future." +msgstr "" +"Le mode robot est activé avec l'option B<--robot>. Cela rend la sortie de " +"B plus facile à analyser par d'autres programmes. Actuellement, B<--" +"robot> n'est seulement pris en charge qu'avec B<--version>, B<--info-memory> " +"et B<--list>. Il sera pris en charge pour la compression et la décompression " +"dans le futur." + +#. type: SS +#: ../src/xz/xz.1:1964 +#, no-wrap +msgid "Version" +msgstr "Version" + +#. type: Plain text +#: ../src/xz/xz.1:1969 +msgid "" +"B will print the version number of B and liblzma " +"in the following format:" +msgstr "" +"B affichera le numéro de version de B et liblzma " +"dans le format suivant :" + +#. type: Plain text +#: ../src/xz/xz.1:1971 +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1973 +msgid "BI" +msgstr "BI" + +#. type: TP +#: ../src/xz/xz.1:1973 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1976 +msgid "Major version." +msgstr "Version majeure." + +#. type: TP +#: ../src/xz/xz.1:1976 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1981 +msgid "" +"Minor version. Even numbers are stable. Odd numbers are alpha or beta " +"versions." +msgstr "" +"Version mineure. Les numéros pairs sont stables. Les numéros impairs sont " +"des versions alpha ou beta." + +#. type: TP +#: ../src/xz/xz.1:1981 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1985 +msgid "" +"Patch level for stable releases or just a counter for development releases." +msgstr "" +"Niveau de correctif pour les options stables ou juste un compteur pour les " +"options de développement." + +#. type: TP +#: ../src/xz/xz.1:1985 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1993 +msgid "" +"Stability. 0 is alpha, 1 is beta, and 2 is stable. I should be always 2 " +"when I is even." +msgstr "" +"Stabilité. 0 est alpha, 1 est bêta et 2 est stable. I devrait toujours " +"être 2 quand I est pair." + +#. type: Plain text +#: ../src/xz/xz.1:1998 +msgid "" +"I are the same on both lines if B and liblzma are from the " +"same XZ Utils release." +msgstr "" +"I sont identiques sur les deux lignes si B et liblzma sont " +"issus de la même version d'utilitaires XZ." + +#. type: Plain text +#: ../src/xz/xz.1:2004 +msgid "Examples: 4.999.9beta is B<49990091> and 5.0.0 is B<50000002>." +msgstr "Exemples : 4.999.9beta est B<49990091> et 5.0.0 est B<50000002>." + +#. type: SS +#: ../src/xz/xz.1:2005 +#, no-wrap +msgid "Memory limit information" +msgstr "Information de limite de mémoire" + +#. type: Plain text +#: ../src/xz/xz.1:2008 +msgid "" +"B prints a single line with three tab-separated " +"columns:" +msgstr "" +"B affiche une seule ligne avec trois colonnes " +"séparées par des tabulations :" + +#. type: IP +#: ../src/xz/xz.1:2008 +#, no-wrap +msgid "1." +msgstr "1." + +#. type: Plain text +#: ../src/xz/xz.1:2010 +#, fuzzy +#| msgid "Total amount of physical memory (RAM) in bytes" +msgid "Total amount of physical memory (RAM) in bytes." +msgstr "Quantité totale de mémoire physique (RAM) en octets" + +#. type: IP +#: ../src/xz/xz.1:2010 ../src/xz/xz.1:2125 ../src/xz/xz.1:2162 +#: ../src/xz/xz.1:2188 ../src/xz/xz.1:2258 ../src/xz/xz.1:2285 +#, no-wrap +msgid "2." +msgstr "2." + +#. type: Plain text +#: ../src/xz/xz.1:2017 +#, fuzzy +#| msgid "" +#| "Memory usage limit for compression in bytes. A special value of zero " +#| "indicates the default setting, which for single-threaded mode is the same " +#| "as no limit." +msgid "" +"Memory usage limit for compression in bytes (B<--memlimit-compress>). A " +"special value of B<0> indicates the default setting which for single-" +"threaded mode is the same as no limit." +msgstr "" +"Limite d'utilisation de la mémoire pour la compression en octets. Une valeur " +"spéciale de zéro indique le réglage par défaut, lequel en mode mono-thread " +"indique qu'il n'y a pas de limite." + +#. type: IP +#: ../src/xz/xz.1:2017 ../src/xz/xz.1:2127 ../src/xz/xz.1:2164 +#: ../src/xz/xz.1:2190 ../src/xz/xz.1:2263 ../src/xz/xz.1:2287 +#, no-wrap +msgid "3." +msgstr "3." + +#. type: Plain text +#: ../src/xz/xz.1:2024 +#, fuzzy +#| msgid "" +#| "Memory usage limit for decompression in bytes. A special value of zero " +#| "indicates the default setting, which for single-threaded mode is the same " +#| "as no limit." +msgid "" +"Memory usage limit for decompression in bytes (B<--memlimit-decompress>). A " +"special value of B<0> indicates the default setting which for single-" +"threaded mode is the same as no limit." +msgstr "" +"Limite d'utilisation de la mémoire pour la décompression en octets. Une " +"valeur spéciale de zéro indique le réglage par défaut, ce qui est équivalent " +"à sans limite en mode mono-thread." + +#. type: IP +#: ../src/xz/xz.1:2024 ../src/xz/xz.1:2129 ../src/xz/xz.1:2166 +#: ../src/xz/xz.1:2193 ../src/xz/xz.1:2273 ../src/xz/xz.1:2289 +#, no-wrap +msgid "4." +msgstr "4." + +#. type: Plain text +#: ../src/xz/xz.1:2036 +msgid "" +"Since B 5.3.4alpha: Memory usage for multi-threaded decompression in " +"bytes (B<--memlimit-mt-decompress>). This is never zero because a system-" +"specific default value shown in the column 5 is used if no limit has been " +"specified explicitly. This is also never greater than the value in the " +"column 3 even if a larger value has been specified with B<--memlimit-mt-" +"decompress>." +msgstr "" + +#. type: IP +#: ../src/xz/xz.1:2036 ../src/xz/xz.1:2131 ../src/xz/xz.1:2168 +#: ../src/xz/xz.1:2195 ../src/xz/xz.1:2291 +#, no-wrap +msgid "5." +msgstr "5." + +#. type: Plain text +#: ../src/xz/xz.1:2048 +msgid "" +"Since B 5.3.4alpha: A system-specific default memory usage limit that is " +"used to limit the number of threads when compressing with an automatic " +"number of threads (B<--threads=0>) and no memory usage limit has been " +"specified (B<--memlimit-compress>). This is also used as the default value " +"for B<--memlimit-mt-decompress>." +msgstr "" + +#. type: IP +#: ../src/xz/xz.1:2048 ../src/xz/xz.1:2133 ../src/xz/xz.1:2170 +#: ../src/xz/xz.1:2197 ../src/xz/xz.1:2293 +#, no-wrap +msgid "6." +msgstr "6." + +#. type: Plain text +#: ../src/xz/xz.1:2053 +msgid "Since B 5.3.4alpha: Number of available processor threads." +msgstr "" + +#. type: Plain text +#: ../src/xz/xz.1:2057 +msgid "" +"In the future, the output of B may have more " +"columns, but never more than a single line." +msgstr "" +"Dans le futur, la sortie de B pourrait avoir plus " +"de colonnes, mais jamais plus qu'une ligne unique." + +#. type: SS +#: ../src/xz/xz.1:2058 +#, no-wrap +msgid "List mode" +msgstr "Mode liste" + +#. type: Plain text +#: ../src/xz/xz.1:2063 +msgid "" +"B uses tab-separated output. The first column of every " +"line has a string that indicates the type of the information found on that " +"line:" +msgstr "" +"B utilise une sortie séparée par des tabulations. La " +"première colonne de toutes les lignes possède une chaîne qui indique le type " +"d'information trouvée sur cette ligne :" + +#. type: TP +#: ../src/xz/xz.1:2063 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2067 +msgid "" +"This is always the first line when starting to list a file. The second " +"column on the line is the filename." +msgstr "" +"C'est toujours la première ligne au début de la liste d'un fichier. La " +"seconde colonne de la ligne est le nom de fichier." + +#. type: TP +#: ../src/xz/xz.1:2067 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2075 +msgid "" +"This line contains overall information about the B<.xz> file. This line is " +"always printed after the B line." +msgstr "" +"Cette ligne contient l'information globale sur le fichier B<.xz>. Cette " +"ligne est toujours écrite après la ligne B." + +#. type: TP +#: ../src/xz/xz.1:2075 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2085 +msgid "" +"This line type is used only when B<--verbose> was specified. There are as " +"many B lines as there are streams in the B<.xz> file." +msgstr "" +"Ce type de ligne n'est utilisée que lorsque B< --verbose> a été indiquée. Il " +"y a autant de lignes B qu'il y a de flux dans le fichier B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2085 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2100 +msgid "" +"This line type is used only when B<--verbose> was specified. There are as " +"many B lines as there are blocks in the B<.xz> file. The B " +"lines are shown after all the B lines; different line types are not " +"interleaved." +msgstr "" +"Ce type de ligne n'est utilisé seulement lorsque B<--verbose> a été " +"indiquée. Il y a autant de lignes B qu'il y a de blocs dans le " +"fichier B<.xz>. Les lignes B sont affichées après toutes les lignes " +"B ; les différents types de lignes ne sont pas imbriqués." + +#. type: TP +#: ../src/xz/xz.1:2100 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2115 +msgid "" +"This line type is used only when B<--verbose> was specified twice. This " +"line is printed after all B lines. Like the B line, the " +"B line contains overall information about the B<.xz> file." +msgstr "" +"Ce type de ligne n'est utilisé que lorsque B<--verbose> a été indiqué deux " +"fois. Cette ligne est affichée après toutes les lignes B. Comme la " +"ligne B, la ligne B contient l'information globale sur le " +"fichier B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2115 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2119 +msgid "" +"This line is always the very last line of the list output. It shows the " +"total counts and sizes." +msgstr "" +"Cette ligne est toujours la toute dernière ligne de la sortie. Elle affiche " +"les comptes et les tailles totaux." + +#. type: Plain text +#: ../src/xz/xz.1:2123 +msgid "The columns of the B lines:" +msgstr "Les colonnes des lignes B :" + +#. type: Plain text +#: ../src/xz/xz.1:2127 +msgid "Number of streams in the file" +msgstr "Nombre de flux dans le fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2129 +msgid "Total number of blocks in the stream(s)" +msgstr "Nombre total de blocs dans le ou les flux." + +#. type: Plain text +#: ../src/xz/xz.1:2131 +msgid "Compressed size of the file" +msgstr "Taille compressée du fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2133 +msgid "Uncompressed size of the file" +msgstr "Taille décompressée du fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2139 +#, fuzzy +#| msgid "" +#| "Compression ratio, for example B<0.123.> If ratio is over 9.999, three " +#| "dashes (B<--->) are displayed instead of the ratio." +msgid "" +"Compression ratio, for example, B<0.123>. If ratio is over 9.999, three " +"dashes (B<--->) are displayed instead of the ratio." +msgstr "" +"Taux de compression, par exemple B<0.123>. Si le taux est supérieur à 9 999, " +"trois tirets (B<--->) sont affichés au lieu du taux." + +#. type: IP +#: ../src/xz/xz.1:2139 ../src/xz/xz.1:2172 ../src/xz/xz.1:2199 +#: ../src/xz/xz.1:2295 +#, no-wrap +msgid "7." +msgstr "7." + +#. type: Plain text +#: ../src/xz/xz.1:2152 +msgid "" +"Comma-separated list of integrity check names. The following strings are " +"used for the known check types: B, B, B, and " +"B. For unknown check types, BI is used, where I is " +"the Check ID as a decimal number (one or two digits)." +msgstr "" +"Liste de noms de contrôles d'intégrité séparés par des virgules. Les chaînes " +"suivantes sont utilisées pour les types de vérification connus : B, " +"B, B et B. Pour le types de vérification inconnus, " +"BI est utilisé, où I est un identifiant de vérification sous " +"la forme d'un nombre décimal (un ou deux chiffres)." + +#. type: IP +#: ../src/xz/xz.1:2152 ../src/xz/xz.1:2174 ../src/xz/xz.1:2201 +#: ../src/xz/xz.1:2298 +#, no-wrap +msgid "8." +msgstr "8." + +#. type: Plain text +#: ../src/xz/xz.1:2154 +msgid "Total size of stream padding in the file" +msgstr "Taille totale du remplissage du flux dans le fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2160 +msgid "The columns of the B lines:" +msgstr "Les colonnes des lignes B :" + +#. type: Plain text +#: ../src/xz/xz.1:2164 +msgid "Stream number (the first stream is 1)" +msgstr "Numéro de flux (le premier flux a le numéro 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2166 +msgid "Number of blocks in the stream" +msgstr "Nombre de blocs dans le flux" + +#. type: Plain text +#: ../src/xz/xz.1:2168 +msgid "Compressed start offset" +msgstr "Décalage de départ compressé" + +#. type: Plain text +#: ../src/xz/xz.1:2170 +msgid "Uncompressed start offset" +msgstr "Décalage de départ décompressé" + +#. type: Plain text +#: ../src/xz/xz.1:2172 +msgid "Compressed size (does not include stream padding)" +msgstr "Taille compressée (ne comprend pas le remplissage du flux)" + +#. type: Plain text +#: ../src/xz/xz.1:2174 ../src/xz/xz.1:2203 ../src/xz/xz.1:2293 +msgid "Uncompressed size" +msgstr "Taille décompressée" + +#. type: Plain text +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2205 +msgid "Compression ratio" +msgstr "Taux de compression" + +#. type: IP +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2203 ../src/xz/xz.1:2300 +#, no-wrap +msgid "9." +msgstr "9." + +#. type: Plain text +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2207 +msgid "Name of the integrity check" +msgstr "Nom de la vérification d'intégrité" + +#. type: IP +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2205 ../src/xz/xz.1:2316 +#, no-wrap +msgid "10." +msgstr "10." + +#. type: Plain text +#: ../src/xz/xz.1:2180 +msgid "Size of stream padding" +msgstr "Taille du remplissage de flux" + +#. type: Plain text +#: ../src/xz/xz.1:2186 +msgid "The columns of the B lines:" +msgstr "Les colonnes des lignes B :" + +#. type: Plain text +#: ../src/xz/xz.1:2190 +msgid "Number of the stream containing this block" +msgstr "Numéro du flux qui contient ce bloc" + +#. type: Plain text +#: ../src/xz/xz.1:2193 +msgid "" +"Block number relative to the beginning of the stream (the first block is 1)" +msgstr "" +"Numéro du bloc relatif au commencement du flux (le premier bloc a pour " +"numéro 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2195 +msgid "Block number relative to the beginning of the file" +msgstr "Numéro du bloc relatif au début du fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2197 +msgid "Compressed start offset relative to the beginning of the file" +msgstr "Décalage de départ compressé relatif au début du fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2199 +msgid "Uncompressed start offset relative to the beginning of the file" +msgstr "Décalage de départ décompressé relatif au début du fichier" + +#. type: Plain text +#: ../src/xz/xz.1:2201 +msgid "Total compressed size of the block (includes headers)" +msgstr "Taille compressée totale du bloc (en-têtes inclus)" + +#. type: Plain text +#: ../src/xz/xz.1:2219 +msgid "" +"If B<--verbose> was specified twice, additional columns are included on the " +"B lines. These are not displayed with a single B<--verbose>, because " +"getting this information requires many seeks and can thus be slow:" +msgstr "" +"Si B<--verbose> a été indiqué deux fois, les colonnes additionnelles sont " +"inclues sur les lignes B. Elles ne sont pas affichées avec un seul " +"B<--verbose>, car l'obtention de ces informations nécessite de nombreuses " +"recherches et peut donc être lente :" + +#. type: IP +#: ../src/xz/xz.1:2221 ../src/xz/xz.1:2321 +#, no-wrap +msgid "11." +msgstr "11." + +#. type: Plain text +#: ../src/xz/xz.1:2223 +msgid "Value of the integrity check in hexadecimal" +msgstr "Valeur de la vérification d'intégrité en hexadécimal" + +#. type: IP +#: ../src/xz/xz.1:2223 ../src/xz/xz.1:2331 +#, no-wrap +msgid "12." +msgstr "12." + +#. type: Plain text +#: ../src/xz/xz.1:2225 +msgid "Block header size" +msgstr "Taille d'en-tête de bloc" + +#. type: IP +#: ../src/xz/xz.1:2225 +#, no-wrap +msgid "13." +msgstr "13." + +#. type: Plain text +#: ../src/xz/xz.1:2235 +msgid "" +"Block flags: B indicates that compressed size is present, and B " +"indicates that uncompressed size is present. If the flag is not set, a dash " +"(B<->) is shown instead to keep the string length fixed. New flags may be " +"added to the end of the string in the future." +msgstr "" +"Drapeaux du bloc : B indique que la taille compressée est présente, et " +"B indique que la taille décompréssée est présente. Si le drapeau n'est " +"pas indiqué, un tiret (B<->) est affiché à la place pour que la longueur de " +"la chaîne reste fixe. De nouveaux drapeaux pourraient être ajoutés à la fin " +"de la chaîne dans le futur." + +#. type: IP +#: ../src/xz/xz.1:2235 +#, no-wrap +msgid "14." +msgstr "14." + +#. type: Plain text +#: ../src/xz/xz.1:2238 +msgid "" +"Size of the actual compressed data in the block (this excludes the block " +"header, block padding, and check fields)" +msgstr "" +"Taille des données effectivement compressées dans le bloc (en excluant l'en-" +"tête de bloc, le remplissage de bloc et les champs de vérification)." + +#. type: IP +#: ../src/xz/xz.1:2238 +#, no-wrap +msgid "15." +msgstr "15." + +#. type: Plain text +#: ../src/xz/xz.1:2243 +msgid "" +"Amount of memory (in bytes) required to decompress this block with this " +"B version" +msgstr "" +"Quantité de mémoire (en octets) nécessaire pour décompresser ce bloc avec " +"cette version de B." + +#. type: IP +#: ../src/xz/xz.1:2243 +#, no-wrap +msgid "16." +msgstr "16." + +#. type: Plain text +#: ../src/xz/xz.1:2250 +msgid "" +"Filter chain. Note that most of the options used at compression time cannot " +"be known, because only the options that are needed for decompression are " +"stored in the B<.xz> headers." +msgstr "" +"Chaîne de filtrage. Remarquez que la plupart des options utilisées au moment " +"de la compression ne peuvent pas être connues, car seules les options " +"nécessaires pour la décompression sont stockées dans les en-têtes B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:2256 +msgid "The columns of the B lines:" +msgstr "Les colonnes des lignes B :" + +#. type: Plain text +#: ../src/xz/xz.1:2263 +msgid "" +"Amount of memory (in bytes) required to decompress this file with this B " +"version" +msgstr "" +"Quantité de mémoire (en octets) nécessaire pour décompresser ce fichier avec " +"cette version de B." + +#. type: Plain text +#: ../src/xz/xz.1:2269 ../src/xz/xz.1:2327 +msgid "" +"B or B indicating if all block headers have both compressed size " +"and uncompressed size stored in them" +msgstr "" +"B ou B indique si tous les en-têtes de bloc stockent à la fois la " +"taille compressée et la taille décompressée." + +#. type: Plain text +#: ../src/xz/xz.1:2273 ../src/xz/xz.1:2331 +msgid "I B I<5.1.2alpha:>" +msgstr "I B I<5.1.2alpha:>" + +#. type: Plain text +#: ../src/xz/xz.1:2277 ../src/xz/xz.1:2335 +msgid "Minimum B version required to decompress the file" +msgstr "Version minimale de B nécessaire pour décompresser le fichier." + +#. type: Plain text +#: ../src/xz/xz.1:2283 +msgid "The columns of the B line:" +msgstr "Les colonnes de la ligne B :" + +#. type: Plain text +#: ../src/xz/xz.1:2287 +msgid "Number of streams" +msgstr "Nombre de flux" + +#. type: Plain text +#: ../src/xz/xz.1:2289 +msgid "Number of blocks" +msgstr "Nombre de blocs" + +#. type: Plain text +#: ../src/xz/xz.1:2291 +msgid "Compressed size" +msgstr "Taille compressée" + +#. type: Plain text +#: ../src/xz/xz.1:2295 +msgid "Average compression ratio" +msgstr "Taux de compression moyen" + +#. type: Plain text +#: ../src/xz/xz.1:2298 +msgid "" +"Comma-separated list of integrity check names that were present in the files" +msgstr "" +"Liste séparée par des virgules des noms de vérification d'intégrité qui " +"étaient présents dans les fichiers" + +#. type: Plain text +#: ../src/xz/xz.1:2300 +msgid "Stream padding size" +msgstr "Taille de remplissage de flux" + +#. type: Plain text +#: ../src/xz/xz.1:2306 +msgid "" +"Number of files. This is here to keep the order of the earlier columns the " +"same as on B lines." +msgstr "" +"Nombre de fichiers. Permet de garder l'ordre des colonnes précédentes comme " +"sur les lignes B." + +#. type: Plain text +#: ../src/xz/xz.1:2314 +msgid "" +"If B<--verbose> was specified twice, additional columns are included on the " +"B line:" +msgstr "" +"Si B<--verbose> a été indiqué deux fois, des colonnes supplémentaires sont " +"incluses sur la ligne B :" + +#. type: Plain text +#: ../src/xz/xz.1:2321 +msgid "" +"Maximum amount of memory (in bytes) required to decompress the files with " +"this B version" +msgstr "" +"Quantité maximale de mémoire (en octets) nécessaire pour décompresser les " +"fichiers avec cette version de B." + +#. type: Plain text +#: ../src/xz/xz.1:2341 +msgid "" +"Future versions may add new line types and new columns can be added to the " +"existing line types, but the existing columns won't be changed." +msgstr "" +"Les versions futures pourront ajouter de nouveaux types de lignes et de " +"nouvelles colonnes pourront être ajoutées aux types de lignes existants, " +"mais les colonnes existantes ne seront pas modifiées." + +#. type: SH +#: ../src/xz/xz.1:2342 ../src/xzdec/xzdec.1:104 ../src/lzmainfo/lzmainfo.1:44 +#: ../src/scripts/xzgrep.1:81 +#, no-wrap +msgid "EXIT STATUS" +msgstr "STATUT DE SORTIE" + +#. type: TP +#: ../src/xz/xz.1:2343 ../src/xzdec/xzdec.1:105 ../src/lzmainfo/lzmainfo.1:45 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../src/xz/xz.1:2346 ../src/lzmainfo/lzmainfo.1:48 +msgid "All is good." +msgstr "Tout est bon." + +#. type: TP +#: ../src/xz/xz.1:2346 ../src/xzdec/xzdec.1:108 ../src/lzmainfo/lzmainfo.1:48 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../src/xz/xz.1:2349 ../src/xzdec/xzdec.1:111 ../src/lzmainfo/lzmainfo.1:51 +msgid "An error occurred." +msgstr "Une erreur est survenue." + +#. type: TP +#: ../src/xz/xz.1:2349 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:2353 +msgid "Something worth a warning occurred, but no actual errors occurred." +msgstr "" +"Quelquechose méritant un avertissement s'est produit, mais aucune erreur " +"véritable n'est survenue." + +#. type: Plain text +#: ../src/xz/xz.1:2356 +msgid "" +"Notices (not warnings or errors) printed on standard error don't affect the " +"exit status." +msgstr "" +"Les notifications (pas les avertissements ou les erreurs) affichées sur " +"l'erreur standard n'affectent pas le statut de sortie." + +#. type: SH +#: ../src/xz/xz.1:2357 ../src/scripts/xzgrep.1:94 ../src/scripts/xzless.1:52 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "ENVIRONNEMENT" + +#. type: Plain text +#: ../src/xz/xz.1:2370 +msgid "" +"B parses space-separated lists of options from the environment variables " +"B and B, in this order, before parsing the options from " +"the command line. Note that only options are parsed from the environment " +"variables; all non-options are silently ignored. Parsing is done with " +"B(3) which is used also for the command line arguments." +msgstr "" +"B analyse les listes d'options séparées par des espaces à partir des " +"variables d'environnement B et B, dans cet ordre, avant " +"d'analyser les options de la ligne de commandes. Remarquez que seules les " +"options sont analysées depuis l'environnement des variables ; toutes les non-" +"options sont ignorées silencieusement. L'analyse est faite avec " +"B(3) qui est aussi utilisé pour les arguments de la ligne de " +"commandes." + +#. type: TP +#: ../src/xz/xz.1:2370 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2379 +msgid "" +"User-specific or system-wide default options. Typically this is set in a " +"shell initialization script to enable B's memory usage limiter by " +"default. Excluding shell initialization scripts and similar special cases, " +"scripts must never set or unset B." +msgstr "" +"Options par défaut propres à l'utilisateur ou pour tout le système. Elles " +"sont le plus souvent définies dans un script d'initialisation de " +"l'interpréteur pour activer le limiteur d'utilisation de la mémoire de B " +"par défaut. A part pour les scripts d'initialisation de l'interpréteur ou " +"des cas similaires, les sripts ne doivent jamais définir ou désactiver " +"B." + +#. type: TP +#: ../src/xz/xz.1:2379 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2390 +#, fuzzy +#| msgid "" +#| "This is for passing options to B when it is not possible to set the " +#| "options directly on the B command line. This is the case e.g. when " +#| "B is run by a script or tool, e.g. GNU B(1):" +msgid "" +"This is for passing options to B when it is not possible to set the " +"options directly on the B command line. This is the case when B is " +"run by a script or tool, for example, GNU B(1):" +msgstr "" +"Cela permet de passer des options à B lorsqu'il n'est pas possible de " +"définir ces options directement sur la ligne de commande B. C'est le " +"cas, par exemple, lorsque B est lancé par un script ou un outil, par " +"exemple B(1) de GNU :" + +#. type: Plain text +#: ../src/xz/xz.1:2396 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2410 +#, fuzzy +#| msgid "" +#| "Scripts may use B e.g. to set script-specific default compression " +#| "options. It is still recommended to allow users to override B if " +#| "that is reasonable, e.g. in B(1) scripts one may use something like " +#| "this:" +msgid "" +"Scripts may use B, for example, to set script-specific default " +"compression options. It is still recommended to allow users to override " +"B if that is reasonable. For example, in B(1) scripts one may " +"use something like this:" +msgstr "" +"Les scripts peuvent utiliser B, par exemple pour définir des options " +"de compression par défaut spécifiques au script. Il est toujours recommandé " +"d'autoriser les utilisateurs à outrepasser B si cela est " +"raisonnable, comme par exemple dans les scripts B(1) quelquechose comme " +"ceci devrait être utilisé :" + +#. type: Plain text +#: ../src/xz/xz.1:2417 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: SH +#: ../src/xz/xz.1:2422 +#, no-wrap +msgid "LZMA UTILS COMPATIBILITY" +msgstr "Compatibilité des utilitaires LZMA" + +#. type: Plain text +#: ../src/xz/xz.1:2435 +msgid "" +"The command line syntax of B is practically a superset of B, " +"B, and B as found from LZMA Utils 4.32.x. In most cases, it " +"is possible to replace LZMA Utils with XZ Utils without breaking existing " +"scripts. There are some incompatibilities though, which may sometimes cause " +"problems." +msgstr "" +"La syntaxe de la ligne de commande de B est quasimment un sur-ensemble " +"de B, B et B comme ils sont trouvés dans les " +"utilitaires LZMA 4.32.x . Dans la pluspart des cas, il est possible de " +"remplacer les outils LZMA par les outils XZ sans casser les scripts " +"existants. Il existe cependant certaines incompatibilités qui peuvent " +"parfois poser des problèmes." + +#. type: SS +#: ../src/xz/xz.1:2436 +#, no-wrap +msgid "Compression preset levels" +msgstr "Niveaux de préréglage de la compression" + +#. type: Plain text +#: ../src/xz/xz.1:2443 +msgid "" +"The numbering of the compression level presets is not identical in B and " +"LZMA Utils. The most important difference is how dictionary sizes are " +"mapped to different presets. Dictionary size is roughly equal to the " +"decompressor memory usage." +msgstr "" +"La numérotation des préréglages de niveau de compression est différente " +"entre les outils B et LZMA. La différence la plus importante est la " +"manière dont les tailles de dictionnaire sont affectées aux différents " +"préréglages. La taille de dictionnaire est à peu près égale à celle " +"d'utilisation de la mémoire de la décompression." + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "Level" +msgstr "Niveau" + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "xz" +msgstr "xz" + +#. type: tbl table +#: ../src/xz/xz.1:2449 +#, no-wrap +msgid "LZMA Utils" +msgstr "Utilitaires LZMA" + +#. type: tbl table +#: ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#, no-wrap +msgid "N/A" +msgstr "N/A" + +#. type: tbl table +#: ../src/xz/xz.1:2451 +#, no-wrap +msgid "64 KiB" +msgstr "64 KiB" + +#. type: tbl table +#: ../src/xz/xz.1:2453 +#, no-wrap +msgid "512 KiB" +msgstr "512 KiB" + +#. type: Plain text +#: ../src/xz/xz.1:2468 +msgid "" +"The dictionary size differences affect the compressor memory usage too, but " +"there are some other differences between LZMA Utils and XZ Utils, which make " +"the difference even bigger:" +msgstr "" +"Les différences de tailles des dictionnaires affectent aussi l'utilisation " +"de la mémoire du compresseur, mais il y a quelques autres différences entre " +"les outils LZMA et les outils XZ, qui rendent la différence encore plus " +"grande :" + +#. type: tbl table +#: ../src/xz/xz.1:2474 +#, no-wrap +msgid "LZMA Utils 4.32.x" +msgstr "Utilitaires LZMA 4.32.x" + +#. type: tbl table +#: ../src/xz/xz.1:2477 ../src/xz/xz.1:2478 +#, no-wrap +msgid "12 MiB" +msgstr "12 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2480 +#, no-wrap +msgid "26 MiB" +msgstr "26 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2481 +#, no-wrap +msgid "45 MiB" +msgstr "45 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2482 +#, no-wrap +msgid "83 MiB" +msgstr "83 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2483 +#, no-wrap +msgid "159 MiB" +msgstr "159 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2484 +#, no-wrap +msgid "311 MiB" +msgstr "311 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:2493 +msgid "" +"The default preset level in LZMA Utils is B<-7> while in XZ Utils it is " +"B<-6>, so both use an 8 MiB dictionary by default." +msgstr "" +"Le niveau de préréglage par défaut dans les outils LZMA est B<-7> alors que " +"pour les outils XZ c'est B<-6>, les deux utilisent ainsi un dictionnaire de " +"8 Mio par défaut." + +#. type: SS +#: ../src/xz/xz.1:2494 +#, no-wrap +msgid "Streamed vs. non-streamed .lzma files" +msgstr "Fichiers .lzma en flux ou non" + +#. type: Plain text +#: ../src/xz/xz.1:2504 +#, fuzzy +#| msgid "" +#| "The uncompressed size of the file can be stored in the B<.lzma> header. " +#| "LZMA Utils does that when compressing regular files. The alternative is " +#| "to mark that uncompressed size is unknown and use end-of-payload marker " +#| "to indicate where the decompressor should stop. LZMA Utils uses this " +#| "method when uncompressed size isn't known, which is the case for example " +#| "in pipes." +msgid "" +"The uncompressed size of the file can be stored in the B<.lzma> header. " +"LZMA Utils does that when compressing regular files. The alternative is to " +"mark that uncompressed size is unknown and use end-of-payload marker to " +"indicate where the decompressor should stop. LZMA Utils uses this method " +"when uncompressed size isn't known, which is the case, for example, in pipes." +msgstr "" +"La taille non compressée du fichier peut être stockée dans l'en-tête B<." +"lzma>. C'est ainsi que font les outils LZMA avec les fichiers normaux. " +"L'alternative est d'indiquer que la taille décompressée est inconnue et " +"utiliser un marqueur de fin de charge pour indiquer où le décompresseur doit " +"s'arrêter. Les outils LZMA utilisent cette méthode quand la taille " +"décompressée n'est pas connue, ce qui est le cas par exemple dans les " +"redirections." + +#. type: Plain text +#: ../src/xz/xz.1:2525 +msgid "" +"B supports decompressing B<.lzma> files with or without end-of-payload " +"marker, but all B<.lzma> files created by B will use end-of-payload " +"marker and have uncompressed size marked as unknown in the B<.lzma> header. " +"This may be a problem in some uncommon situations. For example, a B<.lzma> " +"decompressor in an embedded device might work only with files that have " +"known uncompressed size. If you hit this problem, you need to use LZMA " +"Utils or LZMA SDK to create B<.lzma> files with known uncompressed size." +msgstr "" +"B prend en charge la décompression des fichiers B<.lzma> avec ou sans " +"marqueur de fin de charge utile, mais tous les fichiers B<.lzma> créés par " +"B utiliseront un marqueur de fin de charge utile et ont la taille non " +"compréssée marquée comme inconnue dans l'en-tête B<.lzma>. Cela peut être un " +"problème dans quelques situations inhabituelles. Par exemple, un " +"décompresseur B<.lzma> dans un périphérique embarqué pourrait ne fonctionner " +"qu'avec des fichiers dont la taille non comprimée est connue. Si vous vous " +"heurtez à ce problème, vous devez utiliser les utilitaires LZMA ou LZMA SDK " +"pour créer des fichiers B<.lzma> avec une taille non compressée connue." + +#. type: SS +#: ../src/xz/xz.1:2526 +#, no-wrap +msgid "Unsupported .lzma files" +msgstr "Fichiers .lzma non pris en charge" + +#. type: Plain text +#: ../src/xz/xz.1:2549 +msgid "" +"The B<.lzma> format allows I values up to 8, and I values up to 4. " +"LZMA Utils can decompress files with any I and I, but always creates " +"files with B and B. Creating files with other I and I " +"is possible with B and with LZMA SDK." +msgstr "" +"Le format B<.lzma> autorise des valeurs I jusqu'à 8, et des valeurs " +"I jusqu'à 4. Les outils LZMA peuvent décompresser des fichiers avec tous " +"les I et I, mais créez toujours les fichiers avec B et " +"B. Créer des fichiers avec d'autres valeurs I et I est " +"possible avec B et avec LZMA SDK." + +#. type: Plain text +#: ../src/xz/xz.1:2560 +msgid "" +"The implementation of the LZMA1 filter in liblzma requires that the sum of " +"I and I must not exceed 4. Thus, B<.lzma> files, which exceed this " +"limitation, cannot be decompressed with B." +msgstr "" +"L'implémentation du filtre LZMA1 dans liblzma nécessite que la somme de " +"I et I soit inférieure ou égale à 4. Ainsi, les fichiers B<.lzma> " +"qui excèdent cette limitation ne peuvent pas être décompressés avec B." + +#. type: Plain text +#: ../src/xz/xz.1:2575 +msgid "" +"LZMA Utils creates only B<.lzma> files which have a dictionary size of " +"2^I (a power of 2) but accepts files with any dictionary size. liblzma " +"accepts only B<.lzma> files which have a dictionary size of 2^I or 2^I " +"+ 2^(I-1). This is to decrease false positives when detecting B<.lzma> " +"files." +msgstr "" +"Les outils LZMA créent seulement des fichiers B<.lzma> qui ont une taille de " +"dictionnaire de 2^I (une puissance de 2) mais acceptent les fichiers avec " +"toutes les tailles de dictionnaire. Libzlma n'accepte que les fichiers B<." +"lzma> qui ont une taille dictionnaire de 2^I ou 2^I + 2^(I-1). Cela " +"afin de diminuer les faux positifs lors de la détection des fichiers B<." +"lzma>." + +#. type: Plain text +#: ../src/xz/xz.1:2580 +msgid "" +"These limitations shouldn't be a problem in practice, since practically all " +"B<.lzma> files have been compressed with settings that liblzma will accept." +msgstr "" +"Ces limitations ne devraient pas poser problème en pratique, car " +"pratiquement tous les fichiers B<.lzma> ont été compressés avec des réglages " +"que liblzma accepte." + +#. type: SS +#: ../src/xz/xz.1:2581 +#, no-wrap +msgid "Trailing garbage" +msgstr "Déchets excédentaires" + +#. type: Plain text +#: ../src/xz/xz.1:2591 +msgid "" +"When decompressing, LZMA Utils silently ignore everything after the first B<." +"lzma> stream. In most situations, this is a bug. This also means that LZMA " +"Utils don't support decompressing concatenated B<.lzma> files." +msgstr "" +"Lors de la décompession, l'utilitaire LZMA ignore silencieusement tout ce " +"qui est après le premier flux B<.lzma>. Dans la majorité des situations, " +"c'est un bogue. Cela veut dire aussi que les outils LZMA ne gèrent pas la " +"décompression de fichiers B<.lzma> concaténés." + +#. type: Plain text +#: ../src/xz/xz.1:2601 +msgid "" +"If there is data left after the first B<.lzma> stream, B considers the " +"file to be corrupt unless B<--single-stream> was used. This may break " +"obscure scripts which have assumed that trailing garbage is ignored." +msgstr "" +"S'il reste des données après le premier flux B<.lzma>, B considère que " +"le fichier est corrompu sauf si B<--single-stream> a été utilisé. Cela peut " +"casser des scripts obscurs qui ont supposé que les déchets de fin de ligne " +"sont ignorés." + +#. type: SH +#: ../src/xz/xz.1:2602 ../src/xzdec/xzdec.1:117 +#, no-wrap +msgid "NOTES" +msgstr "NOTES" + +#. type: SS +#: ../src/xz/xz.1:2604 +#, no-wrap +msgid "Compressed output may vary" +msgstr "La sortie compressée peut varier" + +#. type: Plain text +#: ../src/xz/xz.1:2615 +msgid "" +"The exact compressed output produced from the same uncompressed input file " +"may vary between XZ Utils versions even if compression options are " +"identical. This is because the encoder can be improved (faster or better " +"compression) without affecting the file format. The output can vary even " +"between different builds of the same XZ Utils version, if different build " +"options are used." +msgstr "" +"La sortie compressée exacte produite par les même fichiers non compressés en " +"entrée peut varier en fonction des différentes versions de l'utilitaire XZ, " +"même si les options de compression sont identiques. En effet, il est " +"possible d'améliorer l'encodeur (compression plus rapide ou meilleure) sans " +"affecter le format du fichier. La sortie peut même varier entre différentes " +"compilations de la même version d'utilitaire XZ, si des options de " +"construction différentes sont utilisées." + +#. type: Plain text +#: ../src/xz/xz.1:2625 +msgid "" +"The above means that once B<--rsyncable> has been implemented, the resulting " +"files won't necessarily be rsyncable unless both old and new files have been " +"compressed with the same xz version. This problem can be fixed if a part of " +"the encoder implementation is frozen to keep rsyncable output stable across " +"xz versions." +msgstr "" +"Cela signifie qu'une fois que B<--rsyncable> a été implémenté, les fichiers " +"résultants ne seront pas nécessairement synchronisables avec rsync à moins " +"que les nouveaux et anciens fichiers n'aient été compressés avec la même " +"version de xz. Ce problème peut être résolu si une partie de " +"l'implémentation est gelée pour garantir la stabilité de la sortie rsyncable " +"à travers les versions de xz." + +#. type: SS +#: ../src/xz/xz.1:2626 +#, no-wrap +msgid "Embedded .xz decompressors" +msgstr "Décompresseurs .xz embarqués" + +#. type: Plain text +#: ../src/xz/xz.1:2643 +msgid "" +"Embedded B<.xz> decompressor implementations like XZ Embedded don't " +"necessarily support files created with integrity I types other than " +"B and B. Since the default is B<--check=crc64>, you must use " +"B<--check=none> or B<--check=crc32> when creating files for embedded systems." +msgstr "" +"Les implémentations de décompresseur embarqué comme XZ Embedded ne gèrent " +"pas nécessairement les fichiers créés avec d'autres types de I " +"d'intégrité que B et B. Comme la valeur par défaut est B<--" +"check=crc64>, vous devez utiliser B<--check=none> ou B<--check=crc32> lors " +"de la création de fichiers pour les systèmes embarqués." + +#. type: Plain text +#: ../src/xz/xz.1:2653 +msgid "" +"Outside embedded systems, all B<.xz> format decompressors support all the " +"I types, or at least are able to decompress the file without " +"verifying the integrity check if the particular I is not supported." +msgstr "" +"En dehors des systèmes embarqués, tous les décompresseurs de format B<.xz> " +"gèrent tous les types de I ou sont au moins capables de " +"décompresser le fichier sans effectuer la vérification d'intégrité si ce " +"type de I particulière n'est pas pris en charge." + +#. type: Plain text +#: ../src/xz/xz.1:2656 +msgid "" +"XZ Embedded supports BCJ filters, but only with the default start offset." +msgstr "" +"XZ Embedded prend en charge les filtres BCJ, mais seulement avec le décalage " +"de départ par défaut." + +#. type: SH +#: ../src/xz/xz.1:2657 +#, no-wrap +msgid "EXAMPLES" +msgstr "EXEMPLES" + +#. type: SS +#: ../src/xz/xz.1:2659 +#, no-wrap +msgid "Basics" +msgstr "Bases" + +#. type: Plain text +#: ../src/xz/xz.1:2669 +msgid "" +"Compress the file I into I using the default compression level " +"(B<-6>), and remove I if compression is successful:" +msgstr "" +"Compresser le fichier I en I en utilisant le niveau de " +"compression par défaut (B<-6>) et supprimer I si la compression " +"réussit :" + +#. type: Plain text +#: ../src/xz/xz.1:2674 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2685 +msgid "" +"Decompress I into I and don't remove I even if " +"decompression is successful:" +msgstr "" +"Décompresser I en I et ne pas supprimer I même " +"si la compression réussit :" + +#. type: Plain text +#: ../src/xz/xz.1:2690 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2703 +#, fuzzy +#| msgid "" +#| "Create I with the preset B<-4e> (B<-4 --extreme>), which is " +#| "slower than e.g. the default B<-6>, but needs less memory for compression " +#| "and decompression (48\\ MiB and 5\\ MiB, respectively):" +msgid "" +"Create I with the preset B<-4e> (B<-4 --extreme>), which is " +"slower than the default B<-6>, but needs less memory for compression and " +"decompression (48\\ MiB and 5\\ MiB, respectively):" +msgstr "" +"Créer I avec le préréglage B<-4e> (B<-4--extreme>), lequel est " +"plus lent que par exemle B<-6> (par défaut), mais nécessite moins de mémoire " +"pour la compression et la décompression (48\\ Mio et 5\\ Mio, " +"respectivement) :" + +#. type: Plain text +#: ../src/xz/xz.1:2708 +#, no-wrap +msgid "CW baz.tar.xz>\n" +msgstr "CW truc.tar.xz>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2714 +msgid "" +"A mix of compressed and uncompressed files can be decompressed to standard " +"output with a single command:" +msgstr "" +"Un mélange de fichiers compressés et non compressés peuvent être " +"décompressés vers la sortie standard avec une simple commande :" + +#. type: Plain text +#: ../src/xz/xz.1:2719 +#, no-wrap +msgid "CW abcd.txt>\n" +msgstr "CW abcd.txt>\n" + +#. type: SS +#: ../src/xz/xz.1:2723 +#, no-wrap +msgid "Parallel compression of many files" +msgstr "Compression en parallèle de plusieurs fichiers" + +#. type: Plain text +#: ../src/xz/xz.1:2729 +msgid "" +"On GNU and *BSD, B(1) and B(1) can be used to parallelize " +"compression of many files:" +msgstr "" +"Sur GNU et *BSD, B(1) et B(1) peuvent être utilisés pour mettre " +"en parallèle la compression de plusieurs fichiers :" + +#. type: Plain text +#: ../src/xz/xz.1:2735 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2757 +msgid "" +"The B<-P> option to B(1) sets the number of parallel B " +"processes. The best value for the B<-n> option depends on how many files " +"there are to be compressed. If there are only a couple of files, the value " +"should probably be 1; with tens of thousands of files, 100 or even more may " +"be appropriate to reduce the number of B processes that B(1) " +"will eventually create." +msgstr "" +"L'option B

passée à B(1) fixe le nombre de processus B en " +"parallèles. La meilleure valeur pour l'option B dépend du nombre de " +"fichiers à compresser. S-il n'y a que quelques fichiers, la valeur sera " +"probablement 1 ; avec des dizaines de milliers de fichiers, 100 ou même plus " +"serait approprié pour réduire le nombre de processus B que B(1) " +"créera éventuellement." + +#. type: Plain text +#: ../src/xz/xz.1:2765 +msgid "" +"The option B<-T1> for B is there to force it to single-threaded mode, " +"because B(1) is used to control the amount of parallelization." +msgstr "" +"L'option B<-T1> de B est là pour le forcer en mode mono-thread, car " +"B(1) est utilisé pour contrôler la quantité de mise en parallèle." + +#. type: SS +#: ../src/xz/xz.1:2766 +#, no-wrap +msgid "Robot mode" +msgstr "Mode robot" + +#. type: Plain text +#: ../src/xz/xz.1:2769 +msgid "" +"Calculate how many bytes have been saved in total after compressing multiple " +"files:" +msgstr "" +"Calculer combien d'octets ont été économisés au total après avoir compressé " +"plusieurs fichiers :" + +#. type: Plain text +#: ../src/xz/xz.1:2774 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2789 +msgid "" +"A script may want to know that it is using new enough B. The following " +"B(1) script checks that the version number of the B tool is at " +"least 5.0.0. This method is compatible with old beta versions, which didn't " +"support the B<--robot> option:" +msgstr "" +"Un script peut vouloir savoir qu'il utilise une version suffisamment récente " +"de B. Le script B(1) suivant vérifie que le numéro de version de " +"l'outil B soit au minimum 5.0.0. Cette méthode est compatible avec les " +"vieilles versions bêta, qui ne gèrent pas l'option B<--robot> :" + +#. type: Plain text +#: ../src/xz/xz.1:2798 +#, no-wrap +msgid "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" +msgstr "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Votre version de xz est trop ancienne.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2805 +msgid "" +"Set a memory usage limit for decompression using B, but if a limit " +"has already been set, don't increase it:" +msgstr "" +"Régler une limite d'utilisation de la mémoire pour la décompression en " +"utilisant B, mais si une limite a déjà été définie, ne pas " +"l'augmenter : " + +#. type: Plain text +#: ../src/xz/xz.1:2815 +#, fuzzy, no-wrap +#| msgid "" +#| "CWE 20)) # 123 MiB\n" +#| "OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +#| "if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +#| " XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +#| " export XZ_OPT\n" +#| "fi>\n" +msgid "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" +msgstr "" +"CWE 20)) # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2825 +msgid "" +"The simplest use for custom filter chains is customizing a LZMA2 preset. " +"This can be useful, because the presets cover only a subset of the " +"potentially useful combinations of compression settings." +msgstr "" +"L'utilisation la plus simple des chaînes de filtres personnalisées est la " +"personnalisation d'un préréglage LZMA2. Cela peut être utile, car les " +"préréglages ne couvrent qu'un sous-ensemble des réglages de compression " +"potentiellement utiles." + +#. type: Plain text +#: ../src/xz/xz.1:2833 +msgid "" +"The CompCPU columns of the tables from the descriptions of the options " +"B<-0> ... B<-9> and B<--extreme> are useful when customizing LZMA2 presets. " +"Here are the relevant parts collected from those two tables:" +msgstr "" +"Les colonnes CompCPU des tableaux des descriptions des options B<-0> à B<-9> " +"et B<--extreme> sont utiles lors de la personnalisation des préréglages " +"LZMA2. Voici les parties pertinentes recueillies à partir de ces deux " +"tableaux :" + +#. type: Plain text +#: ../src/xz/xz.1:2858 +#, fuzzy +#| msgid "" +#| "If you know that a file requires somewhat big dictionary (e.g. 32 MiB) to " +#| "compress well, but you want to compress it quicker than B would " +#| "do, a preset with a low CompCPU value (e.g. 1) can be modified to use a " +#| "bigger dictionary:" +msgid "" +"If you know that a file requires somewhat big dictionary (for example, 32\\ " +"MiB) to compress well, but you want to compress it quicker than B " +"would do, a preset with a low CompCPU value (for example, 1) can be " +"modified to use a bigger dictionary:" +msgstr "" +"Si vous savez qu'un fichier nécessite un dictionnaire relativement gros (par " +"exemple 32 Mio) pour bien compresser, mais que vous vouliez le compresser " +"plus vite que B ne le ferait, un préréglage avec une valeur basse de " +"CompCPU (par exemple 1) peut être modifié pour utiliser un dictionnaire plus " +"gros :" + +#. type: Plain text +#: ../src/xz/xz.1:2863 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2879 +msgid "" +"With certain files, the above command may be faster than B while " +"compressing significantly better. However, it must be emphasized that only " +"some files benefit from a big dictionary while keeping the CompCPU value " +"low. The most obvious situation, where a big dictionary can help a lot, is " +"an archive containing very similar files of at least a few megabytes each. " +"The dictionary size has to be significantly bigger than any individual file " +"to allow LZMA2 to take full advantage of the similarities between " +"consecutive files." +msgstr "" +"Avec certains fichiers, la commande ci-dessus peut être plus rapide que " +"B tout en compressant bien mieux. Cependant, il faut souligner que " +"seuls certains fichiers bénéficient d'un grand dictionnaire tout en gardant " +"la valeur de CompCPU faible. La siutation la plus évidente où un gros " +"dictionnaire peut baucoup aider, est une archive contenant des fichiers très " +"similaires de quelques megaoctets chacun. La taille de dictionnaire doit " +"être significativement plus grosse que tout fichier individuel pour " +"permettre à LZMA2 de tirer pleinement partie des similarités entre des " +"fichiers consécutifs." + +#. type: Plain text +#: ../src/xz/xz.1:2886 +msgid "" +"If very high compressor and decompressor memory usage is fine, and the file " +"being compressed is at least several hundred megabytes, it may be useful to " +"use an even bigger dictionary than the 64 MiB that B would use:" +msgstr "" +"Si une utilisation de la mémoire élevée pour la compression et décompression " +"convient, et que le fichier à compresser a une taille de plusieurs centaines " +"de megaoctets, il peut être utile d'utiliser un plus gros dictionnaire que " +"celui fourni par B (64 Mio) :" + +#. type: Plain text +#: ../src/xz/xz.1:2891 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2904 +msgid "" +"Using B<-vv> (B<--verbose --verbose>) like in the above example can be " +"useful to see the memory requirements of the compressor and decompressor. " +"Remember that using a dictionary bigger than the size of the uncompressed " +"file is waste of memory, so the above command isn't useful for small files." +msgstr "" +"Utiliser B<-vv> (B<--verbose--verbose>) comme dans l'exemple ci-dessus peut " +"être utile pour voir les besoins en mémoire du compresseur et du " +"décompresseur. Rappelez-vous qu'utiliser un dictionnaire plus gros que la " +"taille du fichier non compressé est un gachis de mémoire, donc la commande " +"ci-dessus n'est pas utile pour les petits fichiers." + +#. type: Plain text +#: ../src/xz/xz.1:2916 +#, fuzzy +#| msgid "" +#| "Sometimes the compression time doesn't matter, but the decompressor " +#| "memory usage has to be kept low e.g. to make it possible to decompress " +#| "the file on an embedded system. The following command uses B<-6e> (B<-6 " +#| "--extreme>) as a base and sets the dictionary to only 64\\ KiB. The " +#| "resulting file can be decompressed with XZ Embedded (that's why there is " +#| "B<--check=crc32>) using about 100\\ KiB of memory." +msgid "" +"Sometimes the compression time doesn't matter, but the decompressor memory " +"usage has to be kept low, for example, to make it possible to decompress the " +"file on an embedded system. The following command uses B<-6e> (B<-6 --" +"extreme>) as a base and sets the dictionary to only 64\\ KiB. The " +"resulting file can be decompressed with XZ Embedded (that's why there is B<--" +"check=crc32>) using about 100\\ KiB of memory." +msgstr "" +"Parfois le temps de compression importe peu, mais l'utilisation de la " +"mémoire du décompresseur doit être maintenue basse (par exemple pour rendre " +"possible la décompression d'un fichier sur un système embarqué). La commande " +"suivante utilise B<-6e> (B<-6 --extreme>) comme base, et définit le " +"dictionnaire à seulement 64\\ Kio. Le fichier qui en résulte peut être " +"décompressé avec XZ Embedded (c'est pourquoi il y a B<--check=crc32>) en " +"utilisant environ 100\\ Kio de mémoire." + +#. type: Plain text +#: ../src/xz/xz.1:2921 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2944 +#, fuzzy +#| msgid "" +#| "If you want to squeeze out as many bytes as possible, adjusting the " +#| "number of literal context bits (I) and number of position bits " +#| "(I) can sometimes help. Adjusting the number of literal position " +#| "bits (I) might help too, but usually I and I are more " +#| "important. E.g. a source code archive contains mostly US-ASCII text, so " +#| "something like the following might give slightly (like 0.1\\ %) smaller " +#| "file than B (try also without B):" +msgid "" +"If you want to squeeze out as many bytes as possible, adjusting the number " +"of literal context bits (I) and number of position bits (I) can " +"sometimes help. Adjusting the number of literal position bits (I) " +"might help too, but usually I and I are more important. For " +"example, a source code archive contains mostly US-ASCII text, so something " +"like the following might give slightly (like 0.1\\ %) smaller file than B (try also without B):" +msgstr "" +"Si vous voulez réduire au maximum le nombre d'octets, ajuster le nombre de " +"bits de contexte littéral (I) et le nombre de bits de position (I) " +"peut parfois être bénéfique. Ajuster le nombre de bits de position littéraux " +"(literal position bits)(I) devrait aider aussi, mais généralement I " +"et I sont plus importants. Par exemple, une archive de code source " +"contient majoritairement du texte US-ASCII, donc quelquechose du style de ce " +"qui suit devrait donner un fichier légèrement (approximativement O.1%) plus " +"petit que B (essayez aussi sans B) :" + +#. type: Plain text +#: ../src/xz/xz.1:2949 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2957 +#, fuzzy +#| msgid "" +#| "Using another filter together with LZMA2 can improve compression with " +#| "certain file types. E.g. to compress a x86-32 or x86-64 shared library " +#| "using the x86 BCJ filter:" +msgid "" +"Using another filter together with LZMA2 can improve compression with " +"certain file types. For example, to compress a x86-32 or x86-64 shared " +"library using the x86 BCJ filter:" +msgstr "" +"Utiliser un autre filtre avec LZMA2 peut améliorer la compression avec " +"certains types de fichiers. Par exemple, pour compresser une bibliothèque " +"partagée x86-32 ou x86-64 en utilisant le filtre BCJ x86 :" + +#. type: Plain text +#: ../src/xz/xz.1:2962 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2976 +msgid "" +"Note that the order of the filter options is significant. If B<--x86> is " +"specified after B<--lzma2>, B will give an error, because there cannot " +"be any filter after LZMA2, and also because the x86 BCJ filter cannot be " +"used as the last filter in the chain." +msgstr "" +"Notez que l'ordre des options de filtre est significatif. Si B<--x86> est " +"indiqué après B<--lzma2>, B donnera une erreur, car il ne peut y avoir " +"aucun filtre après LZMA2, et aussi parce que le filtre BCJ x86 ne peut pas " +"être utilisé comme dernier filtre dans la chaîne." + +#. type: Plain text +#: ../src/xz/xz.1:2982 +msgid "" +"The Delta filter together with LZMA2 can give good results with bitmap " +"images. It should usually beat PNG, which has a few more advanced filters " +"than simple delta but uses Deflate for the actual compression." +msgstr "" +"Le filtre Delta associé à LZMA2 peut donner de bons résultats avec les " +"images bitmap. Cela devrait habituellement battre PNG, qui a quelques " +"filtres avancés supplémentaires qu'un simple delta, mais qui utilise Deflate " +"pour la compression effective." + +#. type: Plain text +#: ../src/xz/xz.1:2992 +#, fuzzy +#| msgid "" +#| "The image has to be saved in uncompressed format, e.g. as uncompressed " +#| "TIFF. The distance parameter of the Delta filter is set to match the " +#| "number of bytes per pixel in the image. E.g. 24-bit RGB bitmap needs " +#| "B, and it is also good to pass B to LZMA2 to accommodate " +#| "the three-byte alignment:" +msgid "" +"The image has to be saved in uncompressed format, for example, as " +"uncompressed TIFF. The distance parameter of the Delta filter is set to " +"match the number of bytes per pixel in the image. For example, 24-bit RGB " +"bitmap needs B, and it is also good to pass B to LZMA2 to " +"accommodate the three-byte alignment:" +msgstr "" +"L'image doit être sauvée dans un format non compressé, comme TIFF non " +"compressé. Le paramètre de distance du filtre Delta est défini pour " +"correspondre au nombre d'octets par pixel dans l'image. Par exemple une " +"image RGB 24 bits nécessite B et il est aussi recommandé de passer " +"B à LZMA2 pour s'adapter à l'alignement trois octets :" + +#. type: Plain text +#: ../src/xz/xz.1:2997 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:3005 +#, fuzzy +#| msgid "" +#| "If multiple images have been put into a single archive (e.g.\\& B<.tar>), " +#| "the Delta filter will work on that too as long as all images have the " +#| "same number of bytes per pixel." +msgid "" +"If multiple images have been put into a single archive (for example, B<." +"tar>), the Delta filter will work on that too as long as all images have the " +"same number of bytes per pixel." +msgstr "" +"Si plusieurs images ont été mises dans une seule archive (par exemple\\&B<." +"tar>), le filtre Delta les modifiera pourvu que toutes les images ont le " +"même nombre d'octets par pixel." + +#. type: SH +#: ../src/xz/xz.1:3006 ../src/xzdec/xzdec.1:143 ../src/lzmainfo/lzmainfo.1:59 +#: ../src/scripts/xzdiff.1:65 ../src/scripts/xzgrep.1:106 +#: ../src/scripts/xzless.1:65 ../src/scripts/xzmore.1:51 +#, no-wrap +msgid "SEE ALSO" +msgstr "VOIR AUSSI" + +#. type: Plain text +#: ../src/xz/xz.1:3015 +msgid "" +"B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1), B<7z>(1)" +msgstr "" +"B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1), B<7z>(1)" + +#. type: Plain text +#: ../src/xz/xz.1:3017 +msgid "XZ Utils: Ehttps://tukaani.org/xz/E" +msgstr "XZ Utilitaires: Ehttps://tukaani.org/xz/E" + +#. type: Plain text +#: ../src/xz/xz.1:3019 ../src/xzdec/xzdec.1:146 +msgid "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" +msgstr "XZ Embarqué: Ehttps://tukaani.org/xz/embedded.htmlE" + +#. type: Plain text +#: ../src/xz/xz.1:3020 +msgid "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" +msgstr "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "XZDEC" +msgstr "XZDEC" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "2017-04-19" +msgstr "19-04-2017" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:10 +msgid "xzdec, lzmadec - Small .xz and .lzma decompressors" +msgstr "xzdec, lzmadec - Small .xz et .lzma decompresseurs" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:14 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:18 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:44 +msgid "" +"B is a liblzma-based decompression-only tool for B<.xz> (and only B<." +"xz>) files. B is intended to work as a drop-in replacement for " +"B(1) in the most common situations where a script has been written to " +"use B (and possibly a few other commonly used " +"options) to decompress B<.xz> files. B is identical to B " +"except that B supports B<.lzma> files instead of B<.xz> files." +msgstr "" +"B est un outil uniquement de décompression, basé sur liblzma pour les " +"fichiers B<.xz> (et seulement B<.xz>). B est destiné à remplacer " +"B(1) dans les situations les plus courantes où un script a été écrit " +"pour utiliser B (et possiblement quelques autres " +"options courantes) pour décompresser des fichiers B<.xz>. B est " +"identique à B, sauf que B prend en charge les fichiers B<." +"lzma> au lieu des fichiers B<.xz>." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:61 +msgid "" +"To reduce the size of the executable, B doesn't support " +"multithreading or localization, and doesn't read options from B " +"and B environment variables. B doesn't support displaying " +"intermediate progress information: sending B to B does " +"nothing, but sending B terminates the process instead of displaying " +"progress information." +msgstr "" +"Pour réduire la taille de l'exécutable, B ne prend en charge ni le " +"multithreading ni la localisation et ne lit pas les options des variables " +"d'environnement B et B. B ne gère pas " +"l'affichage d'information sur la progression du traitement : envoyer " +"B à B ne fait rien, mais envoyer B termine le " +"processus au lieu d'afficher de l'information sur la progression." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:69 +msgid "" +"Ignored for B(1) compatibility. B supports only decompression." +msgstr "" +"Ignoré pour la compatibilité avec B(1), B ne gère que la " +"décompression." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:76 +msgid "" +"Ignored for B(1) compatibility. B never creates or removes any " +"files." +msgstr "" +"Ignoré pour la compatibilité avec B(1), B ne crée ni ne supprime " +"jamais aucun fichier." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:83 +msgid "" +"Ignored for B(1) compatibility. B always writes the " +"decompressed data to standard output." +msgstr "" +"Ignoré pour la compatibilité avec B(1), B écrit toujours les " +"données décompressées sur la sortie standard." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:89 +msgid "" +"Specifying this once does nothing since B never displays any warnings " +"or notices. Specify this twice to suppress errors." +msgstr "" +"Spécifier cela une fois ne fait rien, car B n'affiche jamais aucun " +"avertissement ou notification. Spécifier cela deux fois pour supprimer les " +"erreurs." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:96 +msgid "" +"Ignored for B(1) compatibility. B never uses the exit status 2." +msgstr "" +"Ignoré pour la compatibilité avec B(1), B n'utilise jamais le " +"satut de sortie 2." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:99 +msgid "Display a help message and exit successfully." +msgstr "Afficher un message d'aide et quitter." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:104 +msgid "Display the version number of B and liblzma." +msgstr "Afficher le numéro de version de B et liblzma." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:108 +msgid "All was good." +msgstr "Tout s'est bien passé." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:117 +msgid "" +"B doesn't have any warning messages like B(1) has, thus the exit " +"status 2 is not used by B." +msgstr "" +"A la différence de B(1),B n'a pas de messages d'avertissement, et " +"donc le statut de sortie 2 n'est pas utilisé par B." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:131 +msgid "" +"Use B(1) instead of B or B for normal everyday use. " +"B or B are meant only for situations where it is important " +"to have a smaller decompressor than the full-featured B(1)." +msgstr "" +"Utilisez B(1) au lieu de B ou B pour un usage normal de " +"tous les jours. B ou B ne sont utiles que pour les " +"situations où il est important d'avoir un plus petit décompresseur que le " +"B(1) complet." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:143 +msgid "" +"B and B are not really that small. The size can be reduced " +"further by dropping features from liblzma at compile time, but that " +"shouldn't usually be done for executables distributed in typical non-" +"embedded operating system distributions. If you need a truly small B<.xz> " +"decompressor, consider using XZ Embedded." +msgstr "" +"B et B ne sont en fait pas vraiment si petits. La taille " +"peut être encore réduite en abandonnant des fonctionnalités de liblzma au " +"moment de la compilation, mais cela ne devrait pas être fait pour des " +"exécutables distribués sur des systèmes d'exploitation classique non " +"embarqués. Si vous avez besoin d'un décompresseur vraiment petit, pensez à " +"utiliser XZ Embedded." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:145 ../src/lzmainfo/lzmainfo.1:60 +msgid "B(1)" +msgstr "B(1)" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 +#, no-wrap +msgid "LZMAINFO" +msgstr "LZMAINFO" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "2013-06-30" +msgstr "30-06-2013" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:10 +msgid "lzmainfo - show information stored in the .lzma file header" +msgstr "" +"lzmainfo - Afficher l'information stockée dans l'en-tête du fichier .lzma" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:15 +msgid "B [B<--help>] [B<--version>] [I]" +msgstr "B [B<--help>] [B<--version>] [I]" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:31 +msgid "" +"B shows information stored in the B<.lzma> file header. It reads " +"the first 13 bytes from the specified I, decodes the header, and " +"prints it to standard output in human readable format. If no I are " +"given or I is B<->, standard input is read." +msgstr "" +"B affiche l'information stockée dans l'en-tête du fichier B<." +"lzma>. Il lit les 13 premiers octets du I indiqué, décode l'en-" +"tête, et l'écrit sur la sortie standard dans un format lisible par un " +"humain. Si aucun I n'est spécifié ou si I est B<->, " +"l'entrée standard est lue." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:40 +msgid "" +"Usually the most interesting information is the uncompressed size and the " +"dictionary size. Uncompressed size can be shown only if the file is in the " +"non-streamed B<.lzma> format variant. The amount of memory required to " +"decompress the file is a few dozen kilobytes plus the dictionary size." +msgstr "" +"Habituellement l'information la plus interressante est la taille non " +"compressée et la taille du dictionnaire. La taille ne peut être affichée que " +"si le fichier est dans la variante du format B<.lzma> qui n'est pas en flux. " +"La quantité de mémoire requise pour décompresser le fichier est de quelques " +"douzaines de kilooctets en plus de la taille du dictionnaire." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:44 +msgid "" +"B is included in XZ Utils primarily for backward compatibility " +"with LZMA Utils." +msgstr "" +"B est inclus dans les utilitaires XZ essentiellement pour des " +"besoins de rétrocompatibilité avec les utilitaires LZMA." + +#. type: SH +#: ../src/lzmainfo/lzmainfo.1:51 ../src/scripts/xzdiff.1:74 +#, no-wrap +msgid "BUGS" +msgstr "BOGUES" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:59 +msgid "" +"B uses B while the correct suffix would be B (2^20 " +"bytes). This is to keep the output compatible with LZMA Utils." +msgstr "" +"B utilise B alors que le suffixe correct devrait être " +"B(2^20 octets). Cela pour garder la sortie compatible avec les " +"utilitaires LZMA." + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "XZDIFF" +msgstr "XZDIFF" + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, fuzzy, no-wrap +#| msgid "2013-06-30" +msgid "2021-06-04" +msgstr "30-06-2013" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:12 +msgid "xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files" +msgstr "xzcmp, xzdiff, lzcmp, lzdiff - Comparer des fichiers compressés." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:15 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:18 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:21 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:24 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:59 +#, fuzzy +#| msgid "" +#| "B and B invoke B(1) or B(1) on files " +#| "compressed with B(1), B(1), B(1), B(1), or " +#| "B(1). All options specified are passed directly to B(1) or " +#| "B(1). If only one file is specified, then the files compared are " +#| "I (which must have a suffix of a supported compression format) and " +#| "I from which the compression format suffix has been stripped. If " +#| "two files are specified, then they are uncompressed if necessary and fed " +#| "to B(1) or B(1). The exit status from B(1) or " +#| "B(1) is preserved." +msgid "" +"B and B invoke B(1) or B(1) on files compressed " +"with B(1), B(1), B(1), B(1), B(1), or " +"B(1). All options specified are passed directly to B(1) or " +"B(1). If only one file is specified, then the files compared are " +"I (which must have a suffix of a supported compression format) and " +"I from which the compression format suffix has been stripped. If two " +"files are specified, then they are uncompressed if necessary and fed to " +"B(1) or B(1). The exit status from B(1) or B(1) is " +"preserved unless a decompression error occurs; then exit status is 2." +msgstr "" +"B et B invoquent B(1) ou B(1) sur les fichiers " +"compressés avec B(1), B(1), B(1), B(1) ou B(1). " +"Toutes les options spécifiées sont passées directement à B(1) ou " +"B(1). Si seulement un fichier est indiqué alors les fichiers comparés " +"sont I (lequel doit avoir un suffixe de format de compression pris " +"en charge) et I duquel le suffixe de format a été enlevé. Si deux " +"fichiers sont spécifiés, ils sont décompressés si nécessaire et envoyés à " +"B(1) ou B(1). Le statut de sortie de B(1) ou B(1) est " +"préservé." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:65 +msgid "" +"The names B and B are provided for backward compatibility " +"with LZMA Utils." +msgstr "" +"Les noms B et B sont fournis pour des besoins de " +"rétrocompatibilité avec les Utilitaires LZMA." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:74 +#, fuzzy +#| msgid "" +#| "B(1), B(1), B(1), B(1), B(1), B(1), " +#| "B(1)" +msgid "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1)" +msgstr "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:79 +msgid "" +"Messages from the B(1) or B(1) programs refer to temporary " +"filenames instead of those specified." +msgstr "" +"Les messages des programmes B(1) ou B(1) se réfèrent à des noms " +"de fichiers temporaires et non à ceux spécifiés." + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "XZGREP" +msgstr "XZGREP" + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "2022-07-19" +msgstr "" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:12 +msgid "xzgrep - search compressed files for a regular expression" +msgstr "" +"xzgrep - Chercher une expression rationnelle dans des fichiers compressés" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:18 +#, fuzzy +#| msgid "B [I] [B<-e>] I I..." +msgid "B [I] [B<-e>] I [I]" +msgstr "B [I] [B<-e>] I I..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:21 +#, fuzzy +#| msgid "B ..." +msgid "B \\&..." +msgstr "B ..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:24 +#, fuzzy +#| msgid "B ..." +msgid "B \\&..." +msgstr "B ..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:27 +#, fuzzy +#| msgid "B ..." +msgid "B \\&..." +msgstr "B ..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:30 +#, fuzzy +#| msgid "B ..." +msgid "B \\&..." +msgstr "B ..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:33 +#, fuzzy +#| msgid "B ..." +msgid "B \\&..." +msgstr "B ..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:49 +#, fuzzy +#| msgid "" +#| "B invokes B(1) on I which may be either " +#| "uncompressed or compressed with B(1), B(1), B(1), " +#| "B(1), or B(1). All options specified are passed directly to " +#| "B(1)." +msgid "" +"B invokes B(1) on I which may be either uncompressed " +"or compressed with B(1), B(1), B(1), B(1), " +"B(1), or B(1). All options specified are passed directly to " +"B(1)." +msgstr "" +"B invoque B(1) sur des I qui ont pu être compressés " +"ou décompressés que ce soit avec B(1), B(1), B(1), " +"B(1) ou B(1). Toutes les options spécifiées sont passées " +"directement à B(1)." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:62 +#, fuzzy +#| msgid "" +#| "If no I is specified, then standard input is decompressed if " +#| "necessary and fed to B(1). When reading from standard input, " +#| "B(1), B(1), and B(1) compressed files are not " +#| "supported." +msgid "" +"If no I is specified, then standard input is decompressed if necessary " +"and fed to B(1). When reading from standard input, B(1), " +"B(1), B(1), and B(1) compressed files are not supported." +msgstr "" +"Si aucun I n'est spécifié, alors l'entrée standard est décompressée " +"si nécessaire et alimente B(1). Lorsque c'est l'entrée standard qui " +"est lue, les fichiers compressés B(1), B(1) et B(1) ne " +"sont pas pris en charge." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:81 +#, fuzzy +#| msgid "" +#| "If B is invoked as B or B then B(1) or " +#| "B(1) is used instead of B(1). The same applies to names " +#| "B, B, and B, which are provided for backward " +#| "compatibility with LZMA Utils." +msgid "" +"If B is invoked as B or B then B or " +"B is used instead of B(1). The same applies to names " +"B, B, and B, which are provided for backward " +"compatibility with LZMA Utils." +msgstr "" +"Si B est invoqué comme B ou B, alors B(1) " +"ou B(1) est utilisé à la place de B(1). La même chose " +"s'applique aux noms B, B et B qui sont fournis " +"pour la rétrocompatibilité avec les Utilitaires LZMA." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:86 +msgid "" +"At least one match was found from at least one of the input files. No " +"errors occurred." +msgstr "" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:90 +msgid "No matches were found from any of the input files. No errors occurred." +msgstr "" + +#. type: TP +#: ../src/scripts/xzgrep.1:90 +#, no-wrap +msgid "E1" +msgstr "" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:94 +msgid "One or more errors occurred. It is unknown if matches were found." +msgstr "" + +#. type: TP +#: ../src/scripts/xzgrep.1:95 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:106 +#, fuzzy +#| msgid "" +#| "If the B environment variable is set, B uses it instead of " +#| "B(1), B(1), or B(1)." +msgid "" +"If the B environment variable is set, B uses it instead of " +"B(1), B, or B." +msgstr "" +"Si la variable d'environnement B est définie, B l'utilise à la " +"place de B(1), B(1) ou B(1)." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:113 +#, fuzzy +#| msgid "" +#| "B(1), B(1), B(1), B(1), B(1), B(1)" +msgid "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "XZLESS" +msgstr "XZLESS" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "2010-09-27" +msgstr "27-09-2010" + +#. type: Plain text +#: ../src/scripts/xzless.1:13 +msgid "xzless, lzless - view xz or lzma compressed (text) files" +msgstr "" +"xzless, lzless - Voir le contenu des fichiers (texte) compressés xz ou lzma" + +#. type: Plain text +#: ../src/scripts/xzless.1:16 +msgid "B [I...]" +msgstr "B [I...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:19 +msgid "B [I...]" +msgstr "B [I...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:31 +msgid "" +"B is a filter that displays text from compressed files to a " +"terminal. It works on files compressed with B(1) or B(1). If no " +"I are given, B reads from standard input." +msgstr "" +"B est un filtre qui affiche le contenu de fichiers compressés dans " +"un terminal. Cela fonctionne avec les fichiers compressés avec B(1) ou " +"B(1). Si aucun I n'est donné, B lit depuis l'entrée " +"standard." + +#. type: Plain text +#: ../src/scripts/xzless.1:48 +msgid "" +"B uses B(1) to present its output. Unlike B, its " +"choice of pager cannot be altered by setting an environment variable. " +"Commands are based on both B(1) and B(1) and allow back and " +"forth movement and searching. See the B(1) manual for more " +"information." +msgstr "" +"B utilise B(1) pour afficher sa sortie. Contrairement à " +"B, son choix d'afficheur ne peut pas être modifié en indiquant une " +"variable d'environnement. Les commandes sont basées sur B(1) et " +"B(1) et permettent des déplacements en avant et en arrière et des " +"recherches. Voir le manuel de B(1) pour plus d'information." + +#. type: Plain text +#: ../src/scripts/xzless.1:52 +msgid "" +"The command named B is provided for backward compatibility with LZMA " +"Utils." +msgstr "" +"La commande nommée B est fournie pour la rétrocompatibilité avec les " +"utilitaires LZMA." + +#. type: TP +#: ../src/scripts/xzless.1:53 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:59 +msgid "" +"A list of characters special to the shell. Set by B unless it is " +"already set in the environment." +msgstr "" +"Une liste de caractères spéciaux pour l'interpréteur. Définis par B " +"à moins qu'ils ne l'aient déjà été dans l'environnement." + +#. type: TP +#: ../src/scripts/xzless.1:59 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:65 +msgid "" +"Set to a command line to invoke the B(1) decompressor for preprocessing " +"the input files to B(1)." +msgstr "" +"Définir en ligne de commande le décompresseur B(1) à invoquer pour " +"préparer les fichiers en entrée pour B(1)." + +#. type: Plain text +#: ../src/scripts/xzless.1:69 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZMORE" +msgstr "XZMORE" + +#. type: Plain text +#: ../src/scripts/xzmore.1:10 +msgid "xzmore, lzmore - view xz or lzma compressed (text) files" +msgstr "" +"xzmore, lzmore - Voir le contenu des fichiers (texte) compressés xz ou lzma" + +#. type: Plain text +#: ../src/scripts/xzmore.1:13 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:16 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:24 +msgid "" +"B is a filter which allows examination of B(1) or B(1) " +"compressed text files one screenful at a time on a soft-copy terminal." +msgstr "" +"B est un filtre qui permet d'examiner le contenu des fichiers texte " +"compressés B(1) ou B(1), une page d'écran à la fois, sur un " +"terminal écran." + +#. type: Plain text +#: ../src/scripts/xzmore.1:33 +msgid "" +"To use a pager other than the default B set environment variable " +"B to the name of the desired program. The name B is provided " +"for backward compatibility with LZMA Utils." +msgstr "" +"Pour utiliser un afficheur autre que B, l'afficheur par défaut, " +"définissez la variable d'environnement B avec le nom du programme " +"souhaité. Le nom B est fourni pour la rétrocompatibilité avec les " +"utilitaires LZMA." + +#. type: TP +#: ../src/scripts/xzmore.1:33 +#, no-wrap +msgid "B or B" +msgstr "B ou B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:40 +msgid "" +"When the prompt --More--(Next file: I) is printed, this command " +"causes B to exit." +msgstr "" +"Lorsque l'invite --More--(prochain fichier : I) est affiché, cette " +"commande force B à quitter." + +#. type: TP +#: ../src/scripts/xzmore.1:40 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:47 +msgid "" +"When the prompt --More--(Next file: I) is printed, this command " +"causes B to skip the next file and continue." +msgstr "" +"Lorsque l'invite --More--(prochain fichier : I) est affiché, cette " +"commande force B à ignorer le prochain fichier et continuer." + +#. type: Plain text +#: ../src/scripts/xzmore.1:51 +msgid "" +"For list of keyboard commands supported while actually viewing the content " +"of a file, refer to manual of the pager you use, usually B(1)." +msgstr "" +"Pour une liste des commandes clavier prises en charge lors de la lecture du " +"contenu d'un fichier, référez vous au manuel de l'afficheur (pager) que vous " +"utilisez, habituellement B(1)." + +#. type: Plain text +#: ../src/scripts/xzmore.1:55 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#~ msgid "" +#~ "Display an error and exit if the compression settings exceed the memory " +#~ "usage limit. The default is to adjust the settings downwards so that the " +#~ "memory usage limit is not exceeded. Automatic adjusting is always " +#~ "disabled when creating raw streams (B<--format=raw>)." +#~ msgstr "" +#~ "Afficher une erreur et quitter si les réglages de compression dépassent " +#~ "la limite d'utilisation de la mémoire. Le comportement par défaut " +#~ "consiste à ajuster les réglages vers le bas pour que l'utilisation de la " +#~ "mémoire ne soit pas dépassée. L'ajustement automatique est toujours " +#~ "désactivé lors de la création de flux bruts (B<--format=raw>)." + +#~ msgid "" +#~ "It is fine to apply a BCJ filter on a whole executable; there's no need " +#~ "to apply it only on the executable section. Applying a BCJ filter on an " +#~ "archive that contains both executable and non-executable files may or may " +#~ "not give good results, so it generally isn't good to blindly apply a BCJ " +#~ "filter when compressing binary packages for distribution." +#~ msgstr "" +#~ "Il est possible d'appliquer un filtre BCJ sur l'ensemble d'un " +#~ "exécutable ; il n'est pas nécessaire de l'appliquer uniquement sur la " +#~ "section exécutable. Appliquer un filtre BCJ sur une archive contenant à " +#~ "la fois des fichiers exécutables et des fichiers non-exécutables " +#~ "pourrait, ou non, donner de bons résultats, donc il n'est généralement " +#~ "pas bon d'appliquer aveuglémént un filtre BCJ lors de la compression de " +#~ "paquets binaires pour leur distribution." + +#~ msgid "" +#~ "These BCJ filters are very fast and use insignificant amount of memory. " +#~ "If a BCJ filter improves compression ratio of a file, it can improve " +#~ "decompression speed at the same time. This is because, on the same " +#~ "hardware, the decompression speed of LZMA2 is roughly a fixed number of " +#~ "bytes of compressed data per second." +#~ msgstr "" +#~ "Ces filtres BCJ sont très rapides et utilisent une quantité insignifiante " +#~ "de mémoire. Si un filtre BCJ améliore le taux de compression d'un " +#~ "fichier, il peut en même temps améliorer la vitesse de décompression. " +#~ "Cela parce que sur un même matériel, la vitesse de décompression de LZMA2 " +#~ "est approximativement un nombre fixe d'octets de données compressées par " +#~ "seconde." + +#~ msgid "" +#~ "Applying a BCJ filter on an archive containing multiple similar " +#~ "executables can make the compression ratio worse than not using a BCJ " +#~ "filter. This is because the BCJ filter doesn't detect the boundaries of " +#~ "the executable files, and doesn't reset the address conversion counter " +#~ "for each executable." +#~ msgstr "" +#~ "L'application d'un filtre BCJ sur une archive contenant plusieurs " +#~ "exécutables similaires peut rendre le taux de compression moins bon que " +#~ "si l'on n'utilisait pas de filtre BCJ. Cela est dû au fait que le filtre " +#~ "BCJ ne détecte pas les limites des fichiers exécutables et ne remet pas à " +#~ "zéro le compteur de conversion d'adresse pour chaque exécutable." + +#~ msgid "" +#~ "Both of the above problems will be fixed in the future in a new filter. " +#~ "The old BCJ filters will still be useful in embedded systems, because the " +#~ "decoder of the new filter will be bigger and use more memory." +#~ msgstr "" +#~ "Les deux problèmes ci-dessus seront réglés dans le futur dans un nouveau " +#~ "filtre. Les vieux filtres BCJ seront toujours utiles dans les systèmes " +#~ "embarqués, car le décodeur du nouveau filtre sera plus gros et utilisera " +#~ "plus de mémoire." + +#~ msgid "Different instruction sets have different alignment:" +#~ msgstr "Les différents jeux d'instructions ont un alignement différent :" + +#, no-wrap +#~ msgid "Little endian only" +#~ msgstr "Petit-boutiste seulement" + +#, no-wrap +#~ msgid "Big or little endian" +#~ msgstr "Grand ou petit boutiste" + +#, no-wrap +#~ msgid "2011-03-19" +#~ msgstr "19-03-2011" diff --git a/po4a/ko.po b/po4a/ko.po new file mode 100644 index 0000000..3e90118 --- /dev/null +++ b/po4a/ko.po @@ -0,0 +1,5552 @@ +# Korean translation for the xz-man +# This file is put in the public domain. +# Seong-ho Cho , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: xz-man 5.4.0-pre2\n" +"POT-Creation-Date: 2023-01-03 20:53+0800\n" +"PO-Revision-Date: 2023-01-01 22:37+0900\n" +"Last-Translator: Seong-ho Cho \n" +"Language-Team: Korean \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.3.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "XZ" +msgstr "XZ" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "2022-12-01" +msgstr "2022-12-01" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "Tukaani" +msgstr "Tukaani" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZ Utils" +msgstr "XZ 유틸리티" + +#. type: SH +#: ../src/xz/xz.1:10 ../src/xzdec/xzdec.1:8 ../src/lzmainfo/lzmainfo.1:8 +#: ../src/scripts/xzdiff.1:10 ../src/scripts/xzgrep.1:10 +#: ../src/scripts/xzless.1:11 ../src/scripts/xzmore.1:8 +#, no-wrap +msgid "NAME" +msgstr "이름" + +#. type: Plain text +#: ../src/xz/xz.1:12 +msgid "" +"xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma " +"files" +msgstr "" +"xz, unxz, xzcat, lzma, unlzma, lzcat - .xz 파일과 .lzma 파일을 압축 또는 압" +"축 해제합니다" + +#. type: SH +#: ../src/xz/xz.1:13 ../src/xzdec/xzdec.1:10 ../src/lzmainfo/lzmainfo.1:10 +#: ../src/scripts/xzdiff.1:12 ../src/scripts/xzgrep.1:12 +#: ../src/scripts/xzless.1:13 ../src/scripts/xzmore.1:10 +#, no-wrap +msgid "SYNOPSIS" +msgstr "요약" + +#. type: Plain text +#: ../src/xz/xz.1:17 +msgid "B [I] [I]" +msgstr "B [I<<옵션>...>] [I파일E...>]" + +#. type: SH +#: ../src/xz/xz.1:18 +#, no-wrap +msgid "COMMAND ALIASES" +msgstr "명령 별칭" + +#. type: Plain text +#: ../src/xz/xz.1:22 +msgid "B is equivalent to B." +msgstr "B 명령은 B 명령과 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:26 +msgid "B is equivalent to B." +msgstr "B 명령은 B 명령과 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:30 +msgid "B is equivalent to B." +msgstr "B 명령은 B 명령과 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:34 +msgid "B is equivalent to B." +msgstr "B 명령은 B 명령과 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:38 +msgid "B is equivalent to B." +msgstr "" +"B 명령은 B 명령과 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:50 +msgid "" +"When writing scripts that need to decompress files, it is recommended to " +"always use the name B with appropriate arguments (B or B) instead of the names B and B." +msgstr "" +"파일 압축을 해제해야 하는 셸 스크립트를 작성할 때, B 와 B 이름 " +"대신 B 명령과 적절한 인자 값(B 또는 B)의 사용을 추천드립니" +"다." + +#. type: SH +#: ../src/xz/xz.1:51 ../src/xzdec/xzdec.1:18 ../src/lzmainfo/lzmainfo.1:15 +#: ../src/scripts/xzdiff.1:24 ../src/scripts/xzgrep.1:33 +#: ../src/scripts/xzless.1:19 ../src/scripts/xzmore.1:16 +#, no-wrap +msgid "DESCRIPTION" +msgstr "설명" + +#. type: Plain text +#: ../src/xz/xz.1:70 +msgid "" +"B is a general-purpose data compression tool with command line syntax " +"similar to B(1) and B(1). The native file format is the B<." +"xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw " +"compressed streams with no container format headers are also supported. In " +"addition, decompression of the B<.lz> format used by B is supported." +msgstr "" +"B는 B(1) 과 B(1) 과 비슷한 명령행 문법을 지닌 범용 데이터 " +"압축 도구입니다. 자체 파일 형식은 B<.xz> 형식이나, LZMA 유틸리티에서 사용하" +"는 예전 B<.lzma> 형식과 형식 헤더가 없는 RAW 압축 스트림도 지원합니다. 게다" +"가, B에서 활용하는 B<.lz> 형식 압축 해제도 지원합니다." + +#. type: Plain text +#: ../src/xz/xz.1:92 +msgid "" +"B compresses or decompresses each I according to the selected " +"operation mode. If no I are given or I is B<->, B reads " +"from standard input and writes the processed data to standard output. B " +"will refuse (display an error and skip the I) to write compressed " +"data to standard output if it is a terminal. Similarly, B will refuse " +"to read compressed data from standard input if it is a terminal." +msgstr "" +"각 I<파일> 에 대한 B 압축 또는 압축 해제는 선택 동작 모드에 따릅니다. " +"I파일E> 값이 주어졌거나 I파일E> 값이 B<->이면, B 명령" +"에서 표준 입력을 읽고 처리한 데이터를 표준 출력에 기록합니다. B 에서는 " +"터미널에서 활용할 경우 압축 데이터를 표준 압축으로 기록하는 동작을 거절(오류" +"를 출력하고 I파일E>을 건너뜀)합니다. 이와 비슷하게, B 유틸리티" +"를 터미널에서 실행하면 표준 입력의 압축 데이터 읽기를 거절합니다." + +#. type: Plain text +#: ../src/xz/xz.1:102 +msgid "" +"Unless B<--stdout> is specified, I other than B<-> are written to a " +"new file whose name is derived from the source I name:" +msgstr "" +"B<--stdout> 을 지정하지 않는 한, B<->가 아닌 I파일E>을 원본 I" +"파일E> 이름에서 가져온 새 파일 이름으로 기록합니다:" + +#. type: IP +#: ../src/xz/xz.1:102 ../src/xz/xz.1:108 ../src/xz/xz.1:133 ../src/xz/xz.1:138 +#: ../src/xz/xz.1:141 ../src/xz/xz.1:144 ../src/xz/xz.1:160 ../src/xz/xz.1:421 +#: ../src/xz/xz.1:424 ../src/xz/xz.1:431 ../src/xz/xz.1:676 ../src/xz/xz.1:678 +#: ../src/xz/xz.1:777 ../src/xz/xz.1:788 ../src/xz/xz.1:797 ../src/xz/xz.1:805 +#: ../src/xz/xz.1:1033 ../src/xz/xz.1:1042 ../src/xz/xz.1:1054 +#: ../src/xz/xz.1:1729 ../src/xz/xz.1:1735 ../src/xz/xz.1:1853 +#: ../src/xz/xz.1:1857 ../src/xz/xz.1:1860 ../src/xz/xz.1:1863 +#: ../src/xz/xz.1:1867 ../src/xz/xz.1:1874 ../src/xz/xz.1:1876 +#, no-wrap +msgid "\\(bu" +msgstr "\\(bu" + +#. type: Plain text +#: ../src/xz/xz.1:108 +msgid "" +"When compressing, the suffix of the target file format (B<.xz> or B<.lzma>) " +"is appended to the source filename to get the target filename." +msgstr "" +"압축할 때, 대상 파일 형식의 접미사(B<.xz> or B<.lzma>) 는 원본 파일 이름 뒤" +"에 붙어 대상 파일이름이 됩니다." + +#. type: Plain text +#: ../src/xz/xz.1:123 +msgid "" +"When decompressing, the B<.xz>, B<.lzma>, or B<.lz> suffix is removed from " +"the filename to get the target filename. B also recognizes the suffixes " +"B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgstr "" +"압축 해제할 때, B<.xz>, B<.lzma>, B<.lz> 접미사를 파일 이름에서 제거하고 대" +"상 파일 이름을 알아냅니다. B에서는 B<.txz>, B<.tlz> 접미사도 인식하며, " +"B<.tar> 접미사로 치환합니다." + +#. type: Plain text +#: ../src/xz/xz.1:127 +msgid "" +"If the target file already exists, an error is displayed and the I is " +"skipped." +msgstr "" +"대상 파일이 이미 있으면, 오류를 나타내고 I파일E>을 건너뜁니다." + +#. type: Plain text +#: ../src/xz/xz.1:133 +msgid "" +"Unless writing to standard output, B will display a warning and skip the " +"I if any of the following applies:" +msgstr "" +"표준 출력으로 기록하기 전에는, B는 경고를 나타내며, 다음 조건에 만족할 경" +"우 I파일E>을 건너뜁니다:" + +#. type: Plain text +#: ../src/xz/xz.1:138 +msgid "" +"I is not a regular file. Symbolic links are not followed, and thus " +"they are not considered to be regular files." +msgstr "" +"I파일E>이 일반 파일이 아닐 때. 심볼릭 링크는 따라가지 않기에, 일" +"반 파일로 간주하지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:141 +msgid "I has more than one hard link." +msgstr "I파일E>이 하나 이상의 하드 링크일 떄." + +#. type: Plain text +#: ../src/xz/xz.1:144 +msgid "I has setuid, setgid, or sticky bit set." +msgstr "I파일E>에 setuid, setgid, 끈적이 비트 집합이 붙어있을 떄." + +#. type: Plain text +#: ../src/xz/xz.1:160 +msgid "" +"The operation mode is set to compress and the I already has a suffix " +"of the target file format (B<.xz> or B<.txz> when compressing to the B<.xz> " +"format, and B<.lzma> or B<.tlz> when compressing to the B<.lzma> format)." +msgstr "" +"동작 모드를 압축으로 설정하고, I파일E>은 대상 파일 형식의 접미사를 " +"이미 붙였을 때(B<.xz> 형식으로 압축하면 B<.xz> 또는 B<.txz>, B<.lzma> 형식으" +"로 압축하면 B<.lzma> 또는 B<.tlz>)." + +#. type: Plain text +#: ../src/xz/xz.1:170 +msgid "" +"The operation mode is set to decompress and the I doesn't have a " +"suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, B<." +"tlz>, or B<.lz>)." +msgstr "" +"동작 모드를 압축 해제로 설정하고, I파일E>에 지원 파일 형식 접미사" +"(B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, B<.lz>)를 붙이지 않았을 때." + +#. type: Plain text +#: ../src/xz/xz.1:185 +msgid "" +"After successfully compressing or decompressing the I, B copies " +"the owner, group, permissions, access time, and modification time from the " +"source I to the target file. If copying the group fails, the " +"permissions are modified so that the target file doesn't become accessible " +"to users who didn't have permission to access the source I. B " +"doesn't support copying other metadata like access control lists or extended " +"attributes yet." +msgstr "" +"I파일E> 의 압축 또는 압축 해제를 성공하고 나면, B는 소유자, 소" +"유그룹, 권한, 접근 시각, 수정 시각 정보를 원본 I파일E>에서 대상 파" +"일로 그대로 복사합니다. 그룹 정보 복사에 실패하면, 권한을 수정하여 원본 " +"I파일E>에 접근 권한이 없는 사용자가 대상 파일로 접근하지 못하게 합" +"니다. B는 아직 접근 제어 목록이나 확장 속성 등의 기타 메타데이터를 복사" +"하는 기능은 지원하지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:195 +msgid "" +"Once the target file has been successfully closed, the source I is " +"removed unless B<--keep> was specified. The source I is never removed " +"if the output is written to standard output or if an error occurs." +msgstr "" +"대상 파일을 온전히 닫고 나면, B<--keep> 옵션을 지원하지 않았을 경우 원본 " +"I파일E>을 제거합니다. 원본 I파일E>은 출력을 표준 출력으" +"로 기록했거나 오류가 발생했을 경우 제거하지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:207 +msgid "" +"Sending B or B to the B process makes it print " +"progress information to standard error. This has only limited use since " +"when standard error is a terminal, using B<--verbose> will display an " +"automatically updating progress indicator." +msgstr "" +"B 프로세스에 B 시그널 또는 B 시그널을 보내면 표준 출력" +"으로 진행 정보를 출력합니다. 표준 오류가 터미널일 경우일 경우에만 제한하며 " +"B<--verbose> 옵션을 지정하면 진행 표시줄을 자동으로 나타냅니다." + +#. type: SS +#: ../src/xz/xz.1:208 +#, no-wrap +msgid "Memory usage" +msgstr "메모리 사용" + +#. type: Plain text +#: ../src/xz/xz.1:224 +msgid "" +"The memory usage of B varies from a few hundred kilobytes to several " +"gigabytes depending on the compression settings. The settings used when " +"compressing a file determine the memory requirements of the decompressor. " +"Typically the decompressor needs 5\\ % to 20\\ % of the amount of memory " +"that the compressor needed when creating the file. For example, " +"decompressing a file created with B currently requires 65\\ MiB of " +"memory. Still, it is possible to have B<.xz> files that require several " +"gigabytes of memory to decompress." +msgstr "" +"B 메모리 사용은 수백 킬로바이트로 시작하여 수 기가바이트까지 압축 설정에 " +"따라 다릅니다. 압축 해제 프로그램이 필요로 하는 메모리 공간을 결정하는 파일 " +"압축시에 설정 값을 활용합니다. 보통 압축 해제 프로그램은 파일을 만들 때, 압" +"축 프로그램 메모리 사용량의 5% 에서 20% 정도 필요합니다. 예를 들면, B" +"로 압축한 파일 압축 해제시 현재 65MiB 메모리 용량이 필요합니다. 여전하게도, " +"압축 해제시 수 기가 바이트의 메모리가 필요한 B<.xz> 파일에도 가능한 이야기입" +"니다." + +#. type: Plain text +#: ../src/xz/xz.1:236 +msgid "" +"Especially users of older systems may find the possibility of very large " +"memory usage annoying. To prevent uncomfortable surprises, B has a " +"built-in memory usage limiter, which is disabled by default. While some " +"operating systems provide ways to limit the memory usage of processes, " +"relying on it wasn't deemed to be flexible enough (for example, using " +"B(1) to limit virtual memory tends to cripple B(2))." +msgstr "" +"특히 이전 시스템 사용자의 경우 메모리 사용량이 엄청나게 늘어나는 점에 짜증이 " +"날 수 있습니다. 이런 불편한 상황을 피하기 위해, B에 기본적으로 비활성 상" +"태인 내장 메모리 사용 제한 기능을 넣었습니다. 일부 운영체제에서 처리 중 메모" +"리 사용을 제한하는 수단을 제공하긴 하지만, 여기에 의지하기에는 충분히 유연하" +"지 않습니다(예를 들면, B(1)을 사용하면 가상 메모리를 제한하여 " +"B(2)을 먹통으로 만듭니다)." + +#. type: Plain text +#: ../src/xz/xz.1:258 +msgid "" +"The memory usage limiter can be enabled with the command line option B<--" +"memlimit=>I. Often it is more convenient to enable the limiter by " +"default by setting the environment variable B, for example, " +"B. It is possible to set the limits " +"separately for compression and decompression by using B<--memlimit-" +"compress=>I and B<--memlimit-decompress=>I. Using these two " +"options outside B is rarely useful because a single run of " +"B cannot do both compression and decompression and B<--" +"memlimit=>I (or B<-M> I) is shorter to type on the command " +"line." +msgstr "" +"메모리 사용 제한 기능은 B<--memlimit=>I제한용량E> 명령행 옵션으로 " +"사용할 수 있습니다. 종종 B와 같이 " +"B 환경 변수를 설정하여 제한 기능을 켜는게 더 편합니다. B<--" +"memlimit-compress=>I제한용량E> 옵션과 B<--memlimit-" +"decompress=>I제한용량E> 옵션을 활용하여 압축 및 압축 해제시 별도로 " +"한계 값을 설정할 수 있습니다. 이 두 가지 옵션의 B 환경 변수 밖" +"에서의 사용은, B를 단일 실행할 때 압축 및 압축 해제 동작을 동시에 수행하" +"지 않으며, 앞서 언급한 두가지 옵션을 명령행에 입력하기에는 B<--" +"memlimit=>I제한용량E>(또는 B<-M> I제한용량E>)이 더 짧기 " +"때문에 별로 쓸모가 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:277 +msgid "" +"If the specified memory usage limit is exceeded when decompressing, B " +"will display an error and decompressing the file will fail. If the limit is " +"exceeded when compressing, B will try to scale the settings down so that " +"the limit is no longer exceeded (except when using B<--format=raw> or B<--no-" +"adjust>). This way the operation won't fail unless the limit is very " +"small. The scaling of the settings is done in steps that don't match the " +"compression level presets, for example, if the limit is only slightly less " +"than the amount required for B, the settings will be scaled down only " +"a little, not all the way down to B." +msgstr "" +"압축 해제시 메모리 사용 제한 지정 한계를 초과하면, B 유틸리티에서 오류를 " +"나타내며 파일 압축 해제는 실패합니다. 압축을 실행할 때 사용 제한 지정 한계" +"를 넘어서면 B에서는 설정 값을 줄여서 어쨌든 한계를 넘지 못하게 합니다" +"(B<--format=raw> 옵션 또는 B<--no-adjust> 옵션 사용시 제외). 설정 한계 값이 " +"엄청 작지 않은 이상 이 방식대로 처리하면 어쨌든 실패하지 않습니다. 설정 값조" +"정은 압축 래벨 사전 설정과 일치하지 않을 때 단계적으로 진행하는데, 이를테면, " +"B 명령 수행에 필요한 양보다 한계 값이 약간 작으면, 설정 값을 B" +"에 못미치게 약간 줄여서 진행합니다." + +#. type: SS +#: ../src/xz/xz.1:278 +#, no-wrap +msgid "Concatenation and padding with .xz files" +msgstr ".xz 파일 결합 및 패딩" + +#. type: Plain text +#: ../src/xz/xz.1:286 +msgid "" +"It is possible to concatenate B<.xz> files as is. B will decompress " +"such files as if they were a single B<.xz> file." +msgstr "" +"B<.xz> 파일을 있는 그대로 합칠 수 있습니다. B는 B<.xz> 파일을 단독 파일" +"일 때 처럼 압축해제합니다." + +#. type: Plain text +#: ../src/xz/xz.1:295 +msgid "" +"It is possible to insert padding between the concatenated parts or after the " +"last part. The padding must consist of null bytes and the size of the " +"padding must be a multiple of four bytes. This can be useful, for example, " +"if the B<.xz> file is stored on a medium that measures file sizes in 512-" +"byte blocks." +msgstr "" +"결합 부분과 마지막 부분 뒤에 패딩을 추가할 수 있습니다. 패딩은 널 바이트로 " +"구성해야 하며 패딩 길이는 4바이트로 구성해야 합니다. 512 바이트 블록으로 파" +"일 크기를 이루는 매체에 B<.xz> 파일을 저장했을 경우에 요긴할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:299 +msgid "" +"Concatenation and padding are not allowed with B<.lzma> files or raw streams." +msgstr "B<.lzma> 파일 또는 원시 스트림의 경우 결합과 패딩을 허용하지 않습니다." + +#. type: SH +#: ../src/xz/xz.1:300 ../src/xzdec/xzdec.1:61 +#, no-wrap +msgid "OPTIONS" +msgstr "옵션" + +#. type: SS +#: ../src/xz/xz.1:302 +#, no-wrap +msgid "Integer suffixes and special values" +msgstr "정수 접두사와 별도 값" + +#. type: Plain text +#: ../src/xz/xz.1:306 +msgid "" +"In most places where an integer argument is expected, an optional suffix is " +"supported to easily indicate large integers. There must be no space between " +"the integer and the suffix." +msgstr "" +"정수 인자값이 필요한 대부분 위치에서는, 큰 정수값을 나타내기 쉽게 하도록 추" +"가 접미사를 지원합니다. 정수와 접미사 사이에 어떤 공백이 있으면 안됩니다." + +#. type: TP +#: ../src/xz/xz.1:306 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:317 +msgid "" +"Multiply the integer by 1,024 (2^10). B, B, B, B, and B " +"are accepted as synonyms for B." +msgstr "" +"1,024 (2^10) 배수 정수값. B, B, B, B, B 단위를 B 동의" +"어로 받아들입니다." + +#. type: TP +#: ../src/xz/xz.1:317 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:327 +msgid "" +"Multiply the integer by 1,048,576 (2^20). B, B, B, and B are " +"accepted as synonyms for B." +msgstr "" +"1,048,576 (2^20) 배수 정수값. B, B, B, B 단위를 B 동의어" +"로 받아들입니다." + +#. type: TP +#: ../src/xz/xz.1:327 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:337 +msgid "" +"Multiply the integer by 1,073,741,824 (2^30). B, B, B, and B " +"are accepted as synonyms for B." +msgstr "" +"1,073,741,824 (2^30) 배수 정수값. B, B, B, B 단위를 B 동" +"의어로 받아들입니다." + +#. type: Plain text +#: ../src/xz/xz.1:342 +msgid "" +"The special value B can be used to indicate the maximum integer value " +"supported by the option." +msgstr "" +"특수 값 B는 옵션에서 지원하는 정수 최대 값을 나타낼 때 사용할 수 있습니" +"다." + +#. type: SS +#: ../src/xz/xz.1:343 +#, no-wrap +msgid "Operation mode" +msgstr "동작 모드" + +#. type: Plain text +#: ../src/xz/xz.1:346 +msgid "" +"If multiple operation mode options are given, the last one takes effect." +msgstr "" +"여러 동작 모드를 보여드리겠습니다만, 마지막에 주어진 동작 모드로 동작합니다." + +#. type: TP +#: ../src/xz/xz.1:346 +#, no-wrap +msgid "B<-z>, B<--compress>" +msgstr "B<-z>, B<--compress>" + +#. type: Plain text +#: ../src/xz/xz.1:355 +msgid "" +"Compress. This is the default operation mode when no operation mode option " +"is specified and no other operation mode is implied from the command name " +"(for example, B implies B<--decompress>)." +msgstr "" +"압축합니다. 어떤 동작 모드 옵션도 지정하지 않고 다른 동작 모드를 명령행에 따" +"로 지정하지 않았다면 이 동작 모드는 기본입니다(예: B 는 B<--decompress>" +"를 암시)." + +#. type: TP +#: ../src/xz/xz.1:355 ../src/xzdec/xzdec.1:62 +#, no-wrap +msgid "B<-d>, B<--decompress>, B<--uncompress>" +msgstr "B<-d>, B<--decompress>, B<--uncompress>" + +#. type: Plain text +#: ../src/xz/xz.1:358 +msgid "Decompress." +msgstr "압축을 해제합니다." + +#. type: TP +#: ../src/xz/xz.1:358 +#, no-wrap +msgid "B<-t>, B<--test>" +msgstr "B<-t>, B<--test>" + +#. type: Plain text +#: ../src/xz/xz.1:367 +msgid "" +"Test the integrity of compressed I. This option is equivalent to B<--" +"decompress --stdout> except that the decompressed data is discarded instead " +"of being written to standard output. No files are created or removed." +msgstr "" +"압축 I파일E>의 무결성을 시험해봅니다. 이 옵션은 압축 해제 데이터" +"를 표준 출력으로 기록하는 대신 버린다는 점을 제외하고 B<--decompress --" +"stdout>과 동일합니다. 어떤 파일도 만들거나 제거하지 않습니다." + +#. type: TP +#: ../src/xz/xz.1:367 +#, no-wrap +msgid "B<-l>, B<--list>" +msgstr "B<-l>, B<--list>" + +#. type: Plain text +#: ../src/xz/xz.1:376 +msgid "" +"Print information about compressed I. No uncompressed output is " +"produced, and no files are created or removed. In list mode, the program " +"cannot read the compressed data from standard input or from other unseekable " +"sources." +msgstr "" +"압축 I파일E> 정보를 출력합니다. 압축 해제 출력을 내보내지 않으며, " +"어떤 파일도 만들거나 제거하지 않습니다. 이 조회 모드에서, 프로그램은 표준 입" +"력 또는 기타 탐색 불가능한 원본에서 압축 데이터를 읽을 수 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:391 +msgid "" +"The default listing shows basic information about I, one file per " +"line. To get more detailed information, use also the B<--verbose> option. " +"For even more information, use B<--verbose> twice, but note that this may be " +"slow, because getting all the extra information requires many seeks. The " +"width of verbose output exceeds 80 characters, so piping the output to, for " +"example, B may be convenient if the terminal isn't wide enough." +msgstr "" +"I파일E> 기본 정보를 파일 당 한 줄 씩 기본으로 보여줍니다. 더 자세" +"한 정보를 보려면 B<--verbose> 옵션을 사용하십시오. 더 자세한 정보는 B<--" +"verbose> 옵션을 두번 사용하면 되지만, 추가 정보를 더 많이 가져오면서 탐색 횟" +"수가 늘어나는 문제로 인해 느려질 수 있습니다. 세부 출력 너비는 80 문자를 초" +"과하며, 예를 들어 출력을 파이핑한다면, 터미널이 충분히 너비가 넓지 못할 경우 " +"B 명령이 편리할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:398 +msgid "" +"The exact output may vary between B versions and different locales. For " +"machine-readable output, B<--robot --list> should be used." +msgstr "" +"정확한 출력은 B 버전과 다른 로캘에 따라 바뀔 수 있습니다. 기계 판독용 출" +"력시 B<--robot --list> 옵션을 사용합니다." + +#. type: SS +#: ../src/xz/xz.1:399 +#, no-wrap +msgid "Operation modifiers" +msgstr "동작 수정자" + +#. type: TP +#: ../src/xz/xz.1:400 ../src/xzdec/xzdec.1:69 +#, no-wrap +msgid "B<-k>, B<--keep>" +msgstr "B<-k>, B<--keep>" + +#. type: Plain text +#: ../src/xz/xz.1:403 +msgid "Don't delete the input files." +msgstr "입력 파일을 삭제하지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:417 +msgid "" +"Since B 5.2.6, this option also makes B compress or decompress even " +"if the input is a symbolic link to a regular file, has more than one hard " +"link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and " +"sticky bits are not copied to the target file. In earlier versions this was " +"only done with B<--force>." +msgstr "" +"B 5.2.6 부터는 이 옵션으로 입력 파일이 일반 파일을 참조하는 심볼릭 링크" +"나 하나 이상의 하드 링크, 내지는 setuid, setgid, 끈적이 비트 세트를 설정한 상" +"태라도 압축하거나 압축을 풀 수 있습니다. setuid, setgid, 끈적이 비트는 대상 " +"파일에 복사하지 않습니다. 이전 버전에서는 B<--force> 옵션을 지정했을 때만 가" +"능했습니다." + +#. type: TP +#: ../src/xz/xz.1:417 +#, no-wrap +msgid "B<-f>, B<--force>" +msgstr "B<-f>, B<--force>" + +#. type: Plain text +#: ../src/xz/xz.1:420 +msgid "This option has several effects:" +msgstr "이 옵션은 몇가지 동작에 영향을 줍니다:" + +#. type: Plain text +#: ../src/xz/xz.1:424 +msgid "" +"If the target file already exists, delete it before compressing or " +"decompressing." +msgstr "대상 파일이 이미 있으면, 압축 또는 압축 해제 전 삭제합니다." + +#. type: Plain text +#: ../src/xz/xz.1:431 +msgid "" +"Compress or decompress even if the input is a symbolic link to a regular " +"file, has more than one hard link, or has the setuid, setgid, or sticky bit " +"set. The setuid, setgid, and sticky bits are not copied to the target file." +msgstr "" +"입력 파일이 일반 파일을 참조하는 심볼릭 링크나 하나 이상의 하드 링크, 내지는 " +"setuid, setgid, 끈적이 비트 세트를 설정한 상태라도 압축 또는 압축 해제를 진행" +"합니다. setuid, setgid, 끈적이 비트는 대상 파일에 복사하지 않습니다" + +#. type: Plain text +#: ../src/xz/xz.1:456 +msgid "" +"When used with B<--decompress> B<--stdout> and B cannot recognize the " +"type of the source file, copy the source file as is to standard output. " +"This allows B B<--force> to be used like B(1) for files that " +"have not been compressed with B. Note that in future, B might " +"support new compressed file formats, which may make B decompress more " +"types of files instead of copying them as is to standard output. B<--" +"format=>I can be used to restrict B to decompress only a single " +"file format." +msgstr "" +"B<--decompress> B<--stdout> 옵션을 같이 사용하는 상황에서 B 명령이 원본 " +"파일의 형식을 알아내지 못할 때, 원본 파일의 사본을 표준 출력으로 보냅니다. " +"이렇게 하면 B B<--force> 명령을 B 명령으로 압축하지 않은 파일에 대" +"해 B(1) 을 사용하는 것처럼 사용할 수 있습니다. 참고로 나중에, B에" +"서 B로 하여금 여러 형식의 파일을 표준 출력으로 복사하는 대신 압축을 해제" +"하도록 새 압축 파일 형식을 지원할 예정입니다. B<--format=>I형식E> " +"옵션은 B 명령에 단일 파일 형식만 압축 해제하도록 제한할 때 사용할 수 있습" +"니다." + +#. type: TP +#: ../src/xz/xz.1:457 ../src/xzdec/xzdec.1:76 +#, no-wrap +msgid "B<-c>, B<--stdout>, B<--to-stdout>" +msgstr "B<-c>, B<--stdout>, B<--to-stdout>" + +#. type: Plain text +#: ../src/xz/xz.1:463 +msgid "" +"Write the compressed or decompressed data to standard output instead of a " +"file. This implies B<--keep>." +msgstr "" +"파일 대신 표준 출력으로 압축 또는 압축 해제한 데이터를 기록합니다. B<--keep>" +"를 생략했습니다." + +#. type: TP +#: ../src/xz/xz.1:463 +#, no-wrap +msgid "B<--single-stream>" +msgstr "B<--single-stream>" + +#. type: Plain text +#: ../src/xz/xz.1:472 +msgid "" +"Decompress only the first B<.xz> stream, and silently ignore possible " +"remaining input data following the stream. Normally such trailing garbage " +"makes B display an error." +msgstr "" +"처음 B<.xz> 스트림만 압축 해제하며, 스트림에 뒤따라오는 나머지 입력 데이터는 " +"조용히 무시합니다. 보통 뒤따라오는 쓰레기 값에 대해서는 B 에서 오류를 나" +"타냅니다." + +#. type: Plain text +#: ../src/xz/xz.1:481 +msgid "" +"B never decompresses more than one stream from B<.lzma> files or raw " +"streams, but this option still makes B ignore the possible trailing data " +"after the B<.lzma> file or raw stream." +msgstr "" +"B는 B<.lzma> 파일 또는 원시 스트림에서 온 하나 이상의 스트림에 대해 압축 " +"해제동작을 취하지 않지만, 이 옵션을 사용하면 B에서 B<.lzma> 파일 또는 원" +"시 스트림을 처리한 다음에 뒤따라오는 데이터를 무시하도록 합니다." + +#. type: Plain text +#: ../src/xz/xz.1:486 +msgid "" +"This option has no effect if the operation mode is not B<--decompress> or " +"B<--test>." +msgstr "" +"이 옵션은 동작 모드가 B<--decompress> 또는 B<--test>가 아니면 동작에 아무런 " +"영향을 주지 않습니다." + +#. type: TP +#: ../src/xz/xz.1:486 +#, no-wrap +msgid "B<--no-sparse>" +msgstr "B<--no-sparse>" + +#. type: Plain text +#: ../src/xz/xz.1:498 +msgid "" +"Disable creation of sparse files. By default, if decompressing into a " +"regular file, B tries to make the file sparse if the decompressed data " +"contains long sequences of binary zeros. It also works when writing to " +"standard output as long as standard output is connected to a regular file " +"and certain additional conditions are met to make it safe. Creating sparse " +"files may save disk space and speed up the decompression by reducing the " +"amount of disk I/O." +msgstr "" +"희소 파일을 만들지 않습니다. 기본적으로 일반 파일로 압축 해제할 경우 B " +"에서는 압축 해제한 파일에 이진 0값이 길게 늘어질 경우 희소 배열 파일을 만들려" +"고 합니다. 표준 출력의 내용 길이만큼 연결한 일반 파일로 기록할 때도 동작하" +"며 희소 파일을 만드는 동안 아무런 문제가 나타나지 않게 각각의 추가 조건을 만" +"족합니다. 희소 파일을 만들면 디스크 공간을 절약할 수 있으며 디스크 입출력을 " +"줄여 압축 해제 속도를 올릴 수 있습니다." + +#. type: TP +#: ../src/xz/xz.1:498 +#, no-wrap +msgid "B<-S> I<.suf>, B<--suffix=>I<.suf>" +msgstr "B<-S> I<.suf>, B<--suffix=>I<.suf>" + +#. type: Plain text +#: ../src/xz/xz.1:510 +msgid "" +"When compressing, use I<.suf> as the suffix for the target file instead of " +"B<.xz> or B<.lzma>. If not writing to standard output and the source file " +"already has the suffix I<.suf>, a warning is displayed and the file is " +"skipped." +msgstr "" +"압축할 때, 대상 파일의 접두사를 B<.xz> 또는 B<.lzma> 대신 I<.suf>로 사용하십" +"시오. 표준 출력으로 기록하지 않고 원본 파일에 I<.suf> 접두사가 붙어있으면, " +"경고를 나타내고 해당 파일을 건너뜁니다." + +#. type: Plain text +#: ../src/xz/xz.1:524 +msgid "" +"When decompressing, recognize files with the suffix I<.suf> in addition to " +"files with the B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz> suffix. If the " +"source file has the suffix I<.suf>, the suffix is removed to get the target " +"filename." +msgstr "" +"압축 해제할 때, I<.suf> 접미사로 파일을 인식하기도 하고, B<.xz>, B<.txz>, B<." +"lzma>, B<.tlz>, B<.lz> 접미사가 붙은 파일도 인식합니다. 원본 파일에 I<.suf> " +"접미사가 붙어있으면, 해당 접미사를 제거하여 대상 파일 이름을 알아냅니다." + +#. type: Plain text +#: ../src/xz/xz.1:530 +msgid "" +"When compressing or decompressing raw streams (B<--format=raw>), the suffix " +"must always be specified unless writing to standard output, because there is " +"no default suffix for raw streams." +msgstr "" +"원시 스트림 압축 및 압축 해제시(B<--format=raw>) 원시 스트림에 기본 접미사가 " +"없기 때문에, 표준 출력으로 기록하지 않는 한 접미사를 반드시 지정해야 합니다." + +#. type: TP +#: ../src/xz/xz.1:530 +#, no-wrap +msgid "B<--files>[B<=>I]" +msgstr "B<--files>[B<=>I파일E>]" + +#. type: Plain text +#: ../src/xz/xz.1:544 +msgid "" +"Read the filenames to process from I; if I is omitted, filenames " +"are read from standard input. Filenames must be terminated with the newline " +"character. A dash (B<->) is taken as a regular filename; it doesn't mean " +"standard input. If filenames are given also as command line arguments, they " +"are processed before the filenames read from I." +msgstr "" +"I파일E>에서 처리할 파일 이름을 읽습니다. I파일E>을 생략하" +"면 파일 이름은 표준 입력에서 불러옵니다. 파일 이름은 개행 문자로 끝나야 합니" +"다. 대시 문자(B<->)는 일반 파일 이름으로 취급하며 표준 입력을 의미하지 않습" +"니다. 파일 이름을 명령행 인자로 지정하면, I파일E>에서 파일 이름을 " +"읽어들이기 전 해당 명령행 인자를 먼저 처리합니다." + +#. type: TP +#: ../src/xz/xz.1:544 +#, no-wrap +msgid "B<--files0>[B<=>I]" +msgstr "B<--files0>[B<=>I파일E>]" + +#. type: Plain text +#: ../src/xz/xz.1:548 +msgid "" +"This is identical to B<--files>[B<=>I] except that each filename must " +"be terminated with the null character." +msgstr "" +"각 파일 이름이 널 문자로 끝나야 한다는 점만 제외하면 B<--files>[B<=>I파" +"일E>] 옵션과 동일합니다." + +#. type: SS +#: ../src/xz/xz.1:549 +#, no-wrap +msgid "Basic file format and compression options" +msgstr "기본 파일 형식 및 압축 옵션" + +#. type: TP +#: ../src/xz/xz.1:550 +#, no-wrap +msgid "B<-F> I, B<--format=>I" +msgstr "B<-F> I, B<--format=>I형식E>" + +#. type: Plain text +#: ../src/xz/xz.1:555 +msgid "Specify the file I to compress or decompress:" +msgstr "압축 또는 압축해제 파일 I형식E>을 지정합니다:" + +#. type: TP +#: ../src/xz/xz.1:556 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:568 +msgid "" +"This is the default. When compressing, B is equivalent to B. " +"When decompressing, the format of the input file is automatically detected. " +"Note that raw streams (created with B<--format=raw>) cannot be auto-" +"detected." +msgstr "" +"기본 값입니다. 압축할 때, B는 B의 기본 동작과 동일합니다. 압축을 " +"해제할 때, 입력 파일 형식을 자동으로 찾습니다. 참고로 원시 스트림(B<--" +"format=raw>)의 경우 자동으로 찾을 수 없습니다." + +#. type: TP +#: ../src/xz/xz.1:568 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:575 +msgid "" +"Compress to the B<.xz> file format, or accept only B<.xz> files when " +"decompressing." +msgstr "" +"B<.xz> 파일 형식으로 압축하거나, 압축 해제시 B<.xz> 파일만 받아들입니다." + +#. type: TP +#: ../src/xz/xz.1:575 +#, no-wrap +msgid "B, B" +msgstr "B, B" + +#. type: Plain text +#: ../src/xz/xz.1:585 +msgid "" +"Compress to the legacy B<.lzma> file format, or accept only B<.lzma> files " +"when decompressing. The alternative name B is provided for backwards " +"compatibility with LZMA Utils." +msgstr "" +"이전 B<.lzma> 파일 형식으로 압축하거나, 압축 해제시 B<.lzma> 파일만 받아들입" +"니다. B 대체 명령은 LZMA 유틸리티 하위 호환성을 목적으로 제공합니다." + +#. type: TP +#: ../src/xz/xz.1:585 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:591 +msgid "" +"Accept only B<.lz> files when decompressing. Compression is not supported." +msgstr "압축 해제시 B<.lz> 파일만 받아들입니다. 압축은 지원하지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:604 +msgid "" +"The B<.lz> format version 0 and the unextended version 1 are supported. " +"Version 0 files were produced by B 1.3 and older. Such files aren't " +"common but may be found from file archives as a few source packages were " +"released in this format. People might have old personal files in this " +"format too. Decompression support for the format version 0 was removed in " +"B 1.18." +msgstr "" +"B<.lz> 형식 버전 0과 비확장 버전 1을 지원합니다. 버전 0파일은 B 1.3 이" +"전에서만 만듭니다. 일반적이진 않지만 일부 파일의 경우 이 형식과 관련된 원본 " +"패키지로 보관한 파일을 찾을 수도 있습니다. 개인적으로 이 형식으로 압축한 오" +"래된 개인 파일을 가지고 있을 수도 있습니다. 형식 버전 0 압축 해제 지원은 " +"B 1.18에서 제거했습니다." + +#. type: Plain text +#: ../src/xz/xz.1:613 +msgid "" +"B 1.4 and later create files in the format version 1. The sync flush " +"marker extension to the format version 1 was added in B 1.6. This " +"extension is rarely used and isn't supported by B (diagnosed as corrupt " +"input)." +msgstr "" +"B 1.4 이상에서는 버전 1형식의 파일을 만듭니다. 형식 버전 1로의 동기화 " +"제거 마커 확장은 B 1.6에 추가했습니다. 이 확장은 거의 쓰지 않으며 " +"B 에서 조차도 지원하지 않습니다(손상된 입력 파일로 진단함)." + +#. type: TP +#: ../src/xz/xz.1:613 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:621 +msgid "" +"Compress or uncompress a raw stream (no headers). This is meant for " +"advanced users only. To decode raw streams, you need use B<--format=raw> " +"and explicitly specify the filter chain, which normally would have been " +"stored in the container headers." +msgstr "" +"원시 스트림으로 압축하거나 압축을 해제합니다(헤더 없음). 고급 사용자 전용입" +"니다. 원시 스트림을 디코딩하려면, B<--format=raw> 옵션을 사용하고 분명하게 " +"필터 체인을 지정하여 컨테이너 헤더에 필요한 정보를 저장하게 끔 해야합니다." + +#. type: TP +#: ../src/xz/xz.1:622 +#, no-wrap +msgid "B<-C> I, B<--check=>I" +msgstr "B<-C> I검사방식E>, B<--check=>I검사방식E>" + +#. type: Plain text +#: ../src/xz/xz.1:637 +msgid "" +"Specify the type of the integrity check. The check is calculated from the " +"uncompressed data and stored in the B<.xz> file. This option has an effect " +"only when compressing into the B<.xz> format; the B<.lzma> format doesn't " +"support integrity checks. The integrity check (if any) is verified when the " +"B<.xz> file is decompressed." +msgstr "" +"무결성 검사 방식을 지정합니다. 검사 방식은 B<.xz> 파일에 저장하며 압축 해제 " +"데이터를 계산합니다. 이 옵션은 B<.xz> 형식으로 압축할 때만 효력이 있습니다: " +"B<.lzma> 형식은 무결성 겁사를 지원하지 않습니다. 무결성 검사는 B<.xz> 파일 " +"압축을 풀었을 때에 검사합니다." + +#. type: Plain text +#: ../src/xz/xz.1:641 +msgid "Supported I types:" +msgstr "지원 I<검사> 형식:" + +#. type: TP +#: ../src/xz/xz.1:642 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:648 +msgid "" +"Don't calculate an integrity check at all. This is usually a bad idea. " +"This can be useful when integrity of the data is verified by other means " +"anyway." +msgstr "" +"어떤 경우에도 무결성 검사 계산을 수행하지 않습니다. 보통 바람직하지 못한 생" +"각입니다. 데이터 무결성을 다른 방식으로라도 검증해야 하는 상황이면 쓸만할 " +"수 있습니다." + +#. type: TP +#: ../src/xz/xz.1:648 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:651 +msgid "Calculate CRC32 using the polynomial from IEEE-802.3 (Ethernet)." +msgstr "IEEE-802.3 (이더넷)의 다항 연산으로 CRC32를 계산합니다." + +#. type: TP +#: ../src/xz/xz.1:651 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:656 +msgid "" +"Calculate CRC64 using the polynomial from ECMA-182. This is the default, " +"since it is slightly better than CRC32 at detecting damaged files and the " +"speed difference is negligible." +msgstr "" +"ECMA-182의 다항식 연산으로 CRC64를 계산합니다. 이 동작이 기본 동작이기 때문" +"에 CRC32가 깨진 파일을 찾을 때보다는 좀 낮은 편이며 속도 차이도 거의 없습니" +"다." + +#. type: TP +#: ../src/xz/xz.1:656 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:660 +msgid "Calculate SHA-256. This is somewhat slower than CRC32 and CRC64." +msgstr "SHA-256 해시를 계산합니다. CRC32와 CRC64 보다는 좀 느립니다." + +#. type: Plain text +#: ../src/xz/xz.1:666 +msgid "" +"Integrity of the B<.xz> headers is always verified with CRC32. It is not " +"possible to change or disable it." +msgstr "" +"B<.xz> 헤더 무결성은 항상 CRC32로 검증하빈다. 이를 바꾸거나 It is not " +"possible to change or disable it." + +#. type: TP +#: ../src/xz/xz.1:666 +#, no-wrap +msgid "B<--ignore-check>" +msgstr "B<--ignore-check>" + +#. type: Plain text +#: ../src/xz/xz.1:672 +msgid "" +"Don't verify the integrity check of the compressed data when decompressing. " +"The CRC32 values in the B<.xz> headers will still be verified normally." +msgstr "" +"압축 데이터를 압축해제할 경우 압축 데이터의 무결성 검증을 진행하지 않습니" +"다. B<.xz> 헤더의 CRC32 값은 그래도 여전히 보통 방식으로 검증합니다." + +#. type: Plain text +#: ../src/xz/xz.1:675 +msgid "" +"B Possible " +"reasons to use this option:" +msgstr "" +"B<이 옵션이 정확히 무슨 동작을 하는지 알기 전에는 사용하지 마십시오.> 이 옵션" +"을 사용하는 타당한 이유로:" + +#. type: Plain text +#: ../src/xz/xz.1:678 +msgid "Trying to recover data from a corrupt .xz file." +msgstr "깨진 .xz 파일에서 데이터 복구를 시도합니다." + +#. type: Plain text +#: ../src/xz/xz.1:684 +msgid "" +"Speeding up decompression. This matters mostly with SHA-256 or with files " +"that have compressed extremely well. It's recommended to not use this " +"option for this purpose unless the file integrity is verified externally in " +"some other way." +msgstr "" +"압축 해제 속도를 늘립니다. SHA-256 또는 압축 파일에 들어간 그 무언가를 엄청 " +"빨리 처리합니다. 다른 방식으로 파일 무결성을 검증해야 하는 목적이 아니라면 " +"이 옵션을 사용하지 않는게 좋습니다." + +#. type: TP +#: ../src/xz/xz.1:685 +#, no-wrap +msgid "B<-0> ... B<-9>" +msgstr "B<-0> ... B<-9>" + +#. type: Plain text +#: ../src/xz/xz.1:694 +msgid "" +"Select a compression preset level. The default is B<-6>. If multiple " +"preset levels are specified, the last one takes effect. If a custom filter " +"chain was already specified, setting a compression preset level clears the " +"custom filter chain." +msgstr "" +"압축 사전 설정 수준을 선택합니다. 기본값은 B<-6>입니다. 다중 수준을 지정하" +"면 가장 마지막 수준 옵션을 적용합니다. 개별 필터 체인을 이미 지정했다면, 압" +"축 사전 설정 수준 값을 설정할 때 개별 필터 체인을 정리합니다." + +#. type: Plain text +#: ../src/xz/xz.1:709 +msgid "" +"The differences between the presets are more significant than with " +"B(1) and B(1). The selected compression settings determine " +"the memory requirements of the decompressor, thus using a too high preset " +"level might make it painful to decompress the file on an old system with " +"little RAM. Specifically, B like it often is with B(1) and B(1)." +msgstr "" +"사전 설정간 차이는 B(1)과 B(1)을 사용할 때보다 더 비중을 차지합" +"니다. 선택한 압축 설정은 압축 해제시 필요한 메모리 사용량을 셜정하므로 사전 " +"설정 수준 값을 너무 높게 지정하면 RAM 용량이 적은 오래된 시스템에서 파일 압" +"축 해제시 실패할 수 있습니다. 게다가, B(1) 과 B(1)에서 처럼 종" +"종 B<모든 동작에 -9를 몰래 활용하는건 바람직하지 않습니다>." + +#. type: TP +#: ../src/xz/xz.1:710 +#, no-wrap +msgid "B<-0> ... B<-3>" +msgstr "B<-0> ... B<-3>" + +#. type: Plain text +#: ../src/xz/xz.1:722 +msgid "" +"These are somewhat fast presets. B<-0> is sometimes faster than B " +"while compressing much better. The higher ones often have speed comparable " +"to B(1) with comparable or better compression ratio, although the " +"results depend a lot on the type of data being compressed." +msgstr "" +"동작이 빠른 사전 설정 부류입니다. B<-0>은 때로는 B 명령보다 압축율" +"이 훨씬 우수하면서도 더 빠릅니다. 더 큰 값은 보통 B(1) 명령과 비교했" +"을 떄 압축 결과가 압축 데이터에 따라 달라지더라도, 비교할 법한 속도 또는 더 " +"나은 압축율을 보입니다." + +#. type: TP +#: ../src/xz/xz.1:722 +#, no-wrap +msgid "B<-4> ... B<-6>" +msgstr "B<-4> ... B<-6>" + +#. type: Plain text +#: ../src/xz/xz.1:736 +msgid "" +"Good to very good compression while keeping decompressor memory usage " +"reasonable even for old systems. B<-6> is the default, which is usually a " +"good choice for distributing files that need to be decompressible even on " +"systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth considering " +"too. See B<--extreme>.)" +msgstr "" +"오래된 시스템에서 조차도 압축 해제 프로그램의 적절한 메모리 사용량을 보이면" +"서 양호하거나 최적의 압축율을 보여줍니다. B<-6> 옵션은 압축 해제시 메모리 사" +"용량이 16MiB 밖에 안되기 때문에 파일을 배포할 때 최적의 선택인 기본 값입니" +"다. (B<-5e> 또는 B<-6e>도 역시 고려할 만합니다. B<--extreme>을 참고하십시" +"오.)" + +#. type: TP +#: ../src/xz/xz.1:736 +#, no-wrap +msgid "B<-7 ... -9>" +msgstr "B<-7 ... -9>" + +#. type: Plain text +#: ../src/xz/xz.1:743 +msgid "" +"These are like B<-6> but with higher compressor and decompressor memory " +"requirements. These are useful only when compressing files bigger than 8\\ " +"MiB, 16\\ MiB, and 32\\ MiB, respectively." +msgstr "" +"B<-6>과 비슷하지만 압축 및 압축 해제시 요구 메모리 사용량이 더 높습니다. 압" +"축 파일이 각각 8MiB, 16MiB, 32MiB 보다 클 경우에만 쓸만한 옵션입니다." + +#. type: Plain text +#: ../src/xz/xz.1:751 +msgid "" +"On the same hardware, the decompression speed is approximately a constant " +"number of bytes of compressed data per second. In other words, the better " +"the compression, the faster the decompression will usually be. This also " +"means that the amount of uncompressed output produced per second can vary a " +"lot." +msgstr "" +"동일한 하드웨어에서, 압축 해제 속도는 압축한 데이터의 초당 정적 바이트 처리 " +"수의 어림 평균입니다. 다시 말해, 압축율을 더 올리면, 압축 해제 속도도 역시 " +"올라갑니다. 이는 곧 초당 비압축 데이터 출력 양이 달라질 수 있단 뜻입니다." + +#. type: Plain text +#: ../src/xz/xz.1:753 +msgid "The following table summarises the features of the presets:" +msgstr "다음 표에 사전 설정 기능을 정리했습니다:" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "Preset" +msgstr "Preset" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DictSize" +msgstr "DictSize" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "CompCPU" +msgstr "CompCPU" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "CompMem" +msgstr "CompMem" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DecMem" +msgstr "DecMem" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#: ../src/xz/xz.1:2840 +#, no-wrap +msgid "-0" +msgstr "-0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:842 ../src/xz/xz.1:2450 +#, no-wrap +msgid "256 KiB" +msgstr "256 KiB" + +#. type: TP +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2840 ../src/scripts/xzgrep.1:82 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:763 ../src/xz/xz.1:844 ../src/xz/xz.1:2475 +#, no-wrap +msgid "3 MiB" +msgstr "3 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:762 ../src/xz/xz.1:842 ../src/xz/xz.1:843 +#: ../src/xz/xz.1:2451 ../src/xz/xz.1:2452 ../src/xz/xz.1:2454 +#, no-wrap +msgid "1 MiB" +msgstr "1 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:2451 ../src/xz/xz.1:2476 +#: ../src/xz/xz.1:2841 +#, no-wrap +msgid "-1" +msgstr "-1" + +#. type: TP +#: ../src/xz/xz.1:762 ../src/xz/xz.1:1758 ../src/xz/xz.1:2841 +#: ../src/scripts/xzgrep.1:86 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2476 +#, no-wrap +msgid "9 MiB" +msgstr "9 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:763 ../src/xz/xz.1:843 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2452 ../src/xz/xz.1:2455 ../src/xz/xz.1:2476 +#, no-wrap +msgid "2 MiB" +msgstr "2 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:2452 ../src/xz/xz.1:2477 +#: ../src/xz/xz.1:2842 +#, no-wrap +msgid "-2" +msgstr "-2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:1760 ../src/xz/xz.1:2842 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2477 +#, no-wrap +msgid "17 MiB" +msgstr "17 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2453 ../src/xz/xz.1:2478 +#: ../src/xz/xz.1:2843 +#, no-wrap +msgid "-3" +msgstr "-3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:842 ../src/xz/xz.1:845 +#: ../src/xz/xz.1:846 ../src/xz/xz.1:2453 ../src/xz/xz.1:2454 +#: ../src/xz/xz.1:2456 +#, no-wrap +msgid "4 MiB" +msgstr "4 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2843 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2458 +#: ../src/xz/xz.1:2459 ../src/xz/xz.1:2478 +#, no-wrap +msgid "32 MiB" +msgstr "32 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#, no-wrap +msgid "5 MiB" +msgstr "5 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:2454 ../src/xz/xz.1:2479 +#: ../src/xz/xz.1:2844 +#, no-wrap +msgid "-4" +msgstr "-4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:1759 ../src/xz/xz.1:1761 +#: ../src/xz/xz.1:1762 ../src/xz/xz.1:1764 ../src/xz/xz.1:2844 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 ../src/xz/xz.1:2479 +#, no-wrap +msgid "48 MiB" +msgstr "48 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2455 ../src/xz/xz.1:2480 +#: ../src/xz/xz.1:2845 +#, no-wrap +msgid "-5" +msgstr "-5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2455 ../src/xz/xz.1:2456 ../src/xz/xz.1:2457 +#, no-wrap +msgid "8 MiB" +msgstr "8 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2845 +#, no-wrap +msgid "5" +msgstr "5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2480 ../src/xz/xz.1:2481 +#, no-wrap +msgid "94 MiB" +msgstr "94 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:2456 ../src/xz/xz.1:2481 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "-6" +msgstr "-6" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:768 ../src/xz/xz.1:769 ../src/xz/xz.1:770 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "6" +msgstr "6" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:2457 ../src/xz/xz.1:2482 +#, no-wrap +msgid "-7" +msgstr "-7" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2457 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2479 +#, no-wrap +msgid "16 MiB" +msgstr "16 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2482 +#, no-wrap +msgid "186 MiB" +msgstr "186 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:2458 ../src/xz/xz.1:2483 +#, no-wrap +msgid "-8" +msgstr "-8" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2483 +#, no-wrap +msgid "370 MiB" +msgstr "370 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#, no-wrap +msgid "33 MiB" +msgstr "33 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:2459 ../src/xz/xz.1:2484 +#, no-wrap +msgid "-9" +msgstr "-9" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2459 +#, no-wrap +msgid "64 MiB" +msgstr "64 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2484 +#, no-wrap +msgid "674 MiB" +msgstr "674 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 +#, no-wrap +msgid "65 MiB" +msgstr "65 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:776 +msgid "Column descriptions:" +msgstr "컬럼 설명:" + +#. type: Plain text +#: ../src/xz/xz.1:788 +msgid "" +"DictSize is the LZMA2 dictionary size. It is waste of memory to use a " +"dictionary bigger than the size of the uncompressed file. This is why it is " +"good to avoid using the presets B<-7> ... B<-9> when there's no real need " +"for them. At B<-6> and lower, the amount of memory wasted is usually low " +"enough to not matter." +msgstr "" +"DictSize는 LZMA2 딕셔너리 크기입니다. 압축 해제 파일의 크기보다 딕셔너리에" +"서 사용하는 낭비 메모리 용량입니다. 실제로 필요하지 않은 B<-7> ... B<-9> 사" +"전 설정값을 피해야 하는 적절한 이유이기도 합니다. B<-6> 이하에서는 소모 메모" +"리 양이 충분히 적거나 따로 신경쓸 필요가 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:797 +msgid "" +"CompCPU is a simplified representation of the LZMA2 settings that affect " +"compression speed. The dictionary size affects speed too, so while CompCPU " +"is the same for levels B<-6> ... B<-9>, higher levels still tend to be a " +"little slower. To get even slower and thus possibly better compression, see " +"B<--extreme>." +msgstr "" +"CompCPU는 압축 속도에 영향을 주는 LZMA2 설정의 단순화 표기 값입니다. 딕셔너" +"리 크기는 속도에도 영향을 주기 때문에 CompCPU는 B<-6> ... B<-9> 수준값과 동일" +"한데, 고수준 값은 여전히 조금 더 느려질 수 있습니다. 느려지는 만큼 압축율은 " +"가능한 한 더 좋아집니다. B<--extreme>을 참고하십시오." + +#. type: Plain text +#: ../src/xz/xz.1:805 +msgid "" +"CompMem contains the compressor memory requirements in the single-threaded " +"mode. It may vary slightly between B versions. Memory requirements of " +"some of the future multithreaded modes may be dramatically higher than that " +"of the single-threaded mode." +msgstr "" +"CompMem은 단일-스레드 모드에서 필요한 압축 프로그램의 메모리 점유 용량입니" +"다. B 버전에 따라 다를 수 있습니다. 앞으로 도입할 다중-스레드 모드의 메" +"모리 사용량은 단일-스레드 모드에서의 그것보다는 훨씬 늘어납니다." + +#. type: Plain text +#: ../src/xz/xz.1:812 +msgid "" +"DecMem contains the decompressor memory requirements. That is, the " +"compression settings determine the memory requirements of the decompressor. " +"The exact decompressor memory usage is slightly more than the LZMA2 " +"dictionary size, but the values in the table have been rounded up to the " +"next full MiB." +msgstr "" +"DecMem은 압축 해제 프로그램의 메모리 점유용량입니다. 이는 곧, 압축 해제 프로" +"그램에서 필요한 메모리 사용량을 압축 설정에서 결정한다는 의미가 들어있습니" +"다. 정확한 압축 해제 프로그램의 메모리 사용량은 LZMA2 딕셔너리 크기 보다는 " +"조금 많지만 테이블의 값은 MiB 용량으로 완전히 반올림한 값입니다." + +#. type: TP +#: ../src/xz/xz.1:813 +#, no-wrap +msgid "B<-e>, B<--extreme>" +msgstr "B<-e>, B<--extreme>" + +#. type: Plain text +#: ../src/xz/xz.1:822 +msgid "" +"Use a slower variant of the selected compression preset level (B<-0> ... " +"B<-9>) to hopefully get a little bit better compression ratio, but with bad " +"luck this can also make it worse. Decompressor memory usage is not " +"affected, but compressor memory usage increases a little at preset levels " +"B<-0> ... B<-3>." +msgstr "" +"기대하는 만큼의 좀 더 나은 압축율을 확보하려 선택한 압축 사전 설정 수준의 느" +"린 변형 옵션을 사용하지만, 재수 없는 와중에 골로 가는 경우가 생기기도 합니" +"다. 압축 해제 프로그램의 메모리 사용에는 영향을 주지 않지만, 압축 프로그램" +"의 메모리 사용량은 B<-0> ... B<-3> 사전 설정 수준에서 약간 더 올라갈 뿐입니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:834 +msgid "" +"Since there are two presets with dictionary sizes 4\\ MiB and 8\\ MiB, the " +"presets B<-3e> and B<-5e> use slightly faster settings (lower CompCPU) than " +"B<-4e> and B<-6e>, respectively. That way no two presets are identical." +msgstr "" +"4MiB와 8MiB 두 가지 딕셔너리 용량 설정이 있기 때문에 B<-3e> 와 B<-5e> 사전 설" +"정을 (CompCPU 수치를 낮춰서) 각각 B<-4e> 와 B<-6e> 보다 약간 더 빠르게 설정" +"할 수 있습니다. 이런 식으로 두 사전 설정이 동일하지 않습니다." + +#. type: tbl table +#: ../src/xz/xz.1:842 +#, no-wrap +msgid "-0e" +msgstr "-0e" + +#. type: tbl table +#: ../src/xz/xz.1:842 ../src/xz/xz.1:843 ../src/xz/xz.1:844 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:849 ../src/xz/xz.1:850 ../src/xz/xz.1:851 +#: ../src/xz/xz.1:2848 +#, no-wrap +msgid "8" +msgstr "8" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "-1e" +msgstr "-1e" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "13 MiB" +msgstr "13 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "-2e" +msgstr "-2e" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "25 MiB" +msgstr "25 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:845 +#, no-wrap +msgid "-3e" +msgstr "-3e" + +#. type: tbl table +#: ../src/xz/xz.1:845 ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "7" +msgstr "7" + +#. type: tbl table +#: ../src/xz/xz.1:846 +#, no-wrap +msgid "-4e" +msgstr "-4e" + +#. type: tbl table +#: ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "-5e" +msgstr "-5e" + +#. type: tbl table +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2848 +#, no-wrap +msgid "-6e" +msgstr "-6e" + +#. type: tbl table +#: ../src/xz/xz.1:849 +#, no-wrap +msgid "-7e" +msgstr "-7e" + +#. type: tbl table +#: ../src/xz/xz.1:850 +#, no-wrap +msgid "-8e" +msgstr "-8e" + +#. type: tbl table +#: ../src/xz/xz.1:851 +#, no-wrap +msgid "-9e" +msgstr "-9e" + +#. type: Plain text +#: ../src/xz/xz.1:863 +msgid "" +"For example, there are a total of four presets that use 8\\ MiB dictionary, " +"whose order from the fastest to the slowest is B<-5>, B<-6>, B<-5e>, and " +"B<-6e>." +msgstr "" +"예를 들면, 8MiB 딕셔너리를 활용하는 네가지 사전 설정이 있다고 할 때, 빠른 순" +"으로 설정을 나열하자면, B<-5>, B<-6>, B<-5e>, B<-6e> 입니다." + +#. type: TP +#: ../src/xz/xz.1:863 +#, no-wrap +msgid "B<--fast>" +msgstr "B<--fast>" + +#. type: TP +#: ../src/xz/xz.1:866 +#, no-wrap +msgid "B<--best>" +msgstr "B<--best>" + +#. type: Plain text +#: ../src/xz/xz.1:877 +msgid "" +"These are somewhat misleading aliases for B<-0> and B<-9>, respectively. " +"These are provided only for backwards compatibility with LZMA Utils. Avoid " +"using these options." +msgstr "" +"이 옵션은 B<-0> 과 B<-9>의 별칭으로 각각 오해할 수 있습니다. LZMA 유틸리티의 " +"하위 호환성을 목적으로 제공합니다. 이 옵션 사용은 피하십시오." + +#. type: TP +#: ../src/xz/xz.1:877 +#, no-wrap +msgid "B<--block-size=>I" +msgstr "B<--block-size=>I크기E>" + +#. type: Plain text +#: ../src/xz/xz.1:890 +msgid "" +"When compressing to the B<.xz> format, split the input data into blocks of " +"I bytes. The blocks are compressed independently from each other, " +"which helps with multi-threading and makes limited random-access " +"decompression possible. This option is typically used to override the " +"default block size in multi-threaded mode, but this option can be used in " +"single-threaded mode too." +msgstr "" +"B<.xz> 형식으로 압축할 때, 입력 데이터를 I크기E> 바이트 블록으로 입" +"력 데이터를 쪼갭니다. 각각의 블록은 다중-스레드 방식으로 처리할 수 있고 임" +"의 접근 압축 해제 가능성을 제한할 수 있게 개별적으로 압축 처리합니다. 이 옵" +"션은 보통 다중-스레드 모드에서 기본 블록 크기를 지정할 때 사용하지만, 단일-스" +"레드 모드에서도 사용할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:908 +msgid "" +"In multi-threaded mode about three times I bytes will be allocated in " +"each thread for buffering input and output. The default I is three " +"times the LZMA2 dictionary size or 1 MiB, whichever is more. Typically a " +"good value is 2\\(en4 times the size of the LZMA2 dictionary or at least 1 " +"MiB. Using I less than the LZMA2 dictionary size is waste of RAM " +"because then the LZMA2 dictionary buffer will never get fully used. The " +"sizes of the blocks are stored in the block headers, which a future version " +"of B will use for multi-threaded decompression." +msgstr "" +"다중-스레드 모드에서는 약 3배 용량의 I크기E> 바이트만큼 각 스레드 " +"별로 입출력 버퍼링용 공간을 할당합니다. 기본 I크기E>는 LZMA2 딕셔" +"너리 크기 또는 1MiB 중 가장 큰 쪽의 세 배입니다. 보통 바람직한 값으로 LZMA2 " +"딕셔너리 크기나 최소한 1MiB의 2\\(en4배입니다. LZMA2 딕셔너리 크기보다 작은 " +"I크기E> 는 램의 소모적 사용 공간으로 할당하는데 LZMA2 딕셔너리 버퍼" +"를 할당한 용량 크기 전체를 다 사용하지 않기 때문입니다. 블록 크기는 블록 헤" +"더에 저장하며, 블록 헤더는 B 차기 버전에서 다중-스레드 압축 해제시 활용" +"할 예정입니다." + +#. type: Plain text +#: ../src/xz/xz.1:917 +msgid "" +"In single-threaded mode no block splitting is done by default. Setting this " +"option doesn't affect memory usage. No size information is stored in block " +"headers, thus files created in single-threaded mode won't be identical to " +"files created in multi-threaded mode. The lack of size information also " +"means that a future version of B won't be able decompress the files in " +"multi-threaded mode." +msgstr "" +"단일-스레드 모드에서는 기본적으로 블록 쪼개기를 하지 않습니다. 이 옵션을 설" +"정한다고 해서 메모리 사용에 영향을 주지는 않습니다. 블록 헤더에 크기 정보를 " +"저장하지 않기 때문에 단일-스레드 모드에서 만든 파일은 다중-스레드 모드에서 만" +"든 파일과 동일하지 않습니다. 크기 정보의 누락은 또한 B 차기 버전에서 다" +"중-스레드 모드에서 압축 해제가 불가능함을 의미하기도 합니다." + +#. type: TP +#: ../src/xz/xz.1:917 +#, no-wrap +msgid "B<--block-list=>I" +msgstr "B<--block-list=>I크기E>" + +#. type: Plain text +#: ../src/xz/xz.1:923 +msgid "" +"When compressing to the B<.xz> format, start a new block after the given " +"intervals of uncompressed data." +msgstr "" +"B<.xz> 형식으로 압축할 때, 압축하지 않은 데이터에 주어진 처리 시간 간격 이후" +"에 새 블록 처리를 시작합니다." + +#. type: Plain text +#: ../src/xz/xz.1:929 +msgid "" +"The uncompressed I of the blocks are specified as a comma-separated " +"list. Omitting a size (two or more consecutive commas) is a shorthand to " +"use the size of the previous block." +msgstr "" +"압축하지 않은 블록 I크기E>는 쉼표로 구분한 목록으로 지정합니다. 크" +"기 값을 생략(둘 이상의 연속 쉼표)는 이전 블록 크기를 계속 사용하겠다는 의미입" +"니다." + +#. type: Plain text +#: ../src/xz/xz.1:939 +msgid "" +"If the input file is bigger than the sum of I, the last value in " +"I is repeated until the end of the file. A special value of B<0> may " +"be used as the last value to indicate that the rest of the file should be " +"encoded as a single block." +msgstr "" +"입력 파일이 I크기E>의 합보다 크면, 마지막 I크기E> 값을 파" +"일 마지막까지 반복해서 사용합니다. 특별히 B<0> 값을 마지막 값으로 사용하여 " +"파일 나머지 부분을 단일 블록으로 인코딩해야 한다는 의미를 나타낼 수도 있습니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:954 +msgid "" +"If one specifies I that exceed the encoder's block size (either the " +"default value in threaded mode or the value specified with B<--block-" +"size=>I), the encoder will create additional blocks while keeping the " +"boundaries specified in I. For example, if one specifies B<--block-" +"size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> and the input file " +"is 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10, and 1 " +"MiB." +msgstr "" +"인코더 블록 크기를 초과하는 I크기E> 값을 지정하면(스레드 모드 기본" +"값 또는 B<--block-size=>I크기E> 옵션으로 지정한 값), 인코더는 " +"I크기E> 지정 용량 범위는 유지하면서 추가 블록을 만듭니다. 예를 들" +"면 B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> 옵션을 " +"지정하고 입력 파일을 80MiB 용량으로 전달하면, 각각 5, 10, 8, 10, 2, 10, 10, " +"4, 10, 10, 1 MiB 용량을 차지하는 블록 11개를 결과물로 내줍니다." + +#. type: Plain text +#: ../src/xz/xz.1:960 +msgid "" +"In multi-threaded mode the sizes of the blocks are stored in the block " +"headers. This isn't done in single-threaded mode, so the encoded output " +"won't be identical to that of the multi-threaded mode." +msgstr "" +"다중-스레드 모드에서 블록 크기는 블록 헤더에 저장합니다. 단일-스레드 모드에" +"서는 저장하지 않기 때문에 인코딩 처리한 출력은 다중-스레드 모드의 출력 결과물" +"과는 다릅니다." + +#. type: TP +#: ../src/xz/xz.1:960 +#, no-wrap +msgid "B<--flush-timeout=>I" +msgstr "B<--flush-timeout=>I제한시간E>" + +#. type: Plain text +#: ../src/xz/xz.1:977 +msgid "" +"When compressing, if more than I milliseconds (a positive integer) " +"has passed since the previous flush and reading more input would block, all " +"the pending input data is flushed from the encoder and made available in the " +"output stream. This can be useful if B is used to compress data that is " +"streamed over a network. Small I values make the data available at " +"the receiving end with a small delay, but large I values give " +"better compression ratio." +msgstr "" +"압축할 때, 이전 데이터를 소거하고 다음 입력을 블록 단위로 더 읽는데 I제" +"한시간E> 밀리초(양의 정수값)가 지났을 경우, 대기중이던 모든 입력 데이터" +"를 인코더에서 소거한 다음 출력 스트림에 전달합니다. 이런 동작은 네트워크로 " +"스트리밍한 데이터를 B로 압축할 때 쓸만합니다. I제한시간E> 값" +"을 적게 지정하면 적은 지연 시간에 데이터를 받아낼 수 있지만 I제한시간" +"E> 값을 크게 하면 압축율을 높일 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:985 +msgid "" +"This feature is disabled by default. If this option is specified more than " +"once, the last one takes effect. The special I value of B<0> can " +"be used to explicitly disable this feature." +msgstr "" +"이 기능은 기본적으로 꺼져있습니다. 이 옵션을 한번 이상 지정하면, 마지막 옵션" +"의 값대로 동작합니다. 특별히 I제한시간E> 값을 B<0>으로 설정하면 " +"이 설정을 완전히 끌 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:987 +msgid "This feature is not available on non-POSIX systems." +msgstr "이 기능은 POSIX 시스템이 아닌 곳에서는 사용할 수 없습니다." + +#. FIXME +#. type: Plain text +#: ../src/xz/xz.1:995 +msgid "" +"B Currently B is unsuitable for " +"decompressing the stream in real time due to how B does buffering." +msgstr "" +"B<이 기능은 여전히 시험중입니다>. 현재로서는, B 버퍼링 처리 방식 때문에 " +"B의 실시간 스트림 압축 해제 기능 활용은 적절하지 않습니다." + +#. type: TP +#: ../src/xz/xz.1:995 +#, no-wrap +msgid "B<--memlimit-compress=>I" +msgstr "B<--memlimit-compress=>I제한용량E>" + +#. type: Plain text +#: ../src/xz/xz.1:1000 +msgid "" +"Set a memory usage limit for compression. If this option is specified " +"multiple times, the last one takes effect." +msgstr "" +"압축 수행시 메모리 사용 한계를 지정합니다. 이 옵션을 여러번 지정하면 마지막 " +"값을 취합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1013 +msgid "" +"If the compression settings exceed the I, B will attempt to " +"adjust the settings downwards so that the limit is no longer exceeded and " +"display a notice that automatic adjustment was done. The adjustments are " +"done in this order: reducing the number of threads, switching to single-" +"threaded mode if even one thread in multi-threaded mode exceeds the " +"I, and finally reducing the LZMA2 dictionary size." +msgstr "" +"압축 설정이 I제한용량E>을 초과하면, B는 설정 값의 하향 조정을 " +"시도하여 한계 값을 더이상 넘치지 않게 하고 자동 조절을 끝냈다는 알림을 표시합" +"니다. 조정은 다음 순서대로 진행합니다. 스레드 수를 줄입니다. 다중-스레드 모" +"드에서 스레드 하나의 할당 한계치가 I제한용량E>을 넘으면 단일-스레" +"드 모드로 전환합니다. 그 다음 마지막으로 LZMA2 딕셔너리 크기를 줄입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1021 +msgid "" +"When compressing with B<--format=raw> or if B<--no-adjust> has been " +"specified, only the number of threads may be reduced since it can be done " +"without affecting the compressed output." +msgstr "" +"B<--format=raw> 또는 B<--no-adjust> 미지정 상황에서 압축할 때, 압축 데이터 출" +"력에 영향을 주지 않고 스레드 처리 수만 줄일 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1028 +msgid "" +"If the I cannot be met even with the adjustments described above, an " +"error is displayed and B will exit with exit status 1." +msgstr "" +"I제한용량E> 값이 아래 설명한 조건에 맞지 않으면, 오류가 나타나고 " +"B 명령은 종료 상태 1번을 반환하며 빠져나갑니다." + +#. type: Plain text +#: ../src/xz/xz.1:1032 +msgid "The I can be specified in multiple ways:" +msgstr "I제한용량E> 값은 여러 방식으로 지정할 수 있습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:1042 +msgid "" +"The I can be an absolute value in bytes. Using an integer suffix " +"like B can be useful. Example: B<--memlimit-compress=80MiB>" +msgstr "" +"I제한용량E> 값은 바이트 용량 절대값입니다. 정수 값을 사용하되 " +"B와 같은 접미사를 사용하는게 좋습니다. 예: B<--memlimit-compress=80MiB>" + +#. type: Plain text +#: ../src/xz/xz.1:1054 +msgid "" +"The I can be specified as a percentage of total physical memory " +"(RAM). This can be useful especially when setting the B " +"environment variable in a shell initialization script that is shared between " +"different computers. That way the limit is automatically bigger on systems " +"with more memory. Example: B<--memlimit-compress=70%>" +msgstr "" +"I제한용량E> 값은 총 물리 메모리(RAM) 용량의 백분율로 지정할 수도 있" +"습니다. 다른 컴퓨터끼리 공유하는 셸 초기화 스크립트의 B 환경 변" +"수에 값을 설정할 때 특히 쓸만합니다. 이런 방식으로 설정하면 시스템의 메모리 " +"설치 용량에 따라 자동으로 늘어납니다. 예: B<--memlimit-compress=70%>" + +#. type: Plain text +#: ../src/xz/xz.1:1064 +msgid "" +"The I can be reset back to its default value by setting it to B<0>. " +"This is currently equivalent to setting the I to B (no memory " +"usage limit)." +msgstr "" +"I제한용량E> 값은 B<0> 기본값으로 설정하여 초기화할 수 있습니다. 현" +"재로서는 I제한용량E> 값이 I(최대) (메모리 사용 한계 없음) 인 " +"상태와 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1088 +msgid "" +"For 32-bit B there is a special case: if the I would be over " +"B<4020\\ MiB>, the I is set to B<4020\\ MiB>. On MIPS32 B<2000\\ " +"MiB> is used instead. (The values B<0> and B aren't affected by this. " +"A similar feature doesn't exist for decompression.) This can be helpful " +"when a 32-bit executable has access to 4\\ GiB address space (2 GiB on " +"MIPS32) while hopefully doing no harm in other situations." +msgstr "" +"B 32비트 버전에서는 몇가지 특별한 경우가 있습니다. I제한용량E> " +"값이 B<4020MiB>를 넘으면 I제한용량E>을 B<4020MiB>로 고정합니다. " +"MIPS32에서는 B<2000MiB>로 대신 고정합니다. (B<0>과 B는 이 경우에 해당하" +"지 않습니다. 압축 해제시 비슷한 기능은 없습니다.) 이 경우 32비트 실행 파일" +"이 4GiB(MIPS32의 경우 2GiB) 주소 영역에 접근할 때 매우 용이하며, 다른 경우에" +"는 원하는대로 문제를 일으키지 않습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1091 +msgid "See also the section B." +msgstr "B<메모리 활용> 섹션도 참고하십시오." + +#. type: TP +#: ../src/xz/xz.1:1091 +#, no-wrap +msgid "B<--memlimit-decompress=>I" +msgstr "B<--memlimit-decompress=>I제한용량E>" + +#. type: Plain text +#: ../src/xz/xz.1:1105 +msgid "" +"Set a memory usage limit for decompression. This also affects the B<--list> " +"mode. If the operation is not possible without exceeding the I, " +"B will display an error and decompressing the file will fail. See B<--" +"memlimit-compress=>I for possible ways to specify the I." +msgstr "" +"압축 해제시 메모리 사용 한계 용량을 설정합니다. B<--list> 모드에도 영향을 줍" +"니다. I제한용량E>을 넘기지 않고서는 동작이 진행이 안될 경우, " +"B 에서는 오류를 나타내고 파일 압축 해제를 실패로 간주합니다. I제한" +"용량E>을 지정하는 가능한 방법에 대해서는 B<--memlimit-compress=>I제" +"한용량E> 옵션을 참고하십시오." + +#. type: TP +#: ../src/xz/xz.1:1105 +#, no-wrap +msgid "B<--memlimit-mt-decompress=>I" +msgstr "B<--memlimit-mt-decompress=>I제한용량E>" + +#. type: Plain text +#: ../src/xz/xz.1:1127 +msgid "" +"Set a memory usage limit for multi-threaded decompression. This can only " +"affect the number of threads; this will never make B refuse to " +"decompress a file. If I is too low to allow any multi-threading, the " +"I is ignored and B will continue in single-threaded mode. Note " +"that if also B<--memlimit-decompress> is used, it will always apply to both " +"single-threaded and multi-threaded modes, and so the effective I for " +"multi-threading will never be higher than the limit set with B<--memlimit-" +"decompress>." +msgstr "" +"다중-스레드 모드 압축 해제시 메모리 사용 한계 용량을 설정합니다. 스레드 수" +"에 영향을 줄 수도 있습니다. B에서 파일 압축 해제를 거부하게 하진 않습니" +"다. I제한용량E> 수치가 다중-스레드로 처리하기에 너무 낮다면, " +"I제한용량E> 값을 무시하고 B 동작을 단일-스레드 모드로 계속 진행" +"합니다. 참고로 B<--memlimit-decompress> 옵션도 사용하면, 단일-스레드 모드와 " +"다중-스레드 모드 두 경우에 모두 적용하기에, 다중-스레드 모드에 적용할 I" +"제한용량E> 값은 B<--memlimit-decompress>에 설정하는 제한 값보다 더 크면 " +"안됩니다." + +#. type: Plain text +#: ../src/xz/xz.1:1134 +msgid "" +"In contrast to the other memory usage limit options, B<--memlimit-mt-" +"decompress=>I has a system-specific default I. B can be used to see the current value." +msgstr "" +"다른 메모리 사용 용량 제한 옵션과는 달리, B<--memlimit-mt-decompress=>I" +"제한용량E> 옵션은 시스템별 기본 I제한용량E> 값을 지닙니다. 현" +"재 설정 값은 B 명령으로 확인해볼 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1150 +msgid "" +"This option and its default value exist because without any limit the " +"threaded decompressor could end up allocating an insane amount of memory " +"with some input files. If the default I is too low on your system, " +"feel free to increase the I but never set it to a value larger than " +"the amount of usable RAM as with appropriate input files B will attempt " +"to use that amount of memory even with a low number of threads. Running out " +"of memory or swapping will not improve decompression performance." +msgstr "" +"이 옵션과 기본 값은 한계 값을 주지 않으면 스레드 기반 압축 해제 프로그램이 일" +"부 입력 파일에 대해 정신나간 수준의 메모리 용량을 할당해서 동작이 끝나버릴 " +"수 있습니다. 기본 I제한용량E>이 시스템의 사양에 비해 낮다면, " +"I제한용량E> 값을 자유롭게 올리시되, B 에서 적은 스레드 수에도 " +"메모리 공간 할당을 시도하는 만큼, 입력 파일에 적절한 수준으로 가용 RAM 용량" +"을 넘는 큰 값을 설정하지 마십시오. 메모리나 스와핑 영역 공간이 줄어들면 압축" +"해제 성능을 개선하지 못합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1162 +msgid "" +"See B<--memlimit-compress=>I for possible ways to specify the " +"I. Setting I to B<0> resets the I to the default " +"system-specific value." +msgstr "" +"I제한용량E> 값을 지정하는 가능한 방법을 보려면 B<--memlimit-" +"compress=>I제한용량E> 옵션을 참고하십시오. I제한용량E> " +"값을 B<0>으로 설정하면 I제한용량E> 값이 시스템 지정 기본값으로 바뀝" +"니다." + +#. type: TP +#: ../src/xz/xz.1:1163 +#, no-wrap +msgid "B<-M> I, B<--memlimit=>I, B<--memory=>I" +msgstr "B<-M> I제한용량E>, B<--memlimit=>I제한용량E>, B<--memory=>I제한용량E>" + +#. type: Plain text +#: ../src/xz/xz.1:1169 +msgid "" +"This is equivalent to specifying B<--memlimit-compress=>I B<--" +"memlimit-decompress=>I B<--memlimit-mt-decompress=>I." +msgstr "" +"B<--memlimit-compress=>I제한용량E> B<--memlimit-decompress=>I" +"제한용량E> B<--memlimit-mt-decompress=>I제한용량E> 지정과 동일" +"합니다." + +#. type: TP +#: ../src/xz/xz.1:1169 +#, no-wrap +msgid "B<--no-adjust>" +msgstr "B<--no-adjust>" + +#. type: Plain text +#: ../src/xz/xz.1:1179 +msgid "" +"Display an error and exit if the memory usage limit cannot be met without " +"adjusting settings that affect the compressed output. That is, this " +"prevents B from switching the encoder from multi-threaded mode to single-" +"threaded mode and from reducing the LZMA2 dictionary size. Even when this " +"option is used the number of threads may be reduced to meet the memory usage " +"limit as that won't affect the compressed output." +msgstr "" +"압축 출력 결과에 영향을 주는 설정을 조정하지 않고는 메모리 사용 용량 제한 조" +"건이 맞지 않으면 오류를 표시하고 빠져나갑니다. 이 옵션은 B가 다중-스레" +"드 모드에서 단일-스레드 모드로 전환하고 LZMA2 딕셔너리 크기를 줄이는 동작을 " +"막아줍니다. 심지어 이 옵션을 사용하면 메모리 사용 한계를 만족하도록 스레드 " +"수를 줄여 압축 결과물 출력에 영향이 가지 않게 합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1182 +msgid "" +"Automatic adjusting is always disabled when creating raw streams (B<--" +"format=raw>)." +msgstr "원시 스트림(B<--format=raw>)을 만들 떄 자동 조정은 항상 꺼집니다." + +#. type: TP +#: ../src/xz/xz.1:1182 +#, no-wrap +msgid "B<-T> I, B<--threads=>I" +msgstr "B<-T> I스레드수E>, B<--threads=>I스레드수E>" + +#. type: Plain text +#: ../src/xz/xz.1:1197 +msgid "" +"Specify the number of worker threads to use. Setting I to a " +"special value B<0> makes B use up to as many threads as the processor(s) " +"on the system support. The actual number of threads can be fewer than " +"I if the input file is not big enough for threading with the given " +"settings or if using more threads would exceed the memory usage limit." +msgstr "" +"활용할 작업 스레드 수를 지정합니다. I스레드수E> 값을 B<0> 값으로 " +"설정하면, B는 시스템에서 지원하는 최대 프로세서 스레드 수를 모두 확보합니" +"다. 실제 스레드 수는 입력 파일이 주어진 설정대로 스레드 처리를 할 만큼 그렇" +"게 크지 않을 경우, 내지는 더 많은 스레드를 사용했을 때 메모리 사용량 한계를 " +"초과할 경우 I스레드수E> 보다 적을 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1216 +msgid "" +"The single-threaded and multi-threaded compressors produce different " +"output. Single-threaded compressor will give the smallest file size but " +"only the output from the multi-threaded compressor can be decompressed using " +"multiple threads. Setting I to B<1> will use the single-threaded " +"mode. Setting I to any other value, including B<0>, will use the " +"multi-threaded compressor even if the system supports only one hardware " +"thread. (B 5.2.x used single-threaded mode in this situation.)" +msgstr "" +"단일-스레드와 다중-스레드 압축 프로그램은 다른 출력 결과물을 냅니다. 단일-스" +"레드 압축 프로그램은 작은 파일 크기 결과물을 내놓지만, 다중-스레드 압축 프로" +"그램의 경우 다중-스레드 압축 프로그램에서 내놓은 결과물은 다중-스레드로만 압" +"축을 해제할 수 있습니다. I스레드수E>를 B<1>로 설정하면 단일-스레" +"드 모드를 사용합니다. I스레드수E>를 B<0>과 다른 값으로 설정하면, " +"시스템에서 실제로 하드웨어 스레드가 1개만 지원한다 하더라도, 다중-스레드 압" +"축 프로그램을 사용합니다. (B 5.2.x에서는 이 경우 단일-스레드 모드를 활용" +"합니다.)" + +#. type: Plain text +#: ../src/xz/xz.1:1235 +msgid "" +"To use multi-threaded mode with only one thread, set I to B<+1>. " +"The B<+> prefix has no effect with values other than B<1>. A memory usage " +"limit can still make B switch to single-threaded mode unless B<--no-" +"adjust> is used. Support for the B<+> prefix was added in B 5.4.0." +msgstr "" +"단일-스레드로 다중-스레드 모드를 사용하려면, I스레드수E>를 B<+1>로 " +"설정하십시오. B<+> 접두사는 B<1> 이외의 값에는 영향을 주지 않습니다. 메모리 " +"사용량 한계 설정은 B을 B<--no-adjust> 옵션을 쓰기 전까지는 단일-스레드로 " +"전환하게 합니다. B<+> 접두사 지원은 B 5.4.0에 추가했습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1250 +msgid "" +"If an automatic number of threads has been requested and no memory usage " +"limit has been specified, then a system-specific default soft limit will be " +"used to possibly limit the number of threads. It is a soft limit in sense " +"that it is ignored if the number of threads becomes one, thus a soft limit " +"will never stop B from compressing or decompressing. This default soft " +"limit will not make B switch from multi-threaded mode to single-threaded " +"mode. The active limits can be seen with B." +msgstr "" +"자동 스레드 수를 요청했고 메모리 사용 한계를 지정하지 않았다면, 시스템에 맞게" +"끔 가능한 스레드 수를 제한하는 기본 소프트 제한 값을 사용합니다. 스레드 수가 " +"한개가 되면 무시하는 이런 개념이 소프트 제한이기에, B로 하여금 압축 동작 " +"및 압축 해제 동작 수행시 멈추지 않습니다. 이 가본 소프트 제한 값은 B 실" +"행 도중 다중-스레드 모드에서 단일-스레드 모드로 바뀌게 하지는 않습니다. 활" +"성 제한 값은 B 명령으로 볼 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1257 +msgid "" +"Currently the only threading method is to split the input into blocks and " +"compress them independently from each other. The default block size depends " +"on the compression level and can be overridden with the B<--block-" +"size=>I option." +msgstr "" +"현재 스레딩 처리 방식은 입력을 블록 단위로 쪼개고 각각의 블록을 독립적으로 압" +"축하는 동작을 취합니다. 기본 블록 크기는 압축 수준에 따라 다르며 B<--block-" +"size=>I크기E> 옵션으로 재지정할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1265 +msgid "" +"Threaded decompression only works on files that contain multiple blocks with " +"size information in block headers. All large enough files compressed in " +"multi-threaded mode meet this condition, but files compressed in single-" +"threaded mode don't even if B<--block-size=>I has been used." +msgstr "" +"스레드 압축 해제 방식은 여러 블록이 블록 헤더에 넣은 크기 정보와 함께 들어간 " +"파일에만 동작합니다. 다중-스레드 모드에서 압축한 충분히 큰 모든 파일은 이 조" +"건에 만족하지만, 단일-스레드 모드에서 압축한 파일은 B<--block-size=>I크" +"기E> 옵션을 지정하더라도 조건에 만족하지 않습니다." + +#. type: SS +#: ../src/xz/xz.1:1266 ../src/xz/xz.1:2819 +#, no-wrap +msgid "Custom compressor filter chains" +msgstr "개별 압축 필터 체인 설정" + +#. type: Plain text +#: ../src/xz/xz.1:1282 +msgid "" +"A custom filter chain allows specifying the compression settings in detail " +"instead of relying on the settings associated to the presets. When a custom " +"filter chain is specified, preset options (B<-0> \\&...\\& B<-9> and B<--" +"extreme>) earlier on the command line are forgotten. If a preset option is " +"specified after one or more custom filter chain options, the new preset " +"takes effect and the custom filter chain options specified earlier are " +"forgotten." +msgstr "" +"개별 필터 체인은 사전 설정에 엮인 설정에 의존하는 대신 압축 설정을 세부적으" +"로 하나하나 설정할 수 있게 합니다. 개별 필터 체인을 지정하면, 명령행에 앞서 " +"지정한 사전 설정 옵션(B<-0> \\&...\\& B<-9> 과 B<--extreme>)은 무시합니다. " +"사전 설정 옵션을 하나 이상의 필터 체인 옵션 다음에 지정하면, 새 사전 설정을 " +"취하며, 앞서 지정한 개별 필터 체인 옵션은 무시합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1289 +msgid "" +"A filter chain is comparable to piping on the command line. When " +"compressing, the uncompressed input goes to the first filter, whose output " +"goes to the next filter (if any). The output of the last filter gets " +"written to the compressed file. The maximum number of filters in the chain " +"is four, but typically a filter chain has only one or two filters." +msgstr "" +"필터 체인은 명령행 파이핑에 비교할 수 있습니다. 압축할 때, 압축하지 않은 입" +"력을 첫번째 필터로 놓고, 출력 대상(이 있으면)을 다음 필터로 지정합니다. 최" +"종 필터의 출력은 압축 파일로 기옥합니다. 체인의 최대 필터 수는 4이지만, 필" +"터 체인상 필터 갯수는 보통 1~2개입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1297 +msgid "" +"Many filters have limitations on where they can be in the filter chain: some " +"filters can work only as the last filter in the chain, some only as a non-" +"last filter, and some work in any position in the chain. Depending on the " +"filter, this limitation is either inherent to the filter design or exists to " +"prevent security issues." +msgstr "" +"수많은 필터가 필터 체인 상에서 제약점을 가지고 있습니다. 일부 필터는 체인의 " +"마지막 필터로만 동작하며, 일부 다른 필터는 마지막이 아닌 필터로, 어떤 동작은 " +"체인의 어떤 위치에든 둡니다. 필터에 따라, 이 제한은 필터 설계를 따르거나 보" +"안 문제를 막기 위해 존재하기도 합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1305 +msgid "" +"A custom filter chain is specified by using one or more filter options in " +"the order they are wanted in the filter chain. That is, the order of filter " +"options is significant! When decoding raw streams (B<--format=raw>), the " +"filter chain is specified in the same order as it was specified when " +"compressing." +msgstr "" +"개별 필터 체인은 필터 체인에서 원하는 순서대로 하나 이상의 필터 옵션을 사용하" +"여 지정합니다. 이는, 필터 옵션 순서가 중요하다는 뜻입니다! 원시 스트림을 디" +"코딩할 때(B<--format=raw>), 필터 체인은 압축할 때 지정했던 동일한 순서대로 지" +"정합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1314 +msgid "" +"Filters take filter-specific I as a comma-separated list. Extra " +"commas in I are ignored. Every option has a default value, so you " +"need to specify only those you want to change." +msgstr "" +"필터는 쉼표로 구분하는 필터별 I옵션E>이 있습니다. I옵션E>" +"에 추가로 입력한 쉼표는 무시합니다. 모든 옵션 값에는 기본값이 있어, 값을 바" +"꾸려면 지정해야합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1323 +msgid "" +"To see the whole filter chain and I, use B (that is, use " +"B<--verbose> twice). This works also for viewing the filter chain options " +"used by presets." +msgstr "" +"전체 필터 체인과 I옵션E>을 보려면 B (B<--verbose> 두 번)명" +"령을 사용하십시오. 이 명령은 사전 설정이 사용하는 필터 체인 옵션도 볼 수 있" +"습니다." + +#. type: TP +#: ../src/xz/xz.1:1323 +#, no-wrap +msgid "B<--lzma1>[B<=>I]" +msgstr "B<--lzma1>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1326 +#, no-wrap +msgid "B<--lzma2>[B<=>I]" +msgstr "B<--lzma2>[B<=>I옵션E>]" + +#. type: Plain text +#: ../src/xz/xz.1:1331 +msgid "" +"Add LZMA1 or LZMA2 filter to the filter chain. These filters can be used " +"only as the last filter in the chain." +msgstr "" +"LZMA1 또는 LZMA2 필터를 필터 체인에 추가합니다. 이 필터는 필터 체인의 마지" +"막 요소로만 사용할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1343 +msgid "" +"LZMA1 is a legacy filter, which is supported almost solely due to the legacy " +"B<.lzma> file format, which supports only LZMA1. LZMA2 is an updated " +"version of LZMA1 to fix some practical issues of LZMA1. The B<.xz> format " +"uses LZMA2 and doesn't support LZMA1 at all. Compression speed and ratios " +"of LZMA1 and LZMA2 are practically the same." +msgstr "" +"LZMA1은 고전 필터로, LZMA1만 지원하는 고전 B<.lzma> 파일 형식에서만 지원합니" +"다. LZMA2는 LZMA1의 업데이트 버전으로 LZMA1의 실질적 문제를 해결했습니다. " +"B<.xz> 형식은 LZMA2 필터를 사용하며 LZMA1 필터는 전적으로 지원하지 않습니" +"다. 압축 속도와 압축율은 LZMA1과 LZMA2가 실질적으로 동일합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1346 +msgid "LZMA1 and LZMA2 share the same set of I:" +msgstr "LZMA1과 LZMA2는 동일한 I옵션E> 집합을 공유합니다:" + +#. type: TP +#: ../src/xz/xz.1:1347 +#, no-wrap +msgid "BI" +msgstr "BI사전설정E>" + +#. type: Plain text +#: ../src/xz/xz.1:1374 +msgid "" +"Reset all LZMA1 or LZMA2 I to I. I consist of an " +"integer, which may be followed by single-letter preset modifiers. The " +"integer can be from B<0> to B<9>, matching the command line options B<-0> " +"\\&...\\& B<-9>. The only supported modifier is currently B, which " +"matches B<--extreme>. If no B is specified, the default values of " +"LZMA1 or LZMA2 I are taken from the preset B<6>." +msgstr "" +"LZMA1 또는 LZMA2의 모든 I옵션E>을 I사전설정E>으로 초기화" +"합니다. I사전설정E> 값은 정수 값으로 이루어져 있으며, 사전 설정에 " +"변형을 줄 떄 단일 문자가 따라올 수도 있습니다. 정수 값은 B<0>에서 B<9> 까지" +"이며, 명령행 옵션에서 B<-0> \\&...\\& B<-9>로 대응합니다. 변형 옵션으로 지원" +"하는 문자는 현재 B 뿐이며, B<--extreme>에 대응합니다. I사전설정" +"E> 값을 지정하지 않으면, LZMA1 또는 LZMA2 기본값을 사전 설정 B<6>에서 가" +"져온 I옵션E>으로 취합니다." + +#. type: TP +#: ../src/xz/xz.1:1374 +#, no-wrap +msgid "BI" +msgstr "BI크기E>" + +#. type: Plain text +#: ../src/xz/xz.1:1389 +msgid "" +"Dictionary (history buffer) I indicates how many bytes of the " +"recently processed uncompressed data is kept in memory. The algorithm tries " +"to find repeating byte sequences (matches) in the uncompressed data, and " +"replace them with references to the data currently in the dictionary. The " +"bigger the dictionary, the higher is the chance to find a match. Thus, " +"increasing dictionary I usually improves compression ratio, but a " +"dictionary bigger than the uncompressed file is waste of memory." +msgstr "" +"딕셔너리(기록 버퍼) I크기E>는 최근 처리한 비압축 데이터를 바이트 " +"단위로 메모리에 얼마나 유지하는지 나타냅니다. 알고리즘은 비압축 데이터상 바" +"이트 시퀀스(일치 항목) 반복 탐색을 시도하며, 해당 부분을 딕셔너리의 현재 참조" +"로 치환합니다. 딕셔너리가 크면 일치하는 항목을 찾을 기회가 더 많아집니다. 따" +"라서, 딕셔너리 I크기E>를 더욱 크게 설정하면 압축율을 증가할 수는 있" +"지만, 압축하지 않은 파일보다 딕셔너리가 크면 메모리 낭비율이 올라갑니다." + +#. type: Plain text +#: ../src/xz/xz.1:1398 +msgid "" +"Typical dictionary I is from 64\\ KiB to 64\\ MiB. The minimum is 4\\ " +"KiB. The maximum for compression is currently 1.5\\ GiB (1536\\ MiB). The " +"decompressor already supports dictionaries up to one byte less than 4\\ GiB, " +"which is the maximum for the LZMA1 and LZMA2 stream formats." +msgstr "" +"보통 딕셔너리 I크기E>는 64KiB 에서 64MiB 정도 됩니다. 최소 4KiB 입" +"니다. 압축시 최대 용량은 현재 1.5GiB(1536MiB)로 나타납니다. 압축 해제 프로그" +"램에도 4GiB 미만으로 딕셔너리 크기를 이미 지원하며 4GiB 라는 수치는 LZMA1과 " +"LZMA2 스트림 형식의 최대값입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1425 +msgid "" +"Dictionary I and match finder (I) together determine the memory " +"usage of the LZMA1 or LZMA2 encoder. The same (or bigger) dictionary " +"I is required for decompressing that was used when compressing, thus " +"the memory usage of the decoder is determined by the dictionary size used " +"when compressing. The B<.xz> headers store the dictionary I either as " +"2^I or 2^I + 2^(I-1), so these I are somewhat preferred for " +"compression. Other I will get rounded up when stored in the B<.xz> " +"headers." +msgstr "" +"딕셔너리 I크기E>와 검색기(I)는 LZMA1 또는 LZMA 인코더의 메모리 " +"사용량을 함께 결정합니다. 동일한(또는 더 큰) 딕셔너리 I크기E>가 데" +"이터를 압축했을 때만큼 압축 해제할 떄 필요하기 때문에, 디코더의 메모리 사용량" +"은 압축할 때의 딕셔너리 크기로 결정합니다. B<.xz> 헤더에는 딕셔너리 I" +"크기E>를 2^I 또는 2^I + 2^(I-1) 으로 저장하기에, 이 I크기" +"E> 값을 압축할 때 선호하는 편입니다. 다른 I크기E> 값은 B<.xz> " +"헤더에 저장할 때 반올림합니다." + +#. type: TP +#: ../src/xz/xz.1:1425 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1434 +msgid "" +"Specify the number of literal context bits. The minimum is 0 and the " +"maximum is 4; the default is 3. In addition, the sum of I and I " +"must not exceed 4." +msgstr "" +"리터럴 컨텍스트 비트 수를 지정합니다. 최소 값은 0이고 최대 값은 4입니다. 기" +"본 값은 3입니다. 추가로, I 값과 I 값의 합은 4를 넘으면 안됩니다." + +#. type: Plain text +#: ../src/xz/xz.1:1439 +msgid "" +"All bytes that cannot be encoded as matches are encoded as literals. That " +"is, literals are simply 8-bit bytes that are encoded one at a time." +msgstr "" +"조건이 일치하지 않아 인코딩할 수 없는 모든 바이트는 리터럴로 인코딩합니다. " +"이 말인 즉슨, 간단히 8비트 바이트로서의 리터럴을 한번에 하나씩 인코딩합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1453 +msgid "" +"The literal coding makes an assumption that the highest I bits of the " +"previous uncompressed byte correlate with the next byte. For example, in " +"typical English text, an upper-case letter is often followed by a lower-case " +"letter, and a lower-case letter is usually followed by another lower-case " +"letter. In the US-ASCII character set, the highest three bits are 010 for " +"upper-case letters and 011 for lower-case letters. When I is at least " +"3, the literal coding can take advantage of this property in the " +"uncompressed data." +msgstr "" +"리터럴 코딩을 할 때 이전 비압축 바이트와 다음 바이트와의 관련성을 가진 가장 " +"많은 I 비트 수를 가정합니다. 예를 들면, 보통 영문 문장의 경우 대문자 다" +"음에 종종 소문자가 오고, 소문자 다음에 다른 소문자가 따라옵니다. US-ASCII 문" +"자 세트에서는 가장 긴 비트 3개는 대문자에 대해 010, 소문자에 대해 011입니" +"다. I 값이 최소한 3이면, 리터럴 코딩시 비압축 데이터에 대해 이런 속성의 " +"장점을 취할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1462 +msgid "" +"The default value (3) is usually good. If you want maximum compression, " +"test B. Sometimes it helps a little, and sometimes it makes " +"compression worse. If it makes it worse, test B too." +msgstr "" +"(어쨌거나) 기본값 (3)은 보통 적절합니다. 최대 압축을 원한다면 B 값을 " +"시험해보십시오. 때로는 약간 도움이 되기도 하겠지만, 오히려 결과가 안좋을 수" +"도 있습니다. 결과가 엄한 방향으로 간다면, B 값도 시험해보십시오." + +#. type: TP +#: ../src/xz/xz.1:1462 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1466 +msgid "" +"Specify the number of literal position bits. The minimum is 0 and the " +"maximum is 4; the default is 0." +msgstr "" +"리터럴 위치 비트 수를 지정하빈다. 최소 값은 0이고 최대 값은 4입니다. 기본 값" +"은 0입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1473 +msgid "" +"I affects what kind of alignment in the uncompressed data is assumed " +"when encoding literals. See I below for more information about " +"alignment." +msgstr "" +"I 값은 리터럴 인코딩 진행시 비압축 데이터 정렬 방식 고려에 영향을 줍니" +"다. 정렬 방식에 대한 자세한 정보는 하단 I를 참고하십시오." + +#. type: TP +#: ../src/xz/xz.1:1473 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1477 +msgid "" +"Specify the number of position bits. The minimum is 0 and the maximum is 4; " +"the default is 2." +msgstr "" +"위치 비트 수를 지정합니다. 최소 값은 0이며 최대 값은 4입니다. 기본값은 2입" +"니다." + +#. type: Plain text +#: ../src/xz/xz.1:1484 +msgid "" +"I affects what kind of alignment in the uncompressed data is assumed in " +"general. The default means four-byte alignment (2^I=2^2=4), which is " +"often a good choice when there's no better guess." +msgstr "" +"I 값은 보통 압축하지 않은 데이터에 어떤 정렬 방식을 고려하느냐에 영향을 " +"줍니다. 기본적으로 4바이트 정렬(2^I=2^2=4)을 의미하는데, 이보다 더 나은 " +"추측 값이 없어서 종종 최적의 선택으로 간주합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1498 +msgid "" +"When the alignment is known, setting I accordingly may reduce the file " +"size a little. For example, with text files having one-byte alignment (US-" +"ASCII, ISO-8859-*, UTF-8), setting B can improve compression " +"slightly. For UTF-16 text, B is a good choice. If the alignment is " +"an odd number like 3 bytes, B might be the best choice." +msgstr "" +"정렬 상태를 알지 못할 경우, I 설정 값이 파일 크기를 조금 줄일 수 있습니" +"다. 예를 들면, 텍스트 파일이 단일 바이트 단위로 정돈된 상태(US-ASCII, " +"ISO-8859-*, UTF-8)라면, B 설정 값으로 압축율을 조금 개선할 수 있습니" +"다. UTF-16 텍스트의 경우, B 설정 값이 좋은 선택입니다. 정렬 바이트가 " +"3 바이트 같은 홀수 바이트일 경우, B 설정 값이 최적의 선택일지도 모릅니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:1506 +msgid "" +"Even though the assumed alignment can be adjusted with I and I, " +"LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth " +"taking into account when designing file formats that are likely to be often " +"compressed with LZMA1 or LZMA2." +msgstr "" +"가정 정렬을 I 값과 I 값으로 조정하긴 하지만, LZMA1과 LZMA2는 여전히 " +"16바이트 정렬 방식으로 선호합니다. LZMA1 또는 LZMA2로 종종 압축하는 파일 형" +"식이라고 하면 고려해볼만 합니다." + +#. type: TP +#: ../src/xz/xz.1:1506 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1521 +msgid "" +"Match finder has a major effect on encoder speed, memory usage, and " +"compression ratio. Usually Hash Chain match finders are faster than Binary " +"Tree match finders. The default depends on the I: 0 uses B, " +"1\\(en3 use B, and the rest use B." +msgstr "" +"일치 검색기는 인코더 속도, 메모리 사용량, 압축율에 주된 영향을 줍니다. 보통 " +"해시 체인 검색기는 이진 트리 검색기보다 빠르긴 합니다. 기본 값은 I사전" +"설정E>에 따라 다릅니다. 0은 B을, 1\\(en3은 B를, 나머지는 B" +"를 활용합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1527 +msgid "" +"The following match finders are supported. The memory usage formulas below " +"are rough approximations, which are closest to the reality when I is a " +"power of two." +msgstr "" +"다음 검색 필터를 지원합니다. 메모리 사용 공식은 I 값이 2의 승수일 경" +"우 실제에 가까운 근사치입니다." + +#. type: TP +#: ../src/xz/xz.1:1528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1531 +msgid "Hash Chain with 2- and 3-byte hashing" +msgstr "2바이트, 3바이트 해싱 체인" + +#. type: Plain text +#: ../src/xz/xz.1:1535 ../src/xz/xz.1:1584 +msgid "Minimum value for I: 3" +msgstr "I 최소값: 3" + +#. type: Plain text +#: ../src/xz/xz.1:1537 ../src/xz/xz.1:1556 ../src/xz/xz.1:1586 +#: ../src/xz/xz.1:1605 +msgid "Memory usage:" +msgstr "메모리 사용:" + +#. type: Plain text +#: ../src/xz/xz.1:1542 +msgid "I * 7.5 (if I E= 16 MiB);" +msgstr "I * 7.5 (조건: I E= 16 MiB);" + +#. type: Plain text +#: ../src/xz/xz.1:1547 +msgid "I * 5.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 5.5 + 64 MiB (조건: I E 16 MiB)" + +#. type: TP +#: ../src/xz/xz.1:1547 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1550 +msgid "Hash Chain with 2-, 3-, and 4-byte hashing" +msgstr "2바이트, 3바이트, 4바이트 해싱 체인" + +#. type: Plain text +#: ../src/xz/xz.1:1554 ../src/xz/xz.1:1603 +msgid "Minimum value for I: 4" +msgstr "I 최소값: 4" + +#. type: Plain text +#: ../src/xz/xz.1:1561 +msgid "I * 7.5 (if I E= 32 MiB);" +msgstr "I * 7.5 (조건: I E= 32 MiB);" + +#. type: Plain text +#: ../src/xz/xz.1:1566 +msgid "I * 6.5 (if I E 32 MiB)" +msgstr "I * 6.5 (조건: I E 32 MiB)" + +#. type: TP +#: ../src/xz/xz.1:1566 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1569 +msgid "Binary Tree with 2-byte hashing" +msgstr "2바이트 해싱 이진 트리" + +#. type: Plain text +#: ../src/xz/xz.1:1573 +msgid "Minimum value for I: 2" +msgstr "I 최소값: 2" + +#. type: Plain text +#: ../src/xz/xz.1:1577 +msgid "Memory usage: I * 9.5" +msgstr "메모리 사용: I * 9.5" + +#. type: TP +#: ../src/xz/xz.1:1577 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1580 +msgid "Binary Tree with 2- and 3-byte hashing" +msgstr "2바이트, 3바이트 해싱 이진트리" + +#. type: Plain text +#: ../src/xz/xz.1:1591 +msgid "I * 11.5 (if I E= 16 MiB);" +msgstr "I * 11.5 (조건: I E= 16 MiB);" + +#. type: Plain text +#: ../src/xz/xz.1:1596 +msgid "I * 9.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 9.5 + 64 MiB (조건: I E 16 MiB)" + +#. type: TP +#: ../src/xz/xz.1:1596 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1599 +msgid "Binary Tree with 2-, 3-, and 4-byte hashing" +msgstr "2바이트, 3바이트, 4바이트 해싱 이진 트리" + +#. type: Plain text +#: ../src/xz/xz.1:1610 +msgid "I * 11.5 (if I E= 32 MiB);" +msgstr "I * 11.5 (조건: I E= 32 MiB);" + +#. type: Plain text +#: ../src/xz/xz.1:1615 +msgid "I * 10.5 (if I E 32 MiB)" +msgstr "I * 10.5 (조건: I E 32 MiB)" + +#. type: TP +#: ../src/xz/xz.1:1616 +#, no-wrap +msgid "BI" +msgstr "BI모드E>" + +#. type: Plain text +#: ../src/xz/xz.1:1637 +msgid "" +"Compression I specifies the method to analyze the data produced by the " +"match finder. Supported I are B and B. The default is " +"B for I 0\\(en3 and B for I 4\\(en9." +msgstr "" +"압축 I모드E> 값은 일치 검색기에서 생산하는 데이터 분석 방식을 지정" +"합니다. 지원하는 I모드E>는 B와 B 입니다. 기본값은 " +"I사전설정E>값 0\\(en3에 대해 B, I사전설정E>값 " +"4\\(en9에 대해 B입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1646 +msgid "" +"Usually B is used with Hash Chain match finders and B with " +"Binary Tree match finders. This is also what the I do." +msgstr "" +"보통 B는 해시 체인 검색기에서 사용하며 B은 이진 트리 검색기에" +"서 사용합니다. 이 동작은 또한 I사전설정E> 값이 할 일이기도 합니다." + +#. type: TP +#: ../src/xz/xz.1:1646 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1653 +msgid "" +"Specify what is considered to be a nice length for a match. Once a match of " +"at least I bytes is found, the algorithm stops looking for possibly " +"better matches." +msgstr "" +"일치하는 nice 길이를 지정합니다. 최소한 I 바이트 정도 일치하면, 알고리" +"즘이 가능한 최선의 부분을 찾는 동작을 멈춥니다." + +#. type: Plain text +#: ../src/xz/xz.1:1660 +msgid "" +"I can be 2\\(en273 bytes. Higher values tend to give better " +"compression ratio at the expense of speed. The default depends on the " +"I." +msgstr "" +"I 값은 2\\(en273 바이트입니다. 값이 클 수록 속도 면에서는 손해를 보겠" +"지만 압축율은 더욱 올라갑니다. 기본 값은 I사전설정E>값에 따라 다릅" +"니다." + +#. type: TP +#: ../src/xz/xz.1:1660 +#, no-wrap +msgid "BI" +msgstr "BI깊이E>" + +#. type: Plain text +#: ../src/xz/xz.1:1670 +msgid "" +"Specify the maximum search depth in the match finder. The default is the " +"special value of 0, which makes the compressor determine a reasonable " +"I from I and I." +msgstr "" +"일치 검색기에서의 최대 검색 깊이를 지정합니다. 기본값은 특별한 값 0으로 지정" +"하며, 이 값으로 압축 프로그램이 I 와 I간 적절한 I깊이E> " +"값을 결정합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1681 +msgid "" +"Reasonable I for Hash Chains is 4\\(en100 and 16\\(en1000 for Binary " +"Trees. Using very high values for I can make the encoder extremely " +"slow with some files. Avoid setting the I over 1000 unless you are " +"prepared to interrupt the compression in case it is taking far too long." +msgstr "" +"적절한 해시 체인 I깊이E> 값은 이진 트리에서 4\\(en100 그리고 " +"16\\(en1000 입니다. 상당히 큰 값을 I깊이E> 값으로 사용하면 일부 파" +"일에 대해 인코더가 매우 느리게 동작할 수가 있습니다. 압축 시간이 너무 오래걸" +"려서 동작을 중간에 끊을 준비가 되지 않은 이상 I깊이E> 설정 값은 " +"1000을 넘지 않게하십시오." + +#. type: Plain text +#: ../src/xz/xz.1:1692 +msgid "" +"When decoding raw streams (B<--format=raw>), LZMA2 needs only the dictionary " +"I. LZMA1 needs also I, I, and I." +msgstr "" +"원시 스트림(B<--format=raw>)을 디코딩할 때, LZMA2는 딕셔너리 I크기" +"E>만 필요합니다. LZMA1는 I, I, I 값이 모두 필요합니다." + +#. type: TP +#: ../src/xz/xz.1:1692 +#, no-wrap +msgid "B<--x86>[B<=>I]" +msgstr "B<--x86>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1695 +#, no-wrap +msgid "B<--arm>[B<=>I]" +msgstr "B<--arm>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1697 +#, no-wrap +msgid "B<--armthumb>[B<=>I]" +msgstr "B<--armthumb>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1699 +#, no-wrap +msgid "B<--arm64>[B<=>I]" +msgstr "B<--arm64>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1701 +#, no-wrap +msgid "B<--powerpc>[B<=>I]" +msgstr "B<--powerpc>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1703 +#, no-wrap +msgid "B<--ia64>[B<=>I]" +msgstr "B<--ia64>[B<=>I옵션E>]" + +#. type: TP +#: ../src/xz/xz.1:1705 +#, no-wrap +msgid "B<--sparc>[B<=>I]" +msgstr "B<--sparc>[B<=>I옵션E>]" + +#. type: Plain text +#: ../src/xz/xz.1:1711 +msgid "" +"Add a branch/call/jump (BCJ) filter to the filter chain. These filters can " +"be used only as a non-last filter in the filter chain." +msgstr "" +"브랜치/호출/점프(BCJ) 필터를 필터 체인에 추가합니다. 이 필터는 필터 체인의 " +"비종결 필터로만 사용할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1725 +msgid "" +"A BCJ filter converts relative addresses in the machine code to their " +"absolute counterparts. This doesn't change the size of the data but it " +"increases redundancy, which can help LZMA2 to produce 0\\(en15\\ % smaller " +"B<.xz> file. The BCJ filters are always reversible, so using a BCJ filter " +"for wrong type of data doesn't cause any data loss, although it may make the " +"compression ratio slightly worse. The BCJ filters are very fast and use an " +"insignificant amount of memory." +msgstr "" +"BCJ 필터는 머신 코드의 상대 주소를 절대 주소로 변환합니다. 데이터 크기를 바" +"꾸지는 않지만 LZMA2에서 B<.xz> 파일을 0\\(en15% 정도 줄여주게 하는 중복성이 " +"늘어납니다. BCJ 필터는 언제든 뒤집을 수 있어, 데이터에 적절하지 않은 BCJ 필" +"터 형식을 활용하면, 그냥 가만히 두면 압축율이 약간 떨어지게 한다 하더라도, 데" +"이터를 잃을 수가 있습니다. BCJ 필터는 굉장히 빠르며 메모리 공간을 적게 활용" +"합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1728 +msgid "These BCJ filters have known problems related to the compression ratio:" +msgstr "이 BCJ 필터에는 압축율 관련 몇가지 문제가 있습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:1735 +msgid "" +"Some types of files containing executable code (for example, object files, " +"static libraries, and Linux kernel modules) have the addresses in the " +"instructions filled with filler values. These BCJ filters will still do the " +"address conversion, which will make the compression worse with these files." +msgstr "" +"실행 코드가 들어있는 몇가지 파일 형식(예: 목적 파일, 정적 라이브러리, 리눅스 " +"커널 모듈)의 경우 필터 값으로 채운 명령 주소가 있습니다. 여기 BCJ 필터의 경" +"우 파일의 압축율을 떨어뜨리는 주소 변환을 수행합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1745 +msgid "" +"If a BCJ filter is applied on an archive, it is possible that it makes the " +"compression ratio worse than not using a BCJ filter. For example, if there " +"are similar or even identical executables then filtering will likely make " +"the files less similar and thus compression is worse. The contents of non-" +"executable files in the same archive can matter too. In practice one has to " +"try with and without a BCJ filter to see which is better in each situation." +msgstr "" +"BCJ 필터를 아카이브에 적용하면, BCJ 필터를 사용하지 않았을 때보다 압축율이 떨" +"어질 수가 있습니다. 예를 들면, 유사하거나 동일한 실행 파일 여럿이 있으면 필" +"터를 사용하여 파일을 덜 비슷하게 만들어 압축율이 떨어지게 합니다. 동일한 아" +"카이브 파일에서 비 실행 파일의 내용에 대해서도 비슷한 일이 벌어질 수 있습니" +"다. 실제로 하나는 BCJ 필터를 걸고 하나는 제외하여 각 경우에 대해 어떤 경우" +"가 결과가 우수한 지 살펴보겠습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1750 +msgid "" +"Different instruction sets have different alignment: the executable file " +"must be aligned to a multiple of this value in the input data to make the " +"filter work." +msgstr "" +"다른 명령 세트는 다른 정렬 상태에 놓여있습니다. 실행 파일은 필터가 제대로 동" +"작하게 하려면 입력 데이터에 있는 이 값의 배수로 정돈해야합니다." + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Filter" +msgstr "필터" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Alignment" +msgstr "정렬" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Notes" +msgstr "참고" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "x86" +msgstr "x86" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "32-bit or 64-bit x86" +msgstr "32-bit 또는 64-bit x86" + +#. type: tbl table +#: ../src/xz/xz.1:1759 +#, no-wrap +msgid "ARM" +msgstr "ARM" + +#. type: tbl table +#: ../src/xz/xz.1:1760 +#, no-wrap +msgid "ARM-Thumb" +msgstr "ARM-Thumb" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "ARM64" +msgstr "ARM64" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "4096-byte alignment is best" +msgstr "4096 바이트 정렬이 가장 좋습니다" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "PowerPC" +msgstr "PowerPC" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "Big endian only" +msgstr "빅엔디안 전용" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "IA-64" +msgstr "IA-64" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "16" +msgstr "16" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "Itanium" +msgstr "Itanium" + +#. type: tbl table +#: ../src/xz/xz.1:1764 +#, no-wrap +msgid "SPARC" +msgstr "SPARC" + +#. type: Plain text +#: ../src/xz/xz.1:1781 +msgid "" +"Since the BCJ-filtered data is usually compressed with LZMA2, the " +"compression ratio may be improved slightly if the LZMA2 options are set to " +"match the alignment of the selected BCJ filter. For example, with the IA-64 " +"filter, it's good to set B or even B with LZMA2 " +"(2^4=16). The x86 filter is an exception; it's usually good to stick to " +"LZMA2's default four-byte alignment when compressing x86 executables." +msgstr "" +"BCJ 필터를 사용한 데이터는 LZMA2로 보통 압축하기 때문에 LZMA2 옵션을 선택한 " +"BCJ 필터의 정렬기준에 맞추도록 설정하면 압축율을 좀 더 개선할 수 있습니다. " +"예를 들면, IA-64 필터에서는 B 또는 LZMA2에 대해 B " +"(2^4=16) 값이 바람직합ㄴ디ㅏ. x86 필터는 예외로, x86 실행 파일을 압축할 경" +"우 LZMA2의 기본 4바이트 정렬을 따르는게 좋습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1784 +msgid "All BCJ filters support the same I:" +msgstr "모든 BCJ 필터는 동일한 I<옵션>을 지원합니다:" + +#. type: TP +#: ../src/xz/xz.1:1785 +#, no-wrap +msgid "BI" +msgstr "BI오프셋E>" + +#. type: Plain text +#: ../src/xz/xz.1:1799 +msgid "" +"Specify the start I that is used when converting between relative " +"and absolute addresses. The I must be a multiple of the alignment " +"of the filter (see the table above). The default is zero. In practice, the " +"default is good; specifying a custom I is almost never useful." +msgstr "" +"상대 주소와 절대 주소를 변환할 때 사용할 시작 I오프셋E>을 지정합니" +"다. I오프셋E>에는 필터 정렬 배수여야 합니다(상단 테이블 참조). 기" +"본값은 0입니다. 실제로 기본값이 낫습니다. 개별 I오프셋E> 지정 값" +"은 거의 쓸모가 없습니다." + +#. type: TP +#: ../src/xz/xz.1:1800 +#, no-wrap +msgid "B<--delta>[B<=>I]" +msgstr "B<--delta>[B<=>I옵션E>]" + +#. type: Plain text +#: ../src/xz/xz.1:1805 +msgid "" +"Add the Delta filter to the filter chain. The Delta filter can be only used " +"as a non-last filter in the filter chain." +msgstr "" +"필터 체인에 델타 필터를 추가합니다. 델타 필터는 필터 체인에서 마지막에 지정" +"하지 않은 필터로만 사용할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1814 +msgid "" +"Currently only simple byte-wise delta calculation is supported. It can be " +"useful when compressing, for example, uncompressed bitmap images or " +"uncompressed PCM audio. However, special purpose algorithms may give " +"significantly better results than Delta + LZMA2. This is true especially " +"with audio, which compresses faster and better, for example, with B(1)." +msgstr "" +"현재로서는 바이트 단위 단순 델타계산 결과만 보여줍니다. 예를 들면, 압축하지 " +"않은 비트맵 그림 또는 압축하지 않은 PCM 오디오를 압축할 때 쓸만합니다. 그러" +"나 특별한 목적으로 활용하는 알고리즘은 델타 + LZMA2 보다 더 나은 결과를 가져" +"다 주기도 합니다. 이는 특히 오디오의 경우 맞는 이야기인데, B(1)의 경" +"우 더 빠르고 우수한 압축율을 보여줍니다." + +#. type: Plain text +#: ../src/xz/xz.1:1817 +msgid "Supported I:" +msgstr "지원 I<옵션>:" + +#. type: TP +#: ../src/xz/xz.1:1818 +#, no-wrap +msgid "BI" +msgstr "BI차이E>" + +#. type: Plain text +#: ../src/xz/xz.1:1826 +msgid "" +"Specify the I of the delta calculation in bytes. I must " +"be 1\\(en256. The default is 1." +msgstr "" +"바이트 단위 델터 계산 I차이E>를 지정합니다. I차이E>값은 " +"1\\(en256 이어야합니다. 기본 값은 1입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1831 +msgid "" +"For example, with B and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, " +"the output will be A1 B1 01 02 01 02 01 02." +msgstr "" +"예를 들어, B 옵션과 A1 B1 A2 B3 A3 B5 A4 B7 입력 값을 주면, 출력 값" +"은 A1 B1 01 02 01 02 01 02 입니다." + +#. type: SS +#: ../src/xz/xz.1:1833 +#, no-wrap +msgid "Other options" +msgstr "기타 옵션" + +#. type: TP +#: ../src/xz/xz.1:1834 ../src/xzdec/xzdec.1:83 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../src/xz/xz.1:1841 +msgid "" +"Suppress warnings and notices. Specify this twice to suppress errors too. " +"This option has no effect on the exit status. That is, even if a warning " +"was suppressed, the exit status to indicate a warning is still used." +msgstr "" +"경고 및 알림을 끕니다. 두 번 지정하면 오류 메시지 표시도 끕니다. 이 옵션은 " +"종료 상태에 영향을 주지 않습니다. 경고 표시를 끄더라도, 종료 상태에서는 여전" +"히 경고가 나타났음을 알려줍니다." + +#. type: TP +#: ../src/xz/xz.1:1841 +#, no-wrap +msgid "B<-v>, B<--verbose>" +msgstr "B<-v>, B<--verbose>" + +#. type: Plain text +#: ../src/xz/xz.1:1850 +msgid "" +"Be verbose. If standard error is connected to a terminal, B will " +"display a progress indicator. Specifying B<--verbose> twice will give even " +"more verbose output." +msgstr "" +"출력 내용이 많아집니다. 표준 오류를 터미널에 연결했다면 B는 진행 표시를 " +"나타냅니다. B<--verbose>를 두번 지정하면 더 많은 내용을 표시합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1852 +msgid "The progress indicator shows the following information:" +msgstr "진행 표시에서는 다음 정보를 나타냅니다:" + +#. type: Plain text +#: ../src/xz/xz.1:1857 +msgid "" +"Completion percentage is shown if the size of the input file is known. That " +"is, the percentage cannot be shown in pipes." +msgstr "" +"입력 파일의 크기를 알고 있을 경우 완료 백분율. 파이프 처리시에는 백분율을 나" +"타낼 수 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:1860 +msgid "" +"Amount of compressed data produced (compressing) or consumed " +"(decompressing)." +msgstr "산출 압축 데이터 용량 (압축) 또는 소모 공간 용량 (압축 해제)." + +#. type: Plain text +#: ../src/xz/xz.1:1863 +msgid "" +"Amount of uncompressed data consumed (compressing) or produced " +"(decompressing)." +msgstr "비압축 데이터 소모 용량 (압축) 또는 산출 용량 (압축 해제)." + +#. type: Plain text +#: ../src/xz/xz.1:1867 +msgid "" +"Compression ratio, which is calculated by dividing the amount of compressed " +"data processed so far by the amount of uncompressed data processed so far." +msgstr "" +"압축 데이터 산출 용량을 비압축 데이터 처리 용량으로 나누어 계산한 압축율." + +#. type: Plain text +#: ../src/xz/xz.1:1874 +msgid "" +"Compression or decompression speed. This is measured as the amount of " +"uncompressed data consumed (compression) or produced (decompression) per " +"second. It is shown after a few seconds have passed since B started " +"processing the file." +msgstr "" +"압축 또는 압축 해제 속도. 초당 비압축 데이터 소모량(압축) 또는 산출 용량(압" +"축 해제)를 측정한 값입니다. B에서 파일 처리를 시작한 몇 초 후 나타납니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:1876 +msgid "Elapsed time in the format M:SS or H:MM:SS." +msgstr "경과 시간 형식은 M:SS 또는 H:MM:SS 입니다." + +#. type: Plain text +#: ../src/xz/xz.1:1884 +msgid "" +"Estimated remaining time is shown only when the size of the input file is " +"known and a couple of seconds have already passed since B started " +"processing the file. The time is shown in a less precise format which never " +"has any colons, for example, 2 min 30 s." +msgstr "" +"추산 여분 시간은 B가 파일을 처리하기 시작한 이후 입력 파일의 크기를 알고 " +"몇 초가 지난 후에야 보여줍니다. 시간은 콜론 문자를 사용하지 않고 덜 자세한 " +"형식으로, 예를 들면, 2분 30초 와 같은 형식으로 보여줍니다." + +#. type: Plain text +#: ../src/xz/xz.1:1899 +msgid "" +"When standard error is not a terminal, B<--verbose> will make B print " +"the filename, compressed size, uncompressed size, compression ratio, and " +"possibly also the speed and elapsed time on a single line to standard error " +"after compressing or decompressing the file. The speed and elapsed time are " +"included only when the operation took at least a few seconds. If the " +"operation didn't finish, for example, due to user interruption, also the " +"completion percentage is printed if the size of the input file is known." +msgstr "" +"표준 오류가 터미널이 아니라면 B<--verbose>는 B에서 파일 이름, 압축 크기, " +"압축 해제 용량, 압축율, 그리고 가능하다면 파일을 압축 또는 압축 해제한 후 표" +"준 오류로 속도와 걸린 시간을 나타내도록 합니다. 속도와 걸린 시간 정보는 동작" +"을 처리하는데 최소한 몇초 정도 소요했을 경우에만 들어갑니다. 동작이 끝나지 " +"않았다면, 이를테면 사용자의 중단 요청이 있었을 경우 입력 파일의 크기를 알고 " +"있을 때 압축 백분율 정보도 들어갑니다." + +#. type: TP +#: ../src/xz/xz.1:1899 ../src/xzdec/xzdec.1:89 +#, no-wrap +msgid "B<-Q>, B<--no-warn>" +msgstr "B<-Q>, B<--no-warn>" + +#. type: Plain text +#: ../src/xz/xz.1:1909 +msgid "" +"Don't set the exit status to 2 even if a condition worth a warning was " +"detected. This option doesn't affect the verbosity level, thus both B<--" +"quiet> and B<--no-warn> have to be used to not display warnings and to not " +"alter the exit status." +msgstr "" +"경고로 알릴 만한 상황을 만났다 하더라도 종료 상태 2번을 설정하지 않습니다. " +"이 옵션은 출력 수준에 영향을 주지 않기 때문에, B<--quiet> 옵션과 B<--no-" +"warn> 옵션을 경고 표시를 막고 종료 상태를 바꾸지 않을 목적으로 사용합니다." + +#. type: TP +#: ../src/xz/xz.1:1909 +#, no-wrap +msgid "B<--robot>" +msgstr "B<--robot>" + +#. type: Plain text +#: ../src/xz/xz.1:1921 +msgid "" +"Print messages in a machine-parsable format. This is intended to ease " +"writing frontends that want to use B instead of liblzma, which may be " +"the case with various scripts. The output with this option enabled is meant " +"to be stable across B releases. See the section B for " +"details." +msgstr "" +"머신에서 해석할 형식으로 메시지를 나타냅니다. liblzma 대신 B를 활용하려" +"는 다양상 스크립트로서의 프론트엔드를 쉽게 작성하도록 하기 위함입니다. 이 옵" +"션을 지정한 출력은 B 릴리스가 어떻게 되든 안정 버전이란 의미입니다. 자세" +"한 내용은 B<로봇 모드> 섹션을 참고하십시오." + +#. type: TP +#: ../src/xz/xz.1:1921 +#, no-wrap +msgid "B<--info-memory>" +msgstr "B<--info-memory>" + +#. type: Plain text +#: ../src/xz/xz.1:1928 +msgid "" +"Display, in human-readable format, how much physical memory (RAM) and how " +"many processor threads B thinks the system has and the memory usage " +"limits for compression and decompression, and exit successfully." +msgstr "" +"압축 및 압축 해제시 물리 메모리 용량 (RAM), B에서 파악하는 프로세서 스레" +"드 갯수, 메모리 사용량 한계를 파악하기 쉬운 형식으로 나타내고 무사히 나갑니" +"다." + +#. type: TP +#: ../src/xz/xz.1:1928 ../src/xzdec/xzdec.1:96 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../src/xz/xz.1:1932 +msgid "" +"Display a help message describing the most commonly used options, and exit " +"successfully." +msgstr "" +"보통 사용하는 옵션을 설명하는 도움말 메시지를 출력한 후, 완전히 빠져나갑니다." + +#. type: TP +#: ../src/xz/xz.1:1932 +#, no-wrap +msgid "B<-H>, B<--long-help>" +msgstr "B<-H>, B<--long-help>" + +#. type: Plain text +#: ../src/xz/xz.1:1937 +msgid "" +"Display a help message describing all features of B, and exit " +"successfully" +msgstr "" +"B의 모든 기능을 설명하는 도움말 메시지를 출력한 후, 완전히 빠져나갑니다" + +#. type: TP +#: ../src/xz/xz.1:1937 ../src/xzdec/xzdec.1:99 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../src/xz/xz.1:1946 +msgid "" +"Display the version number of B and liblzma in human readable format. " +"To get machine-parsable output, specify B<--robot> before B<--version>." +msgstr "" +"B와 liblzma 버전 번호를 가독 형식으로 출력합니다. 기계 해석 가능 형식을 " +"가져오려면 B<--version> 앞에 B<--robot>을 지정하십시오." + +#. type: SH +#: ../src/xz/xz.1:1947 +#, no-wrap +msgid "ROBOT MODE" +msgstr "로봇 모드" + +#. type: Plain text +#: ../src/xz/xz.1:1963 +msgid "" +"The robot mode is activated with the B<--robot> option. It makes the output " +"of B easier to parse by other programs. Currently B<--robot> is " +"supported only together with B<--version>, B<--info-memory>, and B<--list>. " +"It will be supported for compression and decompression in the future." +msgstr "" +"로봇 모드는 B<--robot> 옵션으로 동작합니다. B 출력을 다른 프로그램에서 " +"해석하기 쉽게 해줍니다. 현재로서는 B<--robot> 옵션은 B<--version>, B<--" +"info-memory>, B<--list> 옵션하고만 사용할 수 있습니다. 앞으로는 압축 및 압" +"축 해제 동작에 대해서도 지원합니다." + +#. type: SS +#: ../src/xz/xz.1:1964 +#, no-wrap +msgid "Version" +msgstr "버전" + +#. type: Plain text +#: ../src/xz/xz.1:1969 +msgid "" +"B will print the version number of B and liblzma " +"in the following format:" +msgstr "" +"B 은 B 버전 번호와 liblzma 버전 번호를 다음 형식으" +"로 나타냅니다:" + +#. type: Plain text +#: ../src/xz/xz.1:1971 +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1973 +msgid "BI" +msgstr "BI" + +#. type: TP +#: ../src/xz/xz.1:1973 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1976 +msgid "Major version." +msgstr "주 버전." + +#. type: TP +#: ../src/xz/xz.1:1976 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1981 +msgid "" +"Minor version. Even numbers are stable. Odd numbers are alpha or beta " +"versions." +msgstr "부 버전. 짝수가 안정 버전입니다. 홀수는 알파 또는 베타 버전입니다." + +#. type: TP +#: ../src/xz/xz.1:1981 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1985 +msgid "" +"Patch level for stable releases or just a counter for development releases." +msgstr "안정 릴리스의 패치 수준 또는 개발 릴리스의 횟수입니다." + +#. type: TP +#: ../src/xz/xz.1:1985 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1993 +msgid "" +"Stability. 0 is alpha, 1 is beta, and 2 is stable. I should be always 2 " +"when I is even." +msgstr "" +"안정도. 0은 알파 버전, 1은 베타 버전을 나타내며, 2는 안정 버전을 나타냅니" +"다. I는 I 값이 짝수라 해도 항상 2여야 합니다." + +#. type: Plain text +#: ../src/xz/xz.1:1998 +msgid "" +"I are the same on both lines if B and liblzma are from the " +"same XZ Utils release." +msgstr "" +"B 명령과 liblzma이 동일한 XZ 유틸리티 릴리스에서 나왔다면 두 행의 " +"I 값은 같습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2004 +msgid "Examples: 4.999.9beta is B<49990091> and 5.0.0 is B<50000002>." +msgstr "예제: 4.999.9beta는 B<49990091>이며, 5.0.0은 B<50000002>입니다." + +#. type: SS +#: ../src/xz/xz.1:2005 +#, no-wrap +msgid "Memory limit information" +msgstr "메모리 제한 정보" + +#. type: Plain text +#: ../src/xz/xz.1:2008 +msgid "" +"B prints a single line with three tab-separated " +"columns:" +msgstr "" +"B 명령은 탭으로 나뉜 컬럼 셋의 단일 행을 나타냅니" +"다:" + +#. type: IP +#: ../src/xz/xz.1:2008 +#, no-wrap +msgid "1." +msgstr "1." + +#. type: Plain text +#: ../src/xz/xz.1:2010 +msgid "Total amount of physical memory (RAM) in bytes." +msgstr "물리 메모리(RAM)의 바이트 단위 총량." + +#. type: IP +#: ../src/xz/xz.1:2010 ../src/xz/xz.1:2125 ../src/xz/xz.1:2162 +#: ../src/xz/xz.1:2188 ../src/xz/xz.1:2258 ../src/xz/xz.1:2285 +#, no-wrap +msgid "2." +msgstr "2." + +#. type: Plain text +#: ../src/xz/xz.1:2017 +msgid "" +"Memory usage limit for compression in bytes (B<--memlimit-compress>). A " +"special value of B<0> indicates the default setting which for single-" +"threaded mode is the same as no limit." +msgstr "" +"압축 진행시 바이트 단위 메모리 사용 한계값 (B<--memlimit-compress>). 특수 " +"값 B<0>은 단일-스레드 모드에서 제한을 두지 않는 기본 설정임을 나타냅니다." + +#. type: IP +#: ../src/xz/xz.1:2017 ../src/xz/xz.1:2127 ../src/xz/xz.1:2164 +#: ../src/xz/xz.1:2190 ../src/xz/xz.1:2263 ../src/xz/xz.1:2287 +#, no-wrap +msgid "3." +msgstr "3." + +#. type: Plain text +#: ../src/xz/xz.1:2024 +msgid "" +"Memory usage limit for decompression in bytes (B<--memlimit-decompress>). A " +"special value of B<0> indicates the default setting which for single-" +"threaded mode is the same as no limit." +msgstr "" +"압축 해제시 바이트 단위 메모리 사용 한계값 (B<--memlimit-decompress>). 특수 " +"값 B<0>은 단일-스레드 모드에서 제한을 두지 않는 기본 설정임을 나타냅니다." + +#. type: IP +#: ../src/xz/xz.1:2024 ../src/xz/xz.1:2129 ../src/xz/xz.1:2166 +#: ../src/xz/xz.1:2193 ../src/xz/xz.1:2273 ../src/xz/xz.1:2289 +#, no-wrap +msgid "4." +msgstr "4." + +#. type: Plain text +#: ../src/xz/xz.1:2036 +msgid "" +"Since B 5.3.4alpha: Memory usage for multi-threaded decompression in " +"bytes (B<--memlimit-mt-decompress>). This is never zero because a system-" +"specific default value shown in the column 5 is used if no limit has been " +"specified explicitly. This is also never greater than the value in the " +"column 3 even if a larger value has been specified with B<--memlimit-mt-" +"decompress>." +msgstr "" +"B 5.3.4alpha 이후: 다중-스레드 기반 압축 해제시 바이트 단위 메모리 사용량" +"(B<--memlimit-mt-decompress>). 분명하게 제한을 걸어두지 않았을 경우 5번째 컬" +"럼에 나타난 시스템별 기본값을 사용하기 때문에 0 값을 지정하면 안됩니다. 또" +"한 B<--memlimit-mt-decompress>로 세번째 컬럼 값보다 더 크게 지정을 한다 할지" +"라도 이 값이 세번째 컬럼 값보다 크면 안됩니다." + +#. type: IP +#: ../src/xz/xz.1:2036 ../src/xz/xz.1:2131 ../src/xz/xz.1:2168 +#: ../src/xz/xz.1:2195 ../src/xz/xz.1:2291 +#, no-wrap +msgid "5." +msgstr "5." + +#. type: Plain text +#: ../src/xz/xz.1:2048 +msgid "" +"Since B 5.3.4alpha: A system-specific default memory usage limit that is " +"used to limit the number of threads when compressing with an automatic " +"number of threads (B<--threads=0>) and no memory usage limit has been " +"specified (B<--memlimit-compress>). This is also used as the default value " +"for B<--memlimit-mt-decompress>." +msgstr "" +"B 5.3.4alpha 이후: A system-specific default memory usage limit that is " +"used to limit the number of threads when compressing with an automatic " +"number of threads (B<--threads=0>) and no memory usage limit has been " +"specified (B<--memlimit-compress>). This is also used as the default value " +"for B<--memlimit-mt-decompress>." + +#. type: IP +#: ../src/xz/xz.1:2048 ../src/xz/xz.1:2133 ../src/xz/xz.1:2170 +#: ../src/xz/xz.1:2197 ../src/xz/xz.1:2293 +#, no-wrap +msgid "6." +msgstr "6." + +#. type: Plain text +#: ../src/xz/xz.1:2053 +msgid "Since B 5.3.4alpha: Number of available processor threads." +msgstr "B 5.3.4alpha 이후: Number of available processor threads." + +#. type: Plain text +#: ../src/xz/xz.1:2057 +msgid "" +"In the future, the output of B may have more " +"columns, but never more than a single line." +msgstr "" +"차후, B 출력에는 더 많은 내용이 들어가지만, 한 줄 " +"이상은 넘어가지 않습니다." + +#. type: SS +#: ../src/xz/xz.1:2058 +#, no-wrap +msgid "List mode" +msgstr "목록 모드" + +#. type: Plain text +#: ../src/xz/xz.1:2063 +msgid "" +"B uses tab-separated output. The first column of every " +"line has a string that indicates the type of the information found on that " +"line:" +msgstr "" +"B 명령은 탭으로 구분한 출력 형태를 활용합니다. 모든 행의 " +"첫번째 컬럼에는 해당 행에서 찾을 수 있는 정보의 형식을 나타냅니다:" + +#. type: TP +#: ../src/xz/xz.1:2063 +#, no-wrap +msgid "B" +msgstr "B<이름>" + +#. type: Plain text +#: ../src/xz/xz.1:2067 +msgid "" +"This is always the first line when starting to list a file. The second " +"column on the line is the filename." +msgstr "" +"이 행은 항상 파일 목록 시작 부분의 첫번째 줄에 있습니다. 이 행의 두번째 컬럼" +"에 파일 이름이 들어있습니다." + +#. type: TP +#: ../src/xz/xz.1:2067 +#, no-wrap +msgid "B" +msgstr "B<파일>" + +#. type: Plain text +#: ../src/xz/xz.1:2075 +msgid "" +"This line contains overall information about the B<.xz> file. This line is " +"always printed after the B line." +msgstr "" +"이 행에는 B<.xz> 파일의 전반적인 정보가 들어있습니다. 이 행은 항상 B<이름> " +"행 다음에 있습니다." + +#. type: TP +#: ../src/xz/xz.1:2075 +#, no-wrap +msgid "B" +msgstr "B<스트림>" + +#. type: Plain text +#: ../src/xz/xz.1:2085 +msgid "" +"This line type is used only when B<--verbose> was specified. There are as " +"many B lines as there are streams in the B<.xz> file." +msgstr "" +"이 행 형식은 B<--verbose> 옵션을 지정했을 때만 사용합니다. B<.xz> 파일의 B<" +"스트림> 행 수만큼 나타납니다." + +#. type: TP +#: ../src/xz/xz.1:2085 +#, no-wrap +msgid "B" +msgstr "B<블록>" + +#. type: Plain text +#: ../src/xz/xz.1:2100 +msgid "" +"This line type is used only when B<--verbose> was specified. There are as " +"many B lines as there are blocks in the B<.xz> file. The B " +"lines are shown after all the B lines; different line types are not " +"interleaved." +msgstr "" +"이 행 형식은 B<--verbose> 옵션을 지정했을 때만 사용합니다. B<.xz> 파일의 블" +"록 수만큼 B<블록> 행이 나타납니다. B<블록> 행은 모든 B<스트림> 행 다음에 나" +"타납니다. 다른 형식의 행이 끼어들지는 않습니다." + +#. type: TP +#: ../src/xz/xz.1:2100 +#, no-wrap +msgid "B

" +msgstr "B<요약>" + +#. type: Plain text +#: ../src/xz/xz.1:2115 +msgid "" +"This line type is used only when B<--verbose> was specified twice. This " +"line is printed after all B lines. Like the B line, the " +"B line contains overall information about the B<.xz> file." +msgstr "" +"이 행 형식은 B<--verbose> 옵션을 두번 지정했을 때만 사용합니다. 이 행은 모" +"든 B<블록> 행 다음에 출력합니다. B<파일> 행과 비슷하게, B<요약> 행에는 B<." +"xz> 파일의 전반적인 정보가 담겨있습니다." + +#. type: TP +#: ../src/xz/xz.1:2115 +#, no-wrap +msgid "B" +msgstr "B<총계>" + +#. type: Plain text +#: ../src/xz/xz.1:2119 +msgid "" +"This line is always the very last line of the list output. It shows the " +"total counts and sizes." +msgstr "" +"이 행은 목록 출력의 가장 마지막에 항상 나타납니다. 총 갯수와 크기를 나타냅니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:2123 +msgid "The columns of the B lines:" +msgstr "B<파일> 행 컬럼:" + +#. type: Plain text +#: ../src/xz/xz.1:2127 +msgid "Number of streams in the file" +msgstr "파일 스트림 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2129 +msgid "Total number of blocks in the stream(s)" +msgstr "스트림의 블록 총 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2131 +msgid "Compressed size of the file" +msgstr "파일 압축 크기" + +#. type: Plain text +#: ../src/xz/xz.1:2133 +msgid "Uncompressed size of the file" +msgstr "파일 압축 해제 크기" + +#. type: Plain text +#: ../src/xz/xz.1:2139 +msgid "" +"Compression ratio, for example, B<0.123>. If ratio is over 9.999, three " +"dashes (B<--->) are displayed instead of the ratio." +msgstr "" +"예를 들면, B<0.123>과 같은 압축율 입니다. 비율이 9.999라면, 대시 문자 3개 " +"(B<--->)를 비율 값 대신 나타냅니다." + +#. type: IP +#: ../src/xz/xz.1:2139 ../src/xz/xz.1:2172 ../src/xz/xz.1:2199 +#: ../src/xz/xz.1:2295 +#, no-wrap +msgid "7." +msgstr "7." + +#. type: Plain text +#: ../src/xz/xz.1:2152 +msgid "" +"Comma-separated list of integrity check names. The following strings are " +"used for the known check types: B, B, B, and " +"B. For unknown check types, BI is used, where I is " +"the Check ID as a decimal number (one or two digits)." +msgstr "" +"쉼표로 구분한 무결성 검사 이름 목록입니다. B, B, B, " +"B 문자열을 알려진 검사 형식으로 사용합니다. 알 수 없는 검사 형식에 " +"대해서는 BI을 사용하며, 여기서 I은 (한 두자리) 정수형 숫자값" +"으로 이루어진 검사 ID 입니다." + +#. type: IP +#: ../src/xz/xz.1:2152 ../src/xz/xz.1:2174 ../src/xz/xz.1:2201 +#: ../src/xz/xz.1:2298 +#, no-wrap +msgid "8." +msgstr "8." + +#. type: Plain text +#: ../src/xz/xz.1:2154 +msgid "Total size of stream padding in the file" +msgstr "파일의 스트림 패딩 총 길이" + +#. type: Plain text +#: ../src/xz/xz.1:2160 +msgid "The columns of the B lines:" +msgstr "B<스트림> 행 컬럼:" + +#. type: Plain text +#: ../src/xz/xz.1:2164 +msgid "Stream number (the first stream is 1)" +msgstr "스트림 번호 (첫 스트림은 1번)" + +#. type: Plain text +#: ../src/xz/xz.1:2166 +msgid "Number of blocks in the stream" +msgstr "스트림의 블록 총 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2168 +msgid "Compressed start offset" +msgstr "압축 시작 오프셋" + +#. type: Plain text +#: ../src/xz/xz.1:2170 +msgid "Uncompressed start offset" +msgstr "비압축 시작 오프셋" + +#. type: Plain text +#: ../src/xz/xz.1:2172 +msgid "Compressed size (does not include stream padding)" +msgstr "압축 크기 (스트림 패딩 미포함)" + +#. type: Plain text +#: ../src/xz/xz.1:2174 ../src/xz/xz.1:2203 ../src/xz/xz.1:2293 +msgid "Uncompressed size" +msgstr "압축 해제 용량" + +#. type: Plain text +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2205 +msgid "Compression ratio" +msgstr "압축율" + +#. type: IP +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2203 ../src/xz/xz.1:2300 +#, no-wrap +msgid "9." +msgstr "9." + +#. type: Plain text +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2207 +msgid "Name of the integrity check" +msgstr "무결성 검사 이름" + +#. type: IP +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2205 ../src/xz/xz.1:2316 +#, no-wrap +msgid "10." +msgstr "10." + +#. type: Plain text +#: ../src/xz/xz.1:2180 +msgid "Size of stream padding" +msgstr "스트림 패딩 길이" + +#. type: Plain text +#: ../src/xz/xz.1:2186 +msgid "The columns of the B lines:" +msgstr "B<블록> 행 컬럼:" + +#. type: Plain text +#: ../src/xz/xz.1:2190 +msgid "Number of the stream containing this block" +msgstr "이 블록이 들어간 스트림 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2193 +msgid "" +"Block number relative to the beginning of the stream (the first block is 1)" +msgstr "스트림 시작 부분의 블록 번호 (첫번째 블록은 1번)" + +#. type: Plain text +#: ../src/xz/xz.1:2195 +msgid "Block number relative to the beginning of the file" +msgstr "파일 시작 부분의 블록 번호" + +#. type: Plain text +#: ../src/xz/xz.1:2197 +msgid "Compressed start offset relative to the beginning of the file" +msgstr "파일 시작 부분의 압축 시작 오프셋" + +#. type: Plain text +#: ../src/xz/xz.1:2199 +msgid "Uncompressed start offset relative to the beginning of the file" +msgstr "파일 시작 부분의 비압축 시작 오프셋" + +#. type: Plain text +#: ../src/xz/xz.1:2201 +msgid "Total compressed size of the block (includes headers)" +msgstr "총 블록 압축 크기 (헤더 포함)" + +#. type: Plain text +#: ../src/xz/xz.1:2219 +msgid "" +"If B<--verbose> was specified twice, additional columns are included on the " +"B lines. These are not displayed with a single B<--verbose>, because " +"getting this information requires many seeks and can thus be slow:" +msgstr "" +"B<--verbose>를 두 번 지정하면, 추가 컬럼을 B<블록> 행에 넣습니다. B<--" +"verbose> 단일 지정시에는 이 정보를 볼 때 탐색을 여러번 수행해야 하기 때문에 " +"실행 과정이 느려질 수 있어서 나타내지 않습니다." + +#. type: IP +#: ../src/xz/xz.1:2221 ../src/xz/xz.1:2321 +#, no-wrap +msgid "11." +msgstr "11." + +#. type: Plain text +#: ../src/xz/xz.1:2223 +msgid "Value of the integrity check in hexadecimal" +msgstr "16진수 무결성 검사값" + +#. type: IP +#: ../src/xz/xz.1:2223 ../src/xz/xz.1:2331 +#, no-wrap +msgid "12." +msgstr "12." + +#. type: Plain text +#: ../src/xz/xz.1:2225 +msgid "Block header size" +msgstr "블록 헤더 크기" + +#. type: IP +#: ../src/xz/xz.1:2225 +#, no-wrap +msgid "13." +msgstr "13." + +#. type: Plain text +#: ../src/xz/xz.1:2235 +msgid "" +"Block flags: B indicates that compressed size is present, and B " +"indicates that uncompressed size is present. If the flag is not set, a dash " +"(B<->) is shown instead to keep the string length fixed. New flags may be " +"added to the end of the string in the future." +msgstr "" +"블록 플래그: B는 압축 크기가 현재 값임을 나타내고, B는 압축 전 원본 크" +"기가 현재 값임을 나타냅니다. 플래그를 설정하지 않았다면, 문자열 길이를 유지" +"할 목적으로 대시 B<-> 를 대신 나타냅니다. 새 플래그는 나중에 문자열 끝 부분" +"에 추가할 예정입니다." + +#. type: IP +#: ../src/xz/xz.1:2235 +#, no-wrap +msgid "14." +msgstr "14." + +#. type: Plain text +#: ../src/xz/xz.1:2238 +msgid "" +"Size of the actual compressed data in the block (this excludes the block " +"header, block padding, and check fields)" +msgstr "" +"블록에 압축 해서 넣은 데이터의 실제 츠기 (블록 헤더, 블록 패딩, 검사 필드 제" +"외)" + +#. type: IP +#: ../src/xz/xz.1:2238 +#, no-wrap +msgid "15." +msgstr "15." + +#. type: Plain text +#: ../src/xz/xz.1:2243 +msgid "" +"Amount of memory (in bytes) required to decompress this block with this " +"B version" +msgstr "" +"이 B 버전에서 이 블록의 압축을 해제할 때 필요한 (바이트 단위) 메모리 용량" + +#. type: IP +#: ../src/xz/xz.1:2243 +#, no-wrap +msgid "16." +msgstr "16." + +#. type: Plain text +#: ../src/xz/xz.1:2250 +msgid "" +"Filter chain. Note that most of the options used at compression time cannot " +"be known, because only the options that are needed for decompression are " +"stored in the B<.xz> headers." +msgstr "" +"필터 체인. 대부분 사용하는 옵션은 압축 해제시 필요한 옵션만을 B<.xz> 헤더에 " +"저장하기 때문에 압축 시간에 알 수 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2256 +msgid "The columns of the B lines:" +msgstr "B<요약> 행 컬럼:" + +#. type: Plain text +#: ../src/xz/xz.1:2263 +msgid "" +"Amount of memory (in bytes) required to decompress this file with this B " +"version" +msgstr "" +"이 B 버전에서 이 파일 압축을 해제할 때 필요한 (바이트 단위) 메모리 용량" + +#. type: Plain text +#: ../src/xz/xz.1:2269 ../src/xz/xz.1:2327 +msgid "" +"B or B indicating if all block headers have both compressed size " +"and uncompressed size stored in them" +msgstr "" +"모든 블록 헤더에 압축 크기와 압축 전 원본 크기 정보가 들어갔는지 여부를 나타" +"내는 B 또는 B 값" + +#. type: Plain text +#: ../src/xz/xz.1:2273 ../src/xz/xz.1:2331 +msgid "I B I<5.1.2alpha:>" +msgstr "B I<5.1.2alpha> I<부터>:" + +#. type: Plain text +#: ../src/xz/xz.1:2277 ../src/xz/xz.1:2335 +msgid "Minimum B version required to decompress the file" +msgstr "파일 압축 해제시 필요한 최소 B 버전" + +#. type: Plain text +#: ../src/xz/xz.1:2283 +msgid "The columns of the B line:" +msgstr "B<총계> 행 컬럼:" + +#. type: Plain text +#: ../src/xz/xz.1:2287 +msgid "Number of streams" +msgstr "스트림 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2289 +msgid "Number of blocks" +msgstr "블록 갯수" + +#. type: Plain text +#: ../src/xz/xz.1:2291 +msgid "Compressed size" +msgstr "압축 크기" + +#. type: Plain text +#: ../src/xz/xz.1:2295 +msgid "Average compression ratio" +msgstr "평균 압축율" + +#. type: Plain text +#: ../src/xz/xz.1:2298 +msgid "" +"Comma-separated list of integrity check names that were present in the files" +msgstr "파일에 들어 있어 쉼표로 구분한 무결성 검사 이름 목록" + +#. type: Plain text +#: ../src/xz/xz.1:2300 +msgid "Stream padding size" +msgstr "스트림 패딩 길이" + +#. type: Plain text +#: ../src/xz/xz.1:2306 +msgid "" +"Number of files. This is here to keep the order of the earlier columns the " +"same as on B lines." +msgstr "파일 갯수. B<파일> 행의 컬럼 순서를 따라갑니다." + +#. type: Plain text +#: ../src/xz/xz.1:2314 +msgid "" +"If B<--verbose> was specified twice, additional columns are included on the " +"B line:" +msgstr "" +"B<--verbose> 옵션을 두 번 지정하면, B<총계> 행에 추가 컬럼이 들어갑니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2321 +msgid "" +"Maximum amount of memory (in bytes) required to decompress the files with " +"this B version" +msgstr "" +"이 B 버전에서 파일 압축을 해제할 떄 필요한 (바이트 단위) 최대 메모리 사용" +"량" + +#. type: Plain text +#: ../src/xz/xz.1:2341 +msgid "" +"Future versions may add new line types and new columns can be added to the " +"existing line types, but the existing columns won't be changed." +msgstr "" +"차후 버전에서는 새 행 형식을 추가하고 기존 행 형식에 추가할 수 있는 새 컬럼" +"을 넣기 까지는 알 수 있겠지만, 기존 컬럼은 바꾸지 않을 예정입니다." + +#. type: SH +#: ../src/xz/xz.1:2342 ../src/xzdec/xzdec.1:104 ../src/lzmainfo/lzmainfo.1:44 +#: ../src/scripts/xzgrep.1:81 +#, no-wrap +msgid "EXIT STATUS" +msgstr "종료 상태" + +#. type: TP +#: ../src/xz/xz.1:2343 ../src/xzdec/xzdec.1:105 ../src/lzmainfo/lzmainfo.1:45 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../src/xz/xz.1:2346 ../src/lzmainfo/lzmainfo.1:48 +msgid "All is good." +msgstr "모든 상태 양호." + +#. type: TP +#: ../src/xz/xz.1:2346 ../src/xzdec/xzdec.1:108 ../src/lzmainfo/lzmainfo.1:48 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../src/xz/xz.1:2349 ../src/xzdec/xzdec.1:111 ../src/lzmainfo/lzmainfo.1:51 +msgid "An error occurred." +msgstr "오류 발생." + +#. type: TP +#: ../src/xz/xz.1:2349 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:2353 +msgid "Something worth a warning occurred, but no actual errors occurred." +msgstr "눈여겨볼 경고가 나타났지만, 실제 오류는 일어나지 않음." + +#. type: Plain text +#: ../src/xz/xz.1:2356 +msgid "" +"Notices (not warnings or errors) printed on standard error don't affect the " +"exit status." +msgstr "" +"표준 오류에 출력하는 알림(경고 또는 오류 아님)는 종료 상태에 영향을 주지 않습" +"니다." + +#. type: SH +#: ../src/xz/xz.1:2357 ../src/scripts/xzgrep.1:94 ../src/scripts/xzless.1:52 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "환경" + +#. type: Plain text +#: ../src/xz/xz.1:2370 +msgid "" +"B parses space-separated lists of options from the environment variables " +"B and B, in this order, before parsing the options from " +"the command line. Note that only options are parsed from the environment " +"variables; all non-options are silently ignored. Parsing is done with " +"B(3) which is used also for the command line arguments." +msgstr "" +"B는 빈칸으로 구분한 옵션 값 목록을 B, B 환경 변수에" +"서 순서대로, 명령행에서 옵션을 해석하기 전에 불러옵니다. 참고로 환경 변수에" +"서 옵션만 해석하며, 옵션이 아닌 부분은 조용히 무시합니다. 해석은 " +"B(3)으로 가능하며, 명령행 인자로 활용하기도 합니다." + +#. type: TP +#: ../src/xz/xz.1:2370 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2379 +msgid "" +"User-specific or system-wide default options. Typically this is set in a " +"shell initialization script to enable B's memory usage limiter by " +"default. Excluding shell initialization scripts and similar special cases, " +"scripts must never set or unset B." +msgstr "" +"사용자별, 시스템 범위 기본 옵션입니다. 보통 B의 메모리 사용량 제한을 기" +"본으로 걸어둘 경우 셸 초기화 스크립트에 설정합니다. 셸 초기화 스크립트와 별" +"도의 유사한 경우를 제외하고라면, 스크립트에서는 B 환경 변수를 설" +"정하지 말거나 설정을 해제해야합니다." + +#. type: TP +#: ../src/xz/xz.1:2379 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2390 +msgid "" +"This is for passing options to B when it is not possible to set the " +"options directly on the B command line. This is the case when B is " +"run by a script or tool, for example, GNU B(1):" +msgstr "" +"B 명령행으로 옵션 설정 값을 직접 전달할 수 없을 경우 B에 옵션을 전달" +"하는 환경 변수입니다. 예를 들어, B를 스크립트 또는 도구에서 실행할 경우 " +"GNU B(1) 라면:" + +#. type: Plain text +#: ../src/xz/xz.1:2396 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2410 +msgid "" +"Scripts may use B, for example, to set script-specific default " +"compression options. It is still recommended to allow users to override " +"B if that is reasonable. For example, in B(1) scripts one may " +"use something like this:" +msgstr "" +"예를 들면, 스크립트에서 B 를 활용하여, 스크립트별로 기본 압축 옵션을 " +"지정할 수 있습니다. 적절한 이유가 있다면 B 옵션 값을 사용자가 바꾸는" +"걸 추천합니다. 예를 들면, B(1) 스크립트에서 다음처럼 활용할 수도 있습니" +"다:" + +#. type: Plain text +#: ../src/xz/xz.1:2417 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: SH +#: ../src/xz/xz.1:2422 +#, no-wrap +msgid "LZMA UTILS COMPATIBILITY" +msgstr "LZMA 유틸리티 호환성" + +#. type: Plain text +#: ../src/xz/xz.1:2435 +msgid "" +"The command line syntax of B is practically a superset of B, " +"B, and B as found from LZMA Utils 4.32.x. In most cases, it " +"is possible to replace LZMA Utils with XZ Utils without breaking existing " +"scripts. There are some incompatibilities though, which may sometimes cause " +"problems." +msgstr "" +"B의 명령행 문법은 실제로 LZMA 유틸리티 4.32.x에서 찾을 수 있는 B, " +"B B의 상위 집합입니다. 대부분의 경우 LZMA 유틸리티를 XZ 유틸" +"리티로 기존에 작성한 스크립트를 깨지 않고도 바꿀 수 있습니다. 몇가지 비호환" +"성 문제 때문에 문제가 일어날 수는 있습니다." + +#. type: SS +#: ../src/xz/xz.1:2436 +#, no-wrap +msgid "Compression preset levels" +msgstr "압축 사전 설정 단계" + +#. type: Plain text +#: ../src/xz/xz.1:2443 +msgid "" +"The numbering of the compression level presets is not identical in B and " +"LZMA Utils. The most important difference is how dictionary sizes are " +"mapped to different presets. Dictionary size is roughly equal to the " +"decompressor memory usage." +msgstr "" +"압축 수준 사전 설정의 번호 부여 방식은 B와 LZMA 유틸리티가 동일하지 않습" +"니다. 가장 중요한 차이는 다른 사전 설정에 대해 딕셔너리 크기를 어떻게 대응했" +"느냐 여부입니다. 딕셔너리 크기는 압축 해제시 메모리 사용량과 거의 비슷합니" +"다." + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "Level" +msgstr "단계" + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "xz" +msgstr "xz" + +#. type: tbl table +#: ../src/xz/xz.1:2449 +#, no-wrap +msgid "LZMA Utils" +msgstr "LZMA 유틸리티" + +#. type: tbl table +#: ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#, no-wrap +msgid "N/A" +msgstr "없음" + +#. type: tbl table +#: ../src/xz/xz.1:2451 +#, no-wrap +msgid "64 KiB" +msgstr "64 KiB" + +#. type: tbl table +#: ../src/xz/xz.1:2453 +#, no-wrap +msgid "512 KiB" +msgstr "512 KiB" + +#. type: Plain text +#: ../src/xz/xz.1:2468 +msgid "" +"The dictionary size differences affect the compressor memory usage too, but " +"there are some other differences between LZMA Utils and XZ Utils, which make " +"the difference even bigger:" +msgstr "" +"딕셔너리 크기 차이는 압축 프로그램 메모리 사용에 영향을 주지만, LZMA 유틸리티" +"와 XZ 유틸리티에서 사용량이 늘어나는 다른 차이점이 있습니다:" + +#. type: tbl table +#: ../src/xz/xz.1:2474 +#, no-wrap +msgid "LZMA Utils 4.32.x" +msgstr "LZMA 유틸리티 4.32.x" + +#. type: tbl table +#: ../src/xz/xz.1:2477 ../src/xz/xz.1:2478 +#, no-wrap +msgid "12 MiB" +msgstr "12 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2480 +#, no-wrap +msgid "26 MiB" +msgstr "26 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2481 +#, no-wrap +msgid "45 MiB" +msgstr "45 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2482 +#, no-wrap +msgid "83 MiB" +msgstr "83 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2483 +#, no-wrap +msgid "159 MiB" +msgstr "159 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2484 +#, no-wrap +msgid "311 MiB" +msgstr "311 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:2493 +msgid "" +"The default preset level in LZMA Utils is B<-7> while in XZ Utils it is " +"B<-6>, so both use an 8 MiB dictionary by default." +msgstr "" +"XZ 유틸리티의 기본 사전 설정 수준값은 B<-6>이지만 LZMA 유틸리티의 기본 사전 " +"설정 수준값은 B<-7>입니다. 두 프로그램의 딕셔너리 메모리 기본 사용량은 8MiB입" +"니다." + +#. type: SS +#: ../src/xz/xz.1:2494 +#, no-wrap +msgid "Streamed vs. non-streamed .lzma files" +msgstr "스트림 vs 비스트림 .lzma 파일" + +#. type: Plain text +#: ../src/xz/xz.1:2504 +msgid "" +"The uncompressed size of the file can be stored in the B<.lzma> header. " +"LZMA Utils does that when compressing regular files. The alternative is to " +"mark that uncompressed size is unknown and use end-of-payload marker to " +"indicate where the decompressor should stop. LZMA Utils uses this method " +"when uncompressed size isn't known, which is the case, for example, in pipes." +msgstr "" +"파일을 압축하지 않은 크기는 B<.lzma> 헤더에 저장합니다. LZMA 유틸리티는 일" +"반 파일을 압축할 때 압축하지 않은 파일의 크기를 저장합니다. 이 대신 압축하" +"지 않은 크기를 '알 수 없음' 으로 저장하고 압축 해제 프로그램이 멈춰야 할 지점" +"에 end-of-payload 마커를 사용하는 방법도 있습니다. LZMA 유틸리티는 파이프로 " +"들어온 입력과 같이 압축하지 않은 파일의 크기를 알 수 없을 때 이런 방식을 활용" +"합니다." + +#. type: Plain text +#: ../src/xz/xz.1:2525 +msgid "" +"B supports decompressing B<.lzma> files with or without end-of-payload " +"marker, but all B<.lzma> files created by B will use end-of-payload " +"marker and have uncompressed size marked as unknown in the B<.lzma> header. " +"This may be a problem in some uncommon situations. For example, a B<.lzma> " +"decompressor in an embedded device might work only with files that have " +"known uncompressed size. If you hit this problem, you need to use LZMA " +"Utils or LZMA SDK to create B<.lzma> files with known uncompressed size." +msgstr "" +"B는 B<.lzma> 파일을 end-of-payload 마커의 유무와 관계없이 압축 해제 방식" +"을 모두 지원하지만, B로 만든 모든 B<.lzma> 파일은 end-of-payload 마커를 " +"사용하며, B<.lzma> 헤더에 압축하지 않은 파일 크기를 '알 수 없음'으로 표기합니" +"다. 이 방식은 드문 상황에서 문제를 야기할 수 있습니다. 예를 들면, 임베디드 " +"장치의 B<.lzma> 압축 해제 프로그램은 압축을 해제했을 때 크기를 알아야 동작합" +"니다. 이 문제를 만나면, LZMA 유틸리티 또는 LZMA SDK를 활용하여 B<.lzma> 파일" +"에 압축 전 파일 크기 정보를 저장해야합니다." + +#. type: SS +#: ../src/xz/xz.1:2526 +#, no-wrap +msgid "Unsupported .lzma files" +msgstr "지원하지 않는 .lzma 파일" + +#. type: Plain text +#: ../src/xz/xz.1:2549 +msgid "" +"The B<.lzma> format allows I values up to 8, and I values up to 4. " +"LZMA Utils can decompress files with any I and I, but always creates " +"files with B and B. Creating files with other I and I " +"is possible with B and with LZMA SDK." +msgstr "" +"B<.lzma> 형식은 I 값을 8까지 받아들이며, I 값은 4까지 받아들입니다. " +"LZMA 유틸리티는 어떤 I 값과 I 값을 받아들이고도 압축을 해제할 수 있지" +"만, 파일을 만들 때는 늘 B 값과 B 값을 활용합니다. 다른 I 값" +"과 I 값으로의 파일 압축은 B와 LZMA SDK에서만 가능합니다." + +#. type: Plain text +#: ../src/xz/xz.1:2560 +msgid "" +"The implementation of the LZMA1 filter in liblzma requires that the sum of " +"I and I must not exceed 4. Thus, B<.lzma> files, which exceed this " +"limitation, cannot be decompressed with B." +msgstr "" +"liblzma의 LZMA1 필터 구현체에서는 I 값과 I 값의 합이 4를 넘어가면 안" +"됩니다. 그래서 B<.lzma> 파일의 경우 이 제한을 넘어가면 B로 압축을 해제" +"할 수 없습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2575 +msgid "" +"LZMA Utils creates only B<.lzma> files which have a dictionary size of " +"2^I (a power of 2) but accepts files with any dictionary size. liblzma " +"accepts only B<.lzma> files which have a dictionary size of 2^I or 2^I " +"+ 2^(I-1). This is to decrease false positives when detecting B<.lzma> " +"files." +msgstr "" +"LZMA 유틸리티는 2^I (2의 승수)크기를 지닌 딕셔너리를 가진 B<.lzma> 파일만 " +"만들지만 받아들이는 파일의 딕셔너리 크기는 어떤 크기든 상관 없습니다. " +"liblzma에서는 2^I, 2^I + 2^(I-1) 딕셔너리 크기를 가진 B<.lzma> 파일 " +"만 받아들입니다. 이로 인해 B<.lzma> 파일을 확인할 때 거짓 양성율이 늘어납니" +"다." + +#. type: Plain text +#: ../src/xz/xz.1:2580 +msgid "" +"These limitations shouldn't be a problem in practice, since practically all " +"B<.lzma> files have been compressed with settings that liblzma will accept." +msgstr "" +"모든 B<.lzma> 파일을 liblzma 에서 받아들일 수 있도록 압축하기 때문에 이 제한" +"이 실제로는 문제가 되지 않습니다." + +#. type: SS +#: ../src/xz/xz.1:2581 +#, no-wrap +msgid "Trailing garbage" +msgstr "뒤따라오는 쓰레기 값" + +#. type: Plain text +#: ../src/xz/xz.1:2591 +msgid "" +"When decompressing, LZMA Utils silently ignore everything after the first B<." +"lzma> stream. In most situations, this is a bug. This also means that LZMA " +"Utils don't support decompressing concatenated B<.lzma> files." +msgstr "" +"압축 해제할 때, LZMA 유틸리티는 B<.lzma> 스트림 처음 부분 다음 나머지를 다 조" +"용히 무시합니다. 대부분의 경우, 버그입니다. LZMA 유틸리티에서 B<.lzma> 결" +"합 파일 압축 해제를 지원하지 않음을 의미하기도 합니다." + +#. type: Plain text +#: ../src/xz/xz.1:2601 +msgid "" +"If there is data left after the first B<.lzma> stream, B considers the " +"file to be corrupt unless B<--single-stream> was used. This may break " +"obscure scripts which have assumed that trailing garbage is ignored." +msgstr "" +"B<.lzma> 스트림 처음부분 바로 다음에 데이터가 남아있을 경우, B 에서는 " +"B<--single-stream> 옵션을 사용하지 않으면 깨진 파일로 간주합니다. 이 동작으" +"로 하여금 뒤따라오는 쓰레기 값을 무시하도록 간주하는 애매한 스크립트 동작을 " +"깰 수가 있습니다." + +#. type: SH +#: ../src/xz/xz.1:2602 ../src/xzdec/xzdec.1:117 +#, no-wrap +msgid "NOTES" +msgstr "참고" + +#. type: SS +#: ../src/xz/xz.1:2604 +#, no-wrap +msgid "Compressed output may vary" +msgstr "출력 결과물이 달라짐" + +#. type: Plain text +#: ../src/xz/xz.1:2615 +msgid "" +"The exact compressed output produced from the same uncompressed input file " +"may vary between XZ Utils versions even if compression options are " +"identical. This is because the encoder can be improved (faster or better " +"compression) without affecting the file format. The output can vary even " +"between different builds of the same XZ Utils version, if different build " +"options are used." +msgstr "" +"압축하지 않은 입력 파일로부터 얻어낸 정확한 압축 출력 결과물은 압축 옵션이 완" +"전히 동일하더라도 XZ 유틸리티의 버전에 따라 달라질 수 있습니다. 파일 형식에 " +"영향을 주지 않고 인코더 그 자체를 개선(더 빠르게 하거나 더 나은 압축율로)하" +"기 때문입니다. XZ 유틸리티 버전이 동일하더라도 빌드 옵션을 달리하여 빌드 상" +"태가 제각각인 경우 출력 결과물이 달라질 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2625 +msgid "" +"The above means that once B<--rsyncable> has been implemented, the resulting " +"files won't necessarily be rsyncable unless both old and new files have been " +"compressed with the same xz version. This problem can be fixed if a part of " +"the encoder implementation is frozen to keep rsyncable output stable across " +"xz versions." +msgstr "" +"B<--rsyncable> 기능을 넣었을 경우 동일한 xz 버전에서 이전 파일과 새 파일로 별" +"도로 압축하지 않는 한 결과 파일을 (두 파일이 서로 다른 파일이 아니므로) " +"rsync 처리할 필요가 없습니다. 이 문제는 인코더 구현체 기능 개발이 끝나서 xz " +"버전이 다르더라도 안정적인 rsync 가능한 출력 결과물을 유지할 수 있을 때여야 " +"해결할 수 있습니다." + +#. type: SS +#: ../src/xz/xz.1:2626 +#, no-wrap +msgid "Embedded .xz decompressors" +msgstr "내장 .xz 압축 해제 프로그램" + +#. type: Plain text +#: ../src/xz/xz.1:2643 +msgid "" +"Embedded B<.xz> decompressor implementations like XZ Embedded don't " +"necessarily support files created with integrity I types other than " +"B and B. Since the default is B<--check=crc64>, you must use " +"B<--check=none> or B<--check=crc32> when creating files for embedded systems." +msgstr "" +"XZ 임베디드와 같은 내장 B<.xz> 압축 해제 구현체는 지원 파일의 무결성 I<검사> " +"형식을 I과 I 이외의 설정으로 만들 필요가 없습니다. 기본값이 " +"B<--check=crc64>일 경우에만, 임베디드 시스템에서 파일을 만들 때 B<--" +"check=none> 또는 B<--check=crc32> 옵션을 사용해야합니다." + +#. type: Plain text +#: ../src/xz/xz.1:2653 +msgid "" +"Outside embedded systems, all B<.xz> format decompressors support all the " +"I types, or at least are able to decompress the file without " +"verifying the integrity check if the particular I is not supported." +msgstr "" +"임베디드 시스템이 아니라면, 모든 B<.xz> 형식 압축 해제 프로그램에서는 모든 I<" +"검사> 형식을 지원하거나, 일부 I<검사> 방식을 지원하지 않는다면, 최소한, 무결" +"성 검사로 검증하지 않고 압축을 해제할 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2656 +msgid "" +"XZ Embedded supports BCJ filters, but only with the default start offset." +msgstr "" +"XZ 임베디드는 BCJ 필터를 지원하지만, 기본 시작 오프셋만 지정할 수 있습니다." + +#. type: SH +#: ../src/xz/xz.1:2657 +#, no-wrap +msgid "EXAMPLES" +msgstr "예제" + +#. type: SS +#: ../src/xz/xz.1:2659 +#, no-wrap +msgid "Basics" +msgstr "기본" + +#. type: Plain text +#: ../src/xz/xz.1:2669 +msgid "" +"Compress the file I into I using the default compression level " +"(B<-6>), and remove I if compression is successful:" +msgstr "" +"I 파일을 기본 압축 수준 (B<-6>) 으로 I 파일에 압축해 넣고, 압축 " +"과정이 무사히 끝나면 I를 삭제합니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2674 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2685 +msgid "" +"Decompress I into I and don't remove I even if " +"decompression is successful:" +msgstr "" +"I를 I 에 압축을 해제한 후 압축 해제가 무사히 끝나도 I를 " +"삭제하지 않습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2690 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2703 +msgid "" +"Create I with the preset B<-4e> (B<-4 --extreme>), which is " +"slower than the default B<-6>, but needs less memory for compression and " +"decompression (48\\ MiB and 5\\ MiB, respectively):" +msgstr "" +"기본 사전 설정 B<-6> 보다는 느리지만, 압축 및 압축 해제시 메모리를 적게 차지" +"(각각 48\\ Mib, 5\\MiB)는 B<-4e> 사전 설정(B<-4 --extreme>)을 활용하여 I 파일을 만듭니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2708 +#, no-wrap +msgid "CW baz.tar.xz>\n" +msgstr "CW baz.tar.xz>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2714 +msgid "" +"A mix of compressed and uncompressed files can be decompressed to standard " +"output with a single command:" +msgstr "" +"압축 및 비압축 파일을 단일 명령으로 표준 출력에 압축해제할 수 있습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2719 +#, no-wrap +msgid "CW abcd.txt>\n" +msgstr "CW abcd.txt>\n" + +#. type: SS +#: ../src/xz/xz.1:2723 +#, no-wrap +msgid "Parallel compression of many files" +msgstr "다중 파일 병렬 압축" + +#. type: Plain text +#: ../src/xz/xz.1:2729 +msgid "" +"On GNU and *BSD, B(1) and B(1) can be used to parallelize " +"compression of many files:" +msgstr "" +"GNU와 *BSD에서는 B(1) 명령과 B(1) 명령으로 여러 파일의 압축을 " +"병렬 처리할 수 있습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2735 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2757 +msgid "" +"The B<-P> option to B(1) sets the number of parallel B " +"processes. The best value for the B<-n> option depends on how many files " +"there are to be compressed. If there are only a couple of files, the value " +"should probably be 1; with tens of thousands of files, 100 or even more may " +"be appropriate to reduce the number of B processes that B(1) " +"will eventually create." +msgstr "" +"B(1) 의 B<-P> 옵션으로 B 프로세스의 병렬 처리 갯수를 지정합니" +"다. B<-n> 옵션의 최적 값은 압축할 파일 수에 달려있습니다. 압축할 파일이 몇" +"개밖에 없다면 1이어야합니다. 파일이 수천 수만개 정도 된다면 B(1) 이 " +"어쨌든지간에 만들어낼 B 프로세스의 겟수를 100으로 하거나 아니면 적당한 값" +"을 지정하여 줄이는게 좋습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2765 +msgid "" +"The option B<-T1> for B is there to force it to single-threaded mode, " +"because B(1) is used to control the amount of parallelization." +msgstr "" +"B에 B<-T1>옵션을 지정하면 단일-스레드 모드로 강제합니다. B(1) 에" +"서 병렬 처리 갯수를 제어할 수 있기 때문입니다." + +#. type: SS +#: ../src/xz/xz.1:2766 +#, no-wrap +msgid "Robot mode" +msgstr "로봇 모드" + +#. type: Plain text +#: ../src/xz/xz.1:2769 +msgid "" +"Calculate how many bytes have been saved in total after compressing multiple " +"files:" +msgstr "여러 파일을 압축한 후 저장할 바이트 용량을 계산합니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2774 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2789 +msgid "" +"A script may want to know that it is using new enough B. The following " +"B(1) script checks that the version number of the B tool is at " +"least 5.0.0. This method is compatible with old beta versions, which didn't " +"support the B<--robot> option:" +msgstr "" +"이 스크립트에서는 충분히 최신의 B 명령을 사용하는지 알아보려 합니다. 다" +"음 B(1) 스크립트에서는 B 도구의 버전 번호가 최소한 5.0.0인지 여부를 " +"검사합니다. 이 방식은 B<--robot> 옵션을 지원하지 않는 오래된 베타 버전과도 " +"호환성이 있습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2798 +#, no-wrap +msgid "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" +msgstr "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2805 +msgid "" +"Set a memory usage limit for decompression using B, but if a limit " +"has already been set, don't increase it:" +msgstr "" +"B 환경 변수로 압축 해제시 메뢰 사용량 한계를 설정하지만, 한계 값을 이" +"미 설정했다면, 값을 늘리지 않습니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2815 +#, no-wrap +msgid "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" +msgstr "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2825 +msgid "" +"The simplest use for custom filter chains is customizing a LZMA2 preset. " +"This can be useful, because the presets cover only a subset of the " +"potentially useful combinations of compression settings." +msgstr "" +"개별 설정 필터 체인의 초단순 사용방식은 LZMA2 사전 설정 값을 별도로 설정하는 " +"방식입니다. 사전 설정은 잠재적으로 쓸만한 압축 설정 조합만 다루기 때문에 꽤 " +"쓸모가 있을 수도 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2833 +msgid "" +"The CompCPU columns of the tables from the descriptions of the options " +"B<-0> ... B<-9> and B<--extreme> are useful when customizing LZMA2 presets. " +"Here are the relevant parts collected from those two tables:" +msgstr "" +"B<-0> ... B<-9> 옵션의 설명에서 테이블의 CompCPU 컬럼과 B<--extreme> 옵션은 " +"LZMA2 사전 설정을 개별적으로 맞췄을 때 쓸만할 수도 있습니다. 여기 관련내용" +"을 테이블 둘로 정리해서 모아보았습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2858 +msgid "" +"If you know that a file requires somewhat big dictionary (for example, 32\\ " +"MiB) to compress well, but you want to compress it quicker than B " +"would do, a preset with a low CompCPU value (for example, 1) can be " +"modified to use a bigger dictionary:" +msgstr "" +"어떤 파일을 압축할 때 상당히 큰 딕셔너리(예: 32MiB)가 필요 하다는걸 알아채셨" +"지만, B 명령이 압축할 때보다 더 빠른 속도로 압축하려 한다면, 더 큰 딕" +"셔너리 사용을 위해 더 낮은 CompCPU 사전 설정 값(예: 1)으로 수정할 수 있습니" +"다:" + +#. type: Plain text +#: ../src/xz/xz.1:2863 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2879 +msgid "" +"With certain files, the above command may be faster than B while " +"compressing significantly better. However, it must be emphasized that only " +"some files benefit from a big dictionary while keeping the CompCPU value " +"low. The most obvious situation, where a big dictionary can help a lot, is " +"an archive containing very similar files of at least a few megabytes each. " +"The dictionary size has to be significantly bigger than any individual file " +"to allow LZMA2 to take full advantage of the similarities between " +"consecutive files." +msgstr "" +"각 파일에 대해, 위 명령은 압축율이 더 좋아지면서도 B보다 더 빨라집니" +"다. 그러나, CompCPU 값을 낮게 유지하는 대신 큰 딕셔너리에서 일부 파일을 강조" +"해야 합니다. 큰 딕셔너리가 대부분의 도움을 주는 매우 명백한 상황에서는 최소" +"한 몇 메가바이트의 매우 유사한 각 파일이 아카이브에 들어갑니다. 딕셔너리 크" +"기는 LZMA2가 연속으로 존재하는 각 파일의 유사성으로부터 얻는 장점을 취할 수 " +"있을 때 일부 개별 파일보다 훨씬 더 커집니다." + +#. type: Plain text +#: ../src/xz/xz.1:2886 +msgid "" +"If very high compressor and decompressor memory usage is fine, and the file " +"being compressed is at least several hundred megabytes, it may be useful to " +"use an even bigger dictionary than the 64 MiB that B would use:" +msgstr "" +"압축 프로그램과 압축 해제 프로그램에서 메모리를 엄청 많이 사용해도 상관 없" +"고, 파일을 수백 메가 바이트 메모리 용량을 활용하여 압축한다면, B 명령" +"에 64MiB 용량을 초과하는 딕셔너리를 사용할 수 있게 하는 방법도 쓸만할 지도 모" +"릅니다:" + +#. type: Plain text +#: ../src/xz/xz.1:2891 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2904 +msgid "" +"Using B<-vv> (B<--verbose --verbose>) like in the above example can be " +"useful to see the memory requirements of the compressor and decompressor. " +"Remember that using a dictionary bigger than the size of the uncompressed " +"file is waste of memory, so the above command isn't useful for small files." +msgstr "" +"위 예제에서와 같이 B<-vv> (B<--verbose --verbose>) 옵션을 사용하면 압축 및 압" +"축 해제 과정에서 필요한 메모리 용량을 살펴보는데 요긴할 수 있습니다. 압축 해" +"제한 파일 크기보다 더 큰 딕셔너리를 사용하면 불필요한 메모리 소모량이 발생하" +"여 위 명령이 작은 파일에는 쓸모 없음을 기억하십시오." + +#. type: Plain text +#: ../src/xz/xz.1:2916 +msgid "" +"Sometimes the compression time doesn't matter, but the decompressor memory " +"usage has to be kept low, for example, to make it possible to decompress the " +"file on an embedded system. The following command uses B<-6e> (B<-6 --" +"extreme>) as a base and sets the dictionary to only 64\\ KiB. The " +"resulting file can be decompressed with XZ Embedded (that's why there is B<--" +"check=crc32>) using about 100\\ KiB of memory." +msgstr "" +"때로는 압축 시간이 딱히 상관이 없을 수도 있습니다만, 압축 해제시 메모리 사용" +"량을 적게 유지해야 할 수도 있습니다. 예를 들면, 임베디드 시스템에서 파일 압축" +"을 해제할 수도 있습니다. 다음 명령의 경우 B<-6e> (B<-6 --extreme>) 옵션을 기" +"반 옵션을 사용하며 딕셔너리 크기를 64KiB만 사용하도록 제한합니다. 결과 파일" +"은 XZ 임베디드(이게 B<--check=crc32> 옵션이 있는 이유)로 100KiB 메모리 용량" +"을 활용하여 풀어낼 수 있습니다." + +#. type: Plain text +#: ../src/xz/xz.1:2921 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2944 +msgid "" +"If you want to squeeze out as many bytes as possible, adjusting the number " +"of literal context bits (I) and number of position bits (I) can " +"sometimes help. Adjusting the number of literal position bits (I) " +"might help too, but usually I and I are more important. For " +"example, a source code archive contains mostly US-ASCII text, so something " +"like the following might give slightly (like 0.1\\ %) smaller file than B (try also without B):" +msgstr "" +"가능한 한 수 바이트를 더 쥐어 짜내고 싶을 때, 리터럴 문맥 비트 수(I)와 위" +"치 비트 수(I)를 조정하면 도움이 될 수도 있습니다. 리터럴 위치 비트 수" +"(I)를 조금 건드리는 것 또한 도움이 될 지도 모르겠지만 보통 I 값과 " +"I 값이 더 중요합니다. 예를 들면, 소스 코드 저장 파일에는 US-ASCII 텍스트" +"가 대부분이기에, 다음과 같은 경우는 B 명령을 실행했을 때부다는 아주 " +"약간(거의 0.1% 수준) 작은 파일을 얻어낼 수도 있습니다(B를 빼고도 시도해" +"보십시오):" + +#. type: Plain text +#: ../src/xz/xz.1:2949 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2957 +msgid "" +"Using another filter together with LZMA2 can improve compression with " +"certain file types. For example, to compress a x86-32 or x86-64 shared " +"library using the x86 BCJ filter:" +msgstr "" +"LZMA2와 다른 필터를 함께 사용하면 일부 파일 형식에 대해 압축율을 개선할 수 있" +"습니다. 예를 들면 x86-32 또는 x86-64 공유 라이브러리를 x86 BCJ 필터를 활용하" +"여 압축할 경우:" + +#. type: Plain text +#: ../src/xz/xz.1:2962 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2976 +msgid "" +"Note that the order of the filter options is significant. If B<--x86> is " +"specified after B<--lzma2>, B will give an error, because there cannot " +"be any filter after LZMA2, and also because the x86 BCJ filter cannot be " +"used as the last filter in the chain." +msgstr "" +"참고로 필터 옵션의 순서는 상당히 중요합니다. B<--x86>을 B<--lzma> 이전에 지" +"정하면 B에서 오류가 나는데, LZMA2 다음에는 어떤 필터든 설정할 수 없고, 옵" +"션 체인상 마지막 필터로 x86 BCJ 필터를 사용할 수 없기 때문입니다." + +#. type: Plain text +#: ../src/xz/xz.1:2982 +msgid "" +"The Delta filter together with LZMA2 can give good results with bitmap " +"images. It should usually beat PNG, which has a few more advanced filters " +"than simple delta but uses Deflate for the actual compression." +msgstr "" +"LZMA2와 델타 필터는 비트맵 그림에 최적의 결과를 가져다줄 수 있습니다. PNG에 " +"보통 안성맞춥인데, PNG에는 단순 델타 필터보단 약간 더 고급진 필터를 사용하지" +"만, 실제 압축을 진행할 때는 Deflate를 사용하기 때문입니다." + +#. type: Plain text +#: ../src/xz/xz.1:2992 +msgid "" +"The image has to be saved in uncompressed format, for example, as " +"uncompressed TIFF. The distance parameter of the Delta filter is set to " +"match the number of bytes per pixel in the image. For example, 24-bit RGB " +"bitmap needs B, and it is also good to pass B to LZMA2 to " +"accommodate the three-byte alignment:" +msgstr "" +"예를 들어 이미지를 압축하지 않은 비압축 TIFF로 저장해야 하는 경우가 있습니" +"다. 델타 필터의 거리 매개변수는 그림에서 픽셀당 바이트 수에 일치하도록 설정" +"합니다. 예를 들면, 24비트 RGB 비트맵의 경우 B 거리 매개변수 값을 설" +"정해야 하며, LZMA2 압축시 3바이트 정렬을 따르도록 B 값을 전달하는 방법" +"도 바람직합니다." + +#. type: Plain text +#: ../src/xz/xz.1:2997 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:3005 +msgid "" +"If multiple images have been put into a single archive (for example, B<." +"tar>), the Delta filter will work on that too as long as all images have the " +"same number of bytes per pixel." +msgstr "" +"여러 이미지를 단일 아카이브로 넣고 싶다면(예: B<.tar>), 모든 이미지에 대해 동" +"일한 픽셀당 바이트 수가 들어가는 경우에도 델타 필터가 동작합니다." + +#. type: SH +#: ../src/xz/xz.1:3006 ../src/xzdec/xzdec.1:143 ../src/lzmainfo/lzmainfo.1:59 +#: ../src/scripts/xzdiff.1:65 ../src/scripts/xzgrep.1:106 +#: ../src/scripts/xzless.1:65 ../src/scripts/xzmore.1:51 +#, no-wrap +msgid "SEE ALSO" +msgstr "추가 참조" + +#. type: Plain text +#: ../src/xz/xz.1:3015 +msgid "" +"B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1), B<7z>(1)" +msgstr "" +"B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1), B<7z>(1)" + +#. type: Plain text +#: ../src/xz/xz.1:3017 +msgid "XZ Utils: Ehttps://tukaani.org/xz/E" +msgstr "XZ 유틸리티: Ehttps://tukaani.org/xz/E" + +#. type: Plain text +#: ../src/xz/xz.1:3019 ../src/xzdec/xzdec.1:146 +msgid "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" +msgstr "XZ 임베디드: Ehttps://tukaani.org/xz/embedded.htmlE" + +#. type: Plain text +#: ../src/xz/xz.1:3020 +msgid "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" +msgstr "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "XZDEC" +msgstr "XZDEC" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "2017-04-19" +msgstr "2017-04-19" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:10 +msgid "xzdec, lzmadec - Small .xz and .lzma decompressors" +msgstr "xzdec, lzmadec - .xz와 .lzma용 작은 압축 해제 프로그램" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:14 +msgid "B [I] [I]" +msgstr "B [I<<옵션>...>] [I파일E...>]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:18 +msgid "B [I] [I]" +msgstr "B [I<<옵션>...>] [I파일E...>]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:44 +msgid "" +"B is a liblzma-based decompression-only tool for B<.xz> (and only B<." +"xz>) files. B is intended to work as a drop-in replacement for " +"B(1) in the most common situations where a script has been written to " +"use B (and possibly a few other commonly used " +"options) to decompress B<.xz> files. B is identical to B " +"except that B supports B<.lzma> files instead of B<.xz> files." +msgstr "" +"B은 liblzma 기반 B<.xz> (그리고 B<.xz> 확장자만) 파일 압축 해제 전용 " +"도구 프로그램입니다. B 은 B(1) 명령을 활용하여 B<.xz> 파일의 압" +"축을 해제할 때 쓰던 B (그리고 일반적으로 쓰던 몇가" +"지 다른 옵션도 같이) 명령을 작성하던 일상적인 경우를 대신하려 만든 결과물입니" +"다. B 는 B<.xz> 파일 대신 B<.lzma> 파일을 지원하는 점만 다르며, 나" +"머지는 B과 동일합니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:61 +msgid "" +"To reduce the size of the executable, B doesn't support " +"multithreading or localization, and doesn't read options from B " +"and B environment variables. B doesn't support displaying " +"intermediate progress information: sending B to B does " +"nothing, but sending B terminates the process instead of displaying " +"progress information." +msgstr "" +"실행 파일 크기를 줄이려는 목적으로, B 에서는 다중-스레드 실행 또는 현" +"지 언어 표기를 지원하지 않으며 B 환경 변수와 B 환경 변수" +"의 옵션 값을 읽지 않습니다. B은 단계별 진행 정보를 표시하지 않습니" +"다. B 명령어로 B 시그널을 보내면 아무 동작도 취하지 않지만, " +"B 시그널을 보내면 프 정보를 표시하는 대신 프로세스를 끝냅니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:69 +msgid "" +"Ignored for B(1) compatibility. B supports only decompression." +msgstr "" +"B(1) 호환성을 문제로 무시합니다. B은 압축 해제 기능만 지원합니" +"다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:76 +msgid "" +"Ignored for B(1) compatibility. B never creates or removes any " +"files." +msgstr "" +"B(1) 호환성을 문제로 무시합니다. B은 어떤 파일도 만들거나 제거하" +"지 않습니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:83 +msgid "" +"Ignored for B(1) compatibility. B always writes the " +"decompressed data to standard output." +msgstr "" +"B(1) 호환성을 문제로 무시합니다. B은 항상 압축 해제한 데이터를 " +"표준 출력으로만 기록합니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:89 +msgid "" +"Specifying this once does nothing since B never displays any warnings " +"or notices. Specify this twice to suppress errors." +msgstr "" +"이 옵션을 한번 지정하면 B에서 어떤 경고나 알림을 표시하지 않기 때문에 " +"아무런 동작도 취하지 않습니다. 오류 메시지를 표시하지 않으려면 이 옵션을 두" +"번 지정하십시오." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:96 +msgid "" +"Ignored for B(1) compatibility. B never uses the exit status 2." +msgstr "" +"B(1) 호환성을 문제로 무시합니다. B은 종료 코드 2번을 사용하지 않" +"습니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:99 +msgid "Display a help message and exit successfully." +msgstr "도움말 메시지를 나타내고 무사히 나갑니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:104 +msgid "Display the version number of B and liblzma." +msgstr "B과 liblzma의 버전 번호를 나타냅니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:108 +msgid "All was good." +msgstr "모든 상태 양호." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:117 +msgid "" +"B doesn't have any warning messages like B(1) has, thus the exit " +"status 2 is not used by B." +msgstr "" +"B 은 B에 있는 경고 메시지를 출력하지 않기 때문에 B 에서는 " +"종료 코드 2번을 사용하지 않습니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:131 +msgid "" +"Use B(1) instead of B or B for normal everyday use. " +"B or B are meant only for situations where it is important " +"to have a smaller decompressor than the full-featured B(1)." +msgstr "" +"보통 매일 사용하실 목적이라면 B 또는 B 대신 B 명령을 사용" +"하십시오. B 또는 B은 완전한 기능을 갖춘 B(1) 보다는 작" +"은 압축 해제 프로그램을 사용해야 할 경우에만 사용하라고 있는 명령입니다." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:143 +msgid "" +"B and B are not really that small. The size can be reduced " +"further by dropping features from liblzma at compile time, but that " +"shouldn't usually be done for executables distributed in typical non-" +"embedded operating system distributions. If you need a truly small B<.xz> " +"decompressor, consider using XZ Embedded." +msgstr "" +"B 과 B 은 실제로 그렇게 작은건 아닙니다. 컴파일 시간에 " +"liblzma에서 얼마나 기능을 떨궈내느냐에 따라 더 줄어들 수도 있습니다만, 보통 " +"임베디드 운영체제 배포판이 아닌 경우는 이렇게 할 수가 없습니다. 실제로 작은 " +"B<.xz> 압축 해제 프로그램이 필요하다면 XZ 임베디드 사용을 고려하십시오." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:145 ../src/lzmainfo/lzmainfo.1:60 +msgid "B(1)" +msgstr "B(1)" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 +#, no-wrap +msgid "LZMAINFO" +msgstr "LZMAINFO" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "2013-06-30" +msgstr "2013-06-30" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:10 +msgid "lzmainfo - show information stored in the .lzma file header" +msgstr "lzmainfo - .lzma 파일 헤더에 들어있는 정보를 보여줍니다" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:15 +msgid "B [B<--help>] [B<--version>] [I]" +msgstr "B [B<--help>] [B<--version>] [I파일E...>]" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:31 +msgid "" +"B shows information stored in the B<.lzma> file header. It reads " +"the first 13 bytes from the specified I, decodes the header, and " +"prints it to standard output in human readable format. If no I are " +"given or I is B<->, standard input is read." +msgstr "" +"B 는 B<.lzma> 파일 헤더에 들어있는 정보를 보여줍니다. 지정 I" +"파일E>에서 13바이트를 우선 읽어 헤더를 디코딩한 후, 가독 형식으로 표준 출" +"력에 보여줍니다. I파일E>을 지정하지 않거나 I파일E> 값이 " +"I<-> 이면 표준 입력을 읽습니다." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:40 +msgid "" +"Usually the most interesting information is the uncompressed size and the " +"dictionary size. Uncompressed size can be shown only if the file is in the " +"non-streamed B<.lzma> format variant. The amount of memory required to " +"decompress the file is a few dozen kilobytes plus the dictionary size." +msgstr "" +"보통 대부분 관심있는 정보는 압축 해제 용량과 딕서너리 크기입니다. 압축 해제 " +"용량의 경우 파일이 비스트림 B<.lzma> 형식 계열인 경우에만 나타납니다. 파일 " +"압축 해제 필요 메모리 용량은 수십 킬로바이트에 딕셔너리 크기를 합친 값입니다." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:44 +msgid "" +"B is included in XZ Utils primarily for backward compatibility " +"with LZMA Utils." +msgstr "" +"B 는 LZMA 유틸리티 하위 호환성을 목적으로 XZ 유틸리티에 기본으로 들" +"어있습니다." + +#. type: SH +#: ../src/lzmainfo/lzmainfo.1:51 ../src/scripts/xzdiff.1:74 +#, no-wrap +msgid "BUGS" +msgstr "버그" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:59 +msgid "" +"B uses B while the correct suffix would be B (2^20 " +"bytes). This is to keep the output compatible with LZMA Utils." +msgstr "" +"B 프로그램은 B (2^20 바이트) 용량 단위인데 (실제로) B를 사" +"용합니다. LZMA 유틸리티 출력 호환 유지가 목적입니다." + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "XZDIFF" +msgstr "XZDIFF" + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "2021-06-04" +msgstr "2021-06-04" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:12 +msgid "xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files" +msgstr "xzcmp, xzdiff, lzcmp, lzdiff - 압축 파일을 비교합니다" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:15 +msgid "B [I] I [I]" +msgstr "" +"B [I비교_옵션E>] I파일1E> [I파일2E>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:18 +msgid "B [I] I [I]" +msgstr "B [I<차이_옵션>] I파일1E> [I파일2E>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:21 +msgid "B [I] I [I]" +msgstr "" +"B [I비교_옵션E>] I파일1E> [I파일2E>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:24 +msgid "B [I] I [I]" +msgstr "" +"B [I차이_옵션E>] I파일1E> [I파일2E>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:59 +msgid "" +"B and B invoke B(1) or B(1) on files compressed " +"with B(1), B(1), B(1), B(1), B(1), or " +"B(1). All options specified are passed directly to B(1) or " +"B(1). If only one file is specified, then the files compared are " +"I (which must have a suffix of a supported compression format) and " +"I from which the compression format suffix has been stripped. If two " +"files are specified, then they are uncompressed if necessary and fed to " +"B(1) or B(1). The exit status from B(1) or B(1) is " +"preserved unless a decompression error occurs; then exit status is 2." +msgstr "" +"B 와 B 는 B(1), B(1), B(1), B(1), " +"B(1), B(1) 로 압축한 파일에 대해 B(1) 또는 B(1) 명령" +"을 실행합니다. 지정한 모든 옵션은 직접 B(1) 또는 B(1) 명령에 전달" +"합니다. 파일 하나만 지정했을 경우 I파일1E>만 비교(지원 압축 형식 " +"접미사를 넣어야 함)하며, I파일1E>의 지원 압축 형식 접미사는 빠집니" +"다. 파일 둘을 지정하면, 필요한 경우 압축 해제하며, B(1) 또는 " +"B(1) 명령으로 전달합니다. B(1) 또는 B(1) 명령의 종료 상태" +"는 압축 해제 오류가 나타나지 않는 한 보존됩니다. 압축 해제 오류가 나타나면 종" +"료 상태는 2가 됩니다." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:65 +msgid "" +"The names B and B are provided for backward compatibility " +"with LZMA Utils." +msgstr "" +"B 와 B 명령은 LZMA 유틸리티 하위 호환성을 목적으로 제공합니다." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:74 +msgid "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1)" +msgstr "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1), B(1)" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:79 +msgid "" +"Messages from the B(1) or B(1) programs refer to temporary " +"filenames instead of those specified." +msgstr "" +"B(1) 프로그램 또는 B(1) 프로그램에서 온 메시지는 지정한 파일 이" +"름 대신 임시 파일 이름을 참조합니다." + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "XZGREP" +msgstr "XZGREP" + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "2022-07-19" +msgstr "2022-07-19" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:12 +msgid "xzgrep - search compressed files for a regular expression" +msgstr "xzgrep - 정규 표현식을 활용하여 압축 파일을 검색합니다" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:18 +msgid "B [I] [B<-e>] I [I]" +msgstr "" +"B [I] [B<-e>] I패턴E> [I파일E...>]" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:21 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:24 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:27 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:30 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:33 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:49 +msgid "" +"B invokes B(1) on I which may be either uncompressed " +"or compressed with B(1), B(1), B(1), B(1), " +"B(1), or B(1). All options specified are passed directly to " +"B(1)." +msgstr "" +"B 명령은 B(1), B(1), B(1), B(1), B(1), " +"B(1) 로 압축을 했거나 하지 않은 I파일E>에 대해 B(1) 명" +"령을 실행합니다. 모든 지정 옵션은 B(1)에 바로 전달합니다." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:62 +msgid "" +"If no I is specified, then standard input is decompressed if necessary " +"and fed to B(1). When reading from standard input, B(1), " +"B(1), B(1), and B(1) compressed files are not supported." +msgstr "" +"지정한 I파일E>이 없다면, 필요에 따라 표준 입력 데이터 압축을 풀어내" +"어 B(1) 에 전달합니다. 표준 입력에서 읽을 떄, B(1), " +"B(1), B(1), B(1) 압축 파일은 지원하지 않습니다." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:81 +msgid "" +"If B is invoked as B or B then B or " +"B is used instead of B(1). The same applies to names " +"B, B, and B, which are provided for backward " +"compatibility with LZMA Utils." +msgstr "" +"B을 B 또는 B 으로 실행하면 B(1) 대신 " +"B 또는 B 명령을 활용합니다. LZMA 유틸리티와 하위 호환성을 " +"가진 B, B, B 명령에도 동일합니다." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:86 +msgid "" +"At least one match was found from at least one of the input files. No " +"errors occurred." +msgstr "" +"최소한 하나 이상의 파일에서 하나 이상의 일치하는 결과를 찾았습니다. 오류가 " +"없습니다." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:90 +msgid "No matches were found from any of the input files. No errors occurred." +msgstr "어떤 입력 파일에서든 일치하는 내용이 없습니다. 오류가 없습니다." + +#. type: TP +#: ../src/scripts/xzgrep.1:90 +#, no-wrap +msgid "E1" +msgstr "E1" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:94 +msgid "One or more errors occurred. It is unknown if matches were found." +msgstr "" +"하나 이상의 오류가 나타납니다. 일치하는 항목을 찾아낼 지 여부는 알 수 없습니" +"다." + +#. type: TP +#: ../src/scripts/xzgrep.1:95 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:106 +msgid "" +"If the B environment variable is set, B uses it instead of " +"B(1), B, or B." +msgstr "" +"B 환경 변수를 설정하면, B을 B(1), B, B " +"환경 변수 대신 활용합니다." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:113 +msgid "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1)" +msgstr "" +"B(1), B(1), B(1), B(1), B(1), B(1), " +"B(1)" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "XZLESS" +msgstr "XZLESS" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "2010-09-27" +msgstr "2010-09-27" + +#. type: Plain text +#: ../src/scripts/xzless.1:13 +msgid "xzless, lzless - view xz or lzma compressed (text) files" +msgstr "xzless, lzless - xz 또는 lzma 압축 (텍스트) 파일을 봅니다" + +#. type: Plain text +#: ../src/scripts/xzless.1:16 +msgid "B [I...]" +msgstr "B [I파일E>...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:19 +msgid "B [I...]" +msgstr "B [I파일E>...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:31 +msgid "" +"B is a filter that displays text from compressed files to a " +"terminal. It works on files compressed with B(1) or B(1). If no " +"I are given, B reads from standard input." +msgstr "" +"B 는 압축 파일을 터미널에 나타내는 필터 프로그램입니다. B(1) 또" +"는 B(1) 프로그램으로 압축한 파일에 대해 동작합니다. 주어진 I파일" +"E> 값이 없다면, B 는 표준 입력을 읽어들입니다." + +#. type: Plain text +#: ../src/scripts/xzless.1:48 +msgid "" +"B uses B(1) to present its output. Unlike B, its " +"choice of pager cannot be altered by setting an environment variable. " +"Commands are based on both B(1) and B(1) and allow back and " +"forth movement and searching. See the B(1) manual for more " +"information." +msgstr "" +"B 는 B(1) 를 사용하여 출력을 막습니다. B 와는 다르" +"게, 환경 변수 설정으로 선택한 페이저를 바꿀 수 없습니다. 명령은 B(1) " +"와 B(1) 가 기반이며, 앞뒤로 움직이고 검색할 수 있습니다. 자세한 정보는 " +"B(1) 설명서를 참고하십시오." + +#. type: Plain text +#: ../src/scripts/xzless.1:52 +msgid "" +"The command named B is provided for backward compatibility with LZMA " +"Utils." +msgstr "B 명령은 LZMA 유틸리티 하위 호환용으로 제공합니다." + +#. type: TP +#: ../src/scripts/xzless.1:53 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:59 +msgid "" +"A list of characters special to the shell. Set by B unless it is " +"already set in the environment." +msgstr "" +"셸에서 동작할 수도 있는 특수 문자 목록입니다. 환경에 미리 설정해두지 않았다" +"면 B에서 설정합니다." + +#. type: TP +#: ../src/scripts/xzless.1:59 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:65 +msgid "" +"Set to a command line to invoke the B(1) decompressor for preprocessing " +"the input files to B(1)." +msgstr "" +"입력 파일을 B(1) 에 전달하기 전에 B(1) 압축 해제 프로그램을 실행" +"해서 미리 처리하는 명령행을 설정합니다." + +#. type: Plain text +#: ../src/scripts/xzless.1:69 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZMORE" +msgstr "XZMORE" + +#. type: Plain text +#: ../src/scripts/xzmore.1:10 +msgid "xzmore, lzmore - view xz or lzma compressed (text) files" +msgstr "" +"xzmore, lzmore - xz 압축 (텍스트) 파일 또는 lzma 압축 (텍스트) 파일을 봅니다" + +#. type: Plain text +#: ../src/scripts/xzmore.1:13 +msgid "B [I]" +msgstr "B [I파일E...>]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:16 +msgid "B [I]" +msgstr "B [I파일E...>]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:24 +msgid "" +"B is a filter which allows examination of B(1) or B(1) " +"compressed text files one screenful at a time on a soft-copy terminal." +msgstr "" +"B 는 B(1) 또는 B(1) 형식으로 압축한 텍스트 파일을 한 번" +"에 한 화면만큼 소프트-복제 터미널에 표시하는 필터입니다." + +#. type: Plain text +#: ../src/scripts/xzmore.1:33 +msgid "" +"To use a pager other than the default B set environment variable " +"B to the name of the desired program. The name B is provided " +"for backward compatibility with LZMA Utils." +msgstr "" +"기본 B 대신 다른 페이저 프로그램을 사용하려면, B 환경 변수에 원" +"하는 프로그램 이름을 넣으십시오. B의 이름은 LZMA 유틸리티의 하위 호" +"환성을 목적으로 제공합니다." + +#. type: TP +#: ../src/scripts/xzmore.1:33 +#, no-wrap +msgid "B or B" +msgstr "B 또는 B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:40 +msgid "" +"When the prompt --More--(Next file: I) is printed, this command " +"causes B to exit." +msgstr "" +"--More--(다음 파일: I파일E>) 프롬프트가 뜨면, 이 명령은 B" +"를 빠져나가게 합니다." + +#. type: TP +#: ../src/scripts/xzmore.1:40 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:47 +msgid "" +"When the prompt --More--(Next file: I) is printed, this command " +"causes B to skip the next file and continue." +msgstr "" +"--More--(다음 파일: I파일E>) 프롬프트가 뜨면, 이 명령은 B" +"에서 다음 파일로 건너뛰어 계속 실행하게 합니다." + +#. type: Plain text +#: ../src/scripts/xzmore.1:51 +msgid "" +"For list of keyboard commands supported while actually viewing the content " +"of a file, refer to manual of the pager you use, usually B(1)." +msgstr "" +"파일 내용을 실제로 보는 동안 지원하는 키보드 명령 목록을 보려면, B(1) " +"와 같은 사용하는 페이저의 설명서를 참고하십시오." + +#. type: Plain text +#: ../src/scripts/xzmore.1:55 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" diff --git a/po4a/po4a.conf b/po4a/po4a.conf new file mode 100644 index 0000000..120070a --- /dev/null +++ b/po4a/po4a.conf @@ -0,0 +1,14 @@ +# To add a new language, add it to po4a_langs and run "update-po" +# to get a new .po file. After translating the .po file, run +# "update-po" again to generate the translated man pages. + +[po4a_langs] de fr ro uk ko +[po4a_paths] xz-man.pot $lang:$lang.po + +[type: man] ../src/xz/xz.1 $lang:man/$lang/xz.1 +[type: man] ../src/xzdec/xzdec.1 $lang:man/$lang/xzdec.1 +[type: man] ../src/lzmainfo/lzmainfo.1 $lang:man/$lang/lzmainfo.1 +[type: man] ../src/scripts/xzdiff.1 $lang:man/$lang/xzdiff.1 +[type: man] ../src/scripts/xzgrep.1 $lang:man/$lang/xzgrep.1 +[type: man] ../src/scripts/xzless.1 $lang:man/$lang/xzless.1 +[type: man] ../src/scripts/xzmore.1 $lang:man/$lang/xzmore.1 diff --git a/po4a/ro.po b/po4a/ro.po new file mode 100644 index 0000000..752ca0a --- /dev/null +++ b/po4a/ro.po @@ -0,0 +1,3692 @@ +# Mesajele în limba română pentru pachetul xz-man. +# This file is put in the public domain. +# +# Remus-Gabriel Chelu , 2022. +# +# Cronologia traducerii fișierului „xz-man”: +# Traducerea inițială, făcută de R-GC, pentru versiunea xz-man 5.4.0-pre1. +# Actualizare a traducerii pentru versiunea 5.4.0-pre2, făcută de R-GC, 2022. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(anul). +# +msgid "" +msgstr "" +"Project-Id-Version: xz-man 5.4.0-pre2\n" +"POT-Creation-Date: 2022-12-01 21:23+0200\n" +"PO-Revision-Date: 2022-12-05 20:22+0100\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: plural=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.1.1\n" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "XZ" +msgstr "XZ" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "2022-12-01" +msgstr "01.12.2022" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "Tukaani" +msgstr "Tukaani" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZ Utils" +msgstr "Utilități XZ" + +#. type: SH +#: ../src/xz/xz.1:10 ../src/xzdec/xzdec.1:8 ../src/lzmainfo/lzmainfo.1:8 +#: ../src/scripts/xzdiff.1:10 ../src/scripts/xzgrep.1:10 +#: ../src/scripts/xzless.1:11 ../src/scripts/xzmore.1:8 +#, no-wrap +msgid "NAME" +msgstr "NUME" + +#. type: Plain text +#: ../src/xz/xz.1:12 +msgid "xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma files" +msgstr "xz, unxz, xzcat, lzma, unlzma, lzcat - Comprimă sau decomprimă fișiere .xz și .lzma" + +#. type: SH +#: ../src/xz/xz.1:13 ../src/xzdec/xzdec.1:10 ../src/lzmainfo/lzmainfo.1:10 +#: ../src/scripts/xzdiff.1:12 ../src/scripts/xzgrep.1:12 +#: ../src/scripts/xzless.1:13 ../src/scripts/xzmore.1:10 +#, no-wrap +msgid "SYNOPSIS" +msgstr "REZUMAT" + +#. type: Plain text +#: ../src/xz/xz.1:17 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: SH +#: ../src/xz/xz.1:18 +#, no-wrap +msgid "COMMAND ALIASES" +msgstr "ALIAS COMENZI" + +#. type: Plain text +#: ../src/xz/xz.1:22 +msgid "B is equivalent to B." +msgstr "B este echivalent cu B." + +#. type: Plain text +#: ../src/xz/xz.1:26 +msgid "B is equivalent to B." +msgstr "B este echivalent cu B." + +#. type: Plain text +#: ../src/xz/xz.1:30 +msgid "B is equivalent to B." +msgstr "B este echivalent cu B." + +#. type: Plain text +#: ../src/xz/xz.1:34 +msgid "B is equivalent to B." +msgstr "B este echivalent cu B." + +#. type: Plain text +#: ../src/xz/xz.1:38 +msgid "B is equivalent to B." +msgstr "B este echivalent cu B." + +#. type: Plain text +#: ../src/xz/xz.1:50 +msgid "When writing scripts that need to decompress files, it is recommended to always use the name B with appropriate arguments (B or B) instead of the names B and B." +msgstr "Când scrieți scripturi care trebuie să decomprime fișiere, este recomandat să folosiți întotdeauna comanda B cu argumentele adecvate (B sau B) în loc de comenzile B și B." + +#. type: SH +#: ../src/xz/xz.1:51 ../src/xzdec/xzdec.1:18 ../src/lzmainfo/lzmainfo.1:15 +#: ../src/scripts/xzdiff.1:24 ../src/scripts/xzgrep.1:33 +#: ../src/scripts/xzless.1:19 ../src/scripts/xzmore.1:16 +#, no-wrap +msgid "DESCRIPTION" +msgstr "DESCRIERE" + +#. type: Plain text +#: ../src/xz/xz.1:70 +msgid "B is a general-purpose data compression tool with command line syntax similar to B(1) and B(1). The native file format is the B<.xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw compressed streams with no container format headers are also supported. In addition, decompression of the B<.lz> format used by B is supported." +msgstr "B este un instrument de comprimare a datelor de uz general cu sintaxă de linie de comandă similară cu B(1) și B(1). Formatul de fișier nativ este formatul B<.xz>, dar formatul vechi B<.lzma> folosit de LZMA Utils și fluxurile comprimate brute fără anteturi de format container sunt de asemenea acceptate. În plus, este acceptată decomprimarea formatului B<.lz> folosit de B." + +#. type: Plain text +#: ../src/xz/xz.1:92 +msgid "B compresses or decompresses each I according to the selected operation mode. If no I are given or I is B<->, B reads from standard input and writes the processed data to standard output. B will refuse (display an error and skip the I) to write compressed data to standard output if it is a terminal. Similarly, B will refuse to read compressed data from standard input if it is a terminal." +msgstr "B comprimă sau decomprimă fiecare I în funcție de modul de operare selectat. Dacă nu sunt date I sau I este B<->, B citește de la intrarea standard și scrie datele procesate la ieșirea standard. B va refuza (afișează o eroare și omite I) să scrie date comprimate la ieșirea standard dacă este un terminal. În mod similar, B va refuza să citească datele comprimate de la intrarea standard dacă este un terminal." + +#. type: Plain text +#: ../src/xz/xz.1:102 +msgid "Unless B<--stdout> is specified, I other than B<-> are written to a new file whose name is derived from the source I name:" +msgstr "Cu excepția cazului în care este specificată opțiunea B<--stdout>, I altele decât B<-> sunt scrise într-un fișier nou al cărui nume este derivat din numele I sursă:" + +#. type: IP +#: ../src/xz/xz.1:102 ../src/xz/xz.1:108 ../src/xz/xz.1:133 ../src/xz/xz.1:138 +#: ../src/xz/xz.1:141 ../src/xz/xz.1:144 ../src/xz/xz.1:160 ../src/xz/xz.1:421 +#: ../src/xz/xz.1:424 ../src/xz/xz.1:431 ../src/xz/xz.1:676 ../src/xz/xz.1:678 +#: ../src/xz/xz.1:777 ../src/xz/xz.1:788 ../src/xz/xz.1:797 ../src/xz/xz.1:805 +#: ../src/xz/xz.1:1033 ../src/xz/xz.1:1042 ../src/xz/xz.1:1054 +#: ../src/xz/xz.1:1729 ../src/xz/xz.1:1735 ../src/xz/xz.1:1853 +#: ../src/xz/xz.1:1857 ../src/xz/xz.1:1860 ../src/xz/xz.1:1863 +#: ../src/xz/xz.1:1867 ../src/xz/xz.1:1874 ../src/xz/xz.1:1876 +#, no-wrap +msgid "\\(bu" +msgstr "\\(bu" + +#. type: Plain text +#: ../src/xz/xz.1:108 +msgid "When compressing, the suffix of the target file format (B<.xz> or B<.lzma>) is appended to the source filename to get the target filename." +msgstr "La comprimare, sufixul formatului de fișier țintă (B<.xz> sau B<.lzma>) este atașat la numele fișierului sursă pentru a se obține numele fișierului țintă." + +#. type: Plain text +#: ../src/xz/xz.1:123 +msgid "When decompressing, the B<.xz>, B<.lzma>, or B<.lz> suffix is removed from the filename to get the target filename. B also recognizes the suffixes B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgstr "La decomprimare, sufixul B<.xz>, B<.lzma> sau B<.lz> este eliminat din numele fișierului pentru a se obține numele fișierului țintă. B recunoaște și sufixele B<.txz> și B<.tlz> și le înlocuiește cu sufixul B<.tar>." + +#. type: Plain text +#: ../src/xz/xz.1:127 +msgid "If the target file already exists, an error is displayed and the I is skipped." +msgstr "Dacă fișierul țintă există deja, este afișată o eroare și I este omis." + +#. type: Plain text +#: ../src/xz/xz.1:133 +msgid "Unless writing to standard output, B will display a warning and skip the I if any of the following applies:" +msgstr "Cu excepția cazului în care scrie la ieșirea standard, B va afișa un avertisment și va omite Iul dacă se aplică oricare dintre următoarele:" + +#. type: Plain text +#: ../src/xz/xz.1:138 +msgid "I is not a regular file. Symbolic links are not followed, and thus they are not considered to be regular files." +msgstr "I nu este un fișier obișnuit. Legăturile simbolice nu sunt urmate și, prin urmare, nu sunt considerate fișiere obișnuite." + +#. type: Plain text +#: ../src/xz/xz.1:141 +msgid "I has more than one hard link." +msgstr "I are mai mult de o legătură dură." + +#. type: Plain text +#: ../src/xz/xz.1:144 +msgid "I has setuid, setgid, or sticky bit set." +msgstr "I are activat bitul «setuid», «setgid» sau cel lipicios(sticky)." + +#. type: Plain text +#: ../src/xz/xz.1:160 +msgid "The operation mode is set to compress and the I already has a suffix of the target file format (B<.xz> or B<.txz> when compressing to the B<.xz> format, and B<.lzma> or B<.tlz> when compressing to the B<.lzma> format)." +msgstr "Modul de operare este stabilit la comprimare și I are deja un sufix al formatului de fișier țintă (B<.xz> sau B<.txz> când se comprimă în formatul B<.xz> și B<.lzma> sau B<.tlz> când se comprimă în formatul B<.lzma>)." + +#. type: Plain text +#: ../src/xz/xz.1:170 +msgid "The operation mode is set to decompress and the I doesn't have a suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz>)." +msgstr "Modul de operare este stabilit la decomprimare și I nu are un sufix al niciunui format de fișier acceptat (B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, sau B<.lz>)." + +#. type: Plain text +#: ../src/xz/xz.1:185 +msgid "After successfully compressing or decompressing the I, B copies the owner, group, permissions, access time, and modification time from the source I to the target file. If copying the group fails, the permissions are modified so that the target file doesn't become accessible to users who didn't have permission to access the source I. B doesn't support copying other metadata like access control lists or extended attributes yet." +msgstr "După comprimarea sau decomprimarea cu succes a I, B copiază proprietarul, grupul, permisiunile, timpul de acces și timpul de modificare din I sursă în fișierul țintă. Dacă copierea grupului eșuează, permisiunile sunt modificate astfel încât fișierul țintă să nu devină accesibil utilizatorilor care nu aveau permisiunea de a accesa I sursă. B nu acceptă încă copierea altor metadate, cum ar fi listele de control al accesului sau atributele extinse." + +#. type: Plain text +#: ../src/xz/xz.1:195 +msgid "Once the target file has been successfully closed, the source I is removed unless B<--keep> was specified. The source I is never removed if the output is written to standard output or if an error occurs." +msgstr "Odată ce fișierul țintă a fost închis cu succes, I sursă este eliminat dacă nu a fost specificată opțiunea B<--keep>. I sursă nu este niciodată eliminat dacă rezultatul este scris la ieșirea standard sau dacă apare o eroare." + +#. type: Plain text +#: ../src/xz/xz.1:207 +msgid "Sending B or B to the B process makes it print progress information to standard error. This has only limited use since when standard error is a terminal, using B<--verbose> will display an automatically updating progress indicator." +msgstr "Trimiterea unui semnal B sau B către procesul B face ca acesta să imprime informații despre progres la ieșirea de eroare standard. Acest lucru are o utilizare limitată, deoarece atunci când ieșirea de eroare standard este un terminal, folosind opțiunea B<--verbose> va afișa un indicator de progres de actualizare automată." + +#. type: SS +#: ../src/xz/xz.1:208 +#, no-wrap +msgid "Memory usage" +msgstr "Utilizarea memoriei" + +# R-GC, scrie: +# nu am respectat forma de-a scrie procentele, +# ale autorilor: „5\ % to 20\ %”; pentru că noi +# folosim forma: „5\% la 20\%”; adică, ceea ce +# va vedea utilizatorul la afișarea acestui mesaj, +# va fi: „5% la 20%”, și nu: „5 % la 20 %” +#. type: Plain text +#: ../src/xz/xz.1:224 +msgid "The memory usage of B varies from a few hundred kilobytes to several gigabytes depending on the compression settings. The settings used when compressing a file determine the memory requirements of the decompressor. Typically the decompressor needs 5\\ % to 20\\ % of the amount of memory that the compressor needed when creating the file. For example, decompressing a file created with B currently requires 65\\ MiB of memory. Still, it is possible to have B<.xz> files that require several gigabytes of memory to decompress." +msgstr "Cantitatea de memorie utilizată de B variază de la câteva sute de kiloocteți la câțiva gigaocteți, în funcție de opțiunile de comprimare. Opțiunile utilizate la comprimarea unui fișier determină cerințele de memorie ale instrumentului de decomprimare. De obicei, instrumentul de decomprimare are nevoie de 5% până la 20% din cantitatea de memorie de care a avut nevoie instrumentul de comprimare la crearea fișierului. De exemplu, decomprimarea unui fișier creat cu B necesită în prezent 65Mio de memorie. Totuși, este posibil să aveți fișiere B<.xz> care necesită câțiva gigaocteți de memorie pentru decomprimare." + +#. type: Plain text +#: ../src/xz/xz.1:236 +msgid "Especially users of older systems may find the possibility of very large memory usage annoying. To prevent uncomfortable surprises, B has a built-in memory usage limiter, which is disabled by default. While some operating systems provide ways to limit the memory usage of processes, relying on it wasn't deemed to be flexible enough (for example, using B(1) to limit virtual memory tends to cripple B(2))." +msgstr "În special utilizatorii de sisteme mai vechi pot considera deranjantă posibilitatea unei utilizări foarte mari a memoriei. Pentru a preveni surprizele neplăcute, B are încorporat un limitator de utilizare a memoriei, care este dezactivat implicit. În timp ce unele sisteme de operare oferă modalități de a limita utilizarea memoriei proceselor, bazarea pe aceasta nu a fost considerată a fi suficient de flexibilă (de exemplu, utilizarea B(1) pentru a limita memoria virtuală tinde să paralizeze B(2))." + +#. type: Plain text +#: ../src/xz/xz.1:258 +msgid "The memory usage limiter can be enabled with the command line option B<--memlimit=>I. Often it is more convenient to enable the limiter by default by setting the environment variable B, for example, B. It is possible to set the limits separately for compression and decompression by using B<--memlimit-compress=>I and B<--memlimit-decompress=>I. Using these two options outside B is rarely useful because a single run of B cannot do both compression and decompression and B<--memlimit=>I (or B<-M> I) is shorter to type on the command line." +msgstr "Limitatorul de utilizare a memoriei poate fi activat cu opțiunea din linia de comandă B<--memlimit=>I. Adesea este mai convenabil să activați limitatorul în mod implicit prin definirea variabilei de mediu B, de exemplu, B. Este posibil să stabiliți limitele separat pentru comprimare și decomprimare folosind B<--memlimit-compress=>I și B<--memlimit-decompress=>I. Utilizarea acestor două opțiuni în afara B este foarte rar utilă, deoarece o singură rulare a B nu poate face atât comprimarea, cât și decomprimarea și B<--memlimit=>I (sau B<-M> I ) este mai scurt de tastat pe linia de comandă." + +#. type: Plain text +#: ../src/xz/xz.1:277 +msgid "If the specified memory usage limit is exceeded when decompressing, B will display an error and decompressing the file will fail. If the limit is exceeded when compressing, B will try to scale the settings down so that the limit is no longer exceeded (except when using B<--format=raw> or B<--no-adjust>). This way the operation won't fail unless the limit is very small. The scaling of the settings is done in steps that don't match the compression level presets, for example, if the limit is only slightly less than the amount required for B, the settings will be scaled down only a little, not all the way down to B." +msgstr "Dacă limita de utilizare a memoriei specificată este depășită la decomprimare, B va afișa o eroare și decomprimarea fișierului va eșua. Dacă limita este depășită la comprimare, B va încerca să reducă valorile stabilite astfel încât limita să nu mai fie depășită (cu excepția cazului în care se utilizează opțiunea B<--format=raw> sau B<--no-adjust>). În acest fel, operațiunea nu va eșua decât dacă limita stabilită este foarte mică. Scalarea valorilor stabilite se face în pași care nu se potrivesc cu valorile prestabilite ale nivelului de comprimare, de exemplu, dacă limita este doar puțin mai mică decât cantitatea necesară pentru B, valorile stabilite vor fi reduse doar puțin , nu până la valoarea prestabilită a lui B." + +#. type: SS +#: ../src/xz/xz.1:278 +#, no-wrap +msgid "Concatenation and padding with .xz files" +msgstr "Concatenare și completare (prin umplere cu octeți nuli) cu fișiere .xz" + +#. type: Plain text +#: ../src/xz/xz.1:286 +msgid "It is possible to concatenate B<.xz> files as is. B will decompress such files as if they were a single B<.xz> file." +msgstr "Este posibil să concatenați fișierele B<.xz> așa cum sunt. B va decomprima astfel de fișiere ca și cum ar fi un singur fișier B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:295 +msgid "It is possible to insert padding between the concatenated parts or after the last part. The padding must consist of null bytes and the size of the padding must be a multiple of four bytes. This can be useful, for example, if the B<.xz> file is stored on a medium that measures file sizes in 512-byte blocks." +msgstr "Este posibil să se introducă umplutură între părțile concatenate sau după ultima parte. Umplutura trebuie să fie compusă din octeți nuli, iar dimensiunea umpluturii trebuie să fie un multiplu de patru octeți. Acest lucru poate fi util, de exemplu, dacă fișierul B<.xz> este stocat pe un mediu care măsoară dimensiunile fișierelor în blocuri de 512 de octeți." + +#. type: Plain text +#: ../src/xz/xz.1:299 +msgid "Concatenation and padding are not allowed with B<.lzma> files or raw streams." +msgstr "Concatenarea și completarea nu sunt permise cu fișierele B<.lzma> sau fluxurile brute." + +#. type: SH +#: ../src/xz/xz.1:300 ../src/xzdec/xzdec.1:61 +#, no-wrap +msgid "OPTIONS" +msgstr "OPȚIUNI" + +#. type: SS +#: ../src/xz/xz.1:302 +#, no-wrap +msgid "Integer suffixes and special values" +msgstr "Sufixe de numere întregi și valori speciale" + +#. type: Plain text +#: ../src/xz/xz.1:306 +msgid "In most places where an integer argument is expected, an optional suffix is supported to easily indicate large integers. There must be no space between the integer and the suffix." +msgstr "În majoritatea locurilor în care este de așteptat un număr întreg ca argument, un sufix opțional este acceptat pentru a indica cu ușurință numerele întregi mari. Nu trebuie să existe spațiu între numărul întreg și sufix." + +#. type: TP +#: ../src/xz/xz.1:306 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:317 +msgid "Multiply the integer by 1,024 (2^10). B, B, B, B, and B are accepted as synonyms for B." +msgstr "Înmulțește numărul întreg cu 1.024 (2^10). B, B, B, B și B sunt acceptate ca sinonime pentru B." + +#. type: TP +#: ../src/xz/xz.1:317 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:327 +msgid "Multiply the integer by 1,048,576 (2^20). B, B, B, and B are accepted as synonyms for B." +msgstr "Înmulțește numărul întreg cu 1,048,576 (2^20). B, B, B, și B sunt acceptate ca sinonime pentru B." + +#. type: TP +#: ../src/xz/xz.1:327 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:337 +msgid "Multiply the integer by 1,073,741,824 (2^30). B, B, B, and B are accepted as synonyms for B." +msgstr "Înmulțește numărul întreg cu 1,073,741,824 (2^30). B, B, B, și B sunt acceptate ca sinonime pentru B." + +#. type: Plain text +#: ../src/xz/xz.1:342 +msgid "The special value B can be used to indicate the maximum integer value supported by the option." +msgstr "Valoarea specială B poate fi utilizată pentru a indica valoarea maximă întreagă suportată de opțiune." + +#. type: SS +#: ../src/xz/xz.1:343 +#, no-wrap +msgid "Operation mode" +msgstr "Mod de operare" + +#. type: Plain text +#: ../src/xz/xz.1:346 +msgid "If multiple operation mode options are given, the last one takes effect." +msgstr "Dacă sunt date mai multe opțiuni de mod de funcționare, ultima dintre ele, este cea care va avea efect." + +#. type: TP +#: ../src/xz/xz.1:346 +#, no-wrap +msgid "B<-z>, B<--compress>" +msgstr "B<-z>, B<--compress>" + +#. type: Plain text +#: ../src/xz/xz.1:355 +msgid "Compress. This is the default operation mode when no operation mode option is specified and no other operation mode is implied from the command name (for example, B implies B<--decompress>)." +msgstr "Comprimare. Acesta este modul de operare implicit atunci când nu este specificată nicio opțiune de mod de funcționare și nici un alt mod de operare nu este implicat din numele comenzii (de exemplu, B implică B<--decompress>)." + +#. type: TP +#: ../src/xz/xz.1:355 ../src/xzdec/xzdec.1:62 +#, no-wrap +msgid "B<-d>, B<--decompress>, B<--uncompress>" +msgstr "B<-d>, B<--decompress>, B<--uncompress>" + +#. type: Plain text +#: ../src/xz/xz.1:358 +msgid "Decompress." +msgstr "Decomprimare." + +#. type: TP +#: ../src/xz/xz.1:358 +#, no-wrap +msgid "B<-t>, B<--test>" +msgstr "B<-t>, B<--test>" + +#. type: Plain text +#: ../src/xz/xz.1:367 +msgid "Test the integrity of compressed I. This option is equivalent to B<--decompress --stdout> except that the decompressed data is discarded instead of being written to standard output. No files are created or removed." +msgstr "Testează integritatea I comprimate. Această opțiune este echivalentă cu B<--decompress --stdout> cu excepția faptului că datele decomprimate sunt înlăturate în loc să fie scrise la ieșirea standard. Nu sunt create sau eliminate fișiere." + +#. type: TP +#: ../src/xz/xz.1:367 +#, no-wrap +msgid "B<-l>, B<--list>" +msgstr "B<-l>, B<--list>" + +#. type: Plain text +#: ../src/xz/xz.1:376 +msgid "Print information about compressed I. No uncompressed output is produced, and no files are created or removed. In list mode, the program cannot read the compressed data from standard input or from other unseekable sources." +msgstr "Afișează informații despre I comprimate. Nu are loc nicio decomprimare la ieșire și nu sunt create sau eliminate fișiere. În modul listă, programul nu poate citi datele comprimate din intrarea standard sau din alte surse care nu pot fi căutate." + +#. type: Plain text +#: ../src/xz/xz.1:391 +msgid "The default listing shows basic information about I, one file per line. To get more detailed information, use also the B<--verbose> option. For even more information, use B<--verbose> twice, but note that this may be slow, because getting all the extra information requires many seeks. The width of verbose output exceeds 80 characters, so piping the output to, for example, B may be convenient if the terminal isn't wide enough." +msgstr "Listarea implicită arată informații de bază despre I, câte un fișier pe linie. Pentru a obține informații mai detaliate, utilizați și opțiunea B<--verbose>. Pentru și mai multe informații, utilizați opțiunea B<--verbose> de două ori, dar rețineți că acest lucru poate fi lent, deoarece obținerea tuturor informațiilor suplimentare necesită multe căutări. Lățimea ieșirii detaliate depășește 80 de caractere, deci canalizarea ieșirii către, de exemplu, B poate fi convenabilă dacă terminalul nu este suficient de lat." + +#. type: Plain text +#: ../src/xz/xz.1:398 +msgid "The exact output may vary between B versions and different locales. For machine-readable output, B<--robot --list> should be used." +msgstr "Ieșirea exactă poate varia între versiunile B și diferitele localizări(configurările regionale). Pentru ieșiri care pot fi citite de mașină, ar trebui utilizată opțiunea B<--robot --list>." + +#. type: SS +#: ../src/xz/xz.1:399 +#, no-wrap +msgid "Operation modifiers" +msgstr "Modificatori de operare" + +#. type: TP +#: ../src/xz/xz.1:400 ../src/xzdec/xzdec.1:69 +#, no-wrap +msgid "B<-k>, B<--keep>" +msgstr "B<-k>, B<--keep>" + +#. type: Plain text +#: ../src/xz/xz.1:403 +msgid "Don't delete the input files." +msgstr "Nu șterge fișierele de intrare." + +#. type: Plain text +#: ../src/xz/xz.1:417 +msgid "Since B 5.2.6, this option also makes B compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file. In earlier versions this was only done with B<--force>." +msgstr "Începând cu B 5.2.6, această opțiune face ca B să comprime sau să decomprime, chiar dacă intrarea este o legătură simbolică către un fișier obișnuit, are mai mult de-o legătură dură sau are marcați biții setuid, setgid sau bitul lipicios. Biții setuid, setgid și bitul lipicios nu sunt copiați în fișierul țintă. În versiunile anterioare acest lucru se făcea numai cu ajutorul opțiunii B<--force>." + +#. type: TP +#: ../src/xz/xz.1:417 +#, no-wrap +msgid "B<-f>, B<--force>" +msgstr "B<-f>, B<--force>" + +#. type: Plain text +#: ../src/xz/xz.1:420 +msgid "This option has several effects:" +msgstr "Această opțiune are mai multe efecte:" + +#. type: Plain text +#: ../src/xz/xz.1:424 +msgid "If the target file already exists, delete it before compressing or decompressing." +msgstr "Dacă fișierul țintă există deja, îl șterge înainte de comprimare sau decomprimare." + +#. type: Plain text +#: ../src/xz/xz.1:431 +msgid "Compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file." +msgstr "Comprimă sau decomprimă chiar dacă intrarea este o legătură simbolică către un fișier obișnuit, are mai mult de-o legătură dură sau are marcați biții setuid, setgid sau bitul lipicios. Biții setuid, setgid și bitul lipicios nu sunt copiați în fișierul țintă." + +#. type: Plain text +#: ../src/xz/xz.1:456 +msgid "When used with B<--decompress> B<--stdout> and B cannot recognize the type of the source file, copy the source file as is to standard output. This allows B B<--force> to be used like B(1) for files that have not been compressed with B. Note that in future, B might support new compressed file formats, which may make B decompress more types of files instead of copying them as is to standard output. B<--format=>I can be used to restrict B to decompress only a single file format." +msgstr "Când este utilizată cu opțiunile B<--decompress> și B<--stdout>, comanda B nu poate recunoaște tipul fișierului sursă, și copiază fișierul sursă așa cum este la ieșirea standard. Acest lucru permite comenzii B B<--force> să fie folosită drept comanda B(1) pentru fișierele care nu au fost comprimate cu B. Rețineți că, în viitor, B ar putea să accepte noi formate de fișiere comprimate, ceea ce poate face ca B să decomprime mai multe tipuri de fișiere în loc să le copieze așa cum sunt la ieșirea standard. Opțiunea B<--format=>I poate fi folosită pentru a restricționa B să decomprime doar un singur format de fișier." + +#. type: TP +#: ../src/xz/xz.1:457 ../src/xzdec/xzdec.1:76 +#, no-wrap +msgid "B<-c>, B<--stdout>, B<--to-stdout>" +msgstr "B<-c>, B<--stdout>, B<--to-stdout>" + +#. type: Plain text +#: ../src/xz/xz.1:463 +msgid "Write the compressed or decompressed data to standard output instead of a file. This implies B<--keep>." +msgstr "Scrie datele comprimate sau decomprimate la ieșirea standard în loc de într-un fișier. Aceasta implică B<--keep>." + +#. type: TP +#: ../src/xz/xz.1:463 +#, no-wrap +msgid "B<--single-stream>" +msgstr "B<--single-stream>" + +#. type: Plain text +#: ../src/xz/xz.1:472 +msgid "Decompress only the first B<.xz> stream, and silently ignore possible remaining input data following the stream. Normally such trailing garbage makes B display an error." +msgstr "Decomprimă numai primul flux B<.xz> și ignoră în tăcere posibilele date de intrare rămase în urma fluxului. În mod normal, astfel de resturi rămase face ca B să afișeze o eroare." + +#. type: Plain text +#: ../src/xz/xz.1:481 +msgid "B never decompresses more than one stream from B<.lzma> files or raw streams, but this option still makes B ignore the possible trailing data after the B<.lzma> file or raw stream." +msgstr "B nu decomprimă niciodată mai mult de un flux din fișierele B<.lzma> sau din fluxurile brute, dar această opțiune face ca B să ignore posibilele resturi de date rămase după fișierul B<.lzma> sau fluxul brut." + +#. type: Plain text +#: ../src/xz/xz.1:486 +msgid "This option has no effect if the operation mode is not B<--decompress> or B<--test>." +msgstr "Această opțiune nu are efect dacă modul de funcționare nu este B<--decompress> sau B<--test>." + +#. type: TP +#: ../src/xz/xz.1:486 +#, no-wrap +msgid "B<--no-sparse>" +msgstr "B<--no-sparse>" + +#. type: Plain text +#: ../src/xz/xz.1:498 +msgid "Disable creation of sparse files. By default, if decompressing into a regular file, B tries to make the file sparse if the decompressed data contains long sequences of binary zeros. It also works when writing to standard output as long as standard output is connected to a regular file and certain additional conditions are met to make it safe. Creating sparse files may save disk space and speed up the decompression by reducing the amount of disk I/O." +msgstr "Dezactivează crearea de fișiere dispersate. În mod implicit, dacă decomprimă într-un fișier obișnuit, B încearcă să facă fișierul dispersat dacă datele decomprimate conțin secvențe lungi de zerouri binare. De asemenea, funcționează atunci când scrie la ieșirea standard, atâta timp cât ieșirea standard este conectată la un fișier obișnuit și sunt îndeplinite anumite condiții suplimentare pentru a o face în siguranță. Crearea de fișiere dispersate poate economisi spațiu pe disc și poate accelera decomprimarea prin reducerea cantității de date de In/Ieș pe disc." + +#. type: TP +#: ../src/xz/xz.1:498 +#, no-wrap +msgid "B<-S> I<.suf>, B<--suffix=>I<.suf>" +msgstr "B<-S> I<.suf>, B<--suffix=>I<.suf>" + +#. type: Plain text +#: ../src/xz/xz.1:510 +msgid "When compressing, use I<.suf> as the suffix for the target file instead of B<.xz> or B<.lzma>. If not writing to standard output and the source file already has the suffix I<.suf>, a warning is displayed and the file is skipped." +msgstr "Când comprimă, utilizează I<.suf> ca sufix pentru fișierul țintă în loc de B<.xz> sau B<.lzma>. Dacă nu scrie la ieșirea standard și fișierul sursă are deja sufixul I<.suf>, este afișat un avertisment și fișierul este omis." + +#. type: Plain text +#: ../src/xz/xz.1:524 +msgid "When decompressing, recognize files with the suffix I<.suf> in addition to files with the B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz> suffix. If the source file has the suffix I<.suf>, the suffix is removed to get the target filename." +msgstr "Când decomprimă, recunoaște fișierele cu sufixul I<.suf> în plus față de fișierele cu sufixul B<.xz>, B<.txz>, B<.lzma>, B<.tlz> sau B<.lz>. Dacă fișierul sursă are sufixul I<.suf>, sufixul este eliminat pentru a obține numele fișierului țintă." + +#. type: Plain text +#: ../src/xz/xz.1:530 +msgid "When compressing or decompressing raw streams (B<--format=raw>), the suffix must always be specified unless writing to standard output, because there is no default suffix for raw streams." +msgstr "La comprimarea sau decomprimarea fluxurilor brute (B<--format=raw>), sufixul trebuie să fie întotdeauna specificat, cu excepția cazului în care se scrie la ieșirea standard, deoarece nu există un sufix implicit pentru fluxurile brute." + +#. type: TP +#: ../src/xz/xz.1:530 +#, no-wrap +msgid "B<--files>[B<=>I]" +msgstr "B<--files>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:544 +msgid "Read the filenames to process from I; if I is omitted, filenames are read from standard input. Filenames must be terminated with the newline character. A dash (B<->) is taken as a regular filename; it doesn't mean standard input. If filenames are given also as command line arguments, they are processed before the filenames read from I." +msgstr "Citește numele fișierelor de procesat din I; dacă I este omis, numele fișierelor sunt citite de la intrarea standard. Numele de fișiere trebuie să fie terminate cu caracterul de linie nouă. O liniuță (B<->) este luată ca nume de fișier obișnuit; nu înseamnă intrarea standard. Dacă numele de fișiere sunt date și ca argumente în linia de comandă, ele sunt procesate înainte ca numele fișierelor să fie citite din I." + +#. type: TP +#: ../src/xz/xz.1:544 +#, no-wrap +msgid "B<--files0>[B<=>I]" +msgstr "B<--files0>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:548 +msgid "This is identical to B<--files>[B<=>I] except that each filename must be terminated with the null character." +msgstr "Această opțiune este identică cu B<--files>[B<=>I], cu excepția faptului că fiecare nume de fișier trebuie să fie terminat cu caracterul nul." + +#. type: SS +#: ../src/xz/xz.1:549 +#, no-wrap +msgid "Basic file format and compression options" +msgstr "Formatul de bază al fișierului și opțiunile de comprimare" + +#. type: TP +#: ../src/xz/xz.1:550 +#, no-wrap +msgid "B<-F> I, B<--format=>I" +msgstr "B<-F> I, B<--format=>I" + +#. type: Plain text +#: ../src/xz/xz.1:555 +msgid "Specify the file I to compress or decompress:" +msgstr "Specifică I fișierului pentru comprimare sau decomprimare:" + +#. type: TP +#: ../src/xz/xz.1:556 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:568 +msgid "This is the default. When compressing, B is equivalent to B. When decompressing, the format of the input file is automatically detected. Note that raw streams (created with B<--format=raw>) cannot be auto-detected." +msgstr "Aceasta este valoarea implicită. La comprimare, B este echivalent cu B. La decomprimare, formatul fișierului de intrare este detectat automat. Rețineți că fluxurile brute (create cu B<--format=raw>) nu pot fi detectate automat." + +#. type: TP +#: ../src/xz/xz.1:568 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:575 +msgid "Compress to the B<.xz> file format, or accept only B<.xz> files when decompressing." +msgstr "Comprimă în formatul de fișier B<.xz> sau acceptă numai fișierele B<.xz> când decomprimă." + +#. type: TP +#: ../src/xz/xz.1:575 +#, no-wrap +msgid "B, B" +msgstr "B, B" + +#. type: Plain text +#: ../src/xz/xz.1:585 +msgid "Compress to the legacy B<.lzma> file format, or accept only B<.lzma> files when decompressing. The alternative name B is provided for backwards compatibility with LZMA Utils." +msgstr "Comprimă în formatul de fișier B<.lzma> vechi sau acceptă numai fișierele B<.lzma> când decomprimă. Numele alternativ B este furnizat pentru compatibilitatea cu versiunile mai vechi de LZMA Utils." + +#. type: TP +#: ../src/xz/xz.1:585 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:591 +msgid "Accept only B<.lz> files when decompressing. Compression is not supported." +msgstr "Acceptă numai fișierele B<.lz> când decomprimă. Comprimarea nu este acceptată." + +#. type: Plain text +#: ../src/xz/xz.1:604 +msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B 1.18." +msgstr "Formatul B<.lz> versiunea 0 și versiunea neextinsă 1 sunt acceptate. Fișierele versiunea 0 au fost produse de B cu versiunea 1.3 sau mai veche. Astfel de fișiere nu sunt obișnuite, dar pot fi găsite în arhivele de fișiere, deoarece câteva pachete sursă au fost lansate în acest format. Oamenii ar putea avea și fișiere personale vechi în acest format. Suportul de decomprimare pentru versiunea de format 0 a fost eliminat în B 1.18." + +#. type: Plain text +#: ../src/xz/xz.1:613 +msgid "B 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B 1.6. This extension is rarely used and isn't supported by B (diagnosed as corrupt input)." +msgstr "B 1.4 și versiunile ulterioare creează fișiere în formatul versiunea 1. Extensia „sync flush marker” pentru versiunea 1 de format a fost adăugată în B 1.6. Această extensie este folosită rar și nu este acceptată de B (diagnosticată ca intrare coruptă)." + +#. type: TP +#: ../src/xz/xz.1:613 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:621 +msgid "Compress or uncompress a raw stream (no headers). This is meant for advanced users only. To decode raw streams, you need use B<--format=raw> and explicitly specify the filter chain, which normally would have been stored in the container headers." +msgstr "Comprimă sau decomprimă un flux brut (fără anteturi). Acest lucru este destinat doar utilizatorilor avansați. Pentru a decodifica fluxurile brute, trebuie să utilizați opțiunea B<--format=raw> și să specificați în mod explicit lanțul de filtre, care în mod normal ar fi fost stocat în anteturile containerului." + +#. type: TP +#: ../src/xz/xz.1:622 +#, no-wrap +msgid "B<-C> I, B<--check=>I" +msgstr "B<-C> I, B<--check=>I" + +#. type: Plain text +#: ../src/xz/xz.1:637 +msgid "Specify the type of the integrity check. The check is calculated from the uncompressed data and stored in the B<.xz> file. This option has an effect only when compressing into the B<.xz> format; the B<.lzma> format doesn't support integrity checks. The integrity check (if any) is verified when the B<.xz> file is decompressed." +msgstr "Specifică tipul verificării integrității. Verificarea este calculată din datele necomprimate și stocată în fișierul B<.xz>. Această opțiune are efect numai la comprimarea în format B<.xz>; formatul B<.lzma> nu acceptă verificări de integritate. Verificarea integrității (dacă există) este efectuată atunci când fișierul B<.xz> este decomprimat." + +#. type: Plain text +#: ../src/xz/xz.1:641 +msgid "Supported I types:" +msgstr "Tipuri de I acceptate:" + +#. type: TP +#: ../src/xz/xz.1:642 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:648 +msgid "Don't calculate an integrity check at all. This is usually a bad idea. This can be useful when integrity of the data is verified by other means anyway." +msgstr "Nu calculează deloc o verificare a integrității. Aceasta este de obicei o idee proastă. Acest lucru poate fi util atunci când integritatea datelor este oricum verificată prin alte mijloace." + +#. type: TP +#: ../src/xz/xz.1:648 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:651 +msgid "Calculate CRC32 using the polynomial from IEEE-802.3 (Ethernet)." +msgstr "Calculează CRC32 folosind polinomul din IEEE-802.3 (Ethernet)." + +#. type: TP +#: ../src/xz/xz.1:651 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:656 +msgid "Calculate CRC64 using the polynomial from ECMA-182. This is the default, since it is slightly better than CRC32 at detecting damaged files and the speed difference is negligible." +msgstr "Calculează CRC64 folosind polinomul din ECMA-182. Aceasta este valoarea implicită, deoarece este ceva mai bună decât CRC32 la detectarea fișierelor deteriorate, iar diferența de viteză este neglijabilă." + +#. type: TP +#: ../src/xz/xz.1:656 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:660 +msgid "Calculate SHA-256. This is somewhat slower than CRC32 and CRC64." +msgstr "Calculează SHA-256. Acest lucru este oarecum mai lent decât CRC32 și CRC64." + +#. type: Plain text +#: ../src/xz/xz.1:666 +msgid "Integrity of the B<.xz> headers is always verified with CRC32. It is not possible to change or disable it." +msgstr "Integritatea antetelor B<.xz> este întotdeauna verificată cu CRC32. Nu este posibilă modificarea sau dezactivarea acesteia." + +#. type: TP +#: ../src/xz/xz.1:666 +#, no-wrap +msgid "B<--ignore-check>" +msgstr "B<--ignore-check>" + +#. type: Plain text +#: ../src/xz/xz.1:672 +msgid "Don't verify the integrity check of the compressed data when decompressing. The CRC32 values in the B<.xz> headers will still be verified normally." +msgstr "Nu efectuează verificarea integrității datelor comprimate la decomprimare. Valorile CRC32 din antetele B<.xz> vor fi însă verificate normal." + +#. type: Plain text +#: ../src/xz/xz.1:675 +msgid "B Possible reasons to use this option:" +msgstr "B Motive posibile pentru a utiliza această opțiune:" + +#. type: Plain text +#: ../src/xz/xz.1:678 +msgid "Trying to recover data from a corrupt .xz file." +msgstr "Încercarea de a recupera datele dintr-un fișier .xz corupt." + +#. type: Plain text +#: ../src/xz/xz.1:684 +msgid "Speeding up decompression. This matters mostly with SHA-256 or with files that have compressed extremely well. It's recommended to not use this option for this purpose unless the file integrity is verified externally in some other way." +msgstr "Accelerarea decomprimării. Acest lucru contează mai ales cu SHA-256 sau cu fișierele care s-au comprimat extrem de bine. Este recomandat să nu utilizați această opțiune în acest scop decât dacă integritatea fișierului este verificată extern într-un alt mod." + +#. type: TP +#: ../src/xz/xz.1:685 +#, no-wrap +msgid "B<-0> ... B<-9>" +msgstr "B<-0> ... B<-9>" + +#. type: Plain text +#: ../src/xz/xz.1:694 +msgid "Select a compression preset level. The default is B<-6>. If multiple preset levels are specified, the last one takes effect. If a custom filter chain was already specified, setting a compression preset level clears the custom filter chain." +msgstr "Selectează un nivel prestabilit de comprimare. Valoarea implicită este B<-6>. Dacă sunt specificate mai multe niveluri prestabilite, ultimul are efect. Dacă a fost deja specificat un lanț de filtre personalizat, specificarea unui nivel prestabilit de comprimare șterge lanțul de filtre personalizat." + +#. type: Plain text +#: ../src/xz/xz.1:709 +msgid "The differences between the presets are more significant than with B(1) and B(1). The selected compression settings determine the memory requirements of the decompressor, thus using a too high preset level might make it painful to decompress the file on an old system with little RAM. Specifically, B like it often is with B(1) and B(1)." +msgstr "Diferențele dintre valorile prestabilite sunt mai semnificative decât cu B(1) și B(1). Valorile de comprimare selectate determină cerințele de memorie ale instrumentului de decomprimare, astfel încât utilizarea unui nivel prea mare prestabilit ar putea face „dureroasă” decomprimarea fișierului pe un sistem vechi cu puțină memorie RAM. Mai exact, B așa cum se întâmplă adesea cu B(1) și B(1)." + +#. type: TP +#: ../src/xz/xz.1:710 +#, no-wrap +msgid "B<-0> ... B<-3>" +msgstr "B<-0> ... B<-3>" + +#. type: Plain text +#: ../src/xz/xz.1:722 +msgid "These are somewhat fast presets. B<-0> is sometimes faster than B while compressing much better. The higher ones often have speed comparable to B(1) with comparable or better compression ratio, although the results depend a lot on the type of data being compressed." +msgstr "Acestea sunt valorile prestabilite oarecum rapide. B<-0> este uneori mai rapid decât B în timp ce comprimă mult mai bine. Cele mai ridicate au adesea viteza comparabilă cu B(1) cu un raport de comprimare comparabil sau mai bun, deși rezultatele depind foarte mult de tipul de date care sunt comprimate." + +#. type: TP +#: ../src/xz/xz.1:722 +#, no-wrap +msgid "B<-4> ... B<-6>" +msgstr "B<-4> ... B<-6>" + +#. type: Plain text +#: ../src/xz/xz.1:736 +msgid "Good to very good compression while keeping decompressor memory usage reasonable even for old systems. B<-6> is the default, which is usually a good choice for distributing files that need to be decompressible even on systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth considering too. See B<--extreme>.)" +msgstr "Comprimare bună spre foarte bună, păstrând în același timp utilizarea memoriei de către instrumentul de decomprimare la un nivel rezonabil chiar și pentru sistemele vechi. B<-6> este valoarea implicită, care este de obicei o alegere bună pentru distribuirea fișierelor care trebuie să poată fi decomprimate chiar și pe sisteme cu doar 16Mio de memorie RAM. Opțiunile (B<-5e> sau B<-6e> ar putea fi demne de luat în considerare. A se vedea opțiunea B<--extreme>.)" + +#. type: TP +#: ../src/xz/xz.1:736 +#, no-wrap +msgid "B<-7 ... -9>" +msgstr "B<-7 ... -9>" + +#. type: Plain text +#: ../src/xz/xz.1:743 +msgid "These are like B<-6> but with higher compressor and decompressor memory requirements. These are useful only when compressing files bigger than 8\\ MiB, 16\\ MiB, and 32\\ MiB, respectively." +msgstr "Acestea sunt precum B<-6>, dar cu cerințe mai mari de memorie pentru comprimare și decomprimare. Acestea sunt utile numai atunci când comprimați fișiere mai mari de 8Mio, 16Mio și, respectiv, 32Mio." + +#. type: Plain text +#: ../src/xz/xz.1:751 +msgid "On the same hardware, the decompression speed is approximately a constant number of bytes of compressed data per second. In other words, the better the compression, the faster the decompression will usually be. This also means that the amount of uncompressed output produced per second can vary a lot." +msgstr "Pe același hardware, viteza de decomprimare este aproximativ un număr constant de octeți de date comprimate pe secundă. Cu alte cuvinte, cu cât comprimarea este mai bună, cu atât decomprimarea va fi de obicei mai rapidă. Aceasta înseamnă, de asemenea, că valoarea de la ieșire a cantității de date necomprimate produsă pe secundă poate varia foarte mult." + +#. type: Plain text +#: ../src/xz/xz.1:753 +msgid "The following table summarises the features of the presets:" +msgstr "Următorul tabel rezumă caracteristicile valorilor prestabilite:" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "Preset" +msgstr "ValPrestab" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DictSize" +msgstr "DimDict" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "CompCPU" +msgstr "CPUComp" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "CompMem" +msgstr "MemComp" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DecMem" +msgstr "MemDec" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#: ../src/xz/xz.1:2840 +#, no-wrap +msgid "-0" +msgstr "-0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:842 ../src/xz/xz.1:2450 +#, no-wrap +msgid "256 KiB" +msgstr "256 KiB" + +#. type: TP +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2840 ../src/scripts/xzgrep.1:82 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:763 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2475 +#, no-wrap +msgid "3 MiB" +msgstr "3 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:762 ../src/xz/xz.1:842 ../src/xz/xz.1:843 +#: ../src/xz/xz.1:2451 ../src/xz/xz.1:2452 ../src/xz/xz.1:2454 +#, no-wrap +msgid "1 MiB" +msgstr "1 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:2451 ../src/xz/xz.1:2476 +#: ../src/xz/xz.1:2841 +#, no-wrap +msgid "-1" +msgstr "-1" + +#. type: TP +#: ../src/xz/xz.1:762 ../src/xz/xz.1:1758 ../src/xz/xz.1:2841 +#: ../src/scripts/xzgrep.1:86 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2476 +#, no-wrap +msgid "9 MiB" +msgstr "9 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:763 ../src/xz/xz.1:843 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2452 ../src/xz/xz.1:2455 ../src/xz/xz.1:2476 +#, no-wrap +msgid "2 MiB" +msgstr "2 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:2452 ../src/xz/xz.1:2477 +#: ../src/xz/xz.1:2842 +#, no-wrap +msgid "-2" +msgstr "-2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:1760 ../src/xz/xz.1:2842 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:768 ../src/xz/xz.1:849 +#: ../src/xz/xz.1:2477 +#, no-wrap +msgid "17 MiB" +msgstr "17 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2453 ../src/xz/xz.1:2478 +#: ../src/xz/xz.1:2843 +#, no-wrap +msgid "-3" +msgstr "-3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:842 ../src/xz/xz.1:845 +#: ../src/xz/xz.1:846 ../src/xz/xz.1:2453 ../src/xz/xz.1:2454 +#: ../src/xz/xz.1:2456 +#, no-wrap +msgid "4 MiB" +msgstr "4 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2843 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2459 ../src/xz/xz.1:2478 +#, no-wrap +msgid "32 MiB" +msgstr "32 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#, no-wrap +msgid "5 MiB" +msgstr "5 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:2454 ../src/xz/xz.1:2479 +#: ../src/xz/xz.1:2844 +#, no-wrap +msgid "-4" +msgstr "-4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:1759 ../src/xz/xz.1:1761 +#: ../src/xz/xz.1:1762 ../src/xz/xz.1:1764 ../src/xz/xz.1:2844 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:2479 +#, no-wrap +msgid "48 MiB" +msgstr "48 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2455 ../src/xz/xz.1:2480 +#: ../src/xz/xz.1:2845 +#, no-wrap +msgid "-5" +msgstr "-5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2455 ../src/xz/xz.1:2456 ../src/xz/xz.1:2457 +#, no-wrap +msgid "8 MiB" +msgstr "8 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2845 +#, no-wrap +msgid "5" +msgstr "5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2480 ../src/xz/xz.1:2481 +#, no-wrap +msgid "94 MiB" +msgstr "94 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:2456 ../src/xz/xz.1:2481 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "-6" +msgstr "-6" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:768 ../src/xz/xz.1:769 ../src/xz/xz.1:770 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "6" +msgstr "6" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:2457 ../src/xz/xz.1:2482 +#, no-wrap +msgid "-7" +msgstr "-7" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2457 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2479 +#, no-wrap +msgid "16 MiB" +msgstr "16 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2482 +#, no-wrap +msgid "186 MiB" +msgstr "186 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:2458 ../src/xz/xz.1:2483 +#, no-wrap +msgid "-8" +msgstr "-8" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2483 +#, no-wrap +msgid "370 MiB" +msgstr "370 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#, no-wrap +msgid "33 MiB" +msgstr "33 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:2459 ../src/xz/xz.1:2484 +#, no-wrap +msgid "-9" +msgstr "-9" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2459 +#, no-wrap +msgid "64 MiB" +msgstr "64 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2484 +#, no-wrap +msgid "674 MiB" +msgstr "674 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 +#, no-wrap +msgid "65 MiB" +msgstr "65 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:776 +msgid "Column descriptions:" +msgstr "Descrieri coloane:" + +#. type: Plain text +#: ../src/xz/xz.1:788 +msgid "DictSize is the LZMA2 dictionary size. It is waste of memory to use a dictionary bigger than the size of the uncompressed file. This is why it is good to avoid using the presets B<-7> ... B<-9> when there's no real need for them. At B<-6> and lower, the amount of memory wasted is usually low enough to not matter." +msgstr "DimDict este dimensiunea dicționarului LZMA2. Este o risipă de memorie să folosești un dicționar mai mare decât dimensiunea fișierului necomprimat. De aceea este bine să evitați utilizarea valorilor prestabilite B<-7> ... B<-9> atunci când nu este nevoie cu adevărat de ele. Pentru valoarea prestabilită B<-6> sau alta mai mică, cantitatea de memorie irosită este de obicei suficient de mică pentru a nu conta." + +#. type: Plain text +#: ../src/xz/xz.1:797 +msgid "CompCPU is a simplified representation of the LZMA2 settings that affect compression speed. The dictionary size affects speed too, so while CompCPU is the same for levels B<-6> ... B<-9>, higher levels still tend to be a little slower. To get even slower and thus possibly better compression, see B<--extreme>." +msgstr "CPUComp este o reprezentare simplificată a configurărilor LZMA2 care afectează viteza de comprimare. Dimensiunea dicționarului afectează și viteza, așa că, în timp ce CPUComp este aceeași pentru nivelurile B<-6> ... B<-9>, nivelurile mai mari tind să fie puțin mai lente. Pentru a obține o comprimare și mai lentă și, astfel, posibil mai bună, consultați opțiunea B<--extreme>." + +#. type: Plain text +#: ../src/xz/xz.1:805 +msgid "CompMem contains the compressor memory requirements in the single-threaded mode. It may vary slightly between B versions. Memory requirements of some of the future multithreaded modes may be dramatically higher than that of the single-threaded mode." +msgstr "MemComp conține cerințele de memorie ale comprimării în modul cu un singur fir de execuție. Poate varia ușor între versiunile B. Cerințele de memorie ale unora dintre viitoarele moduri cu mai multe fire de execuție pot să fie din nefericire cu mult mai mari decât cele ale modului cu un singur fir." + +#. type: Plain text +#: ../src/xz/xz.1:812 +msgid "DecMem contains the decompressor memory requirements. That is, the compression settings determine the memory requirements of the decompressor. The exact decompressor memory usage is slightly more than the LZMA2 dictionary size, but the values in the table have been rounded up to the next full MiB." +msgstr "MemDec conține cerințele de memorie pentru decomprimare. Adică, configurările de comprimare determină cerințele de memorie ale decomprimării. Cantitatea exactă a memoriei utilizate la decomprimare este puțin mai mare decât dimensiunea dicționarului LZMA2, dar valorile din tabel au fost rotunjite la următorul Mio." + +#. type: TP +#: ../src/xz/xz.1:813 +#, no-wrap +msgid "B<-e>, B<--extreme>" +msgstr "B<-e>, B<--extreme>" + +#. type: Plain text +#: ../src/xz/xz.1:822 +msgid "Use a slower variant of the selected compression preset level (B<-0> ... B<-9>) to hopefully get a little bit better compression ratio, but with bad luck this can also make it worse. Decompressor memory usage is not affected, but compressor memory usage increases a little at preset levels B<-0> ... B<-3>." +msgstr "Utilizează o variantă mai lentă a nivelului prestabilit de comprimare selectat (B<-0> ... B<-9>) pentru a obține un raport de comprimare puțin mai bun, dar din nefericire, acest lucru îl poate înrăutăți. Utilizarea memoriei pentru decomprimare nu este afectată, dar utilizarea memoriei la comprimare crește puțin la nivelurile prestabilite B<-0> ... B<-3>." + +#. type: Plain text +#: ../src/xz/xz.1:834 +msgid "Since there are two presets with dictionary sizes 4\\ MiB and 8\\ MiB, the presets B<-3e> and B<-5e> use slightly faster settings (lower CompCPU) than B<-4e> and B<-6e>, respectively. That way no two presets are identical." +msgstr "Deoarece există două valori prestabilite cu dimensiuni ale dicționarului de 4Mio și 8Mio, valorile prestabilite B<-3e> și B<-5e> folosesc configurări puțin mai rapide (CPUComp mai mic) decât B<-4e> și B<-6e>, respectiv. În acest fel, nu există două nivele prestabilite identice." + +#. type: tbl table +#: ../src/xz/xz.1:842 +#, no-wrap +msgid "-0e" +msgstr "-0e" + +#. type: tbl table +#: ../src/xz/xz.1:842 ../src/xz/xz.1:843 ../src/xz/xz.1:844 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:849 ../src/xz/xz.1:850 ../src/xz/xz.1:851 +#: ../src/xz/xz.1:2848 +#, no-wrap +msgid "8" +msgstr "8" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "-1e" +msgstr "-1e" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "13 MiB" +msgstr "13 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "-2e" +msgstr "-2e" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "25 MiB" +msgstr "25 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:845 +#, no-wrap +msgid "-3e" +msgstr "-3e" + +#. type: tbl table +#: ../src/xz/xz.1:845 ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "7" +msgstr "7" + +#. type: tbl table +#: ../src/xz/xz.1:846 +#, no-wrap +msgid "-4e" +msgstr "-4e" + +#. type: tbl table +#: ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "-5e" +msgstr "-5e" + +#. type: tbl table +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2848 +#, no-wrap +msgid "-6e" +msgstr "-6e" + +#. type: tbl table +#: ../src/xz/xz.1:849 +#, no-wrap +msgid "-7e" +msgstr "-7e" + +#. type: tbl table +#: ../src/xz/xz.1:850 +#, no-wrap +msgid "-8e" +msgstr "-8e" + +#. type: tbl table +#: ../src/xz/xz.1:851 +#, no-wrap +msgid "-9e" +msgstr "-9e" + +#. type: Plain text +#: ../src/xz/xz.1:863 +msgid "For example, there are a total of four presets that use 8\\ MiB dictionary, whose order from the fastest to the slowest is B<-5>, B<-6>, B<-5e>, and B<-6e>." +msgstr "De exemplu, există un total de patru nivele prestabilite care folosesc dicționarul 8Mio, a căror ordine de la cel mai rapid la cel mai lent este B<-5>, B<-6>, B<-5e> și B<-6e> ." + +#. type: TP +#: ../src/xz/xz.1:863 +#, no-wrap +msgid "B<--fast>" +msgstr "B<--fast>" + +#. type: TP +#: ../src/xz/xz.1:866 +#, no-wrap +msgid "B<--best>" +msgstr "B<--best>" + +#. type: Plain text +#: ../src/xz/xz.1:877 +msgid "These are somewhat misleading aliases for B<-0> and B<-9>, respectively. These are provided only for backwards compatibility with LZMA Utils. Avoid using these options." +msgstr "Acestea sunt alias de opțiuni, oarecum înșelătoare pentru B<-0> și, respectiv, B<-9>. Acestea sunt furnizate numai pentru compatibilitatea cu LZMA Utils. Evitați utilizarea acestor opțiuni." + +#. type: TP +#: ../src/xz/xz.1:877 +#, no-wrap +msgid "B<--block-size=>I" +msgstr "B<--block-size=>I" + +#. type: Plain text +#: ../src/xz/xz.1:890 +msgid "When compressing to the B<.xz> format, split the input data into blocks of I bytes. The blocks are compressed independently from each other, which helps with multi-threading and makes limited random-access decompression possible. This option is typically used to override the default block size in multi-threaded mode, but this option can be used in single-threaded mode too." +msgstr "Când comprimă în formatul B<.xz>, împarte datele de intrare în blocuri de I octeți. Blocurile sunt comprimate independent unul de celălalt, ceea ce ajută în modul cu mai multe fire de execuție și face posibilă decomprimarea cu acces aleatoriu limitat. Această opțiune este de obicei folosită pentru a suprascrie dimensiunea implicită a blocului în modul cu mai multe fire de execuție, dar această opțiune poate fi folosită și în modul cu un singur fir de execuție." + +#. type: Plain text +#: ../src/xz/xz.1:908 +msgid "In multi-threaded mode about three times I bytes will be allocated in each thread for buffering input and output. The default I is three times the LZMA2 dictionary size or 1 MiB, whichever is more. Typically a good value is 2\\(en4 times the size of the LZMA2 dictionary or at least 1 MiB. Using I less than the LZMA2 dictionary size is waste of RAM because then the LZMA2 dictionary buffer will never get fully used. The sizes of the blocks are stored in the block headers, which a future version of B will use for multi-threaded decompression." +msgstr "În modul cu mai multe fire de execuție, aproximativ de trei ori I de octeți vor fi alocați în fiecare fir pentru stocarea intrării și ieșirii. I implicită este de trei ori dimensiunea dicționarului LZMA2 sau 1Mio, oricare dintre acestea este mai mare. În mod obișnuit, o valoare bună este de două la patru ori dimensiunea dicționarului LZMA2 sau de cel puțin 1Mio. Utilizarea unei I mai mici decât dimensiunea dicționarului LZMA2 este o risipă de memorie RAM, deoarece atunci memoria tampon a dicționarului LZMA2 nu va fi niciodată utilizată pe deplin. Dimensiunile blocurilor sunt stocate în antetele blocurilor, pe care o versiune viitoare a B le va folosi pentru decomprimarea cu mai multe fire de execuție." + +#. type: Plain text +#: ../src/xz/xz.1:917 +msgid "In single-threaded mode no block splitting is done by default. Setting this option doesn't affect memory usage. No size information is stored in block headers, thus files created in single-threaded mode won't be identical to files created in multi-threaded mode. The lack of size information also means that a future version of B won't be able decompress the files in multi-threaded mode." +msgstr "În modul cu un singur fir de execuție, nicio divizare a blocurilor nu se face în mod implicit. Folosirea acestei opțiuni nu afectează utilizarea memoriei. Nu sunt stocate informații despre dimensiune în antetele blocurilor, astfel încât fișierele create în modul cu un singur fir de execuție nu vor fi identice cu fișierele create în modul cu mai multe fire de execuție. Lipsa informațiilor despre dimensiune înseamnă, de asemenea, că o versiune viitoare de B nu va putea decomprima fișierele în modul cu mai multe fire de execuție." + +#. type: TP +#: ../src/xz/xz.1:917 +#, no-wrap +msgid "B<--block-list=>I" +msgstr "B<--block-list=>I" + +#. type: Plain text +#: ../src/xz/xz.1:923 +msgid "When compressing to the B<.xz> format, start a new block after the given intervals of uncompressed data." +msgstr "Atunci când comprimă în formatul B<.xz>, începe un nou bloc după intervalele specificate, de date necomprimate." + +#. type: Plain text +#: ../src/xz/xz.1:929 +msgid "The uncompressed I of the blocks are specified as a comma-separated list. Omitting a size (two or more consecutive commas) is a shorthand to use the size of the previous block." +msgstr "I necomprimate ale blocurilor sunt specificate ca o listă separată prin virgule. Omiterea unei dimensiuni (două sau mai multe virgule consecutive) este o prescurtare pentru a folosi dimensiunea blocului anterior." + +#. type: Plain text +#: ../src/xz/xz.1:939 +msgid "If the input file is bigger than the sum of I, the last value in I is repeated until the end of the file. A special value of B<0> may be used as the last value to indicate that the rest of the file should be encoded as a single block." +msgstr "Dacă fișierul de intrare este mai mare decât suma Ilor, ultima valoare din I se repetă până la sfârșitul fișierului. O valoare specială de B<0> poate fi utilizată ca ultima valoare pentru a indica faptul că restul fișierului ar trebui să fie codificat ca un singur bloc." + +#. type: Plain text +#: ../src/xz/xz.1:954 +msgid "If one specifies I that exceed the encoder's block size (either the default value in threaded mode or the value specified with B<--block-size=>I), the encoder will create additional blocks while keeping the boundaries specified in I. For example, if one specifies B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> and the input file is 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10, and 1 MiB." +msgstr "Dacă se specifică I care depășesc dimensiunea blocului codificatorului (fie valoarea implicită în modul fire de execuție, fie valoarea specificată cu opțiunea B<--block-size=>I), codificatorul va crea blocuri suplimentare păstrând în același timp limitele specificate în I. De exemplu, dacă se specifică B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> iar fișierul de intrare este de 80Mio, se vor obține 11 blocuri de: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10 și 1Mio." + +#. type: Plain text +#: ../src/xz/xz.1:960 +msgid "In multi-threaded mode the sizes of the blocks are stored in the block headers. This isn't done in single-threaded mode, so the encoded output won't be identical to that of the multi-threaded mode." +msgstr "În modul cu mai multe fire de execuție, dimensiunile blocurilor sunt stocate în antetele blocurilor. Acest lucru nu se face în modul cu un singur fir de execuție, astfel încât ieșirea codificată nu va fi identică cu cea a modului cu mai multe fire de execuție." + +#. type: TP +#: ../src/xz/xz.1:960 +#, no-wrap +msgid "B<--flush-timeout=>I" +msgstr "B<--flush-timeout=>I" + +#. type: Plain text +#: ../src/xz/xz.1:977 +msgid "When compressing, if more than I milliseconds (a positive integer) has passed since the previous flush and reading more input would block, all the pending input data is flushed from the encoder and made available in the output stream. This can be useful if B is used to compress data that is streamed over a network. Small I values make the data available at the receiving end with a small delay, but large I values give better compression ratio." +msgstr "La comprimare, dacă au trecut mai mult de I milisecunde (un întreg pozitiv) de la curățarea anterioară și citirea mai multor intrări s-ar bloca, toate datele de intrare în așteptare sunt eliminate din codificator și puse la dispoziție în fluxul de ieșire. Acest lucru poate să fie util dacă B este utilizat pentru a comprima datele care sunt transmise în flux printr-o rețea. Valorile mici de I fac datele disponibile la capătul de recepție cu o mică întârziere, dar valorile mari de I oferă un raport de comprimare mai bun." + +#. type: Plain text +#: ../src/xz/xz.1:985 +msgid "This feature is disabled by default. If this option is specified more than once, the last one takes effect. The special I value of B<0> can be used to explicitly disable this feature." +msgstr "Această caracteristică este dezactivată în mod implicit. Dacă această opțiune este specificată de mai multe ori, ultima este cea care se ia în considerare. Valoarea specială a lui I de B<0>, poate fi utilizată pentru a dezactiva în mod explicit această caracteristică." + +#. type: Plain text +#: ../src/xz/xz.1:987 +msgid "This feature is not available on non-POSIX systems." +msgstr "Această caracteristică nu este disponibilă în sistemele non-POSIX." + +#. FIXME +#. type: Plain text +#: ../src/xz/xz.1:995 +msgid "B Currently B is unsuitable for decompressing the stream in real time due to how B does buffering." +msgstr "B În prezent, B este nepotrivit pentru decomprimarea fluxului în timp real datorită modului în care B utilizează memoria tampon." + +#. type: TP +#: ../src/xz/xz.1:995 +#, no-wrap +msgid "B<--memlimit-compress=>I" +msgstr "B<--memlimit-compress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1000 +msgid "Set a memory usage limit for compression. If this option is specified multiple times, the last one takes effect." +msgstr "Stabilește o limită de utilizare a memoriei pentru comprimare. Dacă această opțiune este specificată de mai multe ori, ultima va avea efect." + +#. type: Plain text +#: ../src/xz/xz.1:1013 +msgid "If the compression settings exceed the I, B will attempt to adjust the settings downwards so that the limit is no longer exceeded and display a notice that automatic adjustment was done. The adjustments are done in this order: reducing the number of threads, switching to single-threaded mode if even one thread in multi-threaded mode exceeds the I, and finally reducing the LZMA2 dictionary size." +msgstr "Dacă parametrii de comprimare depășesc I, B va încerca să ajusteze parametrii scăzând valorile acestora, astfel încât limita să nu mai fie depășită și va afișa o notificare că ajustarea automată a fost efectuată. Ajustările se fac în această ordine: reducerea numărului de fire, trecerea la modul un singur fir de execuție dacă chiar și un singur fir în modul cu mai multe fire de execuție depășește I și, în final, reducerea dimensiunii dicționarului LZMA2." + +#. type: Plain text +#: ../src/xz/xz.1:1021 +msgid "When compressing with B<--format=raw> or if B<--no-adjust> has been specified, only the number of threads may be reduced since it can be done without affecting the compressed output." +msgstr "Când comprimă cu opțiunea B<--format=raw> sau dacă a fost specificată opțiunea B<--no-adjust>, numai numărul de fire poate fi redus, deoarece se poate face fără a afecta rezultatul comprimării." + +#. type: Plain text +#: ../src/xz/xz.1:1028 +msgid "If the I cannot be met even with the adjustments described above, an error is displayed and B will exit with exit status 1." +msgstr "Dacă I nu poate fi îndeplinită chiar și cu ajustările descrise mai sus, este afișată o eroare și B va ieși cu starea de ieșire 1." + +#. type: Plain text +#: ../src/xz/xz.1:1032 +msgid "The I can be specified in multiple ways:" +msgstr "I poate fi specificata în mai multe moduri:" + +#. type: Plain text +#: ../src/xz/xz.1:1042 +msgid "The I can be an absolute value in bytes. Using an integer suffix like B can be useful. Example: B<--memlimit-compress=80MiB>" +msgstr "I poate fi o valoare absolută în octeți. Utilizarea unui sufix întreg precum B poate fi utilă. De exemplu: B<--memlimit-compress=80MiB>" + +#. type: Plain text +#: ../src/xz/xz.1:1054 +msgid "The I can be specified as a percentage of total physical memory (RAM). This can be useful especially when setting the B environment variable in a shell initialization script that is shared between different computers. That way the limit is automatically bigger on systems with more memory. Example: B<--memlimit-compress=70%>" +msgstr "I poate fi specificată ca procent din memoria fizică totală (RAM). Acest lucru poate fi util mai ales atunci când definiți variabila de mediu B într-un script de inițializare shell care este partajat între diferite calculatoare. În acest fel, limita este automat mai mare pe sistemele cu mai multă memorie. De exemplu: B<--memlimit-compress=70%>" + +#. type: Plain text +#: ../src/xz/xz.1:1064 +msgid "The I can be reset back to its default value by setting it to B<0>. This is currently equivalent to setting the I to B (no memory usage limit)." +msgstr "I poate fi restabilită la valoarea implicită dându-i valoarea B<0>. În prezent, aceasta este echivalentă cu stabilirea I la B (fără limită de utilizare a memoriei)." + +#. type: Plain text +#: ../src/xz/xz.1:1088 +msgid "For 32-bit B there is a special case: if the I would be over B<4020\\ MiB>, the I is set to B<4020\\ MiB>. On MIPS32 B<2000\\ MiB> is used instead. (The values B<0> and B aren't affected by this. A similar feature doesn't exist for decompression.) This can be helpful when a 32-bit executable has access to 4\\ GiB address space (2 GiB on MIPS32) while hopefully doing no harm in other situations." +msgstr "Pentru B pe 32 de biți există un caz special: dacă I ar fi peste B<4020MiB>, I este stabilită la B<4020MiB>. Pe MIPS32 este stabilită în schimb la B<2000MiB>. (Valorile B<0> și B nu sunt afectate de acest lucru. O caracteristică similară nu există pentru decomprimare.) Acest lucru poate fi util atunci când un executabil pe 32 de biți are acces la un spațiu de adrese de 4Gio (2Gio pe MIPS32), se speră că nu produce daune în alte situații." + +#. type: Plain text +#: ../src/xz/xz.1:1091 +msgid "See also the section B." +msgstr "Consultați și secțiunea B." + +#. type: TP +#: ../src/xz/xz.1:1091 +#, no-wrap +msgid "B<--memlimit-decompress=>I" +msgstr "B<--memlimit-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1105 +msgid "Set a memory usage limit for decompression. This also affects the B<--list> mode. If the operation is not possible without exceeding the I, B will display an error and decompressing the file will fail. See B<--memlimit-compress=>I for possible ways to specify the I." +msgstr "Stabilește o limită de utilizare a memoriei pentru decomprimare. Acest lucru afectează și modul B<--list>. Dacă operațiunea nu este posibilă fără a depăși I, B va afișa o eroare și decomprimarea fișierului va eșua. Consultați B<--memlimit-compress=>I pentru modalitățile posibile de a specifica I." + +#. type: TP +#: ../src/xz/xz.1:1105 +#, no-wrap +msgid "B<--memlimit-mt-decompress=>I" +msgstr "B<--memlimit-mt-decompress=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1127 +msgid "Set a memory usage limit for multi-threaded decompression. This can only affect the number of threads; this will never make B refuse to decompress a file. If I is too low to allow any multi-threading, the I is ignored and B will continue in single-threaded mode. Note that if also B<--memlimit-decompress> is used, it will always apply to both single-threaded and multi-threaded modes, and so the effective I for multi-threading will never be higher than the limit set with B<--memlimit-decompress>." +msgstr "Stabilește o limită de utilizare a memoriei pentru decomprimarea cu mai multe fire de execuție. Acest lucru poate afecta doar numărul de fire de execuție; acest lucru nu îl va face niciodată pe B să refuze decomprimarea unui fișier. Dacă I este prea scăzută pentru a permite orice mod cu mai multe fire de execuție, I este ignorată și B va continua în modul cu un singur fir de execuție. Rețineți că, dacă se folosește și opțiunea B<--memlimit-decompress>, se va aplica întotdeauna atât modurilor cu un singur fir de execuție, cât și modurilor cu mai multe fire de execuție și astfel I efectivă pentru modul cu mai multe fire de execuție nu va fi niciodată mai mare decât limita stabilită cu opțiunea B<--memlimit-decompress>." + +#. type: Plain text +#: ../src/xz/xz.1:1134 +msgid "In contrast to the other memory usage limit options, B<--memlimit-mt-decompress=>I has a system-specific default I. B can be used to see the current value." +msgstr "Spre deosebire de celelalte opțiuni de limită de utilizare a memoriei, opțiunea B<--memlimit-mt-decompress=>I are o I implicită specifică sistemului. Comanda B poate fi folosită pentru a vedea valoarea curentă." + +#. type: Plain text +#: ../src/xz/xz.1:1150 +msgid "This option and its default value exist because without any limit the threaded decompressor could end up allocating an insane amount of memory with some input files. If the default I is too low on your system, feel free to increase the I but never set it to a value larger than the amount of usable RAM as with appropriate input files B will attempt to use that amount of memory even with a low number of threads. Running out of memory or swapping will not improve decompression performance." +msgstr "Această opțiune și valoarea ei implicită există deoarece, fără nicio limită, decomprimarea cu (mai multe) fire de execuție ar putea ajunge să aloce o cantitate „nebună” de memorie cu unele fișiere de intrare. Dacă I implicită este prea scăzută pe sistemul dumneavoastră, nu ezitați să creșteți I, dar niciodată să nu o stabiliți la o valoare mai mare decât cantitatea de memorie RAM utilizabilă și cu niște fișiere de intrare adecvate, B va încerca să utilizeze acea cantitate de memorie chiar și cu un număr redus de fire de execuție. Rularea lui B cu depășirea cantității de memorie fizice(RAM) sau a celei de interschimb(swap) nu va îmbunătăți performanța de decomprimare." + +#. type: Plain text +#: ../src/xz/xz.1:1162 +msgid "See B<--memlimit-compress=>I for possible ways to specify the I. Setting I to B<0> resets the I to the default system-specific value." +msgstr "Consultați opțiunea B<--memlimit-compress=>I pentru modalități posibile de a specifica I. Stabilirea I la B<0> restabilește I la valoarea implicită specifică sistemului." + +#. type: TP +#: ../src/xz/xz.1:1163 +#, no-wrap +msgid "B<-M> I, B<--memlimit=>I, B<--memory=>I" +msgstr "B<-M> I, B<--memlimit=>I, B<--memory=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1169 +msgid "This is equivalent to specifying B<--memlimit-compress=>I B<--memlimit-decompress=>I B<--memlimit-mt-decompress=>I." +msgstr "Aceasta este echivalentă cu specificarea opțiunilor: B<--memlimit-compress=>I B<--memlimit-decompress=>I B<--memlimit-mt-decompress=>I." + +#. type: TP +#: ../src/xz/xz.1:1169 +#, no-wrap +msgid "B<--no-adjust>" +msgstr "B<--no-adjust>" + +#. type: Plain text +#: ../src/xz/xz.1:1179 +msgid "Display an error and exit if the memory usage limit cannot be met without adjusting settings that affect the compressed output. That is, this prevents B from switching the encoder from multi-threaded mode to single-threaded mode and from reducing the LZMA2 dictionary size. Even when this option is used the number of threads may be reduced to meet the memory usage limit as that won't affect the compressed output." +msgstr "Afișează o eroare și iese dacă limita de utilizare a memoriei nu poate fi îndeplinită fără ajustarea parametrilor care afectează ieșirea comprimată. Adică, acest lucru împiedică B să comute codificatorul din modul cu mai multe fire de execuție în modul cu un singur fir de execuție și să reducă dimensiunea dicționarului LZMA2. Chiar și atunci când această opțiune este utilizată, numărul de fire de execuție poate fi redus pentru a îndeplini limita de utilizare a memoriei, deoarece aceasta nu va afecta comprimarea." + +#. type: Plain text +#: ../src/xz/xz.1:1182 +msgid "Automatic adjusting is always disabled when creating raw streams (B<--format=raw>)." +msgstr "Ajustarea automată este întotdeauna dezactivată la crearea fluxurilor brute (B<--format=raw>)." + +#. type: TP +#: ../src/xz/xz.1:1182 +#, no-wrap +msgid "B<-T> I, B<--threads=>I" +msgstr "B<-T> I, B<--threads=>I" + +#. type: Plain text +#: ../src/xz/xz.1:1197 +msgid "Specify the number of worker threads to use. Setting I to a special value B<0> makes B use up to as many threads as the processor(s) on the system support. The actual number of threads can be fewer than I if the input file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit." +msgstr "Specifică numărul de fire de execuție de utilizat. Stabilirea I la valoarea specială B<0>, face ca B să utilizeze până la atâtea fire de execuție câte procesoare sunt în sistem. Numărul real de fire de execuție poate fi mai mic decât I dacă fișierul de intrare nu este suficient de mare pentru a trece la modul cu mai multe fire de execuție cu parametrii dați, sau dacă folosirea mai multor fire de execuție ar depăși limita de utilizare a memoriei." + +#. type: Plain text +#: ../src/xz/xz.1:1216 +msgid "The single-threaded and multi-threaded compressors produce different output. Single-threaded compressor will give the smallest file size but only the output from the multi-threaded compressor can be decompressed using multiple threads. Setting I to B<1> will use the single-threaded mode. Setting I to any other value, including B<0>, will use the multi-threaded compressor even if the system supports only one hardware thread. (B 5.2.x used single-threaded mode in this situation.)" +msgstr "Operațiile de comprimare cu un singur fir de execuție și cele cu mai multe fire de execuție produc ieșiri diferite. Comprimarea cu un singur fir de execuție va oferi cea mai mică dimensiune a fișierului, dar numai ieșirea de la comprimarea cu mai multe fire de execuție poate fi decomprimată folosind mai multe fire. Stabilirea I la B<1> va determina ca B să folosească modul cu un singur fir de execuție. Stabilirea I la orice altă valoare, inclusiv B<0>, va determina ca B să folosească comprimarea cu mai multe fire de execuție chiar dacă sistemul acceptă doar un fir hardware. (B 5.2.x folosește modul cu un singur fir de execuție în această situație.)" + +#. type: Plain text +#: ../src/xz/xz.1:1235 +msgid "To use multi-threaded mode with only one thread, set I to B<+1>. The B<+> prefix has no effect with values other than B<1>. A memory usage limit can still make B switch to single-threaded mode unless B<--no-adjust> is used. Support for the B<+> prefix was added in B 5.4.0." +msgstr "Pentru a utiliza modul cu mai multe fire de execuție cu un singur fir, stabiliți I la B<+1>. Prefixul B<+> nu are efect cu alte valori decât B<1>. O limită de utilizare a memoriei poate face în continuare B să treacă în modul cu un singur fir, cu excepția cazului în care este utilizată opțiunea B<--no-adjust>. Suportul pentru prefixul B<+> a fost adăugat în B 5.4.0." + +#. type: Plain text +#: ../src/xz/xz.1:1250 +msgid "If an automatic number of threads has been requested and no memory usage limit has been specified, then a system-specific default soft limit will be used to possibly limit the number of threads. It is a soft limit in sense that it is ignored if the number of threads becomes one, thus a soft limit will never stop B from compressing or decompressing. This default soft limit will not make B switch from multi-threaded mode to single-threaded mode. The active limits can be seen with B." +msgstr "Dacă a fost solicitat un număr automat de fire și nu a fost specificată nicio limită de utilizare a memoriei, atunci o limită „maleabilă” implicită specifică sistemului va fi utilizată pentru a limita eventual numărul de fire de execuție. Este o limită „maleabilă” în sensul că este ignorată dacă numărul de fire devine unul, astfel o limită „maleabilă” nu va opri niciodată B să comprime sau să decomprime. Această limită „maleabilă” implicită nu va face B să treacă de la modul cu mai multe fire de execuție la modul cu un singur fir de execuție. Limitele active pot fi văzute rulând comanda B." + +#. type: Plain text +#: ../src/xz/xz.1:1257 +msgid "Currently the only threading method is to split the input into blocks and compress them independently from each other. The default block size depends on the compression level and can be overridden with the B<--block-size=>I option." +msgstr "În prezent, singura metodă de procesare cu fire de execuție este împărțirea intrării în blocuri și comprimarea lor independent unul de celălalt. Dimensiunea implicită a blocului depinde de nivelul de comprimare și poate fi înlocuită cu opțiunea B<--block-size=>I." + +#. type: Plain text +#: ../src/xz/xz.1:1265 +msgid "Threaded decompression only works on files that contain multiple blocks with size information in block headers. All large enough files compressed in multi-threaded mode meet this condition, but files compressed in single-threaded mode don't even if B<--block-size=>I has been used." +msgstr "Decomprimarea cu fire de execuție funcționează numai pe fișierele care conțin mai multe blocuri cu informații despre dimensiune în antetele blocurilor. Toate fișierele suficient de mari comprimate în modul cu mai multe fire de execuție îndeplinesc această condiție, dar fișierele comprimate în modul cu un singur fir de execuție nu o îndeplinesc chiar dacă a fost folosită opțiunea B<--block-size=>I." + +#. type: SS +#: ../src/xz/xz.1:1266 ../src/xz/xz.1:2819 +#, no-wrap +msgid "Custom compressor filter chains" +msgstr "Lanțuri de filtrare personalizate pentru instrumentul de comprimare" + +#. type: Plain text +#: ../src/xz/xz.1:1282 +msgid "A custom filter chain allows specifying the compression settings in detail instead of relying on the settings associated to the presets. When a custom filter chain is specified, preset options (B<-0> \\&...\\& B<-9> and B<--extreme>) earlier on the command line are forgotten. If a preset option is specified after one or more custom filter chain options, the new preset takes effect and the custom filter chain options specified earlier are forgotten." +msgstr "Un lanț de filtrare personalizat permite specificarea parametrilor de comprimare în detaliu, în loc să se bazeze pe cei asociați opțiunilor prestabilite. Când este specificat un lanț de filtrare personalizat, opțiunile prestabilite (B<-0> \\&...\\& B<-9> și B<--extreme>) de mai devreme din linia de comandă sunt uitate. Dacă o opțiune prestabilită este specificată după una sau mai multe opțiuni de lanț de filtrare personalizat, noua prestabilire intră în vigoare și opțiunile lanțului de filtrare personalizat, specificate mai devreme sunt uitate." + +#. type: Plain text +#: ../src/xz/xz.1:1289 +msgid "A filter chain is comparable to piping on the command line. When compressing, the uncompressed input goes to the first filter, whose output goes to the next filter (if any). The output of the last filter gets written to the compressed file. The maximum number of filters in the chain is four, but typically a filter chain has only one or two filters." +msgstr "Un lanț de filtrare este comparabil cu conductele din linia de comandă. La comprimare, intrarea necomprimată merge la primul filtru, a cărui ieșire merge la următorul filtru (dacă există). Ieșirea ultimului filtru este scrisă în fișierul comprimat. Numărul maxim de filtre din lanț este de patru, dar de obicei un lanț de filtrare are doar unul sau două filtre." + +#. type: Plain text +#: ../src/xz/xz.1:1297 +msgid "Many filters have limitations on where they can be in the filter chain: some filters can work only as the last filter in the chain, some only as a non-last filter, and some work in any position in the chain. Depending on the filter, this limitation is either inherent to the filter design or exists to prevent security issues." +msgstr "Multe filtre au limitări în ceea ce privește locul în care se pot afla în lanțul de filtrare: unele filtre pot funcționa doar ca ultimul filtru din lanț, altele doar ca non-ultim filtru și unele funcționează în orice poziție din lanț. În funcție de filtru, această limitare este fie inerentă proiectării filtrului, fie există pentru a preveni problemele de securitate." + +#. type: Plain text +#: ../src/xz/xz.1:1305 +msgid "A custom filter chain is specified by using one or more filter options in the order they are wanted in the filter chain. That is, the order of filter options is significant! When decoding raw streams (B<--format=raw>), the filter chain is specified in the same order as it was specified when compressing." +msgstr "Un lanț de filtrare personalizat este specificat utilizând una sau mai multe opțiuni de filtrare în ordinea în care sunt cerute în lanțul de filtrare. Adică, ordinea opțiunilor de filtrare este semnificativă! La decodificarea fluxurilor brute (B<--format=raw>), lanțul de filtrare este specificat în aceeași ordine în care a fost specificat la comprimare." + +#. type: Plain text +#: ../src/xz/xz.1:1314 +msgid "Filters take filter-specific I as a comma-separated list. Extra commas in I are ignored. Every option has a default value, so you need to specify only those you want to change." +msgstr "Filtrele iau I specifice filtrului ca o listă separată prin virgule. Virgulele suplimentare din I sunt ignorate. Fiecare opțiune are o valoare implicită, așa că trebuie să specificați numai cele pe care doriți să le modificați." + +#. type: Plain text +#: ../src/xz/xz.1:1323 +msgid "To see the whole filter chain and I, use B (that is, use B<--verbose> twice). This works also for viewing the filter chain options used by presets." +msgstr "Pentru a vedea întregul lanț de filtre și I, utilizați B (adică folosiți B<--verbose> de două ori). Acest lucru funcționează și pentru vizualizarea opțiunilor lanțului de filtre utilizate de valorile prestabilite." + +#. type: TP +#: ../src/xz/xz.1:1323 +#, no-wrap +msgid "B<--lzma1>[B<=>I]" +msgstr "B<--lzma1>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1326 +#, no-wrap +msgid "B<--lzma2>[B<=>I]" +msgstr "B<--lzma2>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1331 +msgid "Add LZMA1 or LZMA2 filter to the filter chain. These filters can be used only as the last filter in the chain." +msgstr "Adaugă filtrul LZMA1 sau LZMA2 la lanțul de filtre. Aceste filtre pot fi folosite doar ca ultimul filtru din lanț." + +#. type: Plain text +#: ../src/xz/xz.1:1343 +msgid "LZMA1 is a legacy filter, which is supported almost solely due to the legacy B<.lzma> file format, which supports only LZMA1. LZMA2 is an updated version of LZMA1 to fix some practical issues of LZMA1. The B<.xz> format uses LZMA2 and doesn't support LZMA1 at all. Compression speed and ratios of LZMA1 and LZMA2 are practically the same." +msgstr "LZMA1 este un filtru vechi, care este acceptat aproape exclusiv datorită formatului de fișier vechi B<.lzma>, care acceptă numai LZMA1. LZMA2 este o versiune actualizată a LZMA1 pentru a rezolva unele probleme practice ale LZMA1. Formatul B<.xz> folosește LZMA2 și nu acceptă deloc LZMA1. Viteza de comprimare și rapoartele LZMA1 și LZMA2 sunt practic aceleași." + +#. type: Plain text +#: ../src/xz/xz.1:1346 +msgid "LZMA1 and LZMA2 share the same set of I:" +msgstr "LZMA1 și LZMA2 au același set de I:" + +#. type: TP +#: ../src/xz/xz.1:1347 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1374 +msgid "Reset all LZMA1 or LZMA2 I to I. I consist of an integer, which may be followed by single-letter preset modifiers. The integer can be from B<0> to B<9>, matching the command line options B<-0> \\&...\\& B<-9>. The only supported modifier is currently B, which matches B<--extreme>. If no B is specified, the default values of LZMA1 or LZMA2 I are taken from the preset B<6>." +msgstr "Reconfigurează toate I LZMA1 sau LZMA2 la I. I constă dintr-un număr întreg, care poate fi urmat de modificatori prestabiliți cu o singură literă. Numărul întreg poate fi de la B<0> la B<9>, potrivindu-se cu opțiunile liniei de comandă B<-0> \\&...\\& B<-9>. Singurul modificator acceptat în prezent este B, care se potrivește cu B<--extreme>. Dacă nu este specificat B, valorile implicite ale I LZMA1 sau LZMA2 sunt preluate din prestabilirea B<6>." + +#. type: TP +#: ../src/xz/xz.1:1374 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1389 +msgid "Dictionary (history buffer) I indicates how many bytes of the recently processed uncompressed data is kept in memory. The algorithm tries to find repeating byte sequences (matches) in the uncompressed data, and replace them with references to the data currently in the dictionary. The bigger the dictionary, the higher is the chance to find a match. Thus, increasing dictionary I usually improves compression ratio, but a dictionary bigger than the uncompressed file is waste of memory." +msgstr "I dicționarului (istoricul memoriei tampon) indică câți octeți din datele necomprimate recent procesate sunt păstrați în memorie. Algoritmul încearcă să găsească secvențe de octeți care se repetă (potriviri) în datele necomprimate și să le înlocuiască cu referințe la datele aflate în prezent în dicționar. Cu cât dicționarul este mai mare, cu atât este mai mare șansa de a găsi o potrivire. Astfel, creșterea I dicționarului îmbunătățește de obicei raportul de comprimare, dar un dicționar mai mare decât fișierul necomprimat este risipă de memorie." + +#. type: Plain text +#: ../src/xz/xz.1:1398 +msgid "Typical dictionary I is from 64\\ KiB to 64\\ MiB. The minimum is 4\\ KiB. The maximum for compression is currently 1.5\\ GiB (1536\\ MiB). The decompressor already supports dictionaries up to one byte less than 4\\ GiB, which is the maximum for the LZMA1 and LZMA2 stream formats." +msgstr "Itipică a dicționarului este de la 64Kio până la 64Mio. Minimul este de 4Kio. Maximul pentru compresie este în prezent de 1,5Gio (1536Mio). Decomprimarea acceptă deja dicționare cu până la un octet mai puțin de 4Gio, care este maximul pentru formatele de flux LZMA1 și LZMA2." + +#. type: Plain text +#: ../src/xz/xz.1:1425 +msgid "Dictionary I and match finder (I) together determine the memory usage of the LZMA1 or LZMA2 encoder. The same (or bigger) dictionary I is required for decompressing that was used when compressing, thus the memory usage of the decoder is determined by the dictionary size used when compressing. The B<.xz> headers store the dictionary I either as 2^I or 2^I + 2^(I-1), so these I are somewhat preferred for compression. Other I will get rounded up when stored in the B<.xz> headers." +msgstr "I dicționarului și găsitorul de potriviri (match finder) → (I) determină împreună utilizarea memoriei de către codificatorul LZMA1 sau LZMA2. Aceeași I a dicționarului (sau mai mare) care a fost utilizată la comprimare, este necesară pentru decomprimare, astfel încât utilizarea memoriei de către decodificator este determinată de dimensiunea dicționarului utilizată la comprimare. Antetele B<.xz> stochează I dicționarului fie ca 2^I, fie ca 2^I + 2^(I-1), deci aceste I sunt oarecum preferate pentru comprimare. Alte I vor fi rotunjite atunci când sunt stocate în anteturile B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:1425 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1434 +msgid "Specify the number of literal context bits. The minimum is 0 and the maximum is 4; the default is 3. In addition, the sum of I and I must not exceed 4." +msgstr "Specifică numărul de biți de context literal. Minimul este 0 și maximul este 4; implicit este 3. În plus, suma I și I nu trebuie să depășească 4." + +#. type: Plain text +#: ../src/xz/xz.1:1439 +msgid "All bytes that cannot be encoded as matches are encoded as literals. That is, literals are simply 8-bit bytes that are encoded one at a time." +msgstr "Toți octeții care nu pot fi codificați ca potriviri sunt codificați ca literali. Adică, literalii sunt pur și simplu octeți de 8 biți care sunt codificați unul câte unul." + +#. type: Plain text +#: ../src/xz/xz.1:1453 +msgid "The literal coding makes an assumption that the highest I bits of the previous uncompressed byte correlate with the next byte. For example, in typical English text, an upper-case letter is often followed by a lower-case letter, and a lower-case letter is usually followed by another lower-case letter. In the US-ASCII character set, the highest three bits are 010 for upper-case letters and 011 for lower-case letters. When I is at least 3, the literal coding can take advantage of this property in the uncompressed data." +msgstr "Codificarea literală presupune că cei mai mari biți I ai octetului anterior necomprimat se corelează cu octetul următor. De exemplu, în textul tipic englezesc, o literă mare este adesea urmată de o literă mică, iar o literă mică este urmată de obicei de o altă literă mică. În setul de caractere US-ASCII, cei mai mari trei biți sunt 010 pentru literele mari și 011 pentru literele mici. Când I este cel puțin 3, codificarea literală poate profita de această proprietate în datele necomprimate." + +#. type: Plain text +#: ../src/xz/xz.1:1462 +msgid "The default value (3) is usually good. If you want maximum compression, test B. Sometimes it helps a little, and sometimes it makes compression worse. If it makes it worse, test B too." +msgstr "Valoarea implicită (3) este de obicei bună. Dacă doriți o comprimare maximă, testați B. Uneori ajută puțin, iar uneori înrăutățește comprimarea . Dacă o agravează, încercați de-asemeni cu B." + +#. type: TP +#: ../src/xz/xz.1:1462 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1466 +msgid "Specify the number of literal position bits. The minimum is 0 and the maximum is 4; the default is 0." +msgstr "Specifică numărul de biți de poziție literală. Minimul este 0 și maximul este 4; implicit este 0." + +#. type: Plain text +#: ../src/xz/xz.1:1473 +msgid "I affects what kind of alignment in the uncompressed data is assumed when encoding literals. See I below for more information about alignment." +msgstr "I afectează ce fel de aliniere în datele necomprimate este presupusă la codificarea literalelor. Consultați argumentul I de mai jos pentru mai multe informații despre aliniere." + +#. type: TP +#: ../src/xz/xz.1:1473 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1477 +msgid "Specify the number of position bits. The minimum is 0 and the maximum is 4; the default is 2." +msgstr "Specifică numărul de biți de poziție. Minimul este 0 și maximul este 4; implicit este 2." + +#. type: Plain text +#: ../src/xz/xz.1:1484 +msgid "I affects what kind of alignment in the uncompressed data is assumed in general. The default means four-byte alignment (2^I=2^2=4), which is often a good choice when there's no better guess." +msgstr "I afectează ce fel de aliniere în datele necomprimate este presupusă în general. Valoarea implicită înseamnă alinierea pe patru octeți (2^I=2^2=4), care este adesea o alegere bună atunci când nu există o ipoteză mai bună." + +#. type: Plain text +#: ../src/xz/xz.1:1498 +msgid "When the alignment is known, setting I accordingly may reduce the file size a little. For example, with text files having one-byte alignment (US-ASCII, ISO-8859-*, UTF-8), setting B can improve compression slightly. For UTF-16 text, B is a good choice. If the alignment is an odd number like 3 bytes, B might be the best choice." +msgstr "Când alinierea este cunoscută, definirea lui I în mod corespunzător poate reduce puțin dimensiunea fișierului. De exemplu, cu fișierele text cu aliniere pe un octet (US-ASCII, ISO-8859-*, UTF-8), definirea B poate îmbunătăți ușor comprimarea. Pentru textul UTF-16, B este o alegere bună. Dacă alinierea este un număr impar, cum ar fi 3 octeți, B ar putea fi cea mai bună alegere." + +#. type: Plain text +#: ../src/xz/xz.1:1506 +msgid "Even though the assumed alignment can be adjusted with I and I, LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth taking into account when designing file formats that are likely to be often compressed with LZMA1 or LZMA2." +msgstr "Chiar dacă alinierea presupusă poate fi ajustată cu I și I, LZMA1 și LZMA2 încă favorizează ușor alinierea pe 16 octeți. Ar putea fi demn de luat în considerare atunci când proiectați formate de fișiere care pot fi adesea comprimate cu LZMA1 sau LZMA2." + +#. type: TP +#: ../src/xz/xz.1:1506 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1521 +msgid "Match finder has a major effect on encoder speed, memory usage, and compression ratio. Usually Hash Chain match finders are faster than Binary Tree match finders. The default depends on the I: 0 uses B, 1\\(en3 use B, and the rest use B." +msgstr "Căutarea potrivirilor are un efect major asupra vitezei codificatorului, utilizării memoriei și raportului de comprimare. De obicei, găsitorii de potriviri din lanțul sumelor de control sunt mai rapizi decât găsitorii de potriviri din arborele binar. Valoarea implicită depinde de I: 0 folosește B, 1\\(en3 folosește B, iar restul folosește B." + +#. type: Plain text +#: ../src/xz/xz.1:1527 +msgid "The following match finders are supported. The memory usage formulas below are rough approximations, which are closest to the reality when I is a power of two." +msgstr "Sunt acceptate următoarele opțiuni de căutare de potriviri. Formulele de utilizare a memoriei de mai jos sunt aproximări estimative, care se apropie cel mai mult de realitate atunci când I este o putere a lui doi." + +#. type: TP +#: ../src/xz/xz.1:1528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1531 +msgid "Hash Chain with 2- and 3-byte hashing" +msgstr "Lanț de sumă de control, cu suma de control de 2 și 3 octeți" + +#. type: Plain text +#: ../src/xz/xz.1:1535 ../src/xz/xz.1:1584 +msgid "Minimum value for I: 3" +msgstr "Valoarea minimă pentru I: 3" + +#. type: Plain text +#: ../src/xz/xz.1:1537 ../src/xz/xz.1:1556 ../src/xz/xz.1:1586 +#: ../src/xz/xz.1:1605 +msgid "Memory usage:" +msgstr "Utilizarea memoriei:" + +#. type: Plain text +#: ../src/xz/xz.1:1542 +msgid "I * 7.5 (if I E= 16 MiB);" +msgstr "I * 7.5 (dacă I E= 16 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1547 +msgid "I * 5.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 5.5 + 64 MiB (dacă I E 16 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1547 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1550 +msgid "Hash Chain with 2-, 3-, and 4-byte hashing" +msgstr "Lanț de sumă de control, cu suma de control de 2, 3 și 4 octeți" + +#. type: Plain text +#: ../src/xz/xz.1:1554 ../src/xz/xz.1:1603 +msgid "Minimum value for I: 4" +msgstr "Valoarea minimă pentru I: 4" + +#. type: Plain text +#: ../src/xz/xz.1:1561 +msgid "I * 7.5 (if I E= 32 MiB);" +msgstr "I * 7.5 (dacă I E= 32 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1566 +msgid "I * 6.5 (if I E 32 MiB)" +msgstr "I * 6.5 (dacă I E 32 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1566 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1569 +msgid "Binary Tree with 2-byte hashing" +msgstr "Arbore binar cu suma de control de 2 octeți" + +#. type: Plain text +#: ../src/xz/xz.1:1573 +msgid "Minimum value for I: 2" +msgstr "Valoarea minimă pentru I: 2" + +#. type: Plain text +#: ../src/xz/xz.1:1577 +msgid "Memory usage: I * 9.5" +msgstr "Utilizarea memoriei: I * 9.5" + +#. type: TP +#: ../src/xz/xz.1:1577 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1580 +msgid "Binary Tree with 2- and 3-byte hashing" +msgstr "Arbore binar cu suma de control de 2 și 3 octeți" + +#. type: Plain text +#: ../src/xz/xz.1:1591 +msgid "I * 11.5 (if I E= 16 MiB);" +msgstr "I * 11.5 (dacă I E= 16 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1596 +msgid "I * 9.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 9.5 + 64 MiB (dacă I E 16 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1596 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1599 +msgid "Binary Tree with 2-, 3-, and 4-byte hashing" +msgstr "Arbore binar cu suma de control de 2, 3 și 4 octeți" + +#. type: Plain text +#: ../src/xz/xz.1:1610 +msgid "I * 11.5 (if I E= 32 MiB);" +msgstr "I * 11.5 (dacă I E= 32 Mio);" + +#. type: Plain text +#: ../src/xz/xz.1:1615 +msgid "I * 10.5 (if I E 32 MiB)" +msgstr "I * 10.5 (dacă I E 32 Mio)" + +#. type: TP +#: ../src/xz/xz.1:1616 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1637 +msgid "Compression I specifies the method to analyze the data produced by the match finder. Supported I are B and B. The default is B for I 0\\(en3 and B for I 4\\(en9." +msgstr "Comprimarea I specifică metoda de analiză a datelor produse de găsitorul de potriviri. I acceptate sunt B(rapid) și B. Valoarea implicită este B pentru I 0\\(en3 și B pentru I 4\\(en9." + +#. type: Plain text +#: ../src/xz/xz.1:1646 +msgid "Usually B is used with Hash Chain match finders and B with Binary Tree match finders. This is also what the I do." +msgstr "De obicei, B este folosit cu instrumentele de căutare de potriviri ale lanțului de sume de control, și B cu instrumentele de căutare de potriviri din arborele binar. Aceasta este și ceea ce fac I." + +#. type: TP +#: ../src/xz/xz.1:1646 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1653 +msgid "Specify what is considered to be a nice length for a match. Once a match of at least I bytes is found, the algorithm stops looking for possibly better matches." +msgstr "Specifică ceea ce este considerat a fi o lungime bună(nice) pentru o potrivire. Odată ce este găsită o potrivire de cel puțin I octeți, algoritmul nu mai caută după potriviri posibile mai bune." + +#. type: Plain text +#: ../src/xz/xz.1:1660 +msgid "I can be 2\\(en273 bytes. Higher values tend to give better compression ratio at the expense of speed. The default depends on the I." +msgstr "I poate fi de 2\\(en273 octeți. Valorile mai mari tind să ofere un raport de comprimare mai bun în detrimentul vitezei. Valoarea implicită depinde de I." + +#. type: TP +#: ../src/xz/xz.1:1660 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1670 +msgid "Specify the maximum search depth in the match finder. The default is the special value of 0, which makes the compressor determine a reasonable I from I and I." +msgstr "Specifică adâncimea maximă de căutare în găsitorul de potriviri. Valoarea implicită este valoarea specială de 0, ceea ce face ca instrumentul de comprimare să determine o I rezonabilă pornind de la valorile I și I." + +#. type: Plain text +#: ../src/xz/xz.1:1681 +msgid "Reasonable I for Hash Chains is 4\\(en100 and 16\\(en1000 for Binary Trees. Using very high values for I can make the encoder extremely slow with some files. Avoid setting the I over 1000 unless you are prepared to interrupt the compression in case it is taking far too long." +msgstr "I rezonabilă pentru lanțuri de sumă de control este 4\\(en100 și 16\\(en1000 pentru arbori binari. Folosirea unor valori foarte mari pentru I poate face codificatorul extrem de lent cu unele fișiere. Evitați să stabiliți I la valori peste 1000, cu excepția cazului în care sunteți pregătit să întrerupeți comprimarea în cazul în care durează prea mult." + +#. type: Plain text +#: ../src/xz/xz.1:1692 +msgid "When decoding raw streams (B<--format=raw>), LZMA2 needs only the dictionary I. LZMA1 needs also I, I, and I." +msgstr "La decodificarea fluxurilor brute (B<--format=raw>), LZMA2 are nevoie doar de I dicționarului. LZMA1 are nevoie de asemenea de I, I și I." + +#. type: TP +#: ../src/xz/xz.1:1692 +#, no-wrap +msgid "B<--x86>[B<=>I]" +msgstr "B<--x86>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1695 +#, no-wrap +msgid "B<--arm>[B<=>I]" +msgstr "B<--arm>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1697 +#, no-wrap +msgid "B<--armthumb>[B<=>I]" +msgstr "B<--armthumb>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1699 +#, no-wrap +msgid "B<--arm64>[B<=>I]" +msgstr "B<--arm64>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1701 +#, no-wrap +msgid "B<--powerpc>[B<=>I]" +msgstr "B<--powerpc>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1703 +#, no-wrap +msgid "B<--ia64>[B<=>I]" +msgstr "B<--ia64>[B<=>I]" + +#. type: TP +#: ../src/xz/xz.1:1705 +#, no-wrap +msgid "B<--sparc>[B<=>I]" +msgstr "B<--sparc>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1711 +msgid "Add a branch/call/jump (BCJ) filter to the filter chain. These filters can be used only as a non-last filter in the filter chain." +msgstr "Adaugă un filtru de ramură/apel/salt (branch/call/jump ⟶ „BCJ”) la lanțul de filtre. Aceste filtre pot fi utilizate numai ca un filtru care nu este ultimul din lanțul de filtrare." + +#. type: Plain text +#: ../src/xz/xz.1:1725 +msgid "A BCJ filter converts relative addresses in the machine code to their absolute counterparts. This doesn't change the size of the data but it increases redundancy, which can help LZMA2 to produce 0\\(en15\\ % smaller B<.xz> file. The BCJ filters are always reversible, so using a BCJ filter for wrong type of data doesn't cause any data loss, although it may make the compression ratio slightly worse. The BCJ filters are very fast and use an insignificant amount of memory." +msgstr "Un filtru BCJ convertește adresele relative din codul mașinii în omoloagele lor absolute. Acest lucru nu modifică dimensiunea datelor, dar crește redundanța, ceea ce poate ajuta LZMA2 să producă fișier B<.xz> cu 0\\(en15\\ % mai mic. Filtrele BCJ sunt întotdeauna reversibile, deci folosind un filtru BCJ pentru tipul greșit de date nu provoacă nicio pierdere de date, deși poate înrăutăți puțin raportul de comprimare. Filtrele BCJ sunt foarte rapide și folosesc o cantitate nesemnificativă de memorie." + +#. type: Plain text +#: ../src/xz/xz.1:1728 +msgid "These BCJ filters have known problems related to the compression ratio:" +msgstr "Aceste filtre BCJ au probleme cunoscute legate de raportul de comprimare:" + +#. type: Plain text +#: ../src/xz/xz.1:1735 +msgid "Some types of files containing executable code (for example, object files, static libraries, and Linux kernel modules) have the addresses in the instructions filled with filler values. These BCJ filters will still do the address conversion, which will make the compression worse with these files." +msgstr "Unele tipuri de fișiere care conțin cod executabil (de exemplu, fișiere obiect, biblioteci statice și module de kernel Linux) au adresele din instrucțiuni completate cu valori de umplere. Aceste filtre BCJ vor face în continuare conversia adresei, ceea ce va înrăutăți comprimarea cu aceste fișiere." + +#. type: Plain text +#: ../src/xz/xz.1:1745 +msgid "If a BCJ filter is applied on an archive, it is possible that it makes the compression ratio worse than not using a BCJ filter. For example, if there are similar or even identical executables then filtering will likely make the files less similar and thus compression is worse. The contents of non-executable files in the same archive can matter too. In practice one has to try with and without a BCJ filter to see which is better in each situation." +msgstr "Dacă pe o arhivă este aplicat un filtru BCJ, este posibil ca raportul de comprimare să fie mai rău decât la neutilizarea unui filtru BCJ. De exemplu, dacă există executabile similare sau chiar identice, filtrarea va face probabil fișierele mai puțin asemănătoare și astfel comprimarea este mai proastă. Conținutul fișierelor neexecutabile din aceeași arhivă poate conta și el. În practică, trebuie să încercați cu și fără filtru BCJ pentru a vedea care rezultat este mai bun în fiecare situație." + +#. type: Plain text +#: ../src/xz/xz.1:1750 +msgid "Different instruction sets have different alignment: the executable file must be aligned to a multiple of this value in the input data to make the filter work." +msgstr "Seturi de instrucțiuni diferite au o aliniere diferită: fișierul executabil trebuie aliniat la un multiplu al acestei valori în datele de intrare pentru ca filtrul să funcționeze." + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Filter" +msgstr "Filtru" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Alignment" +msgstr "Aliniere" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Notes" +msgstr "Note" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "x86" +msgstr "x86" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "32-bit or 64-bit x86" +msgstr "" +"x86 pe 32 de biți\n" +";;sau 64 de biți" + +#. type: tbl table +#: ../src/xz/xz.1:1759 +#, no-wrap +msgid "ARM" +msgstr "ARM" + +#. type: tbl table +#: ../src/xz/xz.1:1760 +#, no-wrap +msgid "ARM-Thumb" +msgstr "ARM-Thumb" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "ARM64" +msgstr "ARM64" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "4096-byte alignment is best" +msgstr "" +"alinierea pe 4096-octeți\n" +";;este cea mai bună" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "PowerPC" +msgstr "PowerPC" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "Big endian only" +msgstr "Doar big endian" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "IA-64" +msgstr "IA-64" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "16" +msgstr "16" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "Itanium" +msgstr "Itanium" + +#. type: tbl table +#: ../src/xz/xz.1:1764 +#, no-wrap +msgid "SPARC" +msgstr "SPARC" + +#. type: Plain text +#: ../src/xz/xz.1:1781 +msgid "Since the BCJ-filtered data is usually compressed with LZMA2, the compression ratio may be improved slightly if the LZMA2 options are set to match the alignment of the selected BCJ filter. For example, with the IA-64 filter, it's good to set B or even B with LZMA2 (2^4=16). The x86 filter is an exception; it's usually good to stick to LZMA2's default four-byte alignment when compressing x86 executables." +msgstr "Deoarece datele filtrate prin BCJ sunt de obicei comprimate cu LZMA2, raportul de comprimare poate fi ușor îmbunătățit dacă opțiunile LZMA2 sunt definite pentru a se potrivi cu alinierea filtrului BCJ selectat. De exemplu, cu filtrul IA-64, este bine să stabiliți B sau chiar B cu LZMA2 (2^4=16). Filtrul x86 este o excepție; de obicei, este bine să rămână la alinierea implicită de patru octeți a LZMA2 atunci când se comprimă executabile x86." + +#. type: Plain text +#: ../src/xz/xz.1:1784 +msgid "All BCJ filters support the same I:" +msgstr "Toate filtrele BCJ acceptă același I:" + +#. type: TP +#: ../src/xz/xz.1:1785 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1799 +msgid "Specify the start I that is used when converting between relative and absolute addresses. The I must be a multiple of the alignment of the filter (see the table above). The default is zero. In practice, the default is good; specifying a custom I is almost never useful." +msgstr "Specifică I de pornire care este utilizată la conversia între adresele relative și absolute. I trebuie să fie un multiplu al alinierii filtrului (consultați tabelul de mai sus). Valoarea implicită este zero. În practică, valoarea implicită este bună; specificarea unei I personalizate nu este aproape niciodată utilă." + +#. type: TP +#: ../src/xz/xz.1:1800 +#, no-wrap +msgid "B<--delta>[B<=>I]" +msgstr "B<--delta>[B<=>I]" + +#. type: Plain text +#: ../src/xz/xz.1:1805 +msgid "Add the Delta filter to the filter chain. The Delta filter can be only used as a non-last filter in the filter chain." +msgstr "Adaugă filtrul Delta în lanțul de filtrare. Filtrul Delta poate fi folosit doar ca un filtru care nu este ultimul în lanțul de filtrare." + +#. type: Plain text +#: ../src/xz/xz.1:1814 +msgid "Currently only simple byte-wise delta calculation is supported. It can be useful when compressing, for example, uncompressed bitmap images or uncompressed PCM audio. However, special purpose algorithms may give significantly better results than Delta + LZMA2. This is true especially with audio, which compresses faster and better, for example, with B(1)." +msgstr "În prezent, este acceptat doar calculul delta simplu de octeți. Poate fi util la comprimarea, de exemplu, a imaginilor bitmap necomprimate sau a sunetului PCM necomprimat. Cu toate acestea, algoritmii cu scop special pot da rezultate semnificativ mai bune decât Delta + LZMA2. Acest lucru este valabil mai ales în cazul audio, care se comprimă mai repede și mai bine, de exemplu, cu B(1)." + +#. type: Plain text +#: ../src/xz/xz.1:1817 +msgid "Supported I:" +msgstr "I acceptate:" + +#. type: TP +#: ../src/xz/xz.1:1818 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1826 +msgid "Specify the I of the delta calculation in bytes. I must be 1\\(en256. The default is 1." +msgstr "Specifică I calculului delta în octeți. I trebuie să fie 1\\(en256. Valoarea implicită este 1." + +#. type: Plain text +#: ../src/xz/xz.1:1831 +msgid "For example, with B and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02." +msgstr "De exemplu, cu B și intrare de opt octeți: A1 B1 A2 B3 A3 B5 A4 B7, ieșirea va fi: A1 B1 01 02 01 02 01 02." + +#. type: SS +#: ../src/xz/xz.1:1833 +#, no-wrap +msgid "Other options" +msgstr "Alte opțiuni" + +#. type: TP +#: ../src/xz/xz.1:1834 ../src/xzdec/xzdec.1:83 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../src/xz/xz.1:1841 +msgid "Suppress warnings and notices. Specify this twice to suppress errors too. This option has no effect on the exit status. That is, even if a warning was suppressed, the exit status to indicate a warning is still used." +msgstr "Suprimă avertismentele și notificările. Specificați acest lucru de două ori pentru a suprima și erorile. Această opțiune nu are niciun efect asupra stării de ieșire. Adică, chiar dacă o avertizare a fost suprimată, starea de ieșire pentru a indica o avertizare este încă utilizată." + +#. type: TP +#: ../src/xz/xz.1:1841 +#, no-wrap +msgid "B<-v>, B<--verbose>" +msgstr "B<-v>, B<--verbose>" + +#. type: Plain text +#: ../src/xz/xz.1:1850 +msgid "Be verbose. If standard error is connected to a terminal, B will display a progress indicator. Specifying B<--verbose> twice will give even more verbose output." +msgstr "Oferă informații detaliate. Dacă ieșirea de eroare standard este conectată la un terminal, B va afișa un indicator de progres. Specificarea opțiunii B<--verbose> de două ori, va avea ca rezultat oferirea de informații și mai detaliate." + +#. type: Plain text +#: ../src/xz/xz.1:1852 +msgid "The progress indicator shows the following information:" +msgstr "Indicatorul de progres afișează următoarele informații:" + +#. type: Plain text +#: ../src/xz/xz.1:1857 +msgid "Completion percentage is shown if the size of the input file is known. That is, the percentage cannot be shown in pipes." +msgstr "Procentul de completare este afișat dacă se cunoaște dimensiunea fișierului de intrare. Adică, procentul nu poate fi afișat la procesarea fișierului prin conducte(pipe)." + +#. type: Plain text +#: ../src/xz/xz.1:1860 +msgid "Amount of compressed data produced (compressing) or consumed (decompressing)." +msgstr "Cantitatea de date comprimate produse (comprimare) sau consumate (decomprimare)." + +#. type: Plain text +#: ../src/xz/xz.1:1863 +msgid "Amount of uncompressed data consumed (compressing) or produced (decompressing)." +msgstr "Cantitatea de date necomprimate consumate (comprimare) sau produse (decomprimare)." + +#. type: Plain text +#: ../src/xz/xz.1:1867 +msgid "Compression ratio, which is calculated by dividing the amount of compressed data processed so far by the amount of uncompressed data processed so far." +msgstr "Raportul de comprimare, care se calculează împărțind cantitatea de date comprimate procesate până acum la cantitatea de date necomprimate procesate până acum." + +#. type: Plain text +#: ../src/xz/xz.1:1874 +msgid "Compression or decompression speed. This is measured as the amount of uncompressed data consumed (compression) or produced (decompression) per second. It is shown after a few seconds have passed since B started processing the file." +msgstr "Viteza de comprimare sau decomprimare. Aceasta este măsurată drept cantitatea de date necomprimate consumate (comprimare) sau produse (decomprimare) pe secundă. Este afișată după ce au trecut câteva secunde de când B a început procesarea fișierului." + +#. type: Plain text +#: ../src/xz/xz.1:1876 +msgid "Elapsed time in the format M:SS or H:MM:SS." +msgstr "Timpul scurs în format M:SS sau H:MM:SS." + +#. type: Plain text +#: ../src/xz/xz.1:1884 +msgid "Estimated remaining time is shown only when the size of the input file is known and a couple of seconds have already passed since B started processing the file. The time is shown in a less precise format which never has any colons, for example, 2 min 30 s." +msgstr "Timpul rămas estimat este afișat numai atunci când dimensiunea fișierului de intrare este cunoscută și au trecut deja câteva secunde de când B a început procesarea fișierului. Ora este afișată într-un format mai puțin precis, care nu are niciodată două puncte, de exemplu, 2 min 30 s." + +#. type: Plain text +#: ../src/xz/xz.1:1899 +msgid "When standard error is not a terminal, B<--verbose> will make B print the filename, compressed size, uncompressed size, compression ratio, and possibly also the speed and elapsed time on a single line to standard error after compressing or decompressing the file. The speed and elapsed time are included only when the operation took at least a few seconds. If the operation didn't finish, for example, due to user interruption, also the completion percentage is printed if the size of the input file is known." +msgstr "Când ieșirea de eroare standard nu este un terminal, B<--verbose> va face B să imprime numele fișierului, dimensiunea comprimată, dimensiunea necomprimată, raportul de comprimare și, eventual, de asemenea, viteza și timpul scurs pe o singură linie la ieșirea de eroare standard după comprimarea sau decomprimarea fișierului. Viteza și timpul scurs sunt incluse numai atunci când operațiunea a durat cel puțin câteva secunde. Dacă operațiunea nu s-a încheiat, de exemplu, din cauza întreruperii din partea utilizatorului, se imprimă și procentul de completare dacă se cunoaște dimensiunea fișierului de intrare." + +#. type: TP +#: ../src/xz/xz.1:1899 ../src/xzdec/xzdec.1:89 +#, no-wrap +msgid "B<-Q>, B<--no-warn>" +msgstr "B<-Q>, B<--no-warn>" + +#. type: Plain text +#: ../src/xz/xz.1:1909 +msgid "Don't set the exit status to 2 even if a condition worth a warning was detected. This option doesn't affect the verbosity level, thus both B<--quiet> and B<--no-warn> have to be used to not display warnings and to not alter the exit status." +msgstr "Nu comută starea de ieșire la 2 chiar dacă a fost detectată o condiție care merită avertizată. Această opțiune nu afectează nivelul de detaliere al informațiilor, astfel încât atât B<--quiet> cât și B<--no-warn> trebuie folosite pentru a nu afișa avertismente și pentru a nu modifica starea de ieșire." + +#. type: TP +#: ../src/xz/xz.1:1909 +#, no-wrap +msgid "B<--robot>" +msgstr "B<--robot>" + +#. type: Plain text +#: ../src/xz/xz.1:1921 +msgid "Print messages in a machine-parsable format. This is intended to ease writing frontends that want to use B instead of liblzma, which may be the case with various scripts. The output with this option enabled is meant to be stable across B releases. See the section B for details." +msgstr "Afișează mesajele într-un format care poate fi analizat de mașină. Acest lucru are scopul de a ușura scrierea interfețelor în care se dorește să se folosească B în loc de liblzma, ceea ce poate fi cazul cu diferite scripturi. Ieșirea cu această opțiune activată este menită să fie stabilă în toate versiunile B. Consultați secțiunea B pentru detalii." + +#. type: TP +#: ../src/xz/xz.1:1921 +#, no-wrap +msgid "B<--info-memory>" +msgstr "B<--info-memory>" + +#. type: Plain text +#: ../src/xz/xz.1:1928 +msgid "Display, in human-readable format, how much physical memory (RAM) and how many processor threads B thinks the system has and the memory usage limits for compression and decompression, and exit successfully." +msgstr "Afișează, într-un format care poate fi citit de om, câtă memorie fizică (RAM) și câte fire de execuție de procesor B crede că are sistemul și limitele de utilizare a memoriei pentru comprimare și decomprimare și iese cu succes." + +#. type: TP +#: ../src/xz/xz.1:1928 ../src/xzdec/xzdec.1:96 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../src/xz/xz.1:1932 +msgid "Display a help message describing the most commonly used options, and exit successfully." +msgstr "Afișează un mesaj de ajutor care descrie opțiunile cele mai frecvent utilizate și iese cu succes." + +#. type: TP +#: ../src/xz/xz.1:1932 +#, no-wrap +msgid "B<-H>, B<--long-help>" +msgstr "B<-H>, B<--long-help>" + +#. type: Plain text +#: ../src/xz/xz.1:1937 +msgid "Display a help message describing all features of B, and exit successfully" +msgstr "Afișează un mesaj de ajutor care descrie toate caracteristicile B și iese cu succes" + +#. type: TP +#: ../src/xz/xz.1:1937 ../src/xzdec/xzdec.1:99 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../src/xz/xz.1:1946 +msgid "Display the version number of B and liblzma in human readable format. To get machine-parsable output, specify B<--robot> before B<--version>." +msgstr "Afișează numărul versiunii B și liblzma într-un format care poate fi citit de om. Pentru a obține rezultate analizabile de mașină, specificați B<--robot> înainte de B<--version>." + +#. type: SH +#: ../src/xz/xz.1:1947 +#, no-wrap +msgid "ROBOT MODE" +msgstr "MOD ROBOT" + +#. type: Plain text +#: ../src/xz/xz.1:1963 +msgid "The robot mode is activated with the B<--robot> option. It makes the output of B easier to parse by other programs. Currently B<--robot> is supported only together with B<--version>, B<--info-memory>, and B<--list>. It will be supported for compression and decompression in the future." +msgstr "Modul robot este activat cu opțiunea B<--robot>. Face ieșirea lui B mai ușor de analizat de către alte programe. În prezent, opțiunea B<--robot> este acceptată numai împreună cu opțiunile B<--version>, B<--info-memory> și B<--list>. Va fi acceptată pentru comprimare și decomprimare în viitor." + +#. type: SS +#: ../src/xz/xz.1:1964 +#, no-wrap +msgid "Version" +msgstr "Versiunea" + +#. type: Plain text +#: ../src/xz/xz.1:1969 +msgid "B will print the version number of B and liblzma in the following format:" +msgstr "B va afișa numărul versiunii B și liblzma în următorul format:" + +#. type: Plain text +#: ../src/xz/xz.1:1971 +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1973 +msgid "BI" +msgstr "BI" + +#. type: TP +#: ../src/xz/xz.1:1973 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1976 +msgid "Major version." +msgstr "Versiunea majoră." + +#. type: TP +#: ../src/xz/xz.1:1976 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1981 +msgid "Minor version. Even numbers are stable. Odd numbers are alpha or beta versions." +msgstr "Versiunea minoră. Numerele pare sunt prezente în versiunile stabile. Numerele impare sunt prezente în versiunile alfa sau beta." + +#. type: TP +#: ../src/xz/xz.1:1981 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1985 +msgid "Patch level for stable releases or just a counter for development releases." +msgstr "Nivelul de plasture(patch) pentru versiunile stabile sau doar un contor pentru versiunile de dezvoltare." + +#. type: TP +#: ../src/xz/xz.1:1985 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1993 +msgid "Stability. 0 is alpha, 1 is beta, and 2 is stable. I should be always 2 when I is even." +msgstr "Stabilitate. 0 este alfa, 1 este beta și 2 este stabil. I trebuie să fie întotdeauna 2 atunci când I este par." + +#. type: Plain text +#: ../src/xz/xz.1:1998 +msgid "I are the same on both lines if B and liblzma are from the same XZ Utils release." +msgstr "I sunt aceleași pe ambele linii dacă B și liblzma sunt din aceeași versiune XZ Utils." + +#. type: Plain text +#: ../src/xz/xz.1:2004 +msgid "Examples: 4.999.9beta is B<49990091> and 5.0.0 is B<50000002>." +msgstr "Exemple: 4.999.9beta este B<49990091> și 5.0.0 este B<50000002>." + +#. type: SS +#: ../src/xz/xz.1:2005 +#, no-wrap +msgid "Memory limit information" +msgstr "Informații privind limita memoriei" + +#. type: Plain text +#: ../src/xz/xz.1:2008 +msgid "B prints a single line with three tab-separated columns:" +msgstr "B tipărește o singură linie cu trei coloane separate prin tabulatori:" + +#. type: IP +#: ../src/xz/xz.1:2008 +#, no-wrap +msgid "1." +msgstr "1." + +#. type: Plain text +#: ../src/xz/xz.1:2010 +msgid "Total amount of physical memory (RAM) in bytes." +msgstr "Cantitatea totală de memorie fizică (RAM) în octeți." + +#. type: IP +#: ../src/xz/xz.1:2010 ../src/xz/xz.1:2125 ../src/xz/xz.1:2162 +#: ../src/xz/xz.1:2188 ../src/xz/xz.1:2258 ../src/xz/xz.1:2285 +#, no-wrap +msgid "2." +msgstr "2." + +#. type: Plain text +#: ../src/xz/xz.1:2017 +msgid "Memory usage limit for compression in bytes (B<--memlimit-compress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Limita de utilizare a memoriei pentru comprimare în octeți (B<--memlimit-compress>). O valoare specială de B<0> indică configurarea implicită, care pentru modul cu un singur fir este la fel ca fără limită." + +#. type: IP +#: ../src/xz/xz.1:2017 ../src/xz/xz.1:2127 ../src/xz/xz.1:2164 +#: ../src/xz/xz.1:2190 ../src/xz/xz.1:2263 ../src/xz/xz.1:2287 +#, no-wrap +msgid "3." +msgstr "3." + +#. type: Plain text +#: ../src/xz/xz.1:2024 +msgid "Memory usage limit for decompression in bytes (B<--memlimit-decompress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Limita de utilizare a memoriei pentru decomprimare în octeți (B<--memlimit-decompress>). O valoare specială de B<0> indică configurarea implicită, care pentru modul cu un singur fir este la fel ca fără limită." + +#. type: IP +#: ../src/xz/xz.1:2024 ../src/xz/xz.1:2129 ../src/xz/xz.1:2166 +#: ../src/xz/xz.1:2193 ../src/xz/xz.1:2273 ../src/xz/xz.1:2289 +#, no-wrap +msgid "4." +msgstr "4." + +#. type: Plain text +#: ../src/xz/xz.1:2036 +msgid "Since B 5.3.4alpha: Memory usage for multi-threaded decompression in bytes (B<--memlimit-mt-decompress>). This is never zero because a system-specific default value shown in the column 5 is used if no limit has been specified explicitly. This is also never greater than the value in the column 3 even if a larger value has been specified with B<--memlimit-mt-decompress>." +msgstr "Începând cu B 5.3.4alpha: Utilizarea memoriei pentru decomprimarea cu mai multe fire în octeți (B<--memlimit-mt-decompress>). Acesta nu este niciodată zero, deoarece o valoare implicită specifică sistemului afișată în coloana 5 este utilizată dacă nu a fost specificată în mod explicit nicio limită. De asemenea, aceasta nu este niciodată mai mare decât valoarea din coloana 3, chiar dacă a fost specificată o valoare mai mare cu B<--memlimit-mt-decompress>." + +#. type: IP +#: ../src/xz/xz.1:2036 ../src/xz/xz.1:2131 ../src/xz/xz.1:2168 +#: ../src/xz/xz.1:2195 ../src/xz/xz.1:2291 +#, no-wrap +msgid "5." +msgstr "5." + +#. type: Plain text +#: ../src/xz/xz.1:2048 +msgid "Since B 5.3.4alpha: A system-specific default memory usage limit that is used to limit the number of threads when compressing with an automatic number of threads (B<--threads=0>) and no memory usage limit has been specified (B<--memlimit-compress>). This is also used as the default value for B<--memlimit-mt-decompress>." +msgstr "Începând cu B 5.3.4alpha: o limită implicită de utilizare a memoriei specifică sistemului, care este utilizată pentru a limita numărul de fire de execuție atunci când se comprimă cu un număr automat de fire de execuție (B<--threads=0>) și nicio limită de utilizare a memoriei nu fost specificată cu (B<--memlimit-compress>). Aceasta este, de asemenea, utilizată ca valoare implicită pentru B<--memlimit-mt-decompress>." + +#. type: IP +#: ../src/xz/xz.1:2048 ../src/xz/xz.1:2133 ../src/xz/xz.1:2170 +#: ../src/xz/xz.1:2197 ../src/xz/xz.1:2293 +#, no-wrap +msgid "6." +msgstr "6." + +#. type: Plain text +#: ../src/xz/xz.1:2053 +msgid "Since B 5.3.4alpha: Number of available processor threads." +msgstr "Începând cu B 5.3.4alpha: numărul de fire de execuție de procesor disponibile." + +#. type: Plain text +#: ../src/xz/xz.1:2057 +msgid "In the future, the output of B may have more columns, but never more than a single line." +msgstr "În viitor, rezultatul B poate avea mai multe coloane, dar niciodată mai mult de o singură linie." + +#. type: SS +#: ../src/xz/xz.1:2058 +#, no-wrap +msgid "List mode" +msgstr "Modul listă" + +#. type: Plain text +#: ../src/xz/xz.1:2063 +msgid "B uses tab-separated output. The first column of every line has a string that indicates the type of the information found on that line:" +msgstr "B utilizează o ieșire separată de tabulatori. Prima coloană a fiecărei linii are un șir care indică tipul de informații găsite pe acea linie:" + +#. type: TP +#: ../src/xz/xz.1:2063 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2067 +msgid "This is always the first line when starting to list a file. The second column on the line is the filename." +msgstr "Aceasta este întotdeauna prima linie când începe să se listeze un fișier. A doua coloană de pe linie este numele fișierului." + +#. type: TP +#: ../src/xz/xz.1:2067 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2075 +msgid "This line contains overall information about the B<.xz> file. This line is always printed after the B line." +msgstr "Această linie conține informații generale despre fișierul B<.xz>. Această linie este întotdeauna tipărită după linia B." + +#. type: TP +#: ../src/xz/xz.1:2075 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2085 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are streams in the B<.xz> file." +msgstr "Acest tip de linie este utilizat numai atunci când a fost specificată opțiunea B<--verbose>. Există tot atâtea linii B câte fluxuri există în fișierul B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2085 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2100 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are blocks in the B<.xz> file. The B lines are shown after all the B lines; different line types are not interleaved." +msgstr "Acest tip de linie este utilizat numai atunci când a fost specificată opțiunea B<--verbose>. Există tot atâtea linii B câte blocuri există în fișierul B<.xz>. Liniile B sunt afișate după toate liniile B; tipurile diferite de linii nu sunt intercalate." + +#. type: TP +#: ../src/xz/xz.1:2100 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2115 +msgid "This line type is used only when B<--verbose> was specified twice. This line is printed after all B lines. Like the B line, the B line contains overall information about the B<.xz> file." +msgstr "Acest tip de linie este folosit numai atunci când opțiunea B<--verbose> a fost specificată de două ori. Această linie este afișată după toate liniile B. Ca și linia B, linia B conține informații generale despre fișierul B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2115 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2119 +msgid "This line is always the very last line of the list output. It shows the total counts and sizes." +msgstr "Această linie este întotdeauna ultima linie din lista afișată la ieșire. Aceasta arată numărul total și dimensiunile." + +#. type: Plain text +#: ../src/xz/xz.1:2123 +msgid "The columns of the B lines:" +msgstr "Coloanele din liniile B:" + +#. type: Plain text +#: ../src/xz/xz.1:2127 +msgid "Number of streams in the file" +msgstr "Numărul de fluxuri din fișier" + +#. type: Plain text +#: ../src/xz/xz.1:2129 +msgid "Total number of blocks in the stream(s)" +msgstr "Numărul total de blocuri din fluxuri" + +#. type: Plain text +#: ../src/xz/xz.1:2131 +msgid "Compressed size of the file" +msgstr "Dimensiunea comprimată a fișierului" + +#. type: Plain text +#: ../src/xz/xz.1:2133 +msgid "Uncompressed size of the file" +msgstr "Dimensiunea necomprimată a fișierului" + +#. type: Plain text +#: ../src/xz/xz.1:2139 +msgid "Compression ratio, for example, B<0.123>. If ratio is over 9.999, three dashes (B<--->) are displayed instead of the ratio." +msgstr "Raportul de comprimare, de exemplu, B<0,123>. Dacă raportul este peste 9,999, în locul raportului sunt afișate trei liniuțe (B<--->)." + +#. type: IP +#: ../src/xz/xz.1:2139 ../src/xz/xz.1:2172 ../src/xz/xz.1:2199 +#: ../src/xz/xz.1:2295 +#, no-wrap +msgid "7." +msgstr "7." + +#. type: Plain text +#: ../src/xz/xz.1:2152 +msgid "Comma-separated list of integrity check names. The following strings are used for the known check types: B, B, B, and B. For unknown check types, BI is used, where I is the Check ID as a decimal number (one or two digits)." +msgstr "Lista de nume de verificare a integrității, separate prin virgule. Următoarele șiruri sunt utilizate pentru tipurile de verificare cunoscute: B, B, B și B. Pentru tipurile de verificări necunoscute, se utilizează BI, unde I este ID-ul de verificare ca număr zecimal (una sau două cifre)." + +#. type: IP +#: ../src/xz/xz.1:2152 ../src/xz/xz.1:2174 ../src/xz/xz.1:2201 +#: ../src/xz/xz.1:2298 +#, no-wrap +msgid "8." +msgstr "8." + +#. type: Plain text +#: ../src/xz/xz.1:2154 +msgid "Total size of stream padding in the file" +msgstr "Dimensiunea totală a umpluturii fluxului din fișier" + +#. type: Plain text +#: ../src/xz/xz.1:2160 +msgid "The columns of the B lines:" +msgstr "Coloanele din liniile B:" + +#. type: Plain text +#: ../src/xz/xz.1:2164 +msgid "Stream number (the first stream is 1)" +msgstr "Numărul fluxului (primul flux este 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2166 +msgid "Number of blocks in the stream" +msgstr "Numărul de blocuri din flux" + +#. type: Plain text +#: ../src/xz/xz.1:2168 +msgid "Compressed start offset" +msgstr "Poziția de pornire a comprimării" + +#. type: Plain text +#: ../src/xz/xz.1:2170 +msgid "Uncompressed start offset" +msgstr "Poziția de pornire a decomprimării" + +#. type: Plain text +#: ../src/xz/xz.1:2172 +msgid "Compressed size (does not include stream padding)" +msgstr "Dimensiune comprimată (nu include umplutura fluxului)" + +#. type: Plain text +#: ../src/xz/xz.1:2174 ../src/xz/xz.1:2203 ../src/xz/xz.1:2293 +msgid "Uncompressed size" +msgstr "Dimensiune necomprimată" + +#. type: Plain text +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2205 +msgid "Compression ratio" +msgstr "Raport de comprimare" + +#. type: IP +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2203 ../src/xz/xz.1:2300 +#, no-wrap +msgid "9." +msgstr "9." + +#. type: Plain text +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2207 +msgid "Name of the integrity check" +msgstr "Numele verificării de integritate" + +#. type: IP +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2205 ../src/xz/xz.1:2316 +#, no-wrap +msgid "10." +msgstr "10." + +#. type: Plain text +#: ../src/xz/xz.1:2180 +msgid "Size of stream padding" +msgstr "Dimensiunea umpluturii fluxului" + +#. type: Plain text +#: ../src/xz/xz.1:2186 +msgid "The columns of the B lines:" +msgstr "Coloanele din liniile B:" + +#. type: Plain text +#: ../src/xz/xz.1:2190 +msgid "Number of the stream containing this block" +msgstr "Numărul fluxului care conține acest bloc" + +#. type: Plain text +#: ../src/xz/xz.1:2193 +msgid "Block number relative to the beginning of the stream (the first block is 1)" +msgstr "Numărul blocului în raport cu începutul fluxului (primul bloc este 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2195 +msgid "Block number relative to the beginning of the file" +msgstr "Numărul blocului în raport cu începutul fișierului" + +#. type: Plain text +#: ../src/xz/xz.1:2197 +msgid "Compressed start offset relative to the beginning of the file" +msgstr "Poziția de pornire a comprimării în raport cu începutul fișierului" + +#. type: Plain text +#: ../src/xz/xz.1:2199 +msgid "Uncompressed start offset relative to the beginning of the file" +msgstr "Poziția de pornire necomprimată în raport cu începutul fișierului" + +#. type: Plain text +#: ../src/xz/xz.1:2201 +msgid "Total compressed size of the block (includes headers)" +msgstr "Dimensiunea totală comprimată a blocului (include antetele)" + +#. type: Plain text +#: ../src/xz/xz.1:2219 +msgid "If B<--verbose> was specified twice, additional columns are included on the B lines. These are not displayed with a single B<--verbose>, because getting this information requires many seeks and can thus be slow:" +msgstr "Dacă opțiunea B<--verbose> a fost specificată de două ori, coloane suplimentare sunt incluse pe liniile B. Acestea nu sunt afișate cu o singură specificare a opțiunii B<--verbose>, deoarece obținerea acestor informații necesită multe căutări și, prin urmare, poate fi lentă:" + +#. type: IP +#: ../src/xz/xz.1:2221 ../src/xz/xz.1:2321 +#, no-wrap +msgid "11." +msgstr "11." + +#. type: Plain text +#: ../src/xz/xz.1:2223 +msgid "Value of the integrity check in hexadecimal" +msgstr "Valoarea verificării integrității în hexazecimal" + +#. type: IP +#: ../src/xz/xz.1:2223 ../src/xz/xz.1:2331 +#, no-wrap +msgid "12." +msgstr "12." + +#. type: Plain text +#: ../src/xz/xz.1:2225 +msgid "Block header size" +msgstr "Dimensiunea antetului blocului" + +#. type: IP +#: ../src/xz/xz.1:2225 +#, no-wrap +msgid "13." +msgstr "13." + +#. type: Plain text +#: ../src/xz/xz.1:2235 +msgid "Block flags: B indicates that compressed size is present, and B indicates that uncompressed size is present. If the flag is not set, a dash (B<->) is shown instead to keep the string length fixed. New flags may be added to the end of the string in the future." +msgstr "Indicatori de bloc: B indică faptul că este prezentă dimensiunea comprimată, iar B indică faptul că este prezentă dimensiunea necomprimată. Dacă indicatorul nu este determinat, este afișată o liniuță (B<->) pentru a menține lungimea șirului fixă. Pot fi adăugate noi indicatoare la sfârșitul șirului, în viitor." + +#. type: IP +#: ../src/xz/xz.1:2235 +#, no-wrap +msgid "14." +msgstr "14." + +#. type: Plain text +#: ../src/xz/xz.1:2238 +msgid "Size of the actual compressed data in the block (this excludes the block header, block padding, and check fields)" +msgstr "Dimensiunea datelor comprimate reale din bloc (acest lucru exclude antetul blocului, umplutura blocului și câmpurile de verificare)" + +#. type: IP +#: ../src/xz/xz.1:2238 +#, no-wrap +msgid "15." +msgstr "15." + +#. type: Plain text +#: ../src/xz/xz.1:2243 +msgid "Amount of memory (in bytes) required to decompress this block with this B version" +msgstr "Cantitatea de memorie (în octeți) necesară pentru a decomprima acest bloc cu această versiune B" + +#. type: IP +#: ../src/xz/xz.1:2243 +#, no-wrap +msgid "16." +msgstr "16." + +#. type: Plain text +#: ../src/xz/xz.1:2250 +msgid "Filter chain. Note that most of the options used at compression time cannot be known, because only the options that are needed for decompression are stored in the B<.xz> headers." +msgstr "Lanț de filtrare. Rețineți că majoritatea opțiunilor utilizate în timpul comprimării nu pot fi cunoscute, deoarece doar opțiunile necesare pentru decomprimare sunt stocate în anteturile B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:2256 +msgid "The columns of the B lines:" +msgstr "Coloanele din liniile B:" + +#. type: Plain text +#: ../src/xz/xz.1:2263 +msgid "Amount of memory (in bytes) required to decompress this file with this B version" +msgstr "Cantitatea de memorie (în octeți) necesară pentru a decomprima acest fișier cu această versiune B" + +#. type: Plain text +#: ../src/xz/xz.1:2269 ../src/xz/xz.1:2327 +msgid "B or B indicating if all block headers have both compressed size and uncompressed size stored in them" +msgstr "B sau B indicând dacă toate antetele blocurilor au atât dimensiunea comprimată, cât și dimensiunea necomprimată stocate în ele" + +#. type: Plain text +#: ../src/xz/xz.1:2273 ../src/xz/xz.1:2331 +msgid "I B I<5.1.2alpha:>" +msgstr "I<Începând cu> B I<5.1.2alpha:>" + +#. type: Plain text +#: ../src/xz/xz.1:2277 ../src/xz/xz.1:2335 +msgid "Minimum B version required to decompress the file" +msgstr "Versiunea B minimă necesară pentru a decomprima fișierul" + +#. type: Plain text +#: ../src/xz/xz.1:2283 +msgid "The columns of the B line:" +msgstr "Coloanele din linia B:" + +#. type: Plain text +#: ../src/xz/xz.1:2287 +msgid "Number of streams" +msgstr "Numărul de fluxuri" + +#. type: Plain text +#: ../src/xz/xz.1:2289 +msgid "Number of blocks" +msgstr "Numărul de blocuri" + +#. type: Plain text +#: ../src/xz/xz.1:2291 +msgid "Compressed size" +msgstr "Dimensiunea comprimată" + +#. type: Plain text +#: ../src/xz/xz.1:2295 +msgid "Average compression ratio" +msgstr "Raportul mediu de comprimare" + +#. type: Plain text +#: ../src/xz/xz.1:2298 +msgid "Comma-separated list of integrity check names that were present in the files" +msgstr "Lista de nume de verificare a integrității, separate prin virgule, care au fost prezente în fișiere" + +#. type: Plain text +#: ../src/xz/xz.1:2300 +msgid "Stream padding size" +msgstr "Dimensiunea umpluturii fluxului" + +#. type: Plain text +#: ../src/xz/xz.1:2306 +msgid "Number of files. This is here to keep the order of the earlier columns the same as on B lines." +msgstr "Numărul de fișiere. Aceasta este aici pentru a păstra ordinea coloanelor anterioare la fel ca pe liniile B." + +#. type: Plain text +#: ../src/xz/xz.1:2314 +msgid "If B<--verbose> was specified twice, additional columns are included on the B line:" +msgstr "Dacă opțiunea B<--verbose> a fost specificată de două ori, pe linia B sunt incluse coloane suplimentare:" + +#. type: Plain text +#: ../src/xz/xz.1:2321 +msgid "Maximum amount of memory (in bytes) required to decompress the files with this B version" +msgstr "Cantitatea maximă de memorie (în octeți) necesară pentru a decomprima fișierele cu această versiune B" + +#. type: Plain text +#: ../src/xz/xz.1:2341 +msgid "Future versions may add new line types and new columns can be added to the existing line types, but the existing columns won't be changed." +msgstr "Versiunile viitoare pot adăuga noi tipuri de linii și pot fi adăugate coloane noi la tipurile de linii existente, dar coloanele existente nu vor fi modificate." + +#. type: SH +#: ../src/xz/xz.1:2342 ../src/xzdec/xzdec.1:104 ../src/lzmainfo/lzmainfo.1:44 +#: ../src/scripts/xzgrep.1:81 +#, no-wrap +msgid "EXIT STATUS" +msgstr "STARE DE IEȘIRE" + +#. type: TP +#: ../src/xz/xz.1:2343 ../src/xzdec/xzdec.1:105 ../src/lzmainfo/lzmainfo.1:45 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../src/xz/xz.1:2346 ../src/lzmainfo/lzmainfo.1:48 +msgid "All is good." +msgstr "Totul este bine." + +#. type: TP +#: ../src/xz/xz.1:2346 ../src/xzdec/xzdec.1:108 ../src/lzmainfo/lzmainfo.1:48 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../src/xz/xz.1:2349 ../src/xzdec/xzdec.1:111 ../src/lzmainfo/lzmainfo.1:51 +msgid "An error occurred." +msgstr "A apărut o eroare." + +#. type: TP +#: ../src/xz/xz.1:2349 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:2353 +msgid "Something worth a warning occurred, but no actual errors occurred." +msgstr "A apărut ceva care merită să fie avertizat, dar nu au apărut erori reale." + +#. type: Plain text +#: ../src/xz/xz.1:2356 +msgid "Notices (not warnings or errors) printed on standard error don't affect the exit status." +msgstr "Notificările (nu avertismentele sau erorile) afișate la ieșirea de eroare standard nu afectează starea de ieșire." + +#. type: SH +#: ../src/xz/xz.1:2357 ../src/scripts/xzgrep.1:94 ../src/scripts/xzless.1:52 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "VARIABILE DE MEDIU" + +#. type: Plain text +#: ../src/xz/xz.1:2370 +msgid "B parses space-separated lists of options from the environment variables B and B, in this order, before parsing the options from the command line. Note that only options are parsed from the environment variables; all non-options are silently ignored. Parsing is done with B(3) which is used also for the command line arguments." +msgstr "B analizează liste de opțiuni separate prin spații din variabilele de mediu B și B, în această ordine, înainte de a analiza opțiunile din linia de comandă. Rețineți că numai opțiunile sunt analizate din variabilele de mediu; toate non-opțiunile sunt ignorate în tăcere. Analiza se face cu funcția B(3) care este folosită și pentru argumentele liniei de comandă." + +#. type: TP +#: ../src/xz/xz.1:2370 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2379 +msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B's memory usage limiter by default. Excluding shell initialization scripts and similar special cases, scripts must never set or unset B." +msgstr "Opțiuni implicite specifice utilizatorului sau la nivelul întregului sistem. De obicei, acest lucru este specificat într-un script de inițializare shell pentru a activa limitatorul de utilizare a memoriei lui B implicit. Excluzând scripturile de inițializare shell și cazurile speciale similare, scripturile nu trebuie niciodată să modifice sau să dezactiveze B." + +#. type: TP +#: ../src/xz/xz.1:2379 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2390 +msgid "This is for passing options to B when it is not possible to set the options directly on the B command line. This is the case when B is run by a script or tool, for example, GNU B(1):" +msgstr "Acest lucru este pentru transmiterea opțiunilor către B atunci când nu este posibil să definiți opțiunile direct în linia de comandă a B. Acesta este cazul când B este rulat de un script sau de un instrument, de exemplu, GNU B(1):" + +#. type: Plain text +#: ../src/xz/xz.1:2396 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2410 +msgid "Scripts may use B, for example, to set script-specific default compression options. It is still recommended to allow users to override B if that is reasonable. For example, in B(1) scripts one may use something like this:" +msgstr "Scripturile pot folosi B, de exemplu, pentru a configura opțiunile implicite de comprimare specifice scriptului. Se recomandă totuși să se permită utilizatorilor să înlocuiască B dacă acest lucru este rezonabil. De exemplu, în scripturile B(1) se poate folosi ceva de genul acesta:" + +#. type: Plain text +#: ../src/xz/xz.1:2417 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: SH +#: ../src/xz/xz.1:2422 +#, no-wrap +msgid "LZMA UTILS COMPATIBILITY" +msgstr "COMPATIBILITATE CU LZMA-UTILS" + +#. type: Plain text +#: ../src/xz/xz.1:2435 +msgid "The command line syntax of B is practically a superset of B, B, and B as found from LZMA Utils 4.32.x. In most cases, it is possible to replace LZMA Utils with XZ Utils without breaking existing scripts. There are some incompatibilities though, which may sometimes cause problems." +msgstr "Sintaxa liniei de comandă a lui B este practic o super-colecție de B, B și B așa cum se găsește în LZMA Utils 4.32.x. În cele mai multe cazuri, este posibil să înlocuiți LZMA Utils cu XZ Utils fără a întrerupe scripturile existente. Există totuși unele incompatibilități, care uneori pot cauza probleme." + +#. type: SS +#: ../src/xz/xz.1:2436 +#, no-wrap +msgid "Compression preset levels" +msgstr "Niveluri de comprimare prestabilite" + +#. type: Plain text +#: ../src/xz/xz.1:2443 +msgid "The numbering of the compression level presets is not identical in B and LZMA Utils. The most important difference is how dictionary sizes are mapped to different presets. Dictionary size is roughly equal to the decompressor memory usage." +msgstr "Numerotarea nivelurilor de comprimare prestabilite nu este identică în B și LZMA Utils. Cea mai importantă diferență este modul în care dimensiunile dicționarului sunt atribuite diferitelor niveluri prestabilite. Dimensiunea dicționarului este aproximativ egală cu memoria utilizată la decomprimare." + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "Level" +msgstr "Nivel" + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "xz" +msgstr "xz" + +#. type: tbl table +#: ../src/xz/xz.1:2449 +#, no-wrap +msgid "LZMA Utils" +msgstr "LZMA Utils" + +#. type: tbl table +#: ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#, no-wrap +msgid "N/A" +msgstr "N/A" + +#. type: tbl table +#: ../src/xz/xz.1:2451 +#, no-wrap +msgid "64 KiB" +msgstr "64 KiB" + +#. type: tbl table +#: ../src/xz/xz.1:2453 +#, no-wrap +msgid "512 KiB" +msgstr "512 KiB" + +#. type: Plain text +#: ../src/xz/xz.1:2468 +msgid "The dictionary size differences affect the compressor memory usage too, but there are some other differences between LZMA Utils and XZ Utils, which make the difference even bigger:" +msgstr "Diferențele de dimensiune a dicționarului afectează deasemenea cantitatea de memorie utilizată la comprimare dar există și alte diferențe între LZMA Utils și XZ Utils, care fac diferența și mai mare:" + +#. type: tbl table +#: ../src/xz/xz.1:2474 +#, no-wrap +msgid "LZMA Utils 4.32.x" +msgstr "LZMA Utils 4.32.x" + +#. type: tbl table +#: ../src/xz/xz.1:2477 ../src/xz/xz.1:2478 +#, no-wrap +msgid "12 MiB" +msgstr "12 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2480 +#, no-wrap +msgid "26 MiB" +msgstr "26 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2481 +#, no-wrap +msgid "45 MiB" +msgstr "45 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2482 +#, no-wrap +msgid "83 MiB" +msgstr "83 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2483 +#, no-wrap +msgid "159 MiB" +msgstr "159 MiB" + +#. type: tbl table +#: ../src/xz/xz.1:2484 +#, no-wrap +msgid "311 MiB" +msgstr "311 MiB" + +#. type: Plain text +#: ../src/xz/xz.1:2493 +msgid "The default preset level in LZMA Utils is B<-7> while in XZ Utils it is B<-6>, so both use an 8 MiB dictionary by default." +msgstr "Nivelul prestabilit implicit în LZMA Utils este B<-7>, în timp ce în XZ Utils este B<-6>, deci ambele folosesc un dicționar de 8Mio în mod implicit." + +#. type: SS +#: ../src/xz/xz.1:2494 +#, no-wrap +msgid "Streamed vs. non-streamed .lzma files" +msgstr "Fișiere .lzma transmise în flux vs. netransmise în flux" + +#. type: Plain text +#: ../src/xz/xz.1:2504 +msgid "The uncompressed size of the file can be stored in the B<.lzma> header. LZMA Utils does that when compressing regular files. The alternative is to mark that uncompressed size is unknown and use end-of-payload marker to indicate where the decompressor should stop. LZMA Utils uses this method when uncompressed size isn't known, which is the case, for example, in pipes." +msgstr "Dimensiunea necomprimată a fișierului poate fi stocată în antetul B<.lzma>. LZMA Utils face asta atunci când comprimă fișiere obișnuite. Alternativa este să marcați că dimensiunea necomprimată este necunoscută și să folosiți marcajul de sfârșit de încărcare pentru a indica unde ar trebui să se oprească decomprimarea. LZMA Utils folosește această metodă atunci când dimensiunea necomprimată nu este cunoscută, ceea ce este cazul, de exemplu, când se folosesc conducte." + +#. type: Plain text +#: ../src/xz/xz.1:2525 +msgid "B supports decompressing B<.lzma> files with or without end-of-payload marker, but all B<.lzma> files created by B will use end-of-payload marker and have uncompressed size marked as unknown in the B<.lzma> header. This may be a problem in some uncommon situations. For example, a B<.lzma> decompressor in an embedded device might work only with files that have known uncompressed size. If you hit this problem, you need to use LZMA Utils or LZMA SDK to create B<.lzma> files with known uncompressed size." +msgstr "B acceptă decomprimarea fișierelor B<.lzma> cu sau fără marcaj de sfârșit de încărcare, dar toate fișierele B<.lzma> create de B vor folosi marcajul de sfârșit de încărcare și vor avea dimensiunea necomprimată marcată ca necunoscută în antetul B<.lzma>. Aceasta poate fi o problemă în unele situații mai puțin frecvente. De exemplu, un instrument de decomprimare B<.lzma> încorporat într-un dispozitiv poate funcționa numai cu fișiere care au dimensiunea necomprimată cunoscută. Dacă întâmpinați această problemă, trebuie să utilizați LZMA Utils sau LZMA SDK pentru a crea fișiere B<.lzma> cu dimensiunea necomprimată cunoscută." + +#. type: SS +#: ../src/xz/xz.1:2526 +#, no-wrap +msgid "Unsupported .lzma files" +msgstr "Fișiere .lzma neacceptate" + +#. type: Plain text +#: ../src/xz/xz.1:2549 +msgid "The B<.lzma> format allows I values up to 8, and I values up to 4. LZMA Utils can decompress files with any I and I, but always creates files with B and B. Creating files with other I and I is possible with B and with LZMA SDK." +msgstr "Formatul B<.lzma> permite valori I de până la 8 și valori I de până la 4. LZMA Utils poate decomprima fișiere cu orice I și I, dar creează întotdeauna fișiere cu B și B. Crearea de fișiere cu alte I și I este posibilă cu B și cu LZMA SDK." + +#. type: Plain text +#: ../src/xz/xz.1:2560 +msgid "The implementation of the LZMA1 filter in liblzma requires that the sum of I and I must not exceed 4. Thus, B<.lzma> files, which exceed this limitation, cannot be decompressed with B." +msgstr "Implementarea filtrului LZMA1 în liblzma necesită ca suma I și I să nu depășească 4. Altfel, fișierele B<.lzma>, care depășesc această limitare, nu pot fi decomprimate cu B." + +#. type: Plain text +#: ../src/xz/xz.1:2575 +msgid "LZMA Utils creates only B<.lzma> files which have a dictionary size of 2^I (a power of 2) but accepts files with any dictionary size. liblzma accepts only B<.lzma> files which have a dictionary size of 2^I or 2^I + 2^(I-1). This is to decrease false positives when detecting B<.lzma> files." +msgstr "LZMA Utils creează numai fișiere B<.lzma> care au o dimensiune de dicționar de 2^I (o putere de 2), dar acceptă fișiere cu orice dimensiune de dicționar. liblzma acceptă numai fișierele B<.lzma> care au dimensiunea de dicționar de 2^I sau 2^I + 2^(I-1). Acest lucru este pentru a reduce numărul de „fals pozitiv” atunci când se detectează fișiere B<.lzma>." + +#. type: Plain text +#: ../src/xz/xz.1:2580 +msgid "These limitations shouldn't be a problem in practice, since practically all B<.lzma> files have been compressed with settings that liblzma will accept." +msgstr "Aceste limitări nu ar trebui să fie o problemă în practică, deoarece practic toate fișierele B<.lzma> au fost comprimate cu opțiuni pe care liblzma le va accepta." + +#. type: SS +#: ../src/xz/xz.1:2581 +#, no-wrap +msgid "Trailing garbage" +msgstr "Resturi rămase" + +#. type: Plain text +#: ../src/xz/xz.1:2591 +msgid "When decompressing, LZMA Utils silently ignore everything after the first B<.lzma> stream. In most situations, this is a bug. This also means that LZMA Utils don't support decompressing concatenated B<.lzma> files." +msgstr "Când decomprimă, LZMA Utils ignoră în tăcere totul după primul flux B<.lzma>. În majoritatea situațiilor, aceasta este o eroare. Aceasta înseamnă, de asemenea, că LZMA Utils nu acceptă decomprimarea fișierelor B<.lzma> concatenate." + +#. type: Plain text +#: ../src/xz/xz.1:2601 +msgid "If there is data left after the first B<.lzma> stream, B considers the file to be corrupt unless B<--single-stream> was used. This may break obscure scripts which have assumed that trailing garbage is ignored." +msgstr "Dacă au rămas date după primul flux B<.lzma>, B consideră că fișierul este corupt, cu excepția cazului în care a fost utilizată opțiunea B<--single-stream>. Acest lucru poate rupe scripturile obscure(scrise deficitar) care presupun că resturile rămase sunt ignorate." + +#. type: SH +#: ../src/xz/xz.1:2602 ../src/xzdec/xzdec.1:117 +#, no-wrap +msgid "NOTES" +msgstr "NOTE" + +#. type: SS +#: ../src/xz/xz.1:2604 +#, no-wrap +msgid "Compressed output may vary" +msgstr "Rezultatul comprimării poate varia" + +#. type: Plain text +#: ../src/xz/xz.1:2615 +msgid "The exact compressed output produced from the same uncompressed input file may vary between XZ Utils versions even if compression options are identical. This is because the encoder can be improved (faster or better compression) without affecting the file format. The output can vary even between different builds of the same XZ Utils version, if different build options are used." +msgstr "Ieșirea exactă comprimată produsă din același fișier de intrare necomprimat poate varia între versiunile XZ Utils, chiar dacă opțiunile de comprimare sunt identice. Acest lucru se datorează faptului că instrumentul codificator poate fi îmbunătățit (comprimare mai rapidă sau mai bună) fără a afecta formatul fișierului. Ieșirea poate varia chiar și între compilările diferite ale aceleiași versiuni XZ Utils, dacă sunt utilizate opțiuni diferite de compilare." + +#. type: Plain text +#: ../src/xz/xz.1:2625 +msgid "The above means that once B<--rsyncable> has been implemented, the resulting files won't necessarily be rsyncable unless both old and new files have been compressed with the same xz version. This problem can be fixed if a part of the encoder implementation is frozen to keep rsyncable output stable across xz versions." +msgstr "Cele de mai sus înseamnă că odată ce opțiunea B<--rsyncable> a fost utilizată, fișierele rezultate nu vor fi neapărat sincronizate cu rsync decât dacă atât fișierele vechi, cât și cele noi au fost comprimate cu aceeași versiune xz. Această problemă poate fi remediată dacă o parte a implementării codificatorului este înghețată pentru a menține stabilă ieșirea „rsyncabilă” între versiunile xz." + +#. type: SS +#: ../src/xz/xz.1:2626 +#, no-wrap +msgid "Embedded .xz decompressors" +msgstr "Instrumente de decomprimare .xz încorporate" + +#. type: Plain text +#: ../src/xz/xz.1:2643 +msgid "Embedded B<.xz> decompressor implementations like XZ Embedded don't necessarily support files created with integrity I types other than B and B. Since the default is B<--check=crc64>, you must use B<--check=none> or B<--check=crc32> when creating files for embedded systems." +msgstr "Implementările instrumentului de decomprimare B<.xz> încorporat, cum ar fi XZ Embedded, nu acceptă neapărat fișiere create cu tipuri de I a integrității, altele decât B și B. Deoarece valoarea implicită este B<--check=crc64>, trebuie să utilizați B<--check=none> sau B<--check=crc32> atunci când creați fișiere pentru sistemele încorporate." + +#. type: Plain text +#: ../src/xz/xz.1:2653 +msgid "Outside embedded systems, all B<.xz> format decompressors support all the I types, or at least are able to decompress the file without verifying the integrity check if the particular I is not supported." +msgstr "În afara sistemelor încorporate, toate instrumentele de decomprimare în format B<.xz> acceptă toate tipurile de I sau cel puțin pot decomprima fișierul fără a efectua verificarea integrității dacă acel tip de I nu este acceptat." + +#. type: Plain text +#: ../src/xz/xz.1:2656 +msgid "XZ Embedded supports BCJ filters, but only with the default start offset." +msgstr "XZ Embedded acceptă filtre BCJ, dar numai cu poziție de pornire implicită." + +#. type: SH +#: ../src/xz/xz.1:2657 +#, no-wrap +msgid "EXAMPLES" +msgstr "EXEMPLE" + +#. type: SS +#: ../src/xz/xz.1:2659 +#, no-wrap +msgid "Basics" +msgstr "Bazice" + +#. type: Plain text +#: ../src/xz/xz.1:2669 +msgid "Compress the file I into I using the default compression level (B<-6>), and remove I if compression is successful:" +msgstr "Comprimă fișierul I în I folosind nivelul de comprimare implicit (B<-6>) și elimină fișierul I dacă comprimarea are succes:" + +#. type: Plain text +#: ../src/xz/xz.1:2674 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2685 +msgid "Decompress I into I and don't remove I even if decompression is successful:" +msgstr "Decomprimă I în I și nu elimină I chiar dacă decomprimarea este efectuată cu succes:" + +#. type: Plain text +#: ../src/xz/xz.1:2690 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2703 +msgid "Create I with the preset B<-4e> (B<-4 --extreme>), which is slower than the default B<-6>, but needs less memory for compression and decompression (48\\ MiB and 5\\ MiB, respectively):" +msgstr "Creează I cu nivelul prestabilit B<-4e> (B<-4 --extreme>), care este mai lent decât nivelul prestabilit implicit B<-6>, dar necesită mai puțină memorie pentru comprimare și decomprimare (48Mio și, respectiv, 5Mio):" + +#. type: Plain text +#: ../src/xz/xz.1:2708 +#, no-wrap +msgid "CW baz.tar.xz>\n" +msgstr "CW baz.tar.xz>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2714 +msgid "A mix of compressed and uncompressed files can be decompressed to standard output with a single command:" +msgstr "Un amestec de fișiere comprimate și necomprimate poate fi decomprimat la ieșirea standard cu o singură comandă:" + +#. type: Plain text +#: ../src/xz/xz.1:2719 +#, no-wrap +msgid "CW abcd.txt>\n" +msgstr "CW abcd.txt>\n" + +#. type: SS +#: ../src/xz/xz.1:2723 +#, no-wrap +msgid "Parallel compression of many files" +msgstr "Comprimarea în paralel a mai multor fișiere" + +#. type: Plain text +#: ../src/xz/xz.1:2729 +msgid "On GNU and *BSD, B(1) and B(1) can be used to parallelize compression of many files:" +msgstr "În sisteme GNU și *BSD, B(1) și B(1) pot fi utilizate pentru a paraleliza comprimarea mai multor fișiere:" + +#. type: Plain text +#: ../src/xz/xz.1:2735 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2757 +msgid "The B<-P> option to B(1) sets the number of parallel B processes. The best value for the B<-n> option depends on how many files there are to be compressed. If there are only a couple of files, the value should probably be 1; with tens of thousands of files, 100 or even more may be appropriate to reduce the number of B processes that B(1) will eventually create." +msgstr "Opțiunea B<-P> pentru comanda B(1) stabilește numărul de procese paralele B. Cea mai bună valoare pentru opțiunea B<-n> depinde de câte fișiere trebuie să fie comprimate. Dacă există doar câteva fișiere, valoarea ar trebui probabil să fie 1; cu zeci de mii de fișiere, 100 sau chiar mai mult poate să fie valoarea potrivită pentru a reduce numărul de procese B pe care B(1) le va crea în final." + +#. type: Plain text +#: ../src/xz/xz.1:2765 +msgid "The option B<-T1> for B is there to force it to single-threaded mode, because B(1) is used to control the amount of parallelization." +msgstr "Opțiunea B<-T1> pentru B este acolo pentru a-l forța să ruleze în modul cu un singur fir de execuție, deoarece B(1) este folosit pentru a controla cantitatea de paralelizare." + +#. type: SS +#: ../src/xz/xz.1:2766 +#, no-wrap +msgid "Robot mode" +msgstr "Modul robot" + +#. type: Plain text +#: ../src/xz/xz.1:2769 +msgid "Calculate how many bytes have been saved in total after compressing multiple files:" +msgstr "Calculează câți octeți au fost salvați în total după comprimarea mai multor fișiere:" + +#. type: Plain text +#: ../src/xz/xz.1:2774 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2789 +msgid "A script may want to know that it is using new enough B. The following B(1) script checks that the version number of the B tool is at least 5.0.0. This method is compatible with old beta versions, which didn't support the B<--robot> option:" +msgstr "Un script poate dori să afle dacă folosește o versiune B suficient de nouă. Următorul script B(1) verifică dacă numărul versiunii instrumentului B este cel puțin 5.0.0. Această metodă este compatibilă cu versiunile beta vechi, care nu acceptau opțiunea B<--robot>:" + +#. type: Plain text +#: ../src/xz/xz.1:2798 +#, no-wrap +msgid "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" +msgstr "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Versiunea dumneavoastră de „xz” este prea veche!\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2805 +msgid "Set a memory usage limit for decompression using B, but if a limit has already been set, don't increase it:" +msgstr "Stabilește o limită de utilizare a memoriei pentru decomprimare folosind variabila de mediu B, dar dacă o limită a fost deja stabilită, nu o mărește:" + +#. type: Plain text +#: ../src/xz/xz.1:2815 +#, no-wrap +msgid "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" +msgstr "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2825 +msgid "The simplest use for custom filter chains is customizing a LZMA2 preset. This can be useful, because the presets cover only a subset of the potentially useful combinations of compression settings." +msgstr "Cea mai simplă utilizare a lanțurilor de filtrare personalizate este personalizarea unei opțiuni prestabilite LZMA2. Acest lucru poate fi util, deoarece opțiunile prestabilite acoperă doar un subset al combinațiilor potențial utile de opțiuni de comprimare." + +#. type: Plain text +#: ../src/xz/xz.1:2833 +msgid "The CompCPU columns of the tables from the descriptions of the options B<-0> ... B<-9> and B<--extreme> are useful when customizing LZMA2 presets. Here are the relevant parts collected from those two tables:" +msgstr "Coloanele CPUComp din tabelele de descriere a opțiunilor B<-0> ... B<-9> și B<--extreme> sunt utile atunci când personalizați opțiunilor prestabilite LZMA2. Iată părțile relevante colectate din aceste două tabele:" + +#. type: Plain text +#: ../src/xz/xz.1:2858 +msgid "If you know that a file requires somewhat big dictionary (for example, 32\\ MiB) to compress well, but you want to compress it quicker than B would do, a preset with a low CompCPU value (for example, 1) can be modified to use a bigger dictionary:" +msgstr "Dacă știți că un fișier necesită un dicționar oarecum mare (de exemplu, 32Mio) pentru a se comprima bine, dar doriți să-l comprimați mai repede decât ar face B, o opțiune prestabilită cu o valoare CPUComp scăzută (de exemplu, 1) poate fi modificată pentru a utiliza un dicționar mai mare:" + +#. type: Plain text +#: ../src/xz/xz.1:2863 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2879 +msgid "With certain files, the above command may be faster than B while compressing significantly better. However, it must be emphasized that only some files benefit from a big dictionary while keeping the CompCPU value low. The most obvious situation, where a big dictionary can help a lot, is an archive containing very similar files of at least a few megabytes each. The dictionary size has to be significantly bigger than any individual file to allow LZMA2 to take full advantage of the similarities between consecutive files." +msgstr "Cu anumite fișiere, comanda de mai sus poate fi mai rapidă decât B în timp ce comprimă semnificativ mai bine. Cu toate acestea, trebuie subliniat că doar unele fișiere se beneficiază de un dicționar mare, păstrând în același timp valoarea CPUComp scăzută. Cea mai evidentă situație, în care un dicționar mare poate ajuta foarte mult, este o arhivă care conține fișiere foarte asemănătoare de cel puțin câțiva megaocteți fiecare. Dimensiunea dicționarului trebuie să fie semnificativ mai mare decât orice fișier individual pentru a permite LZMA2 să profite din plin de asemănările dintre fișierele consecutive." + +#. type: Plain text +#: ../src/xz/xz.1:2886 +msgid "If very high compressor and decompressor memory usage is fine, and the file being compressed is at least several hundred megabytes, it may be useful to use an even bigger dictionary than the 64 MiB that B would use:" +msgstr "Dacă utilizarea unei mari cantități de memorie pentru comprimare și decomprimare este în regulă, iar fișierul comprimat are cel puțin câteva sute de megaocteți, poate fi util să folosiți un dicționar și mai mare decât cei 64Mio pe care i-ar folosi B:" + +#. type: Plain text +#: ../src/xz/xz.1:2891 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2904 +msgid "Using B<-vv> (B<--verbose --verbose>) like in the above example can be useful to see the memory requirements of the compressor and decompressor. Remember that using a dictionary bigger than the size of the uncompressed file is waste of memory, so the above command isn't useful for small files." +msgstr "Utilizarea opțiunii B<-vv> (B<--verbose --verbose>) ca în exemplul de mai sus, poate fi utilă pentru a vedea cerințele de memorie la comprimare și decomprimare. Amintiți-vă că utilizarea unui dicționar mai mare decât dimensiunea fișierului necomprimat este risipă de memorie, de aceea, comanda de mai sus nu este utilă pentru fișiere mici." + +#. type: Plain text +#: ../src/xz/xz.1:2916 +msgid "Sometimes the compression time doesn't matter, but the decompressor memory usage has to be kept low, for example, to make it possible to decompress the file on an embedded system. The following command uses B<-6e> (B<-6 --extreme>) as a base and sets the dictionary to only 64\\ KiB. The resulting file can be decompressed with XZ Embedded (that's why there is B<--check=crc32>) using about 100\\ KiB of memory." +msgstr "Uneori, timpul de comprimare nu contează, dar utilizarea memoriei la decomprimare trebuie menținută la un nivel scăzut, de exemplu, pentru a face posibilă decomprimarea fișierului pe un sistem încorporat. Următoarea comandă folosește B<-6e> (B<-6 --extreme>) ca bază și fixează dimensiunea dicționarului la doar 64Kio. Fișierul rezultat poate fi decomprimat cu XZ Embedded (de aceea există B<--check=crc32>) folosind aproximativ 100Kio de memorie." + +#. type: Plain text +#: ../src/xz/xz.1:2921 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2944 +msgid "If you want to squeeze out as many bytes as possible, adjusting the number of literal context bits (I) and number of position bits (I) can sometimes help. Adjusting the number of literal position bits (I) might help too, but usually I and I are more important. For example, a source code archive contains mostly US-ASCII text, so something like the following might give slightly (like 0.1\\ %) smaller file than B (try also without B):" +msgstr "Dacă doriți să stoarceți cât mai mulți octeți posibil, ajustarea numărului de biți de context literal (I) și a numărului de biți de poziție (I) poate ajuta uneori. Ajustarea numărului de biți de poziție literală (I) ar putea ajuta, de asemenea, dar de obicei I și I sunt mai importante. De exemplu, o arhivă de cod sursă conține în mare parte text US-ASCII, așa că ceva precum comanda următoare, ar putea oferi un fișier „mai slăbuț” (aproximativ cu 0,1%) mai mic decât cu B (încercați și fără B):" + +#. type: Plain text +#: ../src/xz/xz.1:2949 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2957 +msgid "Using another filter together with LZMA2 can improve compression with certain file types. For example, to compress a x86-32 or x86-64 shared library using the x86 BCJ filter:" +msgstr "Utilizarea unui alt filtru împreună cu LZMA2 poate îmbunătăți comprimarea cu anumite tipuri de fișiere. De exemplu, pentru a comprima o bibliotecă partajată x86 pe 32 de biți sau x86 pe 64 de biți folosind filtrul BCJ x86:" + +#. type: Plain text +#: ../src/xz/xz.1:2962 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2976 +msgid "Note that the order of the filter options is significant. If B<--x86> is specified after B<--lzma2>, B will give an error, because there cannot be any filter after LZMA2, and also because the x86 BCJ filter cannot be used as the last filter in the chain." +msgstr "Rețineți că ordinea opțiunilor de filtrare este semnificativă. Dacă B<--x86> este specificată după B<--lzma2>, B va da o eroare, deoarece nu poate exista niciun filtru după LZMA2 și, de asemenea, pentru că filtrul x86 BCJ nu poate fi utilizat ca ultimul filtru din lanțul de filtrare." + +#. type: Plain text +#: ../src/xz/xz.1:2982 +msgid "The Delta filter together with LZMA2 can give good results with bitmap images. It should usually beat PNG, which has a few more advanced filters than simple delta but uses Deflate for the actual compression." +msgstr "Filtrul Delta împreună cu LZMA2 pot da rezultate bune cu imagini bitmap. De obicei, ar trebui să întreacă comprimarea PNG, care are câteva filtre mai avansate decât delta simplă, dar utilizează Deflate pentru comprimarea reală." + +#. type: Plain text +#: ../src/xz/xz.1:2992 +msgid "The image has to be saved in uncompressed format, for example, as uncompressed TIFF. The distance parameter of the Delta filter is set to match the number of bytes per pixel in the image. For example, 24-bit RGB bitmap needs B, and it is also good to pass B to LZMA2 to accommodate the three-byte alignment:" +msgstr "Imaginea trebuie să fie salvată în format necomprimat, de exemplu, ca TIFF necomprimat. Parametrul de distanță al filtrului Delta este fixat să se potrivească cu numărul de octeți per pixel din imagine. De exemplu, bitmap-ul RGB pe 24 de biți necesită B și este, de asemenea, bine să pasați B la LZMA2 pentru a se adapta alinierii pe trei octeți:" + +#. type: Plain text +#: ../src/xz/xz.1:2997 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:3005 +msgid "If multiple images have been put into a single archive (for example, B<.tar>), the Delta filter will work on that too as long as all images have the same number of bytes per pixel." +msgstr "Dacă mai multe imagini au fost introduse într-o singură arhivă (de exemplu, B<.tar>), filtrul Delta va funcționa și pe aceasta atâta timp cât toate imaginile au același număr de octeți per pixel." + +#. type: SH +#: ../src/xz/xz.1:3006 ../src/xzdec/xzdec.1:143 ../src/lzmainfo/lzmainfo.1:59 +#: ../src/scripts/xzdiff.1:65 ../src/scripts/xzgrep.1:106 +#: ../src/scripts/xzless.1:65 ../src/scripts/xzmore.1:51 +#, no-wrap +msgid "SEE ALSO" +msgstr "CONSULTAȚI ȘI" + +#. type: Plain text +#: ../src/xz/xz.1:3015 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" + +#. type: Plain text +#: ../src/xz/xz.1:3017 +msgid "XZ Utils: Ehttps://tukaani.org/xz/E" +msgstr "XZ Utils: Ehttps://tukaani.org/xz/E" + +#. type: Plain text +#: ../src/xz/xz.1:3019 ../src/xzdec/xzdec.1:146 +msgid "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" +msgstr "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" + +#. type: Plain text +#: ../src/xz/xz.1:3020 +msgid "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" +msgstr "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "XZDEC" +msgstr "XZDEC" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "2017-04-19" +msgstr "19.04.2017" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:10 +msgid "xzdec, lzmadec - Small .xz and .lzma decompressors" +msgstr "xzdec, lzmadec - Programe de decomprimare mici de fișiere .xz și .lzma" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:14 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:18 +msgid "B [I] [I]" +msgstr "B [I] [I]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:44 +msgid "B is a liblzma-based decompression-only tool for B<.xz> (and only B<.xz>) files. B is intended to work as a drop-in replacement for B(1) in the most common situations where a script has been written to use B (and possibly a few other commonly used options) to decompress B<.xz> files. B is identical to B except that B supports B<.lzma> files instead of B<.xz> files." +msgstr "B este un instrument de decomprimare bazat pe liblzma pentru fișierele B<.xz> (și numai B<.xz>). B este destinat să funcționeze ca un înlocuitor pentru B(1) în cele mai frecvente situații în care un script a fost scris pentru a utiliza B (și posibil câteva alte opțiuni frecvent utilizate) pentru a decomprima fișierele B<.xz>. B este identic cu B cu excepția faptului că B acceptă fișierele B<.lzma> în loc de fișierele B<.xz>." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:61 +msgid "To reduce the size of the executable, B doesn't support multithreading or localization, and doesn't read options from B and B environment variables. B doesn't support displaying intermediate progress information: sending B to B does nothing, but sending B terminates the process instead of displaying progress information." +msgstr "Pentru a reduce dimensiunea executabilului, B nu acceptă modul cu mai multe fire de execuție sau localizarea(afișarea mesajelor în limba stabilită de configurările regionale) și nu citește opțiunile din variabilele de mediu B și B. B nu acceptă afișarea informațiilor intermediare de progres: trimiterea semnalului B la B nu face nimic, iar trimiterea semnalului B încheie procesul în loc să afișeze informații despre progres." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:69 +msgid "Ignored for B(1) compatibility. B supports only decompression." +msgstr "Ignorat pentru compatibilitate cu B(1). B acceptă numai decomprimarea." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:76 +msgid "Ignored for B(1) compatibility. B never creates or removes any files." +msgstr "Ignorat pentru compatibilitate cu B(1). B nu creează sau elimină niciodată niciun fișier." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:83 +msgid "Ignored for B(1) compatibility. B always writes the decompressed data to standard output." +msgstr "Ignorat pentru compatibilitate cu B(1). B scrie întotdeauna datele decomprimate la ieșirea standard." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:89 +msgid "Specifying this once does nothing since B never displays any warnings or notices. Specify this twice to suppress errors." +msgstr "Specificarea acestui lucru o dată nu face nimic, deoarece B nu afișează niciodată avertismente sau notificări. Specificați acest lucru de două ori pentru a suprima erorile." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:96 +msgid "Ignored for B(1) compatibility. B never uses the exit status 2." +msgstr "Ignorat pentru compatibilitate cu B(1). B nu folosește niciodată starea de ieșire 2." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:99 +msgid "Display a help message and exit successfully." +msgstr "Afișează un mesaj de ajutor și iese cu succes." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:104 +msgid "Display the version number of B and liblzma." +msgstr "Afișează numărul versiunii B și liblzma." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:108 +msgid "All was good." +msgstr "Toate au fost bine." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:117 +msgid "B doesn't have any warning messages like B(1) has, thus the exit status 2 is not used by B." +msgstr "B nu are niciun mesaj de avertizare precum B(1), astfel că starea de ieșire 2 nu este folosită de B." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:131 +msgid "Use B(1) instead of B or B for normal everyday use. B or B are meant only for situations where it is important to have a smaller decompressor than the full-featured B(1)." +msgstr "Utilizați B(1) în loc de B sau B pentru utilizarea normală de zi cu zi. B sau B sunt destinate numai situațiilor în care este important să aveți un instrument de decomprimare mai mic decât B(1), cu funcții complete." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:143 +msgid "B and B are not really that small. The size can be reduced further by dropping features from liblzma at compile time, but that shouldn't usually be done for executables distributed in typical non-embedded operating system distributions. If you need a truly small B<.xz> decompressor, consider using XZ Embedded." +msgstr "B și B nu sunt chiar atât de mici. Dimensiunea poate fi redusă și mai mult prin eliminarea caracteristicilor din liblzma în timpul compilării, dar acest lucru nu ar trebui să se facă de obicei pentru executabilele distribuite în distribuții tipice de sisteme de operare neîncorporate. Dacă aveți nevoie de un instrument de decomprimare B<.xz> cu adevărat mic, luați în considerare utilizarea XZ Embedded." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:145 ../src/lzmainfo/lzmainfo.1:60 +msgid "B(1)" +msgstr "B(1)" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 +#, no-wrap +msgid "LZMAINFO" +msgstr "LZMAINFO" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "2013-06-30" +msgstr "30.06.2013" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:10 +msgid "lzmainfo - show information stored in the .lzma file header" +msgstr "lzmainfo - afișează informațiile stocate în antetul fișierului .lzma" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:15 +msgid "B [B<--help>] [B<--version>] [I]" +msgstr "B [B<--help>] [B<--version>] [I]" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:31 +msgid "B shows information stored in the B<.lzma> file header. It reads the first 13 bytes from the specified I, decodes the header, and prints it to standard output in human readable format. If no I are given or I is B<->, standard input is read." +msgstr "B afișează informațiile stocate în antetul fișierului B<.lzma>. Citește primii 13 octeți din I specificat, decodifică antetul și îl afișează la ieșirea standard în format care poate fi citit de om. Dacă nu sunt date I sau dacă I este B<->, se citește intrarea standard." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:40 +msgid "Usually the most interesting information is the uncompressed size and the dictionary size. Uncompressed size can be shown only if the file is in the non-streamed B<.lzma> format variant. The amount of memory required to decompress the file is a few dozen kilobytes plus the dictionary size." +msgstr "De obicei, cele mai interesante informații sunt dimensiunea necomprimată și dimensiunea dicționarului. Dimensiunea necomprimată poate fi afișată numai dacă fișierul este în varianta formatului B<.lzma> netransmis în flux. Cantitatea de memorie necesară pentru a decomprima fișierul este de câteva zeci de kiloocteți plus dimensiunea dicționarului." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:44 +msgid "B is included in XZ Utils primarily for backward compatibility with LZMA Utils." +msgstr "B este inclus în XZ Utils în primul rând pentru compatibilitatea cu LZMA Utils." + +#. type: SH +#: ../src/lzmainfo/lzmainfo.1:51 ../src/scripts/xzdiff.1:74 +#, no-wrap +msgid "BUGS" +msgstr "ERORI" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:59 +msgid "B uses B while the correct suffix would be B (2^20 bytes). This is to keep the output compatible with LZMA Utils." +msgstr "B folosește sufixul B în timp ce sufixul corect ar fi B (2^20 octeți). Acest lucru este pentru a menține ieșirea compatibilă cu LZMA Utils." + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "XZDIFF" +msgstr "XZDIFF" + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "2021-06-04" +msgstr "04.06.2021" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:12 +msgid "xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files" +msgstr "xzcmp, xzdiff, lzcmp, lzdiff - compară fișierele comprimate" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:15 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:18 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:21 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:24 +msgid "B [I] I [I]" +msgstr "B [I] I [I]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:59 +msgid "B and B invoke B(1) or B(1) on files compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1) or B(1). If only one file is specified, then the files compared are I (which must have a suffix of a supported compression format) and I from which the compression format suffix has been stripped. If two files are specified, then they are uncompressed if necessary and fed to B(1) or B(1). The exit status from B(1) or B(1) is preserved unless a decompression error occurs; then exit status is 2." +msgstr "B și B invocă B(1) sau B(1) pentru fișierele comprimate cu B(1), B(1), B( 1), B(1), B(1) sau B(1). Toate opțiunile specificate sunt transmise direct către B(1) sau B(1). Dacă este specificat un singur fișier, atunci fișierele comparate sunt I (care trebuie să aibă un sufix al unui format de comprimare acceptat) și I din care a fost eliminat sufixul formatului de comprimare. Dacă sunt specificate două fișiere, atunci acestea sunt decomprimate dacă este necesar și introduse în B(1) sau B(1). Starea de ieșire din B(1) sau B(1) este păstrată cu excepția cazului în care apare o eroare de decomprimare; atunci starea de ieșire este 2." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:65 +msgid "The names B and B are provided for backward compatibility with LZMA Utils." +msgstr "Numele B și B sunt furnizate pentru compatibilitatea cu LZMA Utils." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:74 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:79 +msgid "Messages from the B(1) or B(1) programs refer to temporary filenames instead of those specified." +msgstr "Mesajele din programele B(1) sau B(1) se referă la nume de fișiere temporare în loc de cele specificate." + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "XZGREP" +msgstr "XZGREP" + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "2022-07-19" +msgstr "19.07.2022" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:12 +msgid "xzgrep - search compressed files for a regular expression" +msgstr "xzgrep - caută în fișierele comprimate pentru o expresie regulată" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:18 +msgid "B [I] [B<-e>] I [I]" +msgstr "B [I] [B<-e>] I [I]" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:21 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:24 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:27 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:30 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:33 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:49 +msgid "B invokes B(1) on I which may be either uncompressed or compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1)." +msgstr "B invocă B(1) pentru I care pot să fie decomprimate sau comprimate cu B(1), B(1), B(1), B(1), B(1) sau B(1). Toate opțiunile specificate sunt transmise direct către B(1)." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:62 +msgid "If no I is specified, then standard input is decompressed if necessary and fed to B(1). When reading from standard input, B(1), B(1), B(1), and B(1) compressed files are not supported." +msgstr "Dacă nu este specificat I, atunci intrarea standard este decomprimată dacă este necesar și alimentează B(1). La citirea din intrarea standard, fișierele comprimate B(1), B(1), B(1) și B(1) nu sunt acceptate." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:81 +msgid "If B is invoked as B or B then B or B is used instead of B(1). The same applies to names B, B, and B, which are provided for backward compatibility with LZMA Utils." +msgstr "Dacă B este invocat ca B sau B, atunci este folosit B sau B în loc de B(1). Același lucru este valabil și pentru comenzile B, B și B, care sunt furnizate pentru compatibilitate cu LZMA Utils." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:86 +msgid "At least one match was found from at least one of the input files. No errors occurred." +msgstr "A fost găsită cel puțin o potrivire din cel puțin unul dintre fișierele de la intrare. Nu au apărut erori." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:90 +msgid "No matches were found from any of the input files. No errors occurred." +msgstr "Nu au fost găsite potriviri din niciunul dintre fișierele de la intrare. Nu au apărut erori." + +#. type: TP +#: ../src/scripts/xzgrep.1:90 +#, no-wrap +msgid "E1" +msgstr "E1" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:94 +msgid "One or more errors occurred. It is unknown if matches were found." +msgstr "A apărut una sau mai multe erori. Nu se cunoaște dacă au fost găsite potriviri." + +#. type: TP +#: ../src/scripts/xzgrep.1:95 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:106 +msgid "If the B environment variable is set, B uses it instead of B(1), B, or B." +msgstr "Dacă variabila de mediu B este definită, B o folosește în loc de B(1), B sau B." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:113 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "XZLESS" +msgstr "XZLESS" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "2010-09-27" +msgstr "27.09.2010" + +#. type: Plain text +#: ../src/scripts/xzless.1:13 +msgid "xzless, lzless - view xz or lzma compressed (text) files" +msgstr "xzless, lzless - vizualizează fișierele (text) comprimate xz sau lzma" + +#. type: Plain text +#: ../src/scripts/xzless.1:16 +msgid "B [I...]" +msgstr "B [I...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:19 +msgid "B [I...]" +msgstr "B [I...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:31 +msgid "B is a filter that displays text from compressed files to a terminal. It works on files compressed with B(1) or B(1). If no I are given, B reads from standard input." +msgstr "B este un filtru care afișează textul din fișierele comprimate pe un terminal. Funcționează pentru fișiere comprimate cu B(1) sau B(1). Dacă nu sunt date I, B citește de la intrarea standard." + +#. type: Plain text +#: ../src/scripts/xzless.1:48 +msgid "B uses B(1) to present its output. Unlike B, its choice of pager cannot be altered by setting an environment variable. Commands are based on both B(1) and B(1) and allow back and forth movement and searching. See the B(1) manual for more information." +msgstr "B folosește B(1) pentru a-și prezenta rezultatul. Spre deosebire de B, alegerea sa de pager nu poate fi modificată prin definirea unei variabile de mediu. Comenzile se bazează atât pe B(1) cât și pe B(1) și permit mișcarea înainte și înapoi și căutarea. Consultați manualul B(1) pentru mai multe informații." + +#. type: Plain text +#: ../src/scripts/xzless.1:52 +msgid "The command named B is provided for backward compatibility with LZMA Utils." +msgstr "Comanda numită B este furnizată pentru compatibilitatea cu LZMA Utils." + +#. type: TP +#: ../src/scripts/xzless.1:53 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:59 +msgid "A list of characters special to the shell. Set by B unless it is already set in the environment." +msgstr "O listă de caractere speciale pentru shell. Definită de B, cu excepția cazului în care este deja definită în mediu." + +#. type: TP +#: ../src/scripts/xzless.1:59 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:65 +msgid "Set to a command line to invoke the B(1) decompressor for preprocessing the input files to B(1)." +msgstr "Aceasta este definită în linia de comandă pentru a invoca instrumentul de decomprimare B(1) pentru preprocesarea fișierelor de intrare pentru B(1)." + +#. type: Plain text +#: ../src/scripts/xzless.1:69 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZMORE" +msgstr "XZMORE" + +#. type: Plain text +#: ../src/scripts/xzmore.1:10 +msgid "xzmore, lzmore - view xz or lzma compressed (text) files" +msgstr "xzmore, lzmore - vizualizează fișierele (text) comprimate xz sau lzma" + +#. type: Plain text +#: ../src/scripts/xzmore.1:13 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:16 +msgid "B [I]" +msgstr "B [I]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:24 +msgid "B is a filter which allows examination of B(1) or B(1) compressed text files one screenful at a time on a soft-copy terminal." +msgstr "B este un filtru care vă permite să examinați conținutul fișierelor text comprimate B(1) sau B(1), câte o pagină pe ecran, pe un terminal." + +#. type: Plain text +#: ../src/scripts/xzmore.1:33 +msgid "To use a pager other than the default B set environment variable B to the name of the desired program. The name B is provided for backward compatibility with LZMA Utils." +msgstr "Pentru a utiliza un paginator, altul decât paginatorul implicit B, definiți variabila de mediu B cu numele programului dorit. Comanda B este furnizată pentru compatibilitatea cu LZMA Utils." + +#. type: TP +#: ../src/scripts/xzmore.1:33 +#, no-wrap +msgid "B or B" +msgstr "B sau B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:40 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to exit." +msgstr "Când linia --More--(Fișierul următor: I) este afișată, această comandă face ca B să iasă." + +#. type: TP +#: ../src/scripts/xzmore.1:40 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:47 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to skip the next file and continue." +msgstr "Când linia --More--(Fișierul următor: I) este afișată, această comandă face ca B să omită următorul fișier și să continue." + +#. type: Plain text +#: ../src/scripts/xzmore.1:51 +msgid "For list of keyboard commands supported while actually viewing the content of a file, refer to manual of the pager you use, usually B(1)." +msgstr "Pentru lista comenzilor de la tastatură acceptate în timp ce vizualizați conținutul unui fișier, consultați manualul paginatorului pe care îl utilizați, de obicei B(1)." + +#. type: Plain text +#: ../src/scripts/xzmore.1:55 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#~ msgid "2020-02-01" +#~ msgstr "01.02.2020" diff --git a/po4a/uk.po b/po4a/uk.po new file mode 100644 index 0000000..1c21f84 --- /dev/null +++ b/po4a/uk.po @@ -0,0 +1,3676 @@ +# Ukrainian translation for xz-man. +# This file is distributed under the same license as the XZ Utils package. +# This file is put in the public domain. +# +# Yuri Chornoivan , 2022. +msgid "" +msgstr "" +"Project-Id-Version: xz-man-5.4.0-pre2\n" +"POT-Creation-Date: 2022-12-01 21:23+0200\n" +"PO-Revision-Date: 2022-12-27 17:33+0200\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 20.12.0\n" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "XZ" +msgstr "XZ" + +#. type: TH +#: ../src/xz/xz.1:8 +#, no-wrap +msgid "2022-12-01" +msgstr "1 грудня 2022 року" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "Tukaani" +msgstr "Tukaani" + +#. type: TH +#: ../src/xz/xz.1:8 ../src/xzdec/xzdec.1:7 ../src/lzmainfo/lzmainfo.1:7 +#: ../src/scripts/xzdiff.1:9 ../src/scripts/xzgrep.1:9 +#: ../src/scripts/xzless.1:10 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZ Utils" +msgstr "XZ Utils" + +#. type: SH +#: ../src/xz/xz.1:10 ../src/xzdec/xzdec.1:8 ../src/lzmainfo/lzmainfo.1:8 +#: ../src/scripts/xzdiff.1:10 ../src/scripts/xzgrep.1:10 +#: ../src/scripts/xzless.1:11 ../src/scripts/xzmore.1:8 +#, no-wrap +msgid "NAME" +msgstr "НАЗВА" + +#. type: Plain text +#: ../src/xz/xz.1:12 +msgid "xz, unxz, xzcat, lzma, unlzma, lzcat - Compress or decompress .xz and .lzma files" +msgstr "xz, unxz, xzcat, lzma, unlzma, lzcat — стискання та розпаковування файлів .xz і .lzma" + +#. type: SH +#: ../src/xz/xz.1:13 ../src/xzdec/xzdec.1:10 ../src/lzmainfo/lzmainfo.1:10 +#: ../src/scripts/xzdiff.1:12 ../src/scripts/xzgrep.1:12 +#: ../src/scripts/xzless.1:13 ../src/scripts/xzmore.1:10 +#, no-wrap +msgid "SYNOPSIS" +msgstr "КОРОТКИЙ ОПИС" + +#. type: Plain text +#: ../src/xz/xz.1:17 +msgid "B [I] [I]" +msgstr "B [I<параметр...>] [I<файл...>]" + +#. type: SH +#: ../src/xz/xz.1:18 +#, no-wrap +msgid "COMMAND ALIASES" +msgstr "СКОРОЧЕННЯ КОМАНД" + +#. type: Plain text +#: ../src/xz/xz.1:22 +msgid "B is equivalent to B." +msgstr "B є рівноцінним до B." + +#. type: Plain text +#: ../src/xz/xz.1:26 +msgid "B is equivalent to B." +msgstr "B є рівноцінним до B." + +#. type: Plain text +#: ../src/xz/xz.1:30 +msgid "B is equivalent to B." +msgstr "B є рівноцінним до B." + +#. type: Plain text +#: ../src/xz/xz.1:34 +msgid "B is equivalent to B." +msgstr "B є рівноцінним до B." + +#. type: Plain text +#: ../src/xz/xz.1:38 +msgid "B is equivalent to B." +msgstr "B є рівноцінним до B." + +#. type: Plain text +#: ../src/xz/xz.1:50 +msgid "When writing scripts that need to decompress files, it is recommended to always use the name B with appropriate arguments (B or B) instead of the names B and B." +msgstr "При написанні скриптів, де потрібно розпаковувати файли, рекомендуємо завжди використовувати B із відповідними аргументами (B або B), замість B і B." + +#. type: SH +#: ../src/xz/xz.1:51 ../src/xzdec/xzdec.1:18 ../src/lzmainfo/lzmainfo.1:15 +#: ../src/scripts/xzdiff.1:24 ../src/scripts/xzgrep.1:33 +#: ../src/scripts/xzless.1:19 ../src/scripts/xzmore.1:16 +#, no-wrap +msgid "DESCRIPTION" +msgstr "ОПИС" + +#. type: Plain text +#: ../src/xz/xz.1:70 +msgid "B is a general-purpose data compression tool with command line syntax similar to B(1) and B(1). The native file format is the B<.xz> format, but the legacy B<.lzma> format used by LZMA Utils and raw compressed streams with no container format headers are also supported. In addition, decompression of the B<.lz> format used by B is supported." +msgstr "B інструмент загального призначення для стискання даних із синтаксисом командного рядка, подібним для B(1) і B(1). Власним форматом файлів є B<.xz>, але передбачено підтримку застарілого формату B<.lzma>, який було використано у LZMA Utils, та необроблених потоків стиснених даних без заголовків формату контейнера. Крім того, передбачено підтримку розпаковування формату B<.lz>, який використано у B." + +#. type: Plain text +#: ../src/xz/xz.1:92 +msgid "B compresses or decompresses each I according to the selected operation mode. If no I are given or I is B<->, B reads from standard input and writes the processed data to standard output. B will refuse (display an error and skip the I) to write compressed data to standard output if it is a terminal. Similarly, B will refuse to read compressed data from standard input if it is a terminal." +msgstr "B стискає або розпаковує кожен I<файл> відповідно до вибраного режиму дій. Якщо I<файли> не задано або якщо I<файлом> є B<->, B читатиме дані зі стандартного джерела вхідних даних і записуватиме оброблені дані до стандартного виведення. B відмовить (покаже повідомлення про помилку і пропустить I<файл>) у записів стиснених даних до стандартного виведення, якщо це термінал. Так само, B відмовить у читанні стиснених даних зі стандартного джерела вхідних даних, якщо це термінал." + +#. type: Plain text +#: ../src/xz/xz.1:102 +msgid "Unless B<--stdout> is specified, I other than B<-> are written to a new file whose name is derived from the source I name:" +msgstr "Якщо не вказано B<--stdout>, I<файли>, відмінні від B<->, буде записано до нового файла, чию назву буде визначено з назви початкового I<файла>:" + +#. type: IP +#: ../src/xz/xz.1:102 ../src/xz/xz.1:108 ../src/xz/xz.1:133 ../src/xz/xz.1:138 +#: ../src/xz/xz.1:141 ../src/xz/xz.1:144 ../src/xz/xz.1:160 ../src/xz/xz.1:421 +#: ../src/xz/xz.1:424 ../src/xz/xz.1:431 ../src/xz/xz.1:676 ../src/xz/xz.1:678 +#: ../src/xz/xz.1:777 ../src/xz/xz.1:788 ../src/xz/xz.1:797 ../src/xz/xz.1:805 +#: ../src/xz/xz.1:1033 ../src/xz/xz.1:1042 ../src/xz/xz.1:1054 +#: ../src/xz/xz.1:1729 ../src/xz/xz.1:1735 ../src/xz/xz.1:1853 +#: ../src/xz/xz.1:1857 ../src/xz/xz.1:1860 ../src/xz/xz.1:1863 +#: ../src/xz/xz.1:1867 ../src/xz/xz.1:1874 ../src/xz/xz.1:1876 +#, no-wrap +msgid "\\(bu" +msgstr "\\(bu" + +#. type: Plain text +#: ../src/xz/xz.1:108 +msgid "When compressing, the suffix of the target file format (B<.xz> or B<.lzma>) is appended to the source filename to get the target filename." +msgstr "При стисканні суфікс формату файла призначення (B<.xz> або B<.lzma>) буде дописано до назви початкового файла для отримання назви файла призначення." + +#. type: Plain text +#: ../src/xz/xz.1:123 +msgid "When decompressing, the B<.xz>, B<.lzma>, or B<.lz> suffix is removed from the filename to get the target filename. B also recognizes the suffixes B<.txz> and B<.tlz>, and replaces them with the B<.tar> suffix." +msgstr "При розпаковуванні суфікс B<.xz>, B<.lzma> або B<.lz> буде вилучено з назви файла для отримання назви файла призначення. Крім того, B розпізнає суфікси B<.txz> і B<.tlz> і замінює їх на суфікс B<.tar>." + +#. type: Plain text +#: ../src/xz/xz.1:127 +msgid "If the target file already exists, an error is displayed and the I is skipped." +msgstr "Якщо файл призначення вже існує, буде показано повідомлення про помилку, а I<файл> буде пропущено." + +#. type: Plain text +#: ../src/xz/xz.1:133 +msgid "Unless writing to standard output, B will display a warning and skip the I if any of the following applies:" +msgstr "Окрім випадку запису до стандартного виведення, B покаже попередження і пропустить обробку I<файла>, якщо буде виконано будь-яку з таких умов:" + +#. type: Plain text +#: ../src/xz/xz.1:138 +msgid "I is not a regular file. Symbolic links are not followed, and thus they are not considered to be regular files." +msgstr "I<Файл> не є звичайним файлом. Програма не переходитиме за символічними посиланнями, а отже, не вважатиме їх звичайними файлами." + +#. type: Plain text +#: ../src/xz/xz.1:141 +msgid "I has more than one hard link." +msgstr "На I<файл> існує декілька жорстких посилань." + +#. type: Plain text +#: ../src/xz/xz.1:144 +msgid "I has setuid, setgid, or sticky bit set." +msgstr "Для I<файла> встановлено setuid, setgid або «липкий» біт." + +#. type: Plain text +#: ../src/xz/xz.1:160 +msgid "The operation mode is set to compress and the I already has a suffix of the target file format (B<.xz> or B<.txz> when compressing to the B<.xz> format, and B<.lzma> or B<.tlz> when compressing to the B<.lzma> format)." +msgstr "Режим дій встановлено у значення «стискання», і I<файл> вже має суфікс назви формату файла призначення (B<.xz> або B<.txz> при стисканні до формату B<.xz>, і B<.lzma> або B<.tlz> при стисканні до формату B<.lzma>)." + +#. type: Plain text +#: ../src/xz/xz.1:170 +msgid "The operation mode is set to decompress and the I doesn't have a suffix of any of the supported file formats (B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz>)." +msgstr "Режим дій встановлено у значення «розпаковування», і I<файл> не має суфікса назви жодного з підтримуваних форматів (B<.xz>, B<.txz>, B<.lzma>, B<.tlz> або B<.lz>)." + +#. type: Plain text +#: ../src/xz/xz.1:185 +msgid "After successfully compressing or decompressing the I, B copies the owner, group, permissions, access time, and modification time from the source I to the target file. If copying the group fails, the permissions are modified so that the target file doesn't become accessible to users who didn't have permission to access the source I. B doesn't support copying other metadata like access control lists or extended attributes yet." +msgstr "Після успішного стискання або розпаковування I<файла>, B копіює дані щодо власника, групи, прав доступу, часу доступу та моменту внесення змін з початкового I<файла> до файла призначення. Якщо копіювання даних щодо групи зазнає невдачі, права доступу буде змінено так, що файл призначення стане недоступним для користувачів, які не мають права доступу до початкового I<файла>. В B ще не передбачено підтримки копіювання інших метаданих, зокрема списків керування доступом або розширених атрибутів." + +#. type: Plain text +#: ../src/xz/xz.1:195 +msgid "Once the target file has been successfully closed, the source I is removed unless B<--keep> was specified. The source I is never removed if the output is written to standard output or if an error occurs." +msgstr "Щойно файл призначення буде успішно закрито, початковий I<файл> буде вилучено, якщо не вказано параметра B<--keep>. Початковий I<файл> ніколи не буде вилучено, якщо виведені дані буде записано до стандартного виведення або якщо станеться помилка." + +#. type: Plain text +#: ../src/xz/xz.1:207 +msgid "Sending B or B to the B process makes it print progress information to standard error. This has only limited use since when standard error is a terminal, using B<--verbose> will display an automatically updating progress indicator." +msgstr "Надсилання B або B до процесу B призводить до виведення даних щодо поступу до стандартного виведення помилок. Це має лише обмежене використання, оскільки якщо стандартним виведенням помилок є термінал, використання B<--verbose> призведе до показу автоматично оновлюваного індикатора поступу." + +#. type: SS +#: ../src/xz/xz.1:208 +#, no-wrap +msgid "Memory usage" +msgstr "Використання пам'яті" + +#. type: Plain text +#: ../src/xz/xz.1:224 +msgid "The memory usage of B varies from a few hundred kilobytes to several gigabytes depending on the compression settings. The settings used when compressing a file determine the memory requirements of the decompressor. Typically the decompressor needs 5\\ % to 20\\ % of the amount of memory that the compressor needed when creating the file. For example, decompressing a file created with B currently requires 65\\ MiB of memory. Still, it is possible to have B<.xz> files that require several gigabytes of memory to decompress." +msgstr "Використання B пам'яті може бути різним: від декількох сотень кілобайтів до декількох гігабайтів, залежно від параметрів стискання. Параметри, які використано при стисканні файла, визначають вимоги до об'єму пам'яті при розпакуванні. Типово, засобу розпаковування потрібно від 5\\ % до 20\\ % об'єму пам'яті, якого засіб стискання потребує при створенні файла. Наприклад, розпаковування файла, який створено з використанням B, у поточній версії потребує 65\\ МіБ пам'яті. Втім, можливе створення файлів B<.xz>, які потребуватимуть для розпаковування декількох гігабайтів пам'яті." + +#. type: Plain text +#: ../src/xz/xz.1:236 +msgid "Especially users of older systems may find the possibility of very large memory usage annoying. To prevent uncomfortable surprises, B has a built-in memory usage limiter, which is disabled by default. While some operating systems provide ways to limit the memory usage of processes, relying on it wasn't deemed to be flexible enough (for example, using B(1) to limit virtual memory tends to cripple B(2))." +msgstr "Ймовірність високого рівня використання пам'яті може бути особливо дошкульною для користувачів застарілих комп'ютерів. Щоб запобігти прикрим несподіванкам, у B передбачено вбудований обмежувач пам'яті, який типово вимкнено. Хоча у деяких операційних системах передбачено спосіб обмежити використання пам'яті процесами, сподівання на його ефективність не є аж надто гнучким (наприклад, використання B(1) для обмеження віртуальної пам'яті призводить до викривлення даних B(2))." + +#. type: Plain text +#: ../src/xz/xz.1:258 +msgid "The memory usage limiter can be enabled with the command line option B<--memlimit=>I. Often it is more convenient to enable the limiter by default by setting the environment variable B, for example, B. It is possible to set the limits separately for compression and decompression by using B<--memlimit-compress=>I and B<--memlimit-decompress=>I. Using these two options outside B is rarely useful because a single run of B cannot do both compression and decompression and B<--memlimit=>I (or B<-M> I) is shorter to type on the command line." +msgstr "Обмежувач пам'яті можна увімкнути за допомогою параметра командного рядка B<--memlimit=>I<обмеження>. Часто, зручніше увімкнути обмежувач на типовому рівні, встановивши значення для змінної середовища B, наприклад, B. Можна встановити обмеження окремо для стискання і розпакування за допомогою B<--memlimit-compress=>I and B<--memlimit-decompress=>I<обмеження>. Використання цих двох параметрів поза B не таке вже і корисне, оскільки одноразовий запуск B не може одночасно призводити до стискання та розпаковування, а набрати у командному рядку B<--memlimit=>I<обмеження> (або B<-M> I<обмеження>) набагато швидше." + +#. type: Plain text +#: ../src/xz/xz.1:277 +msgid "If the specified memory usage limit is exceeded when decompressing, B will display an error and decompressing the file will fail. If the limit is exceeded when compressing, B will try to scale the settings down so that the limit is no longer exceeded (except when using B<--format=raw> or B<--no-adjust>). This way the operation won't fail unless the limit is very small. The scaling of the settings is done in steps that don't match the compression level presets, for example, if the limit is only slightly less than the amount required for B, the settings will be scaled down only a little, not all the way down to B." +msgstr "Якщо під час розпаковування вказане обмеження буде перевищено, B покаже повідомлення про помилку, а розпаковування файла зазнає невдачі. Якщо обмеження буде перевищено при стисканні, B спробує масштабувати параметри так, щоб не перевищувати обмеження (окрім випадків використання B<--format=raw> або B<--no-adjust>). Отже, дію буде виконано, якщо обмеження не є надто жорстким. Масштабування параметрів буде виконано кроками, які не збігаються із рівнями шаблонів стискання. Наприклад, якщо обмеження лише трохи не вкладається у об'єм потрібний для B, параметри буде змінено лише трохи, не до рівня B." + +#. type: SS +#: ../src/xz/xz.1:278 +#, no-wrap +msgid "Concatenation and padding with .xz files" +msgstr "Поєднання і заповнення з файлами .xz" + +#. type: Plain text +#: ../src/xz/xz.1:286 +msgid "It is possible to concatenate B<.xz> files as is. B will decompress such files as if they were a single B<.xz> file." +msgstr "Можна поєднати файли B<.xz> без додаткової обробки. B розпакує такі файли так, наче вони є єдиним файлом B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:295 +msgid "It is possible to insert padding between the concatenated parts or after the last part. The padding must consist of null bytes and the size of the padding must be a multiple of four bytes. This can be useful, for example, if the B<.xz> file is stored on a medium that measures file sizes in 512-byte blocks." +msgstr "Можна додати доповнення між з'єднаними частинами або після останньої частини. Доповнення має складатися із нульових байтів і мати розмір, який є кратним до чотирьох байтів. Це може бути корисним, наприклад, якщо файл B<.xz> зберігається на носії даних, де розміри файла вимірюються у 512-байтових блоках." + +#. type: Plain text +#: ../src/xz/xz.1:299 +msgid "Concatenation and padding are not allowed with B<.lzma> files or raw streams." +msgstr "Поєднання та заповнення не можна використовувати для файлів B<.lzma> або потоків необроблених даних." + +#. type: SH +#: ../src/xz/xz.1:300 ../src/xzdec/xzdec.1:61 +#, no-wrap +msgid "OPTIONS" +msgstr "ПАРАМЕТРИ" + +#. type: SS +#: ../src/xz/xz.1:302 +#, no-wrap +msgid "Integer suffixes and special values" +msgstr "Цілочисельні суфікси і спеціальні значення" + +#. type: Plain text +#: ../src/xz/xz.1:306 +msgid "In most places where an integer argument is expected, an optional suffix is supported to easily indicate large integers. There must be no space between the integer and the suffix." +msgstr "У більшості місць, де потрібен цілочисельний аргумент, передбачено підтримку необов'язкового суфікса для простого визначення великих цілих чисел. Між цілим числом і суфіксом не повинно бути пробілів." + +#. type: TP +#: ../src/xz/xz.1:306 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:317 +msgid "Multiply the integer by 1,024 (2^10). B, B, B, B, and B are accepted as synonyms for B." +msgstr "Помножити ціле число на 1024 (2^10). Синонімами B є B, B, B, B та B." + +#. type: TP +#: ../src/xz/xz.1:317 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:327 +msgid "Multiply the integer by 1,048,576 (2^20). B, B, B, and B are accepted as synonyms for B." +msgstr "Помножити ціле число на 1048576 (2^20). Синонімами B є B, B, B, B та B." + +#. type: TP +#: ../src/xz/xz.1:327 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:337 +msgid "Multiply the integer by 1,073,741,824 (2^30). B, B, B, and B are accepted as synonyms for B." +msgstr "Помножити ціле число на 1073741824 (2^30). Синонімами B є B, B, B, B та B." + +#. type: Plain text +#: ../src/xz/xz.1:342 +msgid "The special value B can be used to indicate the maximum integer value supported by the option." +msgstr "Можна скористатися особливим значенням B для позначення максимального цілого значення, підтримку якого передбачено для параметра." + +#. type: SS +#: ../src/xz/xz.1:343 +#, no-wrap +msgid "Operation mode" +msgstr "Режим операції" + +#. type: Plain text +#: ../src/xz/xz.1:346 +msgid "If multiple operation mode options are given, the last one takes effect." +msgstr "Якщо вказано декілька параметрів режиму дій, буде використано лише останній з них." + +#. type: TP +#: ../src/xz/xz.1:346 +#, no-wrap +msgid "B<-z>, B<--compress>" +msgstr "B<-z>, B<--compress>" + +#. type: Plain text +#: ../src/xz/xz.1:355 +msgid "Compress. This is the default operation mode when no operation mode option is specified and no other operation mode is implied from the command name (for example, B implies B<--decompress>)." +msgstr "Стиснути. Це типовий режим дій, якщо не вказано параметр режиму дій, а назва команди неявним чином не визначає іншого режиму дій (наприклад, B неявно визначає B<--decompress>)." + +#. type: TP +#: ../src/xz/xz.1:355 ../src/xzdec/xzdec.1:62 +#, no-wrap +msgid "B<-d>, B<--decompress>, B<--uncompress>" +msgstr "B<-d>, B<--decompress>, B<--uncompress>" + +#. type: Plain text +#: ../src/xz/xz.1:358 +msgid "Decompress." +msgstr "Розпакувати." + +#. type: TP +#: ../src/xz/xz.1:358 +#, no-wrap +msgid "B<-t>, B<--test>" +msgstr "B<-t>, B<--test>" + +#. type: Plain text +#: ../src/xz/xz.1:367 +msgid "Test the integrity of compressed I. This option is equivalent to B<--decompress --stdout> except that the decompressed data is discarded instead of being written to standard output. No files are created or removed." +msgstr "Перевірити цілісність стиснених файлів I<файли>. Цей параметр еквівалентний до B<--decompress --stdout>, але розпаковані дані буде відкинуто, замість запису до стандартного виведення. Жодних файлів не буде створено або вилучено." + +#. type: TP +#: ../src/xz/xz.1:367 +#, no-wrap +msgid "B<-l>, B<--list>" +msgstr "B<-l>, B<--list>" + +#. type: Plain text +#: ../src/xz/xz.1:376 +msgid "Print information about compressed I. No uncompressed output is produced, and no files are created or removed. In list mode, the program cannot read the compressed data from standard input or from other unseekable sources." +msgstr "Вивести відомості щодо стиснених файлів I<файли>. Розпакування даних не виконуватиметься, жодних файлів не буде створено або вилучено. У режимі списку програма не може читати дані зі стандартного введення або з інших джерел, де неможливе позиціювання." + +#. type: Plain text +#: ../src/xz/xz.1:391 +msgid "The default listing shows basic information about I, one file per line. To get more detailed information, use also the B<--verbose> option. For even more information, use B<--verbose> twice, but note that this may be slow, because getting all the extra information requires many seeks. The width of verbose output exceeds 80 characters, so piping the output to, for example, B may be convenient if the terminal isn't wide enough." +msgstr "У типовому списку буде показано базові відомості щодо файлів I<файли>, по одному файлу на рядок. Щоб отримати докладніші відомості, скористайтеся параметром B<--verbose>. Щоб розширити спектр відомостей, скористайтеся параметром B<--verbose> двічі, але зауважте, що це може призвести до значного уповільнення роботи, оскільки отримання додаткових відомостей потребує великої кількості позиціювань. Ширина області докладного виведення даних перевищує 80 символів, тому передавання конвеєром виведених даних, наприклад, до B, може бути зручним способом перегляду даних, якщо термінал недостатньо широкий." + +#. type: Plain text +#: ../src/xz/xz.1:398 +msgid "The exact output may vary between B versions and different locales. For machine-readable output, B<--robot --list> should be used." +msgstr "Виведені дані залежать від версії B та використаної локалі. Для отримання даних, які будуть придатні до обробки комп'ютером, слід скористатися параметрами B<--robot --list>." + +#. type: SS +#: ../src/xz/xz.1:399 +#, no-wrap +msgid "Operation modifiers" +msgstr "Модифікатори режиму роботи" + +#. type: TP +#: ../src/xz/xz.1:400 ../src/xzdec/xzdec.1:69 +#, no-wrap +msgid "B<-k>, B<--keep>" +msgstr "B<-k>, B<--keep>" + +#. type: Plain text +#: ../src/xz/xz.1:403 +msgid "Don't delete the input files." +msgstr "Не вилучати вхідні файли." + +#. type: Plain text +#: ../src/xz/xz.1:417 +msgid "Since B 5.2.6, this option also makes B compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file. In earlier versions this was only done with B<--force>." +msgstr "Починаючи з версії B 5.2.6, використання цього параметра також наказує B виконувати стискання або розпаковування, навіть якщо вхідними даними є символічне посилання на звичайний файл, файл, який має декілька жорстких посилань, або файл, для якого встановлено setuid, setgid або липкий біт. setuid, setgid та липкий біт не буде скопійовано до файла-результату. У попередніх версіях, ці дії виконувалися, лише якщо було використано параметр B<--force>." + +#. type: TP +#: ../src/xz/xz.1:417 +#, no-wrap +msgid "B<-f>, B<--force>" +msgstr "B<-f>, B<--force>" + +#. type: Plain text +#: ../src/xz/xz.1:420 +msgid "This option has several effects:" +msgstr "Результатів використання цього параметра буде декілька:" + +#. type: Plain text +#: ../src/xz/xz.1:424 +msgid "If the target file already exists, delete it before compressing or decompressing." +msgstr "Якщо файл-результат вже існує, вилучити його до стискання або розпаковування." + +#. type: Plain text +#: ../src/xz/xz.1:431 +msgid "Compress or decompress even if the input is a symbolic link to a regular file, has more than one hard link, or has the setuid, setgid, or sticky bit set. The setuid, setgid, and sticky bits are not copied to the target file." +msgstr "Виконувати стискання або розпаковування, навіть якщо вхідними даними є символічне посилання на звичайний файл, файл, який має декілька жорстких посилань, або файл, для якого встановлено setuid, setgid або липкий біт setuid, setgid та липкий біт не буде скопійовано до файла-результату." + +#. type: Plain text +#: ../src/xz/xz.1:456 +msgid "When used with B<--decompress> B<--stdout> and B cannot recognize the type of the source file, copy the source file as is to standard output. This allows B B<--force> to be used like B(1) for files that have not been compressed with B. Note that in future, B might support new compressed file formats, which may make B decompress more types of files instead of copying them as is to standard output. B<--format=>I can be used to restrict B to decompress only a single file format." +msgstr "Якщо використано разом із B<--decompress>, B<--stdout>, і B не зможе розпізнати тип початкового файла, копіювати початковий файл без змін до стандартного виведення. Це надає змогу користуватися B B<--force> подібно до B(1) для файлів, які не було стиснено за допомогою B. Зауважте, що у майбутньому у B може бути реалізовано підтримку нових форматів стиснених файлів, замість копіювання їх без змін до стандартного виведення. Можна скористатися B<--format=>I<формат> для обмеження стискання у B єдиним форматом файлів." + +#. type: TP +#: ../src/xz/xz.1:457 ../src/xzdec/xzdec.1:76 +#, no-wrap +msgid "B<-c>, B<--stdout>, B<--to-stdout>" +msgstr "B<-c>, B<--stdout>, B<--to-stdout>" + +#. type: Plain text +#: ../src/xz/xz.1:463 +msgid "Write the compressed or decompressed data to standard output instead of a file. This implies B<--keep>." +msgstr "Записати стиснені або розпаковані дані до стандартного виведення, а не до файла. Неявним чином встановлює B<--keep>." + +#. type: TP +#: ../src/xz/xz.1:463 +#, no-wrap +msgid "B<--single-stream>" +msgstr "B<--single-stream>" + +#. type: Plain text +#: ../src/xz/xz.1:472 +msgid "Decompress only the first B<.xz> stream, and silently ignore possible remaining input data following the stream. Normally such trailing garbage makes B display an error." +msgstr "Розпакувати лише перший потік даних B<.xz> і без повідомлень проігнорувати решту вхідних даних, які слідують за цим потоком. Зазвичай, такі зайві дані наприкінці файла призводять до показу B повідомлення про помилку." + +#. type: Plain text +#: ../src/xz/xz.1:481 +msgid "B never decompresses more than one stream from B<.lzma> files or raw streams, but this option still makes B ignore the possible trailing data after the B<.lzma> file or raw stream." +msgstr "B ніколи не виконуватиме спроби видобути декілька потоків даних з файлів B<.lzma> або необроблених потоків даних, але використання цього параметра все одно наказує B ігнорувати можливі кінцеві дані після файла B<.lzma> або необробленого потоку даних." + +#. type: Plain text +#: ../src/xz/xz.1:486 +msgid "This option has no effect if the operation mode is not B<--decompress> or B<--test>." +msgstr "Цей параметр нічого не змінює, якщо режимом дій не є B<--decompress> або B<--test>." + +#. type: TP +#: ../src/xz/xz.1:486 +#, no-wrap +msgid "B<--no-sparse>" +msgstr "B<--no-sparse>" + +#. type: Plain text +#: ../src/xz/xz.1:498 +msgid "Disable creation of sparse files. By default, if decompressing into a regular file, B tries to make the file sparse if the decompressed data contains long sequences of binary zeros. It also works when writing to standard output as long as standard output is connected to a regular file and certain additional conditions are met to make it safe. Creating sparse files may save disk space and speed up the decompression by reducing the amount of disk I/O." +msgstr "Вимкнути створення розріджених файлів. Типово, якщо видобування виконується до звичайного файла, B намагається створити розріджений файл, якщо розпаковані дані містять довгі послідовності двійкових нулів. Це також працює, коли виконується запис до стандартного виведення, доки стандартне виведення з'єднано зі звичайним файлом і виконуються певні додаткові умови, які убезпечують роботу. Створення розріджених файлів може заощадити місце на диску і пришвидшити розпаковування шляхом зменшення кількості дій введення та виведення даних на диску." + +#. type: TP +#: ../src/xz/xz.1:498 +#, no-wrap +msgid "B<-S> I<.suf>, B<--suffix=>I<.suf>" +msgstr "B<-S> I<.suf>, B<--suffix=>I<.suf>" + +#. type: Plain text +#: ../src/xz/xz.1:510 +msgid "When compressing, use I<.suf> as the suffix for the target file instead of B<.xz> or B<.lzma>. If not writing to standard output and the source file already has the suffix I<.suf>, a warning is displayed and the file is skipped." +msgstr "При стисканні використати суфікс I<.suf> для файлів призначення, замість суфікса B<.xz> або B<.lzma>. Якщо записування виконується не до стандартного виведення і початковий файл вже має суфікс назви I<.suf>, буде показано попередження, а файл буде пропущено під час обробки." + +#. type: Plain text +#: ../src/xz/xz.1:524 +msgid "When decompressing, recognize files with the suffix I<.suf> in addition to files with the B<.xz>, B<.txz>, B<.lzma>, B<.tlz>, or B<.lz> suffix. If the source file has the suffix I<.suf>, the suffix is removed to get the target filename." +msgstr "При розпаковуванні розпізнавати файли із суфіксом назви I<.suf>, окрім файлів із суфіксами назв B<.xz>, B<.txz>, B<.lzma>, B<.tlz> або B<.lz>. Якщо початковий файл мав суфікс назви I<.suf>, для отримання назви файла призначення цей суфікс буде вилучено." + +#. type: Plain text +#: ../src/xz/xz.1:530 +msgid "When compressing or decompressing raw streams (B<--format=raw>), the suffix must always be specified unless writing to standard output, because there is no default suffix for raw streams." +msgstr "При стисканні або розпакуванні необроблених потоків даних (B<--format=raw>) суфікс слід вказувати завжди, якщо запис не виконується до стандартного виведення, оскільки типового суфікса назви для необроблених потоків даних не передбачено." + +#. type: TP +#: ../src/xz/xz.1:530 +#, no-wrap +msgid "B<--files>[B<=>I]" +msgstr "B<--files>[B<=>I<файл>]" + +#. type: Plain text +#: ../src/xz/xz.1:544 +msgid "Read the filenames to process from I; if I is omitted, filenames are read from standard input. Filenames must be terminated with the newline character. A dash (B<->) is taken as a regular filename; it doesn't mean standard input. If filenames are given also as command line arguments, they are processed before the filenames read from I." +msgstr "Прочитати назви файлів для обробки з файла I<файл>; якщо I не вказано, назви файлів буде прочитано зі стандартного потоку вхідних даних. Назви файлів має бути відокремлено символом нового рядка. Символ дефіса (B<->) буде оброблено як звичайну назву файла; він не позначатиме стандартного джерела вхідних даних. Якщо також буде вказано назви файлів у аргументах рядка команди, файли з цими назвами буде оброблено до обробки файлів, назви яких було прочитано з файла I<файл>." + +#. type: TP +#: ../src/xz/xz.1:544 +#, no-wrap +msgid "B<--files0>[B<=>I]" +msgstr "B<--files0>[B<=>I<файл>]" + +#. type: Plain text +#: ../src/xz/xz.1:548 +msgid "This is identical to B<--files>[B<=>I] except that each filename must be terminated with the null character." +msgstr "Те саме, що і B<--files>[B<=>I<файл>], але файли у списку має бути відокремлено нульовим символом." + +#. type: SS +#: ../src/xz/xz.1:549 +#, no-wrap +msgid "Basic file format and compression options" +msgstr "Параметри базового формату файлів та стискання" + +#. type: TP +#: ../src/xz/xz.1:550 +#, no-wrap +msgid "B<-F> I, B<--format=>I" +msgstr "B<-F> I, B<--format=>I<формат>" + +#. type: Plain text +#: ../src/xz/xz.1:555 +msgid "Specify the file I to compress or decompress:" +msgstr "Вказати файл I<формат> для стискання або розпакування:" + +#. type: TP +#: ../src/xz/xz.1:556 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:568 +msgid "This is the default. When compressing, B is equivalent to B. When decompressing, the format of the input file is automatically detected. Note that raw streams (created with B<--format=raw>) cannot be auto-detected." +msgstr "Типовий варіант. При стисканні B є еквівалентом B. При розпакуванні формат файла вхідних даних буде виявлено автоматично. Зауважте, що автоматичне виявлення необроблених потоків даних (створених за допомогою B<--format=raw>) неможливе." + +#. type: TP +#: ../src/xz/xz.1:568 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:575 +msgid "Compress to the B<.xz> file format, or accept only B<.xz> files when decompressing." +msgstr "Стиснути до формату B<.xz> або приймати лише файли B<.xz> при розпаковуванні." + +#. type: TP +#: ../src/xz/xz.1:575 +#, no-wrap +msgid "B, B" +msgstr "B, B" + +#. type: Plain text +#: ../src/xz/xz.1:585 +msgid "Compress to the legacy B<.lzma> file format, or accept only B<.lzma> files when decompressing. The alternative name B is provided for backwards compatibility with LZMA Utils." +msgstr "Стиснути дані до застарілого формату файлів B<.lzma> або приймати лише файли B<.lzma> при розпаковуванні. Альтернативну назву B може бути використано для зворотної сумісності із LZMA Utils." + +#. type: TP +#: ../src/xz/xz.1:585 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:591 +msgid "Accept only B<.lz> files when decompressing. Compression is not supported." +msgstr "Приймати лише файли B<.lz> при розпакуванні. Підтримки стискання не передбачено." + +#. type: Plain text +#: ../src/xz/xz.1:604 +msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B 1.18." +msgstr "Передбачено підтримку версії формату B<.lz> 0 та нерозширеної версії 1. Файли версії 0 було створено B 1.3 та старішими версіями. Такі файли не є поширеними, але їх можна знайти у файлових архівах, оскільки певну незначну кількість пакунків із початковим кодом було випущено у цьому форматі. Також можуть існувати особисті файли у цьому форматі. Підтримку розпаковування для формату версії 0 було вилучено у B 1.18." + +#. type: Plain text +#: ../src/xz/xz.1:613 +msgid "B 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B 1.6. This extension is rarely used and isn't supported by B (diagnosed as corrupt input)." +msgstr "B 1.4 і пізніші версії створюють файли у форматі версії 1. Розширення синхронізації позначки витирання до формату версії 1 було додано у B 1.6. Це розширення використовують не часто, його підтримки у B не передбачено (програма повідомлятиме про пошкоджені вхідні дані)." + +#. type: TP +#: ../src/xz/xz.1:613 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:621 +msgid "Compress or uncompress a raw stream (no headers). This is meant for advanced users only. To decode raw streams, you need use B<--format=raw> and explicitly specify the filter chain, which normally would have been stored in the container headers." +msgstr "Стиснути або розпакувати потік необроблених даних (лез заголовків). Цей параметр призначено лише для досвідчених користувачів. Для розпаковування необроблених потоків даних слід користуватися параметром B<--format=raw> і явно вказати ланцюжок фільтрування, який за звичайних умов мало б бути збережено у заголовках контейнера." + +#. type: TP +#: ../src/xz/xz.1:622 +#, no-wrap +msgid "B<-C> I, B<--check=>I" +msgstr "B<-C> I<перевірка>, B<--check=>I<перевірка>" + +#. type: Plain text +#: ../src/xz/xz.1:637 +msgid "Specify the type of the integrity check. The check is calculated from the uncompressed data and stored in the B<.xz> file. This option has an effect only when compressing into the B<.xz> format; the B<.lzma> format doesn't support integrity checks. The integrity check (if any) is verified when the B<.xz> file is decompressed." +msgstr "Вказати тип перевірки цілісності. Контрольну суму буде обчислено на основі нестиснених даних і збережено у файлі B<.xz>. Цей параметр працюватиме, лише якщо дані стиснено до файла у форматі B<.xz>; для формату файлів B<.lzma> підтримки перевірки цілісності не передбачено. Перевірку контрольної суми (якщо така є) буде виконано під час розпаковування файла B<.xz>." + +#. type: Plain text +#: ../src/xz/xz.1:641 +msgid "Supported I types:" +msgstr "Підтримувані типи I<перевірок>:" + +#. type: TP +#: ../src/xz/xz.1:642 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:648 +msgid "Don't calculate an integrity check at all. This is usually a bad idea. This can be useful when integrity of the data is verified by other means anyway." +msgstr "Не обчислювати контрольну суму взагалі. Зазвичай, не варто цього робити. Цим варіантом слід скористатися, якщо цілісність даних буде перевірено в інший спосіб." + +#. type: TP +#: ../src/xz/xz.1:648 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:651 +msgid "Calculate CRC32 using the polynomial from IEEE-802.3 (Ethernet)." +msgstr "Обчислити CRC32 за допомогою полінома з IEEE-802.3 (Ethernet)." + +#. type: TP +#: ../src/xz/xz.1:651 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:656 +msgid "Calculate CRC64 using the polynomial from ECMA-182. This is the default, since it is slightly better than CRC32 at detecting damaged files and the speed difference is negligible." +msgstr "Обчислити CRC64 за допомогою полінома з ECMA-182. Це типовий варіант, оскільки він дещо кращий за CRC32 при виявленні пошкоджених файлів, а різниця у швидкості є незрачною." + +#. type: TP +#: ../src/xz/xz.1:656 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:660 +msgid "Calculate SHA-256. This is somewhat slower than CRC32 and CRC64." +msgstr "Обчислити SHA-256. Цей варіант дещо повільніший за CRC32 і CRC64." + +#. type: Plain text +#: ../src/xz/xz.1:666 +msgid "Integrity of the B<.xz> headers is always verified with CRC32. It is not possible to change or disable it." +msgstr "Цілісність заголовків B<.xz> завжди перевіряють за допомогою CRC32. Таку перевірку не можна змінити або скасувати." + +#. type: TP +#: ../src/xz/xz.1:666 +#, no-wrap +msgid "B<--ignore-check>" +msgstr "B<--ignore-check>" + +#. type: Plain text +#: ../src/xz/xz.1:672 +msgid "Don't verify the integrity check of the compressed data when decompressing. The CRC32 values in the B<.xz> headers will still be verified normally." +msgstr "Не перевіряти цілісність стиснених даних при розпаковуванні. Значення CRC32 у заголовках B<.xz> буде у звичайний спосіб перевірено попри цей параметр." + +#. type: Plain text +#: ../src/xz/xz.1:675 +msgid "B Possible reasons to use this option:" +msgstr "B<Не користуйтеся цим параметром, якщо ви не усвідомлюєте наслідків ваших дій.> Можливі причини скористатися цим параметром:" + +#. type: Plain text +#: ../src/xz/xz.1:678 +msgid "Trying to recover data from a corrupt .xz file." +msgstr "Спроба отримання даних з пошкодженого файла .xz." + +#. type: Plain text +#: ../src/xz/xz.1:684 +msgid "Speeding up decompression. This matters mostly with SHA-256 or with files that have compressed extremely well. It's recommended to not use this option for this purpose unless the file integrity is verified externally in some other way." +msgstr "Пришвидшення розпакування. Це, здебільшого, стосується SHA-256 або файлів із надзвичайно високим рівнем пакування. Не рекомендуємо користуватися цим параметром з цією метою, якщо цілісність файлів не буде перевірено у якийсь інший спосіб." + +#. type: TP +#: ../src/xz/xz.1:685 +#, no-wrap +msgid "B<-0> ... B<-9>" +msgstr "B<-0> ... B<-9>" + +#. type: Plain text +#: ../src/xz/xz.1:694 +msgid "Select a compression preset level. The default is B<-6>. If multiple preset levels are specified, the last one takes effect. If a custom filter chain was already specified, setting a compression preset level clears the custom filter chain." +msgstr "Вибрати рівень стискання. Типовим є B<-6>. Якщо буде вказано декілька рівнів стискання, програма використає останній вказаний. Якщо вже було вказано нетиповий ланцюжок фільтрів, встановлення рівня стискання призведе до нехтування цим нетиповим ланцюжком фільтрів." + +#. type: Plain text +#: ../src/xz/xz.1:709 +msgid "The differences between the presets are more significant than with B(1) and B(1). The selected compression settings determine the memory requirements of the decompressor, thus using a too high preset level might make it painful to decompress the file on an old system with little RAM. Specifically, B like it often is with B(1) and B(1)." +msgstr "Різниця між рівнями є суттєвішою, ніж у B(1) і B(1). Вибрані параметри стискання визначають вимоги до пам'яті під час розпаковування, отже використання надто високого рівня стискання може призвести до проблем під час розпаковування файла на застарілих комп'ютерах із невеликим обсягом оперативної пам'яті. Зокрема, B<не варто використовувати -9 для усього>, як це часто буває для B(1) і B(1)." + +#. type: TP +#: ../src/xz/xz.1:710 +#, no-wrap +msgid "B<-0> ... B<-3>" +msgstr "B<-0> ... B<-3>" + +#. type: Plain text +#: ../src/xz/xz.1:722 +msgid "These are somewhat fast presets. B<-0> is sometimes faster than B while compressing much better. The higher ones often have speed comparable to B(1) with comparable or better compression ratio, although the results depend a lot on the type of data being compressed." +msgstr "Це дещо швидші набори налаштувань. B<-0> іноді є швидшим за B, забезпечуючи набагато більший коефіцієнт стискання. Вищі рівні часто мають швидкість, яку можна порівняти з B(1) із подібним або кращим коефіцієнтом стискання, хоча результати значно залежать від типу даних, які стискають." + +#. type: TP +#: ../src/xz/xz.1:722 +#, no-wrap +msgid "B<-4> ... B<-6>" +msgstr "B<-4> ... B<-6>" + +#. type: Plain text +#: ../src/xz/xz.1:736 +msgid "Good to very good compression while keeping decompressor memory usage reasonable even for old systems. B<-6> is the default, which is usually a good choice for distributing files that need to be decompressible even on systems with only 16\\ MiB RAM. (B<-5e> or B<-6e> may be worth considering too. See B<--extreme>.)" +msgstr "Стискання від доброго до дуже доброго рівня із одночасним підтриманням помірного рівня споживання пам'яті засобом розпаковування, навіть для застарілих системи. Типовим є значення B<-6>, яке є добрим варіантом для поширення файлів, які мають бути придатними до розпаковування навіть у системах із лише 16\\ МіБ оперативної пам'яті. (Також можна розглянути варіанти B<-5e> і B<-6e>. Див. B<--extreme>.)" + +#. type: TP +#: ../src/xz/xz.1:736 +#, no-wrap +msgid "B<-7 ... -9>" +msgstr "B<-7 ... -9>" + +#. type: Plain text +#: ../src/xz/xz.1:743 +msgid "These are like B<-6> but with higher compressor and decompressor memory requirements. These are useful only when compressing files bigger than 8\\ MiB, 16\\ MiB, and 32\\ MiB, respectively." +msgstr "Ці варіанти подібні до B<-6>, але із вищими вимогами щодо пам'яті для стискання і розпаковування. Можуть бути корисними лише для стискання файлів з розміром, що перевищує 8\\ МіБ, 16\\ МіБ та 32\\ МіБ, відповідно." + +#. type: Plain text +#: ../src/xz/xz.1:751 +msgid "On the same hardware, the decompression speed is approximately a constant number of bytes of compressed data per second. In other words, the better the compression, the faster the decompression will usually be. This also means that the amount of uncompressed output produced per second can vary a lot." +msgstr "На однаковому обладнанні швидкість розпакування є приблизно сталою кількістю байтів стиснених даних за секунду. Іншими словами, чим кращим є стискання, тим швидшим буде, зазвичай, розпаковування. Це також означає, що об'єм розпакованих виведених даних, які видає програма за секунду, може коливатися у широкому діапазоні." + +#. type: Plain text +#: ../src/xz/xz.1:753 +msgid "The following table summarises the features of the presets:" +msgstr "У наведеній нижче таблиці підсумовано можливості шаблонів:" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "Preset" +msgstr "Шаблон" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DictSize" +msgstr "DictSize" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 ../src/xz/xz.1:2839 +#, no-wrap +msgid "CompCPU" +msgstr "CompCPU" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "CompMem" +msgstr "CompMem" + +#. type: tbl table +#: ../src/xz/xz.1:760 ../src/xz/xz.1:841 +#, no-wrap +msgid "DecMem" +msgstr "DecMem" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#: ../src/xz/xz.1:2840 +#, no-wrap +msgid "-0" +msgstr "-0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:842 ../src/xz/xz.1:2450 +#, no-wrap +msgid "256 KiB" +msgstr "256 КіБ" + +#. type: TP +#: ../src/xz/xz.1:761 ../src/xz/xz.1:2840 ../src/scripts/xzgrep.1:82 +#, no-wrap +msgid "0" +msgstr "0" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:763 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2475 +#, no-wrap +msgid "3 MiB" +msgstr "3 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:761 ../src/xz/xz.1:762 ../src/xz/xz.1:842 ../src/xz/xz.1:843 +#: ../src/xz/xz.1:2451 ../src/xz/xz.1:2452 ../src/xz/xz.1:2454 +#, no-wrap +msgid "1 MiB" +msgstr "1 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:2451 ../src/xz/xz.1:2476 +#: ../src/xz/xz.1:2841 +#, no-wrap +msgid "-1" +msgstr "-1" + +#. type: TP +#: ../src/xz/xz.1:762 ../src/xz/xz.1:1758 ../src/xz/xz.1:2841 +#: ../src/scripts/xzgrep.1:86 +#, no-wrap +msgid "1" +msgstr "1" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2476 +#, no-wrap +msgid "9 MiB" +msgstr "9 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:762 ../src/xz/xz.1:763 ../src/xz/xz.1:843 ../src/xz/xz.1:844 +#: ../src/xz/xz.1:2452 ../src/xz/xz.1:2455 ../src/xz/xz.1:2476 +#, no-wrap +msgid "2 MiB" +msgstr "2 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:2452 ../src/xz/xz.1:2477 +#: ../src/xz/xz.1:2842 +#, no-wrap +msgid "-2" +msgstr "-2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:1760 ../src/xz/xz.1:2842 +#, no-wrap +msgid "2" +msgstr "2" + +#. type: tbl table +#: ../src/xz/xz.1:763 ../src/xz/xz.1:768 ../src/xz/xz.1:849 +#: ../src/xz/xz.1:2477 +#, no-wrap +msgid "17 MiB" +msgstr "17 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2453 ../src/xz/xz.1:2478 +#: ../src/xz/xz.1:2843 +#, no-wrap +msgid "-3" +msgstr "-3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:842 ../src/xz/xz.1:845 +#: ../src/xz/xz.1:846 ../src/xz/xz.1:2453 ../src/xz/xz.1:2454 +#: ../src/xz/xz.1:2456 +#, no-wrap +msgid "4 MiB" +msgstr "4 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:2843 +#, no-wrap +msgid "3" +msgstr "3" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2459 ../src/xz/xz.1:2478 +#, no-wrap +msgid "32 MiB" +msgstr "32 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:764 ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#, no-wrap +msgid "5 MiB" +msgstr "5 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:2454 ../src/xz/xz.1:2479 +#: ../src/xz/xz.1:2844 +#, no-wrap +msgid "-4" +msgstr "-4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:1759 ../src/xz/xz.1:1761 +#: ../src/xz/xz.1:1762 ../src/xz/xz.1:1764 ../src/xz/xz.1:2844 +#, no-wrap +msgid "4" +msgstr "4" + +#. type: tbl table +#: ../src/xz/xz.1:765 ../src/xz/xz.1:845 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:2479 +#, no-wrap +msgid "48 MiB" +msgstr "48 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2455 ../src/xz/xz.1:2480 +#: ../src/xz/xz.1:2845 +#, no-wrap +msgid "-5" +msgstr "-5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2455 ../src/xz/xz.1:2456 ../src/xz/xz.1:2457 +#, no-wrap +msgid "8 MiB" +msgstr "8 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:2845 +#, no-wrap +msgid "5" +msgstr "5" + +#. type: tbl table +#: ../src/xz/xz.1:766 ../src/xz/xz.1:767 ../src/xz/xz.1:847 ../src/xz/xz.1:848 +#: ../src/xz/xz.1:2480 ../src/xz/xz.1:2481 +#, no-wrap +msgid "94 MiB" +msgstr "94 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:2456 ../src/xz/xz.1:2481 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "-6" +msgstr "-6" + +#. type: tbl table +#: ../src/xz/xz.1:767 ../src/xz/xz.1:768 ../src/xz/xz.1:769 ../src/xz/xz.1:770 +#: ../src/xz/xz.1:2846 +#, no-wrap +msgid "6" +msgstr "6" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:2457 ../src/xz/xz.1:2482 +#, no-wrap +msgid "-7" +msgstr "-7" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2457 +#: ../src/xz/xz.1:2458 ../src/xz/xz.1:2479 +#, no-wrap +msgid "16 MiB" +msgstr "16 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:768 ../src/xz/xz.1:849 ../src/xz/xz.1:2482 +#, no-wrap +msgid "186 MiB" +msgstr "186 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:2458 ../src/xz/xz.1:2483 +#, no-wrap +msgid "-8" +msgstr "-8" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 ../src/xz/xz.1:2483 +#, no-wrap +msgid "370 MiB" +msgstr "370 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:769 ../src/xz/xz.1:850 +#, no-wrap +msgid "33 MiB" +msgstr "33 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:2459 ../src/xz/xz.1:2484 +#, no-wrap +msgid "-9" +msgstr "-9" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2459 +#, no-wrap +msgid "64 MiB" +msgstr "64 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 ../src/xz/xz.1:2484 +#, no-wrap +msgid "674 MiB" +msgstr "674 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:770 ../src/xz/xz.1:851 +#, no-wrap +msgid "65 MiB" +msgstr "65 МіБ" + +#. type: Plain text +#: ../src/xz/xz.1:776 +msgid "Column descriptions:" +msgstr "Описи стовпчиків:" + +#. type: Plain text +#: ../src/xz/xz.1:788 +msgid "DictSize is the LZMA2 dictionary size. It is waste of memory to use a dictionary bigger than the size of the uncompressed file. This is why it is good to avoid using the presets B<-7> ... B<-9> when there's no real need for them. At B<-6> and lower, the amount of memory wasted is usually low enough to not matter." +msgstr "DictSize є розміром словника LZMA2. Використання словника, розмір якого перевищує розмір нестисненого файла, — проста витрата пам'яті. Ось чому не варто використовувати шаблони B<-7> ... B<-9>, якщо у них немає реальної потреби. Для B<-6> та нижчих рівнів об'єм витраченої пам'яті, зазвичай, такий низький, що цей фактор ні на що не впливає." + +#. type: Plain text +#: ../src/xz/xz.1:797 +msgid "CompCPU is a simplified representation of the LZMA2 settings that affect compression speed. The dictionary size affects speed too, so while CompCPU is the same for levels B<-6> ... B<-9>, higher levels still tend to be a little slower. To get even slower and thus possibly better compression, see B<--extreme>." +msgstr "CompCPU є спрощеним представленням параметрів LZMA2, які впливають на швидкість стискання. Розмір словника також впливає на швидкість, тому, хоча значення CompCPU є однаковим для рівнів B<-6> ... B<-9>, обробка на вищих рівнях все одно є трошки повільнішою. Що отримати повільніше і, ймовірно, краще стискання, див. B<--extreme>." + +#. type: Plain text +#: ../src/xz/xz.1:805 +msgid "CompMem contains the compressor memory requirements in the single-threaded mode. It may vary slightly between B versions. Memory requirements of some of the future multithreaded modes may be dramatically higher than that of the single-threaded mode." +msgstr "CompMem містить вимоги до пам'яті засобу стискання у однопотоковому режимі. Значення можуть бути дещо різними для різних версій B. Вимоги до пам'яті деяких майбутніх багатопотокових режимів можуть бути набагато вищими, ніж вимоги у однопотоковому режимі." + +#. type: Plain text +#: ../src/xz/xz.1:812 +msgid "DecMem contains the decompressor memory requirements. That is, the compression settings determine the memory requirements of the decompressor. The exact decompressor memory usage is slightly more than the LZMA2 dictionary size, but the values in the table have been rounded up to the next full MiB." +msgstr "У DecMem містяться вимоги до пам'яті при розпаковуванні. Тобто параметри засобу стискання визначають вимоги до пам'яті при розпаковуванні. Точний об'єм пам'яті, яка потрібна для розпаковування, дещо перевищує розмір словника LZMA2, але значення у таблиці було округлено до наступного цілого значення МіБ." + +#. type: TP +#: ../src/xz/xz.1:813 +#, no-wrap +msgid "B<-e>, B<--extreme>" +msgstr "B<-e>, B<--extreme>" + +#. type: Plain text +#: ../src/xz/xz.1:822 +msgid "Use a slower variant of the selected compression preset level (B<-0> ... B<-9>) to hopefully get a little bit better compression ratio, but with bad luck this can also make it worse. Decompressor memory usage is not affected, but compressor memory usage increases a little at preset levels B<-0> ... B<-3>." +msgstr "Використати повільніший варіант вибраного рівня стискання (B<-0> ... B<-9>) у сподіванні отримати трохи кращий коефіцієнт стискання, але, якщо не поталанить, можна його і погіршити. Не впливає на використання пам'яті при розпаковуванні, але використання пам'яті при стисканні дещо збільшиться на рівнях B<-0> ... B<-3>." + +#. type: Plain text +#: ../src/xz/xz.1:834 +msgid "Since there are two presets with dictionary sizes 4\\ MiB and 8\\ MiB, the presets B<-3e> and B<-5e> use slightly faster settings (lower CompCPU) than B<-4e> and B<-6e>, respectively. That way no two presets are identical." +msgstr "Оскільки існує два набори налаштувань із розмірами словників 4\\ МіБ та 8\\ МіБ, у наборах B<-3e> і B<-5e> використано трошки швидші параметри (нижче CompCPU), ніж у наборах B<-4e> і B<-6e>, відповідно. Тому двох однакових наборів у списку немає." + +#. type: tbl table +#: ../src/xz/xz.1:842 +#, no-wrap +msgid "-0e" +msgstr "-0e" + +#. type: tbl table +#: ../src/xz/xz.1:842 ../src/xz/xz.1:843 ../src/xz/xz.1:844 ../src/xz/xz.1:846 +#: ../src/xz/xz.1:848 ../src/xz/xz.1:849 ../src/xz/xz.1:850 ../src/xz/xz.1:851 +#: ../src/xz/xz.1:2848 +#, no-wrap +msgid "8" +msgstr "8" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "-1e" +msgstr "-1e" + +#. type: tbl table +#: ../src/xz/xz.1:843 +#, no-wrap +msgid "13 MiB" +msgstr "13 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "-2e" +msgstr "-2e" + +#. type: tbl table +#: ../src/xz/xz.1:844 +#, no-wrap +msgid "25 MiB" +msgstr "25 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:845 +#, no-wrap +msgid "-3e" +msgstr "-3e" + +#. type: tbl table +#: ../src/xz/xz.1:845 ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "7" +msgstr "7" + +#. type: tbl table +#: ../src/xz/xz.1:846 +#, no-wrap +msgid "-4e" +msgstr "-4e" + +#. type: tbl table +#: ../src/xz/xz.1:847 ../src/xz/xz.1:2847 +#, no-wrap +msgid "-5e" +msgstr "-5e" + +#. type: tbl table +#: ../src/xz/xz.1:848 ../src/xz/xz.1:2848 +#, no-wrap +msgid "-6e" +msgstr "-6e" + +#. type: tbl table +#: ../src/xz/xz.1:849 +#, no-wrap +msgid "-7e" +msgstr "-7e" + +#. type: tbl table +#: ../src/xz/xz.1:850 +#, no-wrap +msgid "-8e" +msgstr "-8e" + +#. type: tbl table +#: ../src/xz/xz.1:851 +#, no-wrap +msgid "-9e" +msgstr "-9e" + +#. type: Plain text +#: ../src/xz/xz.1:863 +msgid "For example, there are a total of four presets that use 8\\ MiB dictionary, whose order from the fastest to the slowest is B<-5>, B<-6>, B<-5e>, and B<-6e>." +msgstr "Наприклад, передбачено загалом чотири набори налаштувань із використанням словника у 8\\ МіБ, порядок яких від найшвидшого до найповільнішого є таким: B<-5>, B<-6>, B<-5e> і B<-6e>." + +#. type: TP +#: ../src/xz/xz.1:863 +#, no-wrap +msgid "B<--fast>" +msgstr "B<--fast>" + +#. type: TP +#: ../src/xz/xz.1:866 +#, no-wrap +msgid "B<--best>" +msgstr "B<--best>" + +#. type: Plain text +#: ../src/xz/xz.1:877 +msgid "These are somewhat misleading aliases for B<-0> and B<-9>, respectively. These are provided only for backwards compatibility with LZMA Utils. Avoid using these options." +msgstr "Це дещо оманливі альтернативні варіанти для B<-0> і B<-9>, відповідно. Реалізовано лише для забезпечення зворотної сумісності із LZMA Utils. Намагайтеся не користуватися цими варіантами параметрів." + +#. type: TP +#: ../src/xz/xz.1:877 +#, no-wrap +msgid "B<--block-size=>I" +msgstr "B<--block-size=>I<розмір>" + +#. type: Plain text +#: ../src/xz/xz.1:890 +msgid "When compressing to the B<.xz> format, split the input data into blocks of I bytes. The blocks are compressed independently from each other, which helps with multi-threading and makes limited random-access decompression possible. This option is typically used to override the default block size in multi-threaded mode, but this option can be used in single-threaded mode too." +msgstr "При стисканні до формату B<.xz> поділити вхідні дані на блоки у I<розмір> байтів. Ці блоки буде стиснуто незалежно один від одного, що допоможе у багатопотоковій обробці і зробить можливим обмежене розпакування для доступу до будь-яких даних. Цим параметром слід типово користуватися для перевизначення типового розміру блоку у багатопотоковому режимі обробки, але цим параметром можна також скористатися в однопотоковому режимі обробки." + +#. type: Plain text +#: ../src/xz/xz.1:908 +msgid "In multi-threaded mode about three times I bytes will be allocated in each thread for buffering input and output. The default I is three times the LZMA2 dictionary size or 1 MiB, whichever is more. Typically a good value is 2\\(en4 times the size of the LZMA2 dictionary or at least 1 MiB. Using I less than the LZMA2 dictionary size is waste of RAM because then the LZMA2 dictionary buffer will never get fully used. The sizes of the blocks are stored in the block headers, which a future version of B will use for multi-threaded decompression." +msgstr "У багатопотоковому режимі для кожного потоку буде отримано для буферів вхідних і вихідних даних майже утричі більше за I<розмір> байтів. Типовий I<розмір> утричі більший за розмір словника LZMA2 або дорівнює 1 МіБ, буде вибрано більше значення. Типовим добрим значенням буде значення, яке у 2\\(en4 рази перевищує розмір словника LZMA2 або дорівнює принаймні 1 МіБ. Використання значення I<розмір>, яке є меншим за розмір словника LZMA2, має наслідком марну витрату оперативної пам'яті, оскільки його використання призводить до того, що буфер словника LZMA2 ніколи не буде використано повністю. Розміри блоків зберігатимуться у заголовках блоків, які майбутня версія B використовуватиме для багатопотокового розпаковування." + +#. type: Plain text +#: ../src/xz/xz.1:917 +msgid "In single-threaded mode no block splitting is done by default. Setting this option doesn't affect memory usage. No size information is stored in block headers, thus files created in single-threaded mode won't be identical to files created in multi-threaded mode. The lack of size information also means that a future version of B won't be able decompress the files in multi-threaded mode." +msgstr "У однопотоковому режимі поділ на блоки типово не виконуватиметься. Встановлення значення для цього параметра не впливатиме на використання пам'яті. У заголовках блоків не зберігатимуться дані щодо розміру, отже файли, які створено в однопотоковому режимі не будуть ідентичними до файлів, які створено у багатопотоковому режимі. Те, що у заголовках блоків не зберігатимуться дані щодо розміру також означає, що майбутні версії B не зможуть розпаковувати такі файли у багатопотоковому режимі." + +#. type: TP +#: ../src/xz/xz.1:917 +#, no-wrap +msgid "B<--block-list=>I" +msgstr "B<--block-list=>I<розміри>" + +#. type: Plain text +#: ../src/xz/xz.1:923 +msgid "When compressing to the B<.xz> format, start a new block after the given intervals of uncompressed data." +msgstr "При стисканні у форматі B<.xz> починати новий блок після вказаної кількості інтервалів нестиснених даних." + +#. type: Plain text +#: ../src/xz/xz.1:929 +msgid "The uncompressed I of the blocks are specified as a comma-separated list. Omitting a size (two or more consecutive commas) is a shorthand to use the size of the previous block." +msgstr "Значення I<розмірів> розпакованих блоків слід задавати у форматі списку відокремлених комами значень. Якщо розмір пропущено (дві або декілька послідовних коми), буде використано розмір попереднього блоку." + +#. type: Plain text +#: ../src/xz/xz.1:939 +msgid "If the input file is bigger than the sum of I, the last value in I is repeated until the end of the file. A special value of B<0> may be used as the last value to indicate that the rest of the file should be encoded as a single block." +msgstr "Якщо файл вхідних даних є більшим за розміром за суму I<розмірів>, останнє значення у I<розмірах> буде повторено до кінця файла. Особливе значення B<0> може бути використано як останнє значення, щоб позначити, що решту файла має бути закодовано як єдиний блок." + +#. type: Plain text +#: ../src/xz/xz.1:954 +msgid "If one specifies I that exceed the encoder's block size (either the default value in threaded mode or the value specified with B<--block-size=>I), the encoder will create additional blocks while keeping the boundaries specified in I. For example, if one specifies B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB> and the input file is 80 MiB, one will get 11 blocks: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10, and 1 MiB." +msgstr "Якщо вказати I<розміри>, які перевищують розмір блоку кодувальника (або типове значення у режимі із потоками обробки, або значення, яке встановлено за допомогою B<--block-size=>I<розмір>), засіб кодування створить додаткові блоки, зберігаючи межі, які вказано у I<розмірах>. Наприклад, якщо вказати B<--block-size=10MiB> B<--block-list=5MiB,10MiB,8MiB,12MiB,24MiB>, а файл вхідних даних має розмір 80 МіБ, буде отримано такі 11 блоків: 5, 10, 8, 10, 2, 10, 10, 4, 10, 10 і 1 МіБ." + +#. type: Plain text +#: ../src/xz/xz.1:960 +msgid "In multi-threaded mode the sizes of the blocks are stored in the block headers. This isn't done in single-threaded mode, so the encoded output won't be identical to that of the multi-threaded mode." +msgstr "У багатопотоковому режимі розмір блоків буде збережено у заголовках блоків. Програма не зберігатиме ці дані у однопотоковому режимі, отже закодований результат не буде ідентичним до отриманого у багатопотоковому режимі." + +#. type: TP +#: ../src/xz/xz.1:960 +#, no-wrap +msgid "B<--flush-timeout=>I" +msgstr "B<--flush-timeout=>I<час_очікування>" + +#. type: Plain text +#: ../src/xz/xz.1:977 +msgid "When compressing, if more than I milliseconds (a positive integer) has passed since the previous flush and reading more input would block, all the pending input data is flushed from the encoder and made available in the output stream. This can be useful if B is used to compress data that is streamed over a network. Small I values make the data available at the receiving end with a small delay, but large I values give better compression ratio." +msgstr "При стискання, якщо з моменту попереднього витирання мине понад I<час_очікування> мілісекунд (додатне ціле значення) і читання додаткових даних буде заблоковано, усі вхідні дані у черзі обробки буде витерто з кодувальника і зроблено доступним у потоці вихідних даних. Це може бути корисним, якщо B використовують для стискання даних, які передають потоком мережею. Невеликі значення аргументу I<час_очікування> зроблять дані доступними на боці отримання із малою затримкою, а великі значення аргумент I<час_очікування> уможливлять кращий коефіцієнт стискання." + +#. type: Plain text +#: ../src/xz/xz.1:985 +msgid "This feature is disabled by default. If this option is specified more than once, the last one takes effect. The special I value of B<0> can be used to explicitly disable this feature." +msgstr "Типово, цю можливість вимкнено. Якщо цей параметр вказано декілька разів, буде використано лише останнє вказане значення. Особливим значенням аргументу I<час_очікування>, рівним B<0>, можна скористатися для вимикання цієї можливості явним чином." + +#. type: Plain text +#: ../src/xz/xz.1:987 +msgid "This feature is not available on non-POSIX systems." +msgstr "Ця можливість недоступна у системах, які не є системами POSIX." + +#. FIXME +#. type: Plain text +#: ../src/xz/xz.1:995 +msgid "B Currently B is unsuitable for decompressing the stream in real time due to how B does buffering." +msgstr "B<Ця можливість усе ще є експериментальною.> У поточній версії, B не може розпаковувати потік даних у режимі реального часу через те, у який спосіб B виконує буферизацію." + +#. type: TP +#: ../src/xz/xz.1:995 +#, no-wrap +msgid "B<--memlimit-compress=>I" +msgstr "B<--memlimit-compress=>I<обмеження>" + +#. type: Plain text +#: ../src/xz/xz.1:1000 +msgid "Set a memory usage limit for compression. If this option is specified multiple times, the last one takes effect." +msgstr "Встановити обмеження на використання пам'яті при стисканні. Якщо цей параметр вказано декілька разів, враховано буде лише останнє вказане значення." + +#. type: Plain text +#: ../src/xz/xz.1:1013 +msgid "If the compression settings exceed the I, B will attempt to adjust the settings downwards so that the limit is no longer exceeded and display a notice that automatic adjustment was done. The adjustments are done in this order: reducing the number of threads, switching to single-threaded mode if even one thread in multi-threaded mode exceeds the I, and finally reducing the LZMA2 dictionary size." +msgstr "Якщо параметри стискання перевищують I<обмеження>, B спробує скоригувати параметри так, щоб обмеження не було перевищено, і покаже повідомлення про те, що було виконано автоматичне коригування. Коригування буде виконано у такому порядку: зменшення кількості потоків обробки, перемикання у однопотоковий режим, якщо хоч в одному потоці багатопотокового режиму буде перевищено I<обмеження>, і нарешті, зменшення розміру словника LZMA2." + +#. type: Plain text +#: ../src/xz/xz.1:1021 +msgid "When compressing with B<--format=raw> or if B<--no-adjust> has been specified, only the number of threads may be reduced since it can be done without affecting the compressed output." +msgstr "При стисканні з використанням B<--format=raw>, або якщо було вказано B<--no-adjust>, може бути зменшена лише кількість потоків обробки, оскільки це може бути зроблено без впливу на стиснені виведені дані." + +#. type: Plain text +#: ../src/xz/xz.1:1028 +msgid "If the I cannot be met even with the adjustments described above, an error is displayed and B will exit with exit status 1." +msgstr "Якщо I<обмеження> не може бути виконано за допомогою коригувань, які описано вище, буде показано повідомлення про помилку, а B завершить роботу зі станом виходу 1." + +#. type: Plain text +#: ../src/xz/xz.1:1032 +msgid "The I can be specified in multiple ways:" +msgstr "Аргумент I<обмеження> можна вказати у декілька способів:" + +#. type: Plain text +#: ../src/xz/xz.1:1042 +msgid "The I can be an absolute value in bytes. Using an integer suffix like B can be useful. Example: B<--memlimit-compress=80MiB>" +msgstr "Значенням I<обмеження> може бути додатне ціле значення у байтах. Можна скористатися цілочисельним суфіксом, подібним до B. Приклад: B<--memlimit-compress=80MiB>" + +#. type: Plain text +#: ../src/xz/xz.1:1054 +msgid "The I can be specified as a percentage of total physical memory (RAM). This can be useful especially when setting the B environment variable in a shell initialization script that is shared between different computers. That way the limit is automatically bigger on systems with more memory. Example: B<--memlimit-compress=70%>" +msgstr "Аргумент I<обмеження> може бути задано у відсотках від загальної фізичної пам'яті системи (RAM). Це може бути корисним особливо при встановленні змінної середовища B у скрипті ініціалізації системи, який є спільним для різних комп'ютерів. У такий спосіб можна вказати вищий рівень обмеження для систем із більшим об'ємом пам'яті. Приклад: B<--memlimit-compress=70%>" + +#. type: Plain text +#: ../src/xz/xz.1:1064 +msgid "The I can be reset back to its default value by setting it to B<0>. This is currently equivalent to setting the I to B (no memory usage limit)." +msgstr "Аргументу I<обмеження> може бути повернуто типове значення встановленням значення B<0>. У поточній версії це еквівалентно до встановлення значення аргументу I<обмеження> B (без обмеження на використання пам'яті)." + +#. type: Plain text +#: ../src/xz/xz.1:1088 +msgid "For 32-bit B there is a special case: if the I would be over B<4020\\ MiB>, the I is set to B<4020\\ MiB>. On MIPS32 B<2000\\ MiB> is used instead. (The values B<0> and B aren't affected by this. A similar feature doesn't exist for decompression.) This can be helpful when a 32-bit executable has access to 4\\ GiB address space (2 GiB on MIPS32) while hopefully doing no harm in other situations." +msgstr "Для 32-бітової версії B передбачено особливий випадок: якщо I<обмеження> перевищуватиме B<4020\\ МіБ>, для I<обмеження> буде встановлено значення B<4020\\ MiB>. На MIPS32 замість цього буде використано B<2000\\ MiB>. (Це не стосується значень B<0> і B. Подібної можливості для розпаковування не існує.) Це може бути корисним, коли 32-бітовий виконуваний файл має доступ до простору адрес у 4\\ ГіБ (2 GiB на MIPS32), хоча, сподіваємося, не зашкодить і в інших випадках." + +#. type: Plain text +#: ../src/xz/xz.1:1091 +msgid "See also the section B." +msgstr "Див. також розділ B<Використання пам'яті>." + +#. type: TP +#: ../src/xz/xz.1:1091 +#, no-wrap +msgid "B<--memlimit-decompress=>I" +msgstr "B<--memlimit-decompress=>I<обмеження>" + +#. type: Plain text +#: ../src/xz/xz.1:1105 +msgid "Set a memory usage limit for decompression. This also affects the B<--list> mode. If the operation is not possible without exceeding the I, B will display an error and decompressing the file will fail. See B<--memlimit-compress=>I for possible ways to specify the I." +msgstr "Встановити обмеження пам'яті на розпаковування. це також вплине на режим B<--list>. Якщо дія є неможливою без перевищення I<обмеження>, B покаже повідомлення про помилку і розпаковування файла не відбудеться. Див. B<--memlimit-compress=>I<обмеження>, щоб дізнатися більше про те, як можна задати I<обмеження>." + +#. type: TP +#: ../src/xz/xz.1:1105 +#, no-wrap +msgid "B<--memlimit-mt-decompress=>I" +msgstr "B<--memlimit-mt-decompress=>I<обмеження>" + +#. type: Plain text +#: ../src/xz/xz.1:1127 +msgid "Set a memory usage limit for multi-threaded decompression. This can only affect the number of threads; this will never make B refuse to decompress a file. If I is too low to allow any multi-threading, the I is ignored and B will continue in single-threaded mode. Note that if also B<--memlimit-decompress> is used, it will always apply to both single-threaded and multi-threaded modes, and so the effective I for multi-threading will never be higher than the limit set with B<--memlimit-decompress>." +msgstr "Встановити обмеження використання пам'яті для багатопотокового розпаковування. Це може вплинути лише на кількість потоків обробки; це ніколи не призводитиме до відмови B у розпаковуванні файла. Якщо I<обмеження є надто низьким>, щоб уможливити будь-яку багатопотокову обробку, I<обмеження> буде проігноровано, і B продовжить обробку в однопотоковому режимі. Зауважте, що якщо використано також B<--memlimit-decompress>, цей параметр буде застосовано до обох режимів, однопотокового та багатопотокового, а отже, задіяне I<обмеження> для багатопотокового режиму ніколи не перевищуватиме обмеження, яке встановлено за допомогою B<--memlimit-decompress>." + +#. type: Plain text +#: ../src/xz/xz.1:1134 +msgid "In contrast to the other memory usage limit options, B<--memlimit-mt-decompress=>I has a system-specific default I. B can be used to see the current value." +msgstr "На відміну від інших параметрів обмеження використання пам'яті, B<--memlimit-mt-decompress=>I<обмеження> містить специфічне для системи типове значення I<обмеження>. Можна скористатися B для перегляду поточного значення." + +#. type: Plain text +#: ../src/xz/xz.1:1150 +msgid "This option and its default value exist because without any limit the threaded decompressor could end up allocating an insane amount of memory with some input files. If the default I is too low on your system, feel free to increase the I but never set it to a value larger than the amount of usable RAM as with appropriate input files B will attempt to use that amount of memory even with a low number of threads. Running out of memory or swapping will not improve decompression performance." +msgstr "Цей параметр і його типове значення існують, оскільки без будь-яких обмежень засіб розпакування зі підтримкою потокової обробки міг би намагатися отримати величезний об'єм пам'яті для деяких файлів вхідних даних. Якщо типове I<обмеження> є надто низьким для вашої системи, не вагайтеся і збільшуйте I<обмеження>, але ніколи не встановлюйте для нього значення, яке є більшим за придатний до користування об'єм оперативної пам'яті, оскільки за відповідних файлів вхідних даних B спробує скористатися цим об'ємом пам'яті, навіть із низькою кількістю потоків обробки. Вичерпання об'єму оперативної пам'яті або використання резервної пам'яті на диску не покращить швидкодію системи під час розпаковування." + +#. type: Plain text +#: ../src/xz/xz.1:1162 +msgid "See B<--memlimit-compress=>I for possible ways to specify the I. Setting I to B<0> resets the I to the default system-specific value." +msgstr "Див. B<--memlimit-compress=>I<обмеження>, щоб ознайомитися із можливими способами визначення I<обмеження>. Встановлення для I<обмеження> значення B<0> відновлює типове специфічне для системи значення I<обмеження>." + +#. type: TP +#: ../src/xz/xz.1:1163 +#, no-wrap +msgid "B<-M> I, B<--memlimit=>I, B<--memory=>I" +msgstr "B<-M> I<обмеження>, B<--memlimit=>I<обмеження>, B<--memory=>I<обмеження>" + +#. type: Plain text +#: ../src/xz/xz.1:1169 +msgid "This is equivalent to specifying B<--memlimit-compress=>I B<--memlimit-decompress=>I B<--memlimit-mt-decompress=>I." +msgstr "Є еквівалентом визначення B<--memlimit-compress=>I<обмеження> B<--memlimit-decompress=>I<обмеження> B<--memlimit-mt-decompress=>I<обмеження>." + +#. type: TP +#: ../src/xz/xz.1:1169 +#, no-wrap +msgid "B<--no-adjust>" +msgstr "B<--no-adjust>" + +#. type: Plain text +#: ../src/xz/xz.1:1179 +msgid "Display an error and exit if the memory usage limit cannot be met without adjusting settings that affect the compressed output. That is, this prevents B from switching the encoder from multi-threaded mode to single-threaded mode and from reducing the LZMA2 dictionary size. Even when this option is used the number of threads may be reduced to meet the memory usage limit as that won't affect the compressed output." +msgstr "Показати повідомлення про помилку і завершити роботу, якщо не вдасться виконати умови щодо обмеження використання пам'яті без коригування параметрів, які впливають на стиснених виведених даних. Тобто це забороняє B перемикати кодувальник з багатопотокового режиму на однопотоковий режим і зменшувати розмір словника LZMA2. Навіть якщо використано цей параметр, кількість потоків може бути зменшено для виконання обмеження на використання пам'яті, оскільки це не вплине на результати стискання." + +#. type: Plain text +#: ../src/xz/xz.1:1182 +msgid "Automatic adjusting is always disabled when creating raw streams (B<--format=raw>)." +msgstr "Автоматичне коригування завжди буде вимкнено при створенні потоків необроблених даних (B<--format=raw>)." + +#. type: TP +#: ../src/xz/xz.1:1182 +#, no-wrap +msgid "B<-T> I, B<--threads=>I" +msgstr "B<-T> I<потоки>, B<--threads=>I<потоки>" + +#. type: Plain text +#: ../src/xz/xz.1:1197 +msgid "Specify the number of worker threads to use. Setting I to a special value B<0> makes B use up to as many threads as the processor(s) on the system support. The actual number of threads can be fewer than I if the input file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit." +msgstr "Вказати кількість потоків обробки, якими слід скористатися. Встановлення для аргументу I<потоки> особливого значення B<0> наказує B використати не більше потоків обробки, ніж передбачено підтримку у процесорах системи. Справжня кількість потоків може бути меншою за значення I<потоки>, якщо файл вхідних даних не є достатньо великим для поділу на потоки обробки при заданих параметрах або якщо використання додаткових потоків призведе до перевищення обмеження на використання пам'яті." + +#. type: Plain text +#: ../src/xz/xz.1:1216 +msgid "The single-threaded and multi-threaded compressors produce different output. Single-threaded compressor will give the smallest file size but only the output from the multi-threaded compressor can be decompressed using multiple threads. Setting I to B<1> will use the single-threaded mode. Setting I to any other value, including B<0>, will use the multi-threaded compressor even if the system supports only one hardware thread. (B 5.2.x used single-threaded mode in this situation.)" +msgstr "Засоби стискання в однопотоковому та багатопотоковому режимі дають різні результати. Однопотоковий засіб стискання дасть найменший розмір файла, але лише результати роботи багатопотокового засобу стискання може бути розпаковано з використанням декількох потоків. Встановлення для аргументу I<потоки> значення B<1> призведе до використання однопотокового режиму. Встановлення для аргументу I<потоки> будь-якого іншого значення, включно з B<0>, призведе до використання багатопотокового засобу стискання, навіть якщо у системі передбачено підтримки лише одного апаратного потоку обробки даних. (Версія B 5.2.x у цьому випадку використовувала однопотоковий режим.)" + +#. type: Plain text +#: ../src/xz/xz.1:1235 +msgid "To use multi-threaded mode with only one thread, set I to B<+1>. The B<+> prefix has no effect with values other than B<1>. A memory usage limit can still make B switch to single-threaded mode unless B<--no-adjust> is used. Support for the B<+> prefix was added in B 5.4.0." +msgstr "Щоб скористатися багатопотоковим режимом із лише одним потоком обробки, встановіть для аргументу I<потоки> значення B<+1>. Префікс B<+> не впливає на значення, окрім B<1>. Обмеження на використання пам'яті можуть перемкнути B в однопотоковий режим, якщо не використано параметр B<--no-adjust>. Підтримку B<+> prefix було додано у версії B 5.4.0." + +#. type: Plain text +#: ../src/xz/xz.1:1250 +msgid "If an automatic number of threads has been requested and no memory usage limit has been specified, then a system-specific default soft limit will be used to possibly limit the number of threads. It is a soft limit in sense that it is ignored if the number of threads becomes one, thus a soft limit will never stop B from compressing or decompressing. This default soft limit will not make B switch from multi-threaded mode to single-threaded mode. The active limits can be seen with B." +msgstr "Якщо було вказано автоматичне визначення кількості потоків і не вказано обмеження на використання пам'яті, буде використано специфічне для системи типове м'яке обмеження для можливого обмеження кількості потоків обробки. Це обмеження є м'яким у сенсі того, що його буде проігноровано, якщо кількість потоків зрівняється з одиницею, а отже, м'яке обмеження ніколи не запобігатиму у B стисканню або розпаковуванню. Це типове м'яке обмеження не перемкне B з багатопотокового режиму на однопотоковий режим. Активні обмеження можна переглянути за допомогою команди B." + +#. type: Plain text +#: ../src/xz/xz.1:1257 +msgid "Currently the only threading method is to split the input into blocks and compress them independently from each other. The default block size depends on the compression level and can be overridden with the B<--block-size=>I option." +msgstr "У поточній версії єдиним способом поділу на потоки обробки є поділ вхідних даних на блоки і стискання цих блоків незалежно один від одного. Типовий розмір блоку залежить від рівня стискання. Його може бути перевизначено за допомогою параметра B<--block-size=>I<розмір>." + +#. type: Plain text +#: ../src/xz/xz.1:1265 +msgid "Threaded decompression only works on files that contain multiple blocks with size information in block headers. All large enough files compressed in multi-threaded mode meet this condition, but files compressed in single-threaded mode don't even if B<--block-size=>I has been used." +msgstr "Розпакування з потоками обробки працює лише для файлів, які містять декілька блоків із даними щодо розміру у заголовках блоків. Цю умову задовольняють усі достатньо великі файли, які стиснено у багатопотоковому режимі, але не задовольняють будь-які файли, які було стиснуто у однопотоковому режимі, навіть якщо було використано параметр B<--block-size=>I<розмір>." + +#. type: SS +#: ../src/xz/xz.1:1266 ../src/xz/xz.1:2819 +#, no-wrap +msgid "Custom compressor filter chains" +msgstr "Нетипові ланцюжки фільтрів засобу стискання" + +#. type: Plain text +#: ../src/xz/xz.1:1282 +msgid "A custom filter chain allows specifying the compression settings in detail instead of relying on the settings associated to the presets. When a custom filter chain is specified, preset options (B<-0> \\&...\\& B<-9> and B<--extreme>) earlier on the command line are forgotten. If a preset option is specified after one or more custom filter chain options, the new preset takes effect and the custom filter chain options specified earlier are forgotten." +msgstr "Нетиповий ланцюжок фільтрування уможливлює докладне визначення параметрів стискання замість використання параметрів, які пов'язано із наперед визначеними рівнями стискання. Якщо вказано нетиповий ланцюжок фільтрів, параметри рівнів стискання (B<-0> \\&...\\& B<-9> і B<--extreme>), які передують їм у рядку команди, буде знехтувано. Якщо параметр рівня стискання вказано після одного або декількох параметрів нетипового ланцюжка фільтрів, буде використано рівень стискання, а попередніми параметрами ланцюжка фільтрування буде знехтувано." + +#. type: Plain text +#: ../src/xz/xz.1:1289 +msgid "A filter chain is comparable to piping on the command line. When compressing, the uncompressed input goes to the first filter, whose output goes to the next filter (if any). The output of the last filter gets written to the compressed file. The maximum number of filters in the chain is four, but typically a filter chain has only one or two filters." +msgstr "Ланцюжок фільтрів можна порівняти із конвеєром у командному рядку. При стисканні нестиснені вхідні дані потрапляють до першого фільтра, виведені ним дані йдуть до наступного фільтра (якщо такий є). Виведені останнім фільтром дані буде записано до стисненого файла. Максимальна кількість фільтрів у ланцюжку дорівнює чотирьом, але у типовому ланцюжку фільтрів використовують один або два фільтри." + +#. type: Plain text +#: ../src/xz/xz.1:1297 +msgid "Many filters have limitations on where they can be in the filter chain: some filters can work only as the last filter in the chain, some only as a non-last filter, and some work in any position in the chain. Depending on the filter, this limitation is either inherent to the filter design or exists to prevent security issues." +msgstr "У багатьох фільтрів є обмеження на місце перебування у ланцюжку фільтрів: деякі фільтри можуть працювати, лише якщо вони є останніми у ланцюжку, деякі, лише якщо не останніми, а деякі працюють у будь-якій позиції ланцюжка. Залежно від фільтра, це обмеження є наслідком структури фільтра або існує для запобігання проблем із захистом." + +#. type: Plain text +#: ../src/xz/xz.1:1305 +msgid "A custom filter chain is specified by using one or more filter options in the order they are wanted in the filter chain. That is, the order of filter options is significant! When decoding raw streams (B<--format=raw>), the filter chain is specified in the same order as it was specified when compressing." +msgstr "Нетиповий ланцюжок фільтрів визначають за допомогою одного або декількох параметрів фільтрування у бажаному для ланцюжка фільтрування порядку. Тобто порядок параметрів фільтрування впливає на результат! При декодуванні необробленого потоку даних (B<--format=raw>) ланцюжок фільтрів визначають у тому самому порядку, який використовують для стискання даних." + +#. type: Plain text +#: ../src/xz/xz.1:1314 +msgid "Filters take filter-specific I as a comma-separated list. Extra commas in I are ignored. Every option has a default value, so you need to specify only those you want to change." +msgstr "Фільтри приймають специфічні для фільтрів I<параметри> у форматі списку значень, які відокремлено комами. Зайві коми у I<параметрах> буде проігноровано. У кожного параметра є типове значення, отже, вам слід вказати лише ті параметри, значення яких ви хочете змінити." + +#. type: Plain text +#: ../src/xz/xz.1:1323 +msgid "To see the whole filter chain and I, use B (that is, use B<--verbose> twice). This works also for viewing the filter chain options used by presets." +msgstr "Щоб переглянути увесь ланцюжок фільтрів та I<параметри>, скористайтеся командою B (тобто, скористайтеся B<--verbose> двічі). Це працює також для перегляду параметрів ланцюжка фільтрів, який використано у рівнях стискання." + +#. type: TP +#: ../src/xz/xz.1:1323 +#, no-wrap +msgid "B<--lzma1>[B<=>I]" +msgstr "B<--lzma1>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1326 +#, no-wrap +msgid "B<--lzma2>[B<=>I]" +msgstr "B<--lzma2>[B<=>I<параметри>]" + +#. type: Plain text +#: ../src/xz/xz.1:1331 +msgid "Add LZMA1 or LZMA2 filter to the filter chain. These filters can be used only as the last filter in the chain." +msgstr "Додати фільтр LZMA1 або LZMA2 до ланцюжка фільтрів. Ці фільтри може бути використано лише як останній фільтр у ланцюжку." + +#. type: Plain text +#: ../src/xz/xz.1:1343 +msgid "LZMA1 is a legacy filter, which is supported almost solely due to the legacy B<.lzma> file format, which supports only LZMA1. LZMA2 is an updated version of LZMA1 to fix some practical issues of LZMA1. The B<.xz> format uses LZMA2 and doesn't support LZMA1 at all. Compression speed and ratios of LZMA1 and LZMA2 are practically the same." +msgstr "LZMA1 є застарілим фільтром, підтримку якого збережено майже лише через використання формату файлів B<.lzma>, у яких передбачено підтримку лише LZMA1. LZMA2 є оновленою версією LZMA1, у якій виправлено деякі практичні вади LZMA1. У форматі B<.xz> використано LZMA2 і взагалі не передбачено підтримки LZMA1. Швидкість стискання та коефіцієнт стискання для LZMA1 і LZMA2 є практично однаковими." + +#. type: Plain text +#: ../src/xz/xz.1:1346 +msgid "LZMA1 and LZMA2 share the same set of I:" +msgstr "LZMA1 і LZMA2 спільно використовують той самий набір I<параметрів>:" + +#. type: TP +#: ../src/xz/xz.1:1347 +#, no-wrap +msgid "BI" +msgstr "BI<шаблон>" + +#. type: Plain text +#: ../src/xz/xz.1:1374 +msgid "Reset all LZMA1 or LZMA2 I to I. I consist of an integer, which may be followed by single-letter preset modifiers. The integer can be from B<0> to B<9>, matching the command line options B<-0> \\&...\\& B<-9>. The only supported modifier is currently B, which matches B<--extreme>. If no B is specified, the default values of LZMA1 or LZMA2 I are taken from the preset B<6>." +msgstr "Скинути усі I<параметри> LZMA1 або LZMA2 до параметрів I<шаблона>. Аргумент I<шаблон> складається з цілого числа, після якого може бути однолітерний модифікатор шаблона. Ціле число може належати лише діапазону від B<0> до B<9>, що відповідає параметрам командного рядка B<-0> \\&...\\& B<-9>. Єдиним підтримуваним модифікатором у поточній версії є B, щоб відповідає параметру B<--extreme>. Якщо аргумент B<шаблон> не вказано, типові значення I<параметрів> LZMA1 або LZMA2 буде взято із шаблона B<6>." + +#. type: TP +#: ../src/xz/xz.1:1374 +#, no-wrap +msgid "BI" +msgstr "BI<розмір>" + +#. type: Plain text +#: ../src/xz/xz.1:1389 +msgid "Dictionary (history buffer) I indicates how many bytes of the recently processed uncompressed data is kept in memory. The algorithm tries to find repeating byte sequences (matches) in the uncompressed data, and replace them with references to the data currently in the dictionary. The bigger the dictionary, the higher is the chance to find a match. Thus, increasing dictionary I usually improves compression ratio, but a dictionary bigger than the uncompressed file is waste of memory." +msgstr "Параметр I<розміру> словника (буфера журналу) визначає, скільки байтів нещодавно оброблених нестиснених даних слід зберігати у пам'яті. Алгоритм намагається знайти повторювані послідовності байтів (відповідники) у нестиснених даних і замінити їх на посилання на дані зі словника. Чим більшим є словник, тим вищою є ймовірність відшукати відповідник. Отже, збільшення I<розміру> словника, зазвичай, покращує коефіцієнт стискання, але використання словника, розмір якого перевищу є розмір нестисненого файла є простоюю витратою пам'яті." + +#. type: Plain text +#: ../src/xz/xz.1:1398 +msgid "Typical dictionary I is from 64\\ KiB to 64\\ MiB. The minimum is 4\\ KiB. The maximum for compression is currently 1.5\\ GiB (1536\\ MiB). The decompressor already supports dictionaries up to one byte less than 4\\ GiB, which is the maximum for the LZMA1 and LZMA2 stream formats." +msgstr "I<Розмір> типового словника складає від 64\\ КіБ до 64\\ МіБ. Мінімальним є розмір 4\\ КіБ. Максимальним розміром для стискання у поточній версії 1.5\\ ГіБ (1536\\ МіБ). У засобі розпаковування вже передбачено підтримку словників на один байт менших за 4\\ ГіБ, що є максимальним значенням для форматів потоків даних LZMA1 і LZMA2." + +#. type: Plain text +#: ../src/xz/xz.1:1425 +msgid "Dictionary I and match finder (I) together determine the memory usage of the LZMA1 or LZMA2 encoder. The same (or bigger) dictionary I is required for decompressing that was used when compressing, thus the memory usage of the decoder is determined by the dictionary size used when compressing. The B<.xz> headers store the dictionary I either as 2^I or 2^I + 2^(I-1), so these I are somewhat preferred for compression. Other I will get rounded up when stored in the B<.xz> headers." +msgstr "Аргумент I<розміру> словника і засіб пошуку відповідників (I) разом визначають параметри використання пам'яті для кодувальника LZMA1 або LZMA2. Для розпаковування потрібен такий самий (або більший) I<розмір> словника, що і для стискання, отже, використання пам'яті для засобу розпаковування буде визначено за розміром словника, який було використано для стискання. У заголовках B<.xz> зберігається I<розмір> словника або як 2^I, або як 2^I + 2^(I-1), отже, ці I<розміри> є дещо пріоритетними для стискання. Інші I<розміри> буде отримано округленням при зберіганні у заголовках B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:1425 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1434 +msgid "Specify the number of literal context bits. The minimum is 0 and the maximum is 4; the default is 3. In addition, the sum of I and I must not exceed 4." +msgstr "Визначає кількість буквальних контекстних бітів. Мінімальною кількістю є 0, а максимальною — 4. Типовою кількістю є 3. Крім того, сума I і I має не перевищувати 4." + +#. type: Plain text +#: ../src/xz/xz.1:1439 +msgid "All bytes that cannot be encoded as matches are encoded as literals. That is, literals are simply 8-bit bytes that are encoded one at a time." +msgstr "Усі байти, які не може бути закодовано як відповідності, буде закодовано як літерали. Тобто літерали є просто 8-бітовими байтами, які буде закодовано по одному за раз." + +#. type: Plain text +#: ../src/xz/xz.1:1453 +msgid "The literal coding makes an assumption that the highest I bits of the previous uncompressed byte correlate with the next byte. For example, in typical English text, an upper-case letter is often followed by a lower-case letter, and a lower-case letter is usually followed by another lower-case letter. In the US-ASCII character set, the highest three bits are 010 for upper-case letters and 011 for lower-case letters. When I is at least 3, the literal coding can take advantage of this property in the uncompressed data." +msgstr "При кодуванні літералів роблять припущення, що найвищі біти I попереднього нестисненого байта корелюють із наступним байтом. Наприклад, у типовому тексті англійською за літерою у верхньому регістрі йде літера у нижньому регістрі, а за літерою у нижньому регістрі, зазвичай, йде інша літера у нижньому регістрі. У наборі символів US-ASCII найвищими трьома бітами є 010 для літер верхнього регістру і 011 для літер нижнього регістру. Якщо I дорівнює принаймні 3, при кодуванні літералів можна отримати перевагу встановлення цієї властивості для нестиснених даних." + +#. type: Plain text +#: ../src/xz/xz.1:1462 +msgid "The default value (3) is usually good. If you want maximum compression, test B. Sometimes it helps a little, and sometimes it makes compression worse. If it makes it worse, test B too." +msgstr "Зазвичай, типового значення (3) достатньо. Якщо вам потрібне максимальне стискання, спробуйте B. Іноді це трохи допомагає, а іноді, робить стискання гіршим. Якщо стискання стане гіршим, спробуйте також B." + +#. type: TP +#: ../src/xz/xz.1:1462 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1466 +msgid "Specify the number of literal position bits. The minimum is 0 and the maximum is 4; the default is 0." +msgstr "Визначає кількість буквальних позиційних бітів. Мінімальною кількістю є 0, а максимальною — 4. Типовою кількістю є 0." + +#. type: Plain text +#: ../src/xz/xz.1:1473 +msgid "I affects what kind of alignment in the uncompressed data is assumed when encoding literals. See I below for more information about alignment." +msgstr "I впливає на те, яке вирівнювання у нестиснених даних слід припускати при кодуванні літералів. Див. I нижче, щоб дізнатися більше про вирівнювання." + +#. type: TP +#: ../src/xz/xz.1:1473 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1477 +msgid "Specify the number of position bits. The minimum is 0 and the maximum is 4; the default is 2." +msgstr "Визначає кількість позиційних бітів. Мінімальною кількістю є 0, а максимальною — 4. Типовою кількістю є 2." + +#. type: Plain text +#: ../src/xz/xz.1:1484 +msgid "I affects what kind of alignment in the uncompressed data is assumed in general. The default means four-byte alignment (2^I=2^2=4), which is often a good choice when there's no better guess." +msgstr "I впливає на те, який тип вирівнювання загалом припускатиметься для нестиснених даних. Типовим є чотирибайтове вирівнювання (2^I=2^2=4), яке, зазвичай, є добрим варіантом, якщо немає кращих припущень." + +#. type: Plain text +#: ../src/xz/xz.1:1498 +msgid "When the alignment is known, setting I accordingly may reduce the file size a little. For example, with text files having one-byte alignment (US-ASCII, ISO-8859-*, UTF-8), setting B can improve compression slightly. For UTF-16 text, B is a good choice. If the alignment is an odd number like 3 bytes, B might be the best choice." +msgstr "Якщо вирівнювання є відомим, встановлення відповідним чином I може трохи зменшити розмір файла. Наприклад, у текстових файлах із однобайтовим вирівнюванням (US-ASCII, ISO-8859-*, UTF-8), встановлення значення B може трохи поліпшити стискання. Для тексту UTF-16 добрим варіантом є B. Якщо вирівнювання є непарним числом, наприклад 3 байти, найкращим вибором, ймовірно, є B." + +#. type: Plain text +#: ../src/xz/xz.1:1506 +msgid "Even though the assumed alignment can be adjusted with I and I, LZMA1 and LZMA2 still slightly favor 16-byte alignment. It might be worth taking into account when designing file formats that are likely to be often compressed with LZMA1 or LZMA2." +msgstr "Хоча прогнозоване вирівнювання можна скоригувати за допомогою I і I, у LZMA1 і LZMA2 дещо пріоритетним є 16-байтове вирівнювання. Це, ймовірно, слід враховувати при компонуванні форматів файлів, які, ймовірно, часто будуть стискатися з використанням LZMA1 або LZMA2." + +#. type: TP +#: ../src/xz/xz.1:1506 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1521 +msgid "Match finder has a major effect on encoder speed, memory usage, and compression ratio. Usually Hash Chain match finders are faster than Binary Tree match finders. The default depends on the I: 0 uses B, 1\\(en3 use B, and the rest use B." +msgstr "Засіб пошуку відповідників має значний вплив на швидкість, використання пам'яті та коефіцієнт стискання кодувальника. Зазвичай, засоби пошуку відповідників на основі ланцюжка хешів є швидшими за засоби пошуку відповідників на основі двійкового дерева. Типовий засіб залежить від I<шаблона>: для 0 використовують B, для 1\\(en3 — B, а для решти використовують B." + +#. type: Plain text +#: ../src/xz/xz.1:1527 +msgid "The following match finders are supported. The memory usage formulas below are rough approximations, which are closest to the reality when I is a power of two." +msgstr "Передбачено підтримку вказаних нижче засобів пошуку відповідників. Наведені нижче формули обчислення використання пам'яті є грубими наближеннями, які є найближчими до реальних значень, якщо значенням I<словник> є степінь двійки." + +#. type: TP +#: ../src/xz/xz.1:1528 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1531 +msgid "Hash Chain with 2- and 3-byte hashing" +msgstr "Ланцюжок хешів із 2- та 3-байтовим хешуванням" + +#. type: Plain text +#: ../src/xz/xz.1:1535 ../src/xz/xz.1:1584 +msgid "Minimum value for I: 3" +msgstr "Мінімальне значення I<пріоритетності>: 3" + +#. type: Plain text +#: ../src/xz/xz.1:1537 ../src/xz/xz.1:1556 ../src/xz/xz.1:1586 +#: ../src/xz/xz.1:1605 +msgid "Memory usage:" +msgstr "Використання пам'яті:" + +#. type: Plain text +#: ../src/xz/xz.1:1542 +msgid "I * 7.5 (if I E= 16 MiB);" +msgstr "I * 7.5 (якщо I E= 16 МіБ);" + +#. type: Plain text +#: ../src/xz/xz.1:1547 +msgid "I * 5.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 5.5 + 64 МіБ (якщо I E 16 МіБ)" + +#. type: TP +#: ../src/xz/xz.1:1547 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1550 +msgid "Hash Chain with 2-, 3-, and 4-byte hashing" +msgstr "Ланцюжок хешів із 2-, 3- та 4-байтовим хешуванням" + +#. type: Plain text +#: ../src/xz/xz.1:1554 ../src/xz/xz.1:1603 +msgid "Minimum value for I: 4" +msgstr "Мінімальне значення I<пріоритетності>: 4" + +#. type: Plain text +#: ../src/xz/xz.1:1561 +msgid "I * 7.5 (if I E= 32 MiB);" +msgstr "I * 7.5 (якщо I E= 32 МіБ);" + +#. type: Plain text +#: ../src/xz/xz.1:1566 +msgid "I * 6.5 (if I E 32 MiB)" +msgstr "I * 6.5 (якщо I E 32 МіБ)" + +#. type: TP +#: ../src/xz/xz.1:1566 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1569 +msgid "Binary Tree with 2-byte hashing" +msgstr "Двійкове дерево із 2-байтовим хешуванням" + +#. type: Plain text +#: ../src/xz/xz.1:1573 +msgid "Minimum value for I: 2" +msgstr "Мінімальне значення I<пріоритетності>: 2" + +#. type: Plain text +#: ../src/xz/xz.1:1577 +msgid "Memory usage: I * 9.5" +msgstr "Використання пам'яті: I * 9.5" + +#. type: TP +#: ../src/xz/xz.1:1577 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1580 +msgid "Binary Tree with 2- and 3-byte hashing" +msgstr "Двійкове дерево із 2- і 3-байтовим хешуванням" + +#. type: Plain text +#: ../src/xz/xz.1:1591 +msgid "I * 11.5 (if I E= 16 MiB);" +msgstr "I * 11.5 (якщо I E= 16 МіБ);" + +#. type: Plain text +#: ../src/xz/xz.1:1596 +msgid "I * 9.5 + 64 MiB (if I E 16 MiB)" +msgstr "I * 9.5 + 64 МіБ (якщо I E 16 МіБ)" + +#. type: TP +#: ../src/xz/xz.1:1596 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:1599 +msgid "Binary Tree with 2-, 3-, and 4-byte hashing" +msgstr "Двійкове дерево із 2-, 3- і 4-байтовим хешуванням" + +#. type: Plain text +#: ../src/xz/xz.1:1610 +msgid "I * 11.5 (if I E= 32 MiB);" +msgstr "I * 11.5 (якщо I E= 32 МіБ);" + +#. type: Plain text +#: ../src/xz/xz.1:1615 +msgid "I * 10.5 (if I E 32 MiB)" +msgstr "I * 10.5 (якщо I E 32 МіБ)" + +#. type: TP +#: ../src/xz/xz.1:1616 +#, no-wrap +msgid "BI" +msgstr "BI<режим>" + +#. type: Plain text +#: ../src/xz/xz.1:1637 +msgid "Compression I specifies the method to analyze the data produced by the match finder. Supported I are B and B. The default is B for I 0\\(en3 and B for I 4\\(en9." +msgstr "Параметр I<режиму> стискання визначає спосіб, який буде використано для аналізу даних, які створено засобом пошуку відповідників. Підтримуваними I<режимами> є B (швидкий) і B (нормальний). Типовим є режим B для I<шаблонів> 0\\(en3 і режим B для I<шаблонів> 4\\(en9." + +#. type: Plain text +#: ../src/xz/xz.1:1646 +msgid "Usually B is used with Hash Chain match finders and B with Binary Tree match finders. This is also what the I do." +msgstr "Зазвичай, із засобом пошуку відповідників на основі ланцюжка хешів використовують B, а із засобом пошуку відповідників на основі двійкового дерева використовують B. Так само налаштовано і I<шаблони>." + +#. type: TP +#: ../src/xz/xz.1:1646 +#, no-wrap +msgid "BI" +msgstr "BI<пріоритетність>" + +#. type: Plain text +#: ../src/xz/xz.1:1653 +msgid "Specify what is considered to be a nice length for a match. Once a match of at least I bytes is found, the algorithm stops looking for possibly better matches." +msgstr "Вказати, яка довжина є пріоритетною для відповідності. Щойно буде виявлено відповідність у принаймні I<пріоритетність> байтів, алгоритм зупинятиме пошук можливих кращих відповідників." + +#. type: Plain text +#: ../src/xz/xz.1:1660 +msgid "I can be 2\\(en273 bytes. Higher values tend to give better compression ratio at the expense of speed. The default depends on the I." +msgstr "I<Пріоритетністю> може бути число до 2\\(en273 байтів. Вищі значення дають кращий коефіцієнт стискання за рахунок швидкості. Типове значення залежить від I<шаблона>." + +#. type: TP +#: ../src/xz/xz.1:1660 +#, no-wrap +msgid "BI" +msgstr "BI<глибина>" + +#. type: Plain text +#: ../src/xz/xz.1:1670 +msgid "Specify the maximum search depth in the match finder. The default is the special value of 0, which makes the compressor determine a reasonable I from I and I." +msgstr "Вказати максимальну глибину пошуку у засобі пошуку відповідності. Типовим є особливе значення 0, яке наказує засобу стискання визначити прийнятну I<глибину> на основі I і I<пріоритетності>." + +#. type: Plain text +#: ../src/xz/xz.1:1681 +msgid "Reasonable I for Hash Chains is 4\\(en100 and 16\\(en1000 for Binary Trees. Using very high values for I can make the encoder extremely slow with some files. Avoid setting the I over 1000 unless you are prepared to interrupt the compression in case it is taking far too long." +msgstr "Прийнятним значенням I<глибини> для ланцюжків хешів є 4\\(en100 і 16\\(en1000 для двійкових дерев. Використання дуже високих значень для I<глибини> може зробити кодувальник дуже повільним для деяких файлів. Не встановлюйте значення I<глибини>, що перевищує 1000, якщо ви не готові перервати стискання, якщо воно триватиме надто довго." + +#. type: Plain text +#: ../src/xz/xz.1:1692 +msgid "When decoding raw streams (B<--format=raw>), LZMA2 needs only the dictionary I. LZMA1 needs also I, I, and I." +msgstr "При декодуванні необроблених потоків даних (B<--format=raw>), LZMA2 потребує лише I<розміру> словника. LZMA1 потребує також I, I і I." + +#. type: TP +#: ../src/xz/xz.1:1692 +#, no-wrap +msgid "B<--x86>[B<=>I]" +msgstr "B<--x86>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1695 +#, no-wrap +msgid "B<--arm>[B<=>I]" +msgstr "B<--arm>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1697 +#, no-wrap +msgid "B<--armthumb>[B<=>I]" +msgstr "B<--armthumb>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1699 +#, no-wrap +msgid "B<--arm64>[B<=>I]" +msgstr "B<--arm64>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1701 +#, no-wrap +msgid "B<--powerpc>[B<=>I]" +msgstr "B<--powerpc>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1703 +#, no-wrap +msgid "B<--ia64>[B<=>I]" +msgstr "B<--ia64>[B<=>I<параметри>]" + +#. type: TP +#: ../src/xz/xz.1:1705 +#, no-wrap +msgid "B<--sparc>[B<=>I]" +msgstr "B<--sparc>[B<=>I<параметри>]" + +#. type: Plain text +#: ../src/xz/xz.1:1711 +msgid "Add a branch/call/jump (BCJ) filter to the filter chain. These filters can be used only as a non-last filter in the filter chain." +msgstr "Додати фільтр гілок/викликів/переходів (branch/call/jump або BCJ) до ланцюжка фільтрів. Цими фільтрами можна скористатися, лише якщо вони не є останнім фільтром у ланцюжку фільтрів." + +#. type: Plain text +#: ../src/xz/xz.1:1725 +msgid "A BCJ filter converts relative addresses in the machine code to their absolute counterparts. This doesn't change the size of the data but it increases redundancy, which can help LZMA2 to produce 0\\(en15\\ % smaller B<.xz> file. The BCJ filters are always reversible, so using a BCJ filter for wrong type of data doesn't cause any data loss, although it may make the compression ratio slightly worse. The BCJ filters are very fast and use an insignificant amount of memory." +msgstr "Фільтр BCJ перетворює відносні адреси у машинному коді на їхні абсолютні відповідники. Це не змінює розміру даних, але підвищує резервування, що може допомогти LZMA2 створити файл B<.xz> на 0\\(en15\\ % менше. Фільтри BCJ завжди є придатними до обернення, тому використання фільтра BCJ до помилкового типу даних не спричинятиме втрати даних, хоча може дещо погіршити коефіцієнт стискання. Фільтри BCJ є дуже швидкими і такими, що використовують незначний об'єм пам'яті." + +#. type: Plain text +#: ../src/xz/xz.1:1728 +msgid "These BCJ filters have known problems related to the compression ratio:" +msgstr "Ці фільтри BCJ мають відомі проблеми, які пов'язано із рівнем стискання:" + +#. type: Plain text +#: ../src/xz/xz.1:1735 +msgid "Some types of files containing executable code (for example, object files, static libraries, and Linux kernel modules) have the addresses in the instructions filled with filler values. These BCJ filters will still do the address conversion, which will make the compression worse with these files." +msgstr "У деяких типах файлів, де зберігається виконуваний код, (наприклад, в об'єктних файлах, статичних бібліотеках та модулях ядра Linux) адреси в інструкціях заповнено значеннями заповнювача. Ці фільтри BCJ виконуватимуть перетворення адрес, яке зробить стискання для цих файлів гіршим." + +#. type: Plain text +#: ../src/xz/xz.1:1745 +msgid "If a BCJ filter is applied on an archive, it is possible that it makes the compression ratio worse than not using a BCJ filter. For example, if there are similar or even identical executables then filtering will likely make the files less similar and thus compression is worse. The contents of non-executable files in the same archive can matter too. In practice one has to try with and without a BCJ filter to see which is better in each situation." +msgstr "Якщо фільтр BCJ застосовано до архіву, може так статися, що він погіршить коефіцієнт стискання порівняно із варіантом без фільтра BCJ. Наприклад, якщо є подібні або навіть однакові виконувані файли, фільтрування, ймовірно, зробить ці файли менш подібними, а отже, зробить стискання гіршим. Вміст файлів, які не є виконуваними, у тому самому архіві також може вплинути на результат. На практиці, варто спробувати варіанти з фільтром BCJ і без нього, щоб визначитися із тим, що буде кращим у кожній ситуації." + +#. type: Plain text +#: ../src/xz/xz.1:1750 +msgid "Different instruction sets have different alignment: the executable file must be aligned to a multiple of this value in the input data to make the filter work." +msgstr "Різні набори інструкцій мають різне вирівнювання: виконуваний файл має бути вирівняно на кратне до цього значення у вхідних даних, щоб фільтр спрацював." + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Filter" +msgstr "Фільтр" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Alignment" +msgstr "Вирівнювання" + +#. type: tbl table +#: ../src/xz/xz.1:1757 +#, no-wrap +msgid "Notes" +msgstr "Нотатки" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "x86" +msgstr "x86" + +#. type: tbl table +#: ../src/xz/xz.1:1758 +#, no-wrap +msgid "32-bit or 64-bit x86" +msgstr "32-бітова або 64-бітова x86" + +#. type: tbl table +#: ../src/xz/xz.1:1759 +#, no-wrap +msgid "ARM" +msgstr "ARM" + +#. type: tbl table +#: ../src/xz/xz.1:1760 +#, no-wrap +msgid "ARM-Thumb" +msgstr "ARM-Thumb" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "ARM64" +msgstr "ARM64" + +#. type: tbl table +#: ../src/xz/xz.1:1761 +#, no-wrap +msgid "4096-byte alignment is best" +msgstr "" +"Найкращим є вирівнювання за\n" +";;4096 байтами" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "PowerPC" +msgstr "PowerPC" + +#. type: tbl table +#: ../src/xz/xz.1:1762 +#, no-wrap +msgid "Big endian only" +msgstr "Лише зворотний порядок байтів" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "IA-64" +msgstr "IA-64" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "16" +msgstr "16" + +#. type: tbl table +#: ../src/xz/xz.1:1763 +#, no-wrap +msgid "Itanium" +msgstr "Itanium" + +#. type: tbl table +#: ../src/xz/xz.1:1764 +#, no-wrap +msgid "SPARC" +msgstr "SPARC" + +#. type: Plain text +#: ../src/xz/xz.1:1781 +msgid "Since the BCJ-filtered data is usually compressed with LZMA2, the compression ratio may be improved slightly if the LZMA2 options are set to match the alignment of the selected BCJ filter. For example, with the IA-64 filter, it's good to set B or even B with LZMA2 (2^4=16). The x86 filter is an exception; it's usually good to stick to LZMA2's default four-byte alignment when compressing x86 executables." +msgstr "Оскільки фільтровані BCJ дані, зазвичай, стискають за допомогою LZMA2, коефіцієнт стискання можна трохи поліпшити, якщо параметри LZMA2 буде встановлено так, щоб вони відповідали вирівнюванню вибраного фільтра BCJ. Наприклад, з фільтром IA-64 варто встановити B або навіть B з LZMA2 (2^4=16). Фільтр x86 є винятком; його, зазвичай, варто поєднувати із типовим чотирибайтовим вирівнюванням LZMA2 при стисканні виконуваних файлів x86." + +#. type: Plain text +#: ../src/xz/xz.1:1784 +msgid "All BCJ filters support the same I:" +msgstr "У всіх фільтрах BCJ передбачено підтримку тих самих I<параметрів>:" + +#. type: TP +#: ../src/xz/xz.1:1785 +#, no-wrap +msgid "BI" +msgstr "BI<зсув>" + +#. type: Plain text +#: ../src/xz/xz.1:1799 +msgid "Specify the start I that is used when converting between relative and absolute addresses. The I must be a multiple of the alignment of the filter (see the table above). The default is zero. In practice, the default is good; specifying a custom I is almost never useful." +msgstr "Встановити початковий I<зсув>, який буде використано при перетворенні між відносною та абсолютною адресами. Значення I<зсув> має бути кратним до вирівнювання фільтра (див. таблицю вище). Типовим зсувом є нульовий. На практиці, типове значення є прийнятним; визначення нетипового значення I<зсув> майже завжди нічого корисного не дає." + +#. type: TP +#: ../src/xz/xz.1:1800 +#, no-wrap +msgid "B<--delta>[B<=>I]" +msgstr "B<--delta>[B<=>I<параметри>]" + +#. type: Plain text +#: ../src/xz/xz.1:1805 +msgid "Add the Delta filter to the filter chain. The Delta filter can be only used as a non-last filter in the filter chain." +msgstr "Додати дельта-фільтр до ланцюжка фільтрів. Дельта-фільтр може бути використано, лише якщо він не є останнім у ланцюжку фільтрів." + +#. type: Plain text +#: ../src/xz/xz.1:1814 +msgid "Currently only simple byte-wise delta calculation is supported. It can be useful when compressing, for example, uncompressed bitmap images or uncompressed PCM audio. However, special purpose algorithms may give significantly better results than Delta + LZMA2. This is true especially with audio, which compresses faster and better, for example, with B(1)." +msgstr "У поточній версії передбачено підтримку обчислення лише простої побітової дельти. Це може бути корисним при стисканні, наприклад, нестиснутих растрових зображень або нестиснутих звукових даних PCM. Втім, спеціалізовані алгоритми можуть давати значно кращі результати за дельту + LZMA2. Це правило особливо стосується звукових даних, які стискає швидше і краще, наприклад, B(1)." + +#. type: Plain text +#: ../src/xz/xz.1:1817 +msgid "Supported I:" +msgstr "Підтримувані I<параметри>:" + +#. type: TP +#: ../src/xz/xz.1:1818 +#, no-wrap +msgid "BI" +msgstr "BI<відстань>" + +#. type: Plain text +#: ../src/xz/xz.1:1826 +msgid "Specify the I of the delta calculation in bytes. I must be 1\\(en256. The default is 1." +msgstr "Вказати I<відстань> обчислень різниці у байтах. Значення I<відстань> має потрапляти у діапазон 1\\(en256. Типовим значенням є 1." + +#. type: Plain text +#: ../src/xz/xz.1:1831 +msgid "For example, with B and eight-byte input A1 B1 A2 B3 A3 B5 A4 B7, the output will be A1 B1 01 02 01 02 01 02." +msgstr "Наприклад, з B та восьмибайтовими вхідними даними A1 B1 A2 B3 A3 B5 A4 B7, результатом буде A1 B1 01 02 01 02 01 02." + +#. type: SS +#: ../src/xz/xz.1:1833 +#, no-wrap +msgid "Other options" +msgstr "Інші параметри" + +#. type: TP +#: ../src/xz/xz.1:1834 ../src/xzdec/xzdec.1:83 +#, no-wrap +msgid "B<-q>, B<--quiet>" +msgstr "B<-q>, B<--quiet>" + +#. type: Plain text +#: ../src/xz/xz.1:1841 +msgid "Suppress warnings and notices. Specify this twice to suppress errors too. This option has no effect on the exit status. That is, even if a warning was suppressed, the exit status to indicate a warning is still used." +msgstr "Придушити попередження та сповіщення. Вкажіть цей параметр двічі, щоб придушити також повідомлення про помилки. Цей параметр не впливає на стан виходу з програми. Тобто, навіть якщо було придушено попередження, стан виходу вказуватиме на те, що попередження були." + +#. type: TP +#: ../src/xz/xz.1:1841 +#, no-wrap +msgid "B<-v>, B<--verbose>" +msgstr "B<-v>, B<--verbose>" + +#. type: Plain text +#: ../src/xz/xz.1:1850 +msgid "Be verbose. If standard error is connected to a terminal, B will display a progress indicator. Specifying B<--verbose> twice will give even more verbose output." +msgstr "Докладний режим повідомлень. Якщо стандартне виведення помилок з'єднано із терміналом, B показуватиме індикатор поступу. Використання B<--verbose> двічі призведе до ще докладнішого виведення." + +#. type: Plain text +#: ../src/xz/xz.1:1852 +msgid "The progress indicator shows the following information:" +msgstr "Індикатор поступу показує такі дані:" + +#. type: Plain text +#: ../src/xz/xz.1:1857 +msgid "Completion percentage is shown if the size of the input file is known. That is, the percentage cannot be shown in pipes." +msgstr "Частку завершеності буде показано, якщо відомий розмір файла вхідних даних. Тобто, для каналів даних частку не може бути показано." + +#. type: Plain text +#: ../src/xz/xz.1:1860 +msgid "Amount of compressed data produced (compressing) or consumed (decompressing)." +msgstr "Об'єм стиснених виведених даних (стискання) або оброблених (розпаковування)." + +#. type: Plain text +#: ../src/xz/xz.1:1863 +msgid "Amount of uncompressed data consumed (compressing) or produced (decompressing)." +msgstr "Об'єм незапакованих даних (стискання) або виведених даних (розпаковування)." + +#. type: Plain text +#: ../src/xz/xz.1:1867 +msgid "Compression ratio, which is calculated by dividing the amount of compressed data processed so far by the amount of uncompressed data processed so far." +msgstr "Коефіцієнт стискання, який обчислено діленням об'єму оброблених стиснутих даних на об'єм оброблених нестиснутих даних." + +#. type: Plain text +#: ../src/xz/xz.1:1874 +msgid "Compression or decompression speed. This is measured as the amount of uncompressed data consumed (compression) or produced (decompression) per second. It is shown after a few seconds have passed since B started processing the file." +msgstr "Швидкість стискання або розпаковування. Обчислюється як об'єм нестиснутих даних (стискання) або виведених даних (розпаковування) за секунду. Його буде показано за декілька секунд з моменту, коли B почала обробляти файл." + +#. type: Plain text +#: ../src/xz/xz.1:1876 +msgid "Elapsed time in the format M:SS or H:MM:SS." +msgstr "Витрачений час у форматі Х:СС або Г:ХХ:СС." + +#. type: Plain text +#: ../src/xz/xz.1:1884 +msgid "Estimated remaining time is shown only when the size of the input file is known and a couple of seconds have already passed since B started processing the file. The time is shown in a less precise format which never has any colons, for example, 2 min 30 s." +msgstr "Оцінку часу, що лишився, буде показано, лише якщо розмір файла вхідних даних є відомим, і минуло принаймні декілька секунд з моменту, коли B почала обробляти файл. Час буде показано у менш точному форматі, без двокрапок, наприклад, 2 хв. 30 с." + +#. type: Plain text +#: ../src/xz/xz.1:1899 +msgid "When standard error is not a terminal, B<--verbose> will make B print the filename, compressed size, uncompressed size, compression ratio, and possibly also the speed and elapsed time on a single line to standard error after compressing or decompressing the file. The speed and elapsed time are included only when the operation took at least a few seconds. If the operation didn't finish, for example, due to user interruption, also the completion percentage is printed if the size of the input file is known." +msgstr "Якщо стандартним виведенням помилок не є термінал, B<--verbose> призведе до того, що B виведе назву файла, стиснений розмір, нестиснений розмір, коефіцієнт стискання та, можливо, також швидкість та витрачений час у одному рядку до стандартного виведення помилок після стискання або розпаковування файла. Швидкість та витрачений час буде включено, лише якщо дія триває принаймні декілька секунд. Якщо дію не буде завершено, наприклад, через втручання користувача, буде також виведено частку виконання, якщо відомий розмір файла вхідних даних." + +#. type: TP +#: ../src/xz/xz.1:1899 ../src/xzdec/xzdec.1:89 +#, no-wrap +msgid "B<-Q>, B<--no-warn>" +msgstr "B<-Q>, B<--no-warn>" + +#. type: Plain text +#: ../src/xz/xz.1:1909 +msgid "Don't set the exit status to 2 even if a condition worth a warning was detected. This option doesn't affect the verbosity level, thus both B<--quiet> and B<--no-warn> have to be used to not display warnings and to not alter the exit status." +msgstr "Не встановлювати стан виходу 2, навіть якщо було виявлено відповідність умові, яка варта попередження. Цей параметр не впливає на рівень докладності повідомлень, отже, слід використати B<--quiet> і B<--no-warn>, щоб програма не показувала попереджень і не змінювала стан виходу." + +#. type: TP +#: ../src/xz/xz.1:1909 +#, no-wrap +msgid "B<--robot>" +msgstr "B<--robot>" + +#. type: Plain text +#: ../src/xz/xz.1:1921 +msgid "Print messages in a machine-parsable format. This is intended to ease writing frontends that want to use B instead of liblzma, which may be the case with various scripts. The output with this option enabled is meant to be stable across B releases. See the section B for details." +msgstr "Виводити повідомлення у придатному для обробки комп'ютером форматі. Цей формат призначено для полегшення написання оболонок, які використовуватимуть B замість liblzma, що може бути зручним для різноманітних скриптів. Виведені дані з цим параметром має бути стабільним для усіх випусків B. Докладніший опис можна знайти у розділі B<РЕЖИМ РОБОТА>." + +#. type: TP +#: ../src/xz/xz.1:1921 +#, no-wrap +msgid "B<--info-memory>" +msgstr "B<--info-memory>" + +#. type: Plain text +#: ../src/xz/xz.1:1928 +msgid "Display, in human-readable format, how much physical memory (RAM) and how many processor threads B thinks the system has and the memory usage limits for compression and decompression, and exit successfully." +msgstr "Вивести у придатному для читання людиною форматі, скільки фізичної пам'яті (RAM) та скільки потоків процесора є за даними B у системі, обмеження для стискання та розпаковування, а потім успішно завершити роботу." + +#. type: TP +#: ../src/xz/xz.1:1928 ../src/xzdec/xzdec.1:96 +#, no-wrap +msgid "B<-h>, B<--help>" +msgstr "B<-h>, B<--help>" + +#. type: Plain text +#: ../src/xz/xz.1:1932 +msgid "Display a help message describing the most commonly used options, and exit successfully." +msgstr "Вивести повідомлення про помилку з описом найбільш типових використаних параметрів і успішно завершити роботу." + +#. type: TP +#: ../src/xz/xz.1:1932 +#, no-wrap +msgid "B<-H>, B<--long-help>" +msgstr "B<-H>, B<--long-help>" + +#. type: Plain text +#: ../src/xz/xz.1:1937 +msgid "Display a help message describing all features of B, and exit successfully" +msgstr "Вивести довідкове повідомлення з описом усіх можливостей B і успішно завершити роботу" + +#. type: TP +#: ../src/xz/xz.1:1937 ../src/xzdec/xzdec.1:99 +#, no-wrap +msgid "B<-V>, B<--version>" +msgstr "B<-V>, B<--version>" + +#. type: Plain text +#: ../src/xz/xz.1:1946 +msgid "Display the version number of B and liblzma in human readable format. To get machine-parsable output, specify B<--robot> before B<--version>." +msgstr "Вивести номер версії B та liblzma у зручному для читання форматі. Щоб отримати дані, зручні для обробки на комп'ютері, вкажіть B<--robot> до B<--version>." + +#. type: SH +#: ../src/xz/xz.1:1947 +#, no-wrap +msgid "ROBOT MODE" +msgstr "РЕЖИМ РОБОТА" + +#. type: Plain text +#: ../src/xz/xz.1:1963 +msgid "The robot mode is activated with the B<--robot> option. It makes the output of B easier to parse by other programs. Currently B<--robot> is supported only together with B<--version>, B<--info-memory>, and B<--list>. It will be supported for compression and decompression in the future." +msgstr "Режим робота активують за допомогою параметра B<--robot>. Він спрощує обробку виведених B даних іншими програмами. У поточній версії підтримку B<--robot> передбачено лише разом із B<--version>, B<--info-memory> та B<--list>. У майбутньому підтримку параметра буде передбачено для стискання та розпаковування." + +#. type: SS +#: ../src/xz/xz.1:1964 +#, no-wrap +msgid "Version" +msgstr "Версія" + +#. type: Plain text +#: ../src/xz/xz.1:1969 +msgid "B will print the version number of B and liblzma in the following format:" +msgstr "B виведе назву версії B і liblzma у такому форматі:" + +#. type: Plain text +#: ../src/xz/xz.1:1971 +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: ../src/xz/xz.1:1973 +msgid "BI" +msgstr "BI" + +#. type: TP +#: ../src/xz/xz.1:1973 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1976 +msgid "Major version." +msgstr "Основна версія." + +#. type: TP +#: ../src/xz/xz.1:1976 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1981 +msgid "Minor version. Even numbers are stable. Odd numbers are alpha or beta versions." +msgstr "Проміжна версія. Непарні номери буде використано для стабільних версій. Непарні номери є номерами тестових версій." + +#. type: TP +#: ../src/xz/xz.1:1981 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1985 +msgid "Patch level for stable releases or just a counter for development releases." +msgstr "Рівень латання для стабільних випусків або просто лічильник для випусків, які перебувають у розробці." + +#. type: TP +#: ../src/xz/xz.1:1985 +#, no-wrap +msgid "I" +msgstr "I" + +#. type: Plain text +#: ../src/xz/xz.1:1993 +msgid "Stability. 0 is alpha, 1 is beta, and 2 is stable. I should be always 2 when I is even." +msgstr "Стабільність. 0 — alpha, 1 — beta, а 2 означає «стабільна версія». I має завжди дорівнювати 2, якщо I є парним." + +#. type: Plain text +#: ../src/xz/xz.1:1998 +msgid "I are the same on both lines if B and liblzma are from the same XZ Utils release." +msgstr "I є тим самим в обох рядках, якщо B і liblzma належать до одного випуску XZ Utils." + +#. type: Plain text +#: ../src/xz/xz.1:2004 +msgid "Examples: 4.999.9beta is B<49990091> and 5.0.0 is B<50000002>." +msgstr "Приклади: 4.999.9beta — це B<49990091>, а 5.0.0 — це B<50000002>." + +#. type: SS +#: ../src/xz/xz.1:2005 +#, no-wrap +msgid "Memory limit information" +msgstr "Дані щодо обмеження пам'яті" + +#. type: Plain text +#: ../src/xz/xz.1:2008 +msgid "B prints a single line with three tab-separated columns:" +msgstr "B виводить один рядок з трьома відокремленими табуляціями стовпчиками:" + +#. type: IP +#: ../src/xz/xz.1:2008 +#, no-wrap +msgid "1." +msgstr "1." + +#. type: Plain text +#: ../src/xz/xz.1:2010 +msgid "Total amount of physical memory (RAM) in bytes." +msgstr "Загальний об'єм фізичної пам'яті (RAM) у байтах." + +#. type: IP +#: ../src/xz/xz.1:2010 ../src/xz/xz.1:2125 ../src/xz/xz.1:2162 +#: ../src/xz/xz.1:2188 ../src/xz/xz.1:2258 ../src/xz/xz.1:2285 +#, no-wrap +msgid "2." +msgstr "2." + +#. type: Plain text +#: ../src/xz/xz.1:2017 +msgid "Memory usage limit for compression in bytes (B<--memlimit-compress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Обмеження на використання пам'яті для стискання у байтах (B<--memlimit-compress>). Особливе значення B<0> вказує на типові налаштування, якими для однопотокового режиму є налаштування без обмеження на використання пам'яті." + +#. type: IP +#: ../src/xz/xz.1:2017 ../src/xz/xz.1:2127 ../src/xz/xz.1:2164 +#: ../src/xz/xz.1:2190 ../src/xz/xz.1:2263 ../src/xz/xz.1:2287 +#, no-wrap +msgid "3." +msgstr "3." + +#. type: Plain text +#: ../src/xz/xz.1:2024 +msgid "Memory usage limit for decompression in bytes (B<--memlimit-decompress>). A special value of B<0> indicates the default setting which for single-threaded mode is the same as no limit." +msgstr "Обмеження на використання пам'яті для розпакування у байтах (B<--memlimit-decompress>). Особливе значення B<0> вказує на типові налаштування, якими для однопотокового режиму є налаштування без обмеження на використання пам'яті." + +#. type: IP +#: ../src/xz/xz.1:2024 ../src/xz/xz.1:2129 ../src/xz/xz.1:2166 +#: ../src/xz/xz.1:2193 ../src/xz/xz.1:2273 ../src/xz/xz.1:2289 +#, no-wrap +msgid "4." +msgstr "4." + +#. type: Plain text +#: ../src/xz/xz.1:2036 +msgid "Since B 5.3.4alpha: Memory usage for multi-threaded decompression in bytes (B<--memlimit-mt-decompress>). This is never zero because a system-specific default value shown in the column 5 is used if no limit has been specified explicitly. This is also never greater than the value in the column 3 even if a larger value has been specified with B<--memlimit-mt-decompress>." +msgstr "Починаючи з B 5.3.4alpha: використання пам'яті для багатопотокового розпаковування у байтах (B<--memlimit-mt-decompress>). Ніколи не дорівнює нулеві, оскільки буде використано специфічне для системи типове значення, яке показано у стовпчику 5, якщо обмеження не встановлено явним чином. Також ніколи не перевищуватиме значення у стовпчику 3, навіть якщо було вказано більше значення за допомогою B<--memlimit-mt-decompress>." + +#. type: IP +#: ../src/xz/xz.1:2036 ../src/xz/xz.1:2131 ../src/xz/xz.1:2168 +#: ../src/xz/xz.1:2195 ../src/xz/xz.1:2291 +#, no-wrap +msgid "5." +msgstr "5." + +#. type: Plain text +#: ../src/xz/xz.1:2048 +msgid "Since B 5.3.4alpha: A system-specific default memory usage limit that is used to limit the number of threads when compressing with an automatic number of threads (B<--threads=0>) and no memory usage limit has been specified (B<--memlimit-compress>). This is also used as the default value for B<--memlimit-mt-decompress>." +msgstr "Починаючи з B 5.3.4alpha: специфічне для системи типове обмеження на використання пам'яті, яке використовують для обмеження кількості потоків при стисканні з автоматичною кількістю потоків (B<--threads=0>) і без визначення обмеження на використання пам'яті (B<--memlimit-compress>). Це значення також використовують як типове значення для B<--memlimit-mt-decompress>." + +#. type: IP +#: ../src/xz/xz.1:2048 ../src/xz/xz.1:2133 ../src/xz/xz.1:2170 +#: ../src/xz/xz.1:2197 ../src/xz/xz.1:2293 +#, no-wrap +msgid "6." +msgstr "6." + +#. type: Plain text +#: ../src/xz/xz.1:2053 +msgid "Since B 5.3.4alpha: Number of available processor threads." +msgstr "Починаючи з B 5.3.4alpha: кількість доступних потоків обробки процесора." + +#. type: Plain text +#: ../src/xz/xz.1:2057 +msgid "In the future, the output of B may have more columns, but never more than a single line." +msgstr "У майбутньому у виведенні B може бути більше стовпчиків, але у виведеному буде не більше за один рядок." + +#. type: SS +#: ../src/xz/xz.1:2058 +#, no-wrap +msgid "List mode" +msgstr "Режим списку" + +#. type: Plain text +#: ../src/xz/xz.1:2063 +msgid "B uses tab-separated output. The first column of every line has a string that indicates the type of the information found on that line:" +msgstr "У B використано табуляції для поділу виведених даних. Першим стовпчиком у кожному рядку є рядок, що вказує на тип відомостей, які можна знайти у цьому рядку:" + +#. type: TP +#: ../src/xz/xz.1:2063 +#, no-wrap +msgid "B" +msgstr "B<назва>" + +#. type: Plain text +#: ../src/xz/xz.1:2067 +msgid "This is always the first line when starting to list a file. The second column on the line is the filename." +msgstr "Це завжди перший рядок на початку списку файла. Другим стовпчиком у рядку є назва файла." + +#. type: TP +#: ../src/xz/xz.1:2067 +#, no-wrap +msgid "B" +msgstr "B<файл>" + +#. type: Plain text +#: ../src/xz/xz.1:2075 +msgid "This line contains overall information about the B<.xz> file. This line is always printed after the B line." +msgstr "У цьому рядку містяться загальні відомості щодо файла B<.xz>. Цей рядок завжди виводять після рядка B." + +#. type: TP +#: ../src/xz/xz.1:2075 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2085 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are streams in the B<.xz> file." +msgstr "Цей тип рядка використовують, лише якщо було вказано B<--verbose>. Буде стільки рядків B, скільки потоків у файлі B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2085 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2100 +msgid "This line type is used only when B<--verbose> was specified. There are as many B lines as there are blocks in the B<.xz> file. The B lines are shown after all the B lines; different line types are not interleaved." +msgstr "Цей тип рядка використовують, лише якщо було вказано B<--verbose>. Буде стільки рядків B, скільки блоків у файлі B<.xz>. Рядки B буде показано після усіх рядків B; різні типи рядків не перемежовуються." + +#. type: TP +#: ../src/xz/xz.1:2100 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2115 +msgid "This line type is used only when B<--verbose> was specified twice. This line is printed after all B lines. Like the B line, the B line contains overall information about the B<.xz> file." +msgstr "Цей тип рядків використовують, лише якщо B<--verbose> було вказано двічі. Цей рядок буде виведено після усіх рядків B. Подібно до рядка B, рядок B містить загальні відомості щодо файла B<.xz>." + +#. type: TP +#: ../src/xz/xz.1:2115 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2119 +msgid "This line is always the very last line of the list output. It shows the total counts and sizes." +msgstr "Цей рядок завжди є найостаннішим рядком у виведеному списку. У ньому буде показано загальні кількості та розміри." + +#. type: Plain text +#: ../src/xz/xz.1:2123 +msgid "The columns of the B lines:" +msgstr "Стовпчики у рядках B<файла>:" + +#. type: Plain text +#: ../src/xz/xz.1:2127 +msgid "Number of streams in the file" +msgstr "Кількість потоків у файлі" + +#. type: Plain text +#: ../src/xz/xz.1:2129 +msgid "Total number of blocks in the stream(s)" +msgstr "Загальна кількість блоків у потоках" + +#. type: Plain text +#: ../src/xz/xz.1:2131 +msgid "Compressed size of the file" +msgstr "Розмір стисненого файла" + +#. type: Plain text +#: ../src/xz/xz.1:2133 +msgid "Uncompressed size of the file" +msgstr "Розмір нестисненого файла" + +#. type: Plain text +#: ../src/xz/xz.1:2139 +msgid "Compression ratio, for example, B<0.123>. If ratio is over 9.999, three dashes (B<--->) are displayed instead of the ratio." +msgstr "Коефіцієнт стискання, наприклад, B<0.123>. Якщо коефіцієнт перевищує 9.999, замість коефіцієнта буде показано дефіси (B<--->)." + +#. type: IP +#: ../src/xz/xz.1:2139 ../src/xz/xz.1:2172 ../src/xz/xz.1:2199 +#: ../src/xz/xz.1:2295 +#, no-wrap +msgid "7." +msgstr "7." + +#. type: Plain text +#: ../src/xz/xz.1:2152 +msgid "Comma-separated list of integrity check names. The following strings are used for the known check types: B, B, B, and B. For unknown check types, BI is used, where I is the Check ID as a decimal number (one or two digits)." +msgstr "Список відокремлених комами назв перевірок цілісності. Наведені нижче рядки використовують для відомих типів перевірок: B, B, B і B. Для невідомих типів перевірок буде використано BI, де I є ідентифікатором перевірки у форматі десяткового числа (одна або дві цифри)." + +#. type: IP +#: ../src/xz/xz.1:2152 ../src/xz/xz.1:2174 ../src/xz/xz.1:2201 +#: ../src/xz/xz.1:2298 +#, no-wrap +msgid "8." +msgstr "8." + +#. type: Plain text +#: ../src/xz/xz.1:2154 +msgid "Total size of stream padding in the file" +msgstr "Загальний розмір доповнення потоку у файлі" + +#. type: Plain text +#: ../src/xz/xz.1:2160 +msgid "The columns of the B lines:" +msgstr "Стовпчики у рядках B:" + +#. type: Plain text +#: ../src/xz/xz.1:2164 +msgid "Stream number (the first stream is 1)" +msgstr "Номер потоку (перший потік має номер 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2166 +msgid "Number of blocks in the stream" +msgstr "Кількість блоків у потоці" + +#. type: Plain text +#: ../src/xz/xz.1:2168 +msgid "Compressed start offset" +msgstr "Зсув початку стисненого" + +#. type: Plain text +#: ../src/xz/xz.1:2170 +msgid "Uncompressed start offset" +msgstr "Зсув початку нестисненого" + +#. type: Plain text +#: ../src/xz/xz.1:2172 +msgid "Compressed size (does not include stream padding)" +msgstr "Стиснений розмір (не включає доповнення потоку)" + +#. type: Plain text +#: ../src/xz/xz.1:2174 ../src/xz/xz.1:2203 ../src/xz/xz.1:2293 +msgid "Uncompressed size" +msgstr "Нестиснутий розмір" + +#. type: Plain text +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2205 +msgid "Compression ratio" +msgstr "Рівень стискання" + +#. type: IP +#: ../src/xz/xz.1:2176 ../src/xz/xz.1:2203 ../src/xz/xz.1:2300 +#, no-wrap +msgid "9." +msgstr "9." + +#. type: Plain text +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2207 +msgid "Name of the integrity check" +msgstr "Назва перевірки цілісності" + +#. type: IP +#: ../src/xz/xz.1:2178 ../src/xz/xz.1:2205 ../src/xz/xz.1:2316 +#, no-wrap +msgid "10." +msgstr "10." + +#. type: Plain text +#: ../src/xz/xz.1:2180 +msgid "Size of stream padding" +msgstr "Розмір доповнення потоку" + +#. type: Plain text +#: ../src/xz/xz.1:2186 +msgid "The columns of the B lines:" +msgstr "Стовпчики у рядках B:" + +#. type: Plain text +#: ../src/xz/xz.1:2190 +msgid "Number of the stream containing this block" +msgstr "Номер потоку, що містить цей блок" + +#. type: Plain text +#: ../src/xz/xz.1:2193 +msgid "Block number relative to the beginning of the stream (the first block is 1)" +msgstr "Номер блоку відносно початку потоку (перший блок має номер 1)" + +#. type: Plain text +#: ../src/xz/xz.1:2195 +msgid "Block number relative to the beginning of the file" +msgstr "Номер блоку відносно початку файла" + +#. type: Plain text +#: ../src/xz/xz.1:2197 +msgid "Compressed start offset relative to the beginning of the file" +msgstr "Зсув початку стисненого відносно початку файла" + +#. type: Plain text +#: ../src/xz/xz.1:2199 +msgid "Uncompressed start offset relative to the beginning of the file" +msgstr "Зсув початку нестисненого відносно початку файла" + +#. type: Plain text +#: ../src/xz/xz.1:2201 +msgid "Total compressed size of the block (includes headers)" +msgstr "Загальний стиснений розмір блоку (включено з заголовками)" + +#. type: Plain text +#: ../src/xz/xz.1:2219 +msgid "If B<--verbose> was specified twice, additional columns are included on the B lines. These are not displayed with a single B<--verbose>, because getting this information requires many seeks and can thus be slow:" +msgstr "Якщо B<--verbose> було вказано двічі, до рядків B буде включено додаткові стовпчики. Ці стовпчики не буде показано, якщо вказано одинарний параметр B<--verbose>, оскільки отримання цих відомостей потребує багатьох позиціювань, а ця процедура може бути повільною:" + +#. type: IP +#: ../src/xz/xz.1:2221 ../src/xz/xz.1:2321 +#, no-wrap +msgid "11." +msgstr "11." + +#. type: Plain text +#: ../src/xz/xz.1:2223 +msgid "Value of the integrity check in hexadecimal" +msgstr "Значення перевірки цілісності у шістнадцятковій формі" + +#. type: IP +#: ../src/xz/xz.1:2223 ../src/xz/xz.1:2331 +#, no-wrap +msgid "12." +msgstr "12." + +#. type: Plain text +#: ../src/xz/xz.1:2225 +msgid "Block header size" +msgstr "Розмір заголовка блоку" + +#. type: IP +#: ../src/xz/xz.1:2225 +#, no-wrap +msgid "13." +msgstr "13." + +#. type: Plain text +#: ../src/xz/xz.1:2235 +msgid "Block flags: B indicates that compressed size is present, and B indicates that uncompressed size is present. If the flag is not set, a dash (B<->) is shown instead to keep the string length fixed. New flags may be added to the end of the string in the future." +msgstr "Прапорці блоку: B вказує, що наявний стиснений розмір, а B вказує, що наявний нестиснений розмір. Якщо прапорець не встановлено, буде показано (B<->) замість підтримання фіксованого розміру рядка. У майбутньому наприкінці рядка може бути додано нові прапорці." + +#. type: IP +#: ../src/xz/xz.1:2235 +#, no-wrap +msgid "14." +msgstr "14." + +#. type: Plain text +#: ../src/xz/xz.1:2238 +msgid "Size of the actual compressed data in the block (this excludes the block header, block padding, and check fields)" +msgstr "Розмір справжніх стиснених даних у блоці (це включає заголовок блоку, доповнення блоку та поля перевірок)" + +#. type: IP +#: ../src/xz/xz.1:2238 +#, no-wrap +msgid "15." +msgstr "15." + +#. type: Plain text +#: ../src/xz/xz.1:2243 +msgid "Amount of memory (in bytes) required to decompress this block with this B version" +msgstr "Об'єм пам'яті (у байтах), який потрібен для розпаковування цього блоку за допомогою цієї версії B" + +#. type: IP +#: ../src/xz/xz.1:2243 +#, no-wrap +msgid "16." +msgstr "16." + +#. type: Plain text +#: ../src/xz/xz.1:2250 +msgid "Filter chain. Note that most of the options used at compression time cannot be known, because only the options that are needed for decompression are stored in the B<.xz> headers." +msgstr "Ланцюжок фільтрів. Зауважте, що більшість параметрів, які використано під час стискання, не є наперед відомим, оскільки у заголовках B<.xz> зберігаються лише параметри, які потрібні для розпаковування." + +#. type: Plain text +#: ../src/xz/xz.1:2256 +msgid "The columns of the B lines:" +msgstr "Стовпчики у рядках B:" + +#. type: Plain text +#: ../src/xz/xz.1:2263 +msgid "Amount of memory (in bytes) required to decompress this file with this B version" +msgstr "Об'єм пам'яті (у байтах), який потрібен для розпаковування цього файла за допомогою цієї версії B" + +#. type: Plain text +#: ../src/xz/xz.1:2269 ../src/xz/xz.1:2327 +msgid "B or B indicating if all block headers have both compressed size and uncompressed size stored in them" +msgstr "B або B вказує, якщо усі заголовки блоків містять одразу стиснений розмір та розпакований розмір" + +#. type: Plain text +#: ../src/xz/xz.1:2273 ../src/xz/xz.1:2331 +msgid "I B I<5.1.2alpha:>" +msgstr "I<Починаючи з> B I<5.1.2alpha:>" + +#. type: Plain text +#: ../src/xz/xz.1:2277 ../src/xz/xz.1:2335 +msgid "Minimum B version required to decompress the file" +msgstr "Мінімальна версія B, яка потрібна для розпаковування файла" + +#. type: Plain text +#: ../src/xz/xz.1:2283 +msgid "The columns of the B line:" +msgstr "Стовпчики рядка B:" + +#. type: Plain text +#: ../src/xz/xz.1:2287 +msgid "Number of streams" +msgstr "Кількість потоків" + +#. type: Plain text +#: ../src/xz/xz.1:2289 +msgid "Number of blocks" +msgstr "Кількість блоків" + +#. type: Plain text +#: ../src/xz/xz.1:2291 +msgid "Compressed size" +msgstr "Стиснутий розмір" + +#. type: Plain text +#: ../src/xz/xz.1:2295 +msgid "Average compression ratio" +msgstr "Середній коефіцієнт стискання" + +#. type: Plain text +#: ../src/xz/xz.1:2298 +msgid "Comma-separated list of integrity check names that were present in the files" +msgstr "Список відокремлених комами назв перевірок цілісності, результати яких наявні у файлах" + +#. type: Plain text +#: ../src/xz/xz.1:2300 +msgid "Stream padding size" +msgstr "Розмір доповнення потоку" + +#. type: Plain text +#: ../src/xz/xz.1:2306 +msgid "Number of files. This is here to keep the order of the earlier columns the same as on B lines." +msgstr "Кількість файлів. Наявний тут для зберігання такого самого порядку стовпчиків, що і у попередніх рядках B." + +#. type: Plain text +#: ../src/xz/xz.1:2314 +msgid "If B<--verbose> was specified twice, additional columns are included on the B line:" +msgstr "Якщо B<--verbose> було вказано двічі, до рядка B буде включено додаткові стовпчики:" + +#. type: Plain text +#: ../src/xz/xz.1:2321 +msgid "Maximum amount of memory (in bytes) required to decompress the files with this B version" +msgstr "Максимальний об'єм пам'яті (у байтах), який потрібен для розпаковування файлів за допомогою цієї версії B" + +#. type: Plain text +#: ../src/xz/xz.1:2341 +msgid "Future versions may add new line types and new columns can be added to the existing line types, but the existing columns won't be changed." +msgstr "У майбутніх версіях може бути додано нові типи рядків і нові стовпчики до наявних типів рядків, але наявні стовпчики мають лишитися незмінними." + +#. type: SH +#: ../src/xz/xz.1:2342 ../src/xzdec/xzdec.1:104 ../src/lzmainfo/lzmainfo.1:44 +#: ../src/scripts/xzgrep.1:81 +#, no-wrap +msgid "EXIT STATUS" +msgstr "СТАН ВИХОДУ" + +#. type: TP +#: ../src/xz/xz.1:2343 ../src/xzdec/xzdec.1:105 ../src/lzmainfo/lzmainfo.1:45 +#, no-wrap +msgid "B<0>" +msgstr "B<0>" + +#. type: Plain text +#: ../src/xz/xz.1:2346 ../src/lzmainfo/lzmainfo.1:48 +msgid "All is good." +msgstr "Усе добре." + +#. type: TP +#: ../src/xz/xz.1:2346 ../src/xzdec/xzdec.1:108 ../src/lzmainfo/lzmainfo.1:48 +#, no-wrap +msgid "B<1>" +msgstr "B<1>" + +#. type: Plain text +#: ../src/xz/xz.1:2349 ../src/xzdec/xzdec.1:111 ../src/lzmainfo/lzmainfo.1:51 +msgid "An error occurred." +msgstr "Сталася помилка." + +#. type: TP +#: ../src/xz/xz.1:2349 +#, no-wrap +msgid "B<2>" +msgstr "B<2>" + +#. type: Plain text +#: ../src/xz/xz.1:2353 +msgid "Something worth a warning occurred, but no actual errors occurred." +msgstr "Сталося щось варте попередження, але справжніх помилок не сталося." + +#. type: Plain text +#: ../src/xz/xz.1:2356 +msgid "Notices (not warnings or errors) printed on standard error don't affect the exit status." +msgstr "Зауваження (не попередження або помилки), які виведено до стандартного виведення помилок, не впливають на стан виходу." + +#. type: SH +#: ../src/xz/xz.1:2357 ../src/scripts/xzgrep.1:94 ../src/scripts/xzless.1:52 +#, no-wrap +msgid "ENVIRONMENT" +msgstr "СЕРЕДОВИЩЕ" + +#. type: Plain text +#: ../src/xz/xz.1:2370 +msgid "B parses space-separated lists of options from the environment variables B and B, in this order, before parsing the options from the command line. Note that only options are parsed from the environment variables; all non-options are silently ignored. Parsing is done with B(3) which is used also for the command line arguments." +msgstr "B обробляє списки відокремлених пробілами параметрів зі змінних середовища B і B, перш ніж обробляти параметри з рядка команди. Зауважте, що буде оброблено лише параметри зі змінних середовища; усі непараметричні записи буде без повідомлень проігноровано. Обробку буде виконано за допомогою функції B(3), яку також використовують для аргументів рядка команди." + +#. type: TP +#: ../src/xz/xz.1:2370 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2379 +msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B's memory usage limiter by default. Excluding shell initialization scripts and similar special cases, scripts must never set or unset B." +msgstr "Специфічні для користувача або загальносистемні типові параметри. Зазвичай, їх встановлюють у скрипті ініціалізації оболонки для типового вмикання обмеження на використання пам'яті у B. Окрім скриптів ініціалізації оболонки і подібних особливих випадків, не слід встановлювати або скасовувати встановлення значення B у скриптах." + +#. type: TP +#: ../src/xz/xz.1:2379 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/xz/xz.1:2390 +msgid "This is for passing options to B when it is not possible to set the options directly on the B command line. This is the case when B is run by a script or tool, for example, GNU B(1):" +msgstr "Цю змінну призначено для передавання параметрів до B, якщо неможливо встановити параметри безпосередньо у рядку команди B. Це трапляється, якщо B запущено скриптом або інструментом, наприклад, GNU B(1):" + +#. type: Plain text +#: ../src/xz/xz.1:2396 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2410 +msgid "Scripts may use B, for example, to set script-specific default compression options. It is still recommended to allow users to override B if that is reasonable. For example, in B(1) scripts one may use something like this:" +msgstr "Скрипти можуть використовувати B, наприклад, для встановлення специфічних типових параметрів стискання. Втім, рекомендуємо дозволити користувачам перевизначати B, якщо це має якісь причини. Наприклад, у скриптах B(1) можна скористатися чимось таким:" + +#. type: Plain text +#: ../src/xz/xz.1:2417 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: SH +#: ../src/xz/xz.1:2422 +#, no-wrap +msgid "LZMA UTILS COMPATIBILITY" +msgstr "СУМІСНІСТЬ ІЗ LZMA UTILS" + +#. type: Plain text +#: ../src/xz/xz.1:2435 +msgid "The command line syntax of B is practically a superset of B, B, and B as found from LZMA Utils 4.32.x. In most cases, it is possible to replace LZMA Utils with XZ Utils without breaking existing scripts. There are some incompatibilities though, which may sometimes cause problems." +msgstr "Синтаксис рядка команди B практично є надбудовою щодо B, B і B з LZMA Utils 4.32.x. У більшості випадків можна замінити LZMA Utils XZ Utils без порушення працездатності наявних скриптів. Втім, існують певні несумісності, які іноді можуть спричиняти проблеми." + +#. type: SS +#: ../src/xz/xz.1:2436 +#, no-wrap +msgid "Compression preset levels" +msgstr "Рівні шаблонів стискання" + +#. type: Plain text +#: ../src/xz/xz.1:2443 +msgid "The numbering of the compression level presets is not identical in B and LZMA Utils. The most important difference is how dictionary sizes are mapped to different presets. Dictionary size is roughly equal to the decompressor memory usage." +msgstr "Нумерація у шаблонах рівнів стискання у B не є тотожною до нумерації у LZMA Utils. Найважливішою відмінністю є прив'язка розмірів словника до різних шаблонів. Розмір словника грубо рівний використанню пам'яті у засобі розпаковування." + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "Level" +msgstr "Рівень" + +#. type: tbl table +#: ../src/xz/xz.1:2449 ../src/xz/xz.1:2474 +#, no-wrap +msgid "xz" +msgstr "xz" + +#. type: tbl table +#: ../src/xz/xz.1:2449 +#, no-wrap +msgid "LZMA Utils" +msgstr "LZMA Utils" + +#. type: tbl table +#: ../src/xz/xz.1:2450 ../src/xz/xz.1:2475 +#, no-wrap +msgid "N/A" +msgstr "н/д" + +#. type: tbl table +#: ../src/xz/xz.1:2451 +#, no-wrap +msgid "64 KiB" +msgstr "64 КіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2453 +#, no-wrap +msgid "512 KiB" +msgstr "512 КіБ" + +#. type: Plain text +#: ../src/xz/xz.1:2468 +msgid "The dictionary size differences affect the compressor memory usage too, but there are some other differences between LZMA Utils and XZ Utils, which make the difference even bigger:" +msgstr "Відмінності у розмірах словників також впливають на використання пам'яті засобом стискання, але є і інші відмінності між LZMA Utils і XZ Utils, які роблять різницю ще помітнішою:" + +#. type: tbl table +#: ../src/xz/xz.1:2474 +#, no-wrap +msgid "LZMA Utils 4.32.x" +msgstr "LZMA Utils 4.32.x" + +#. type: tbl table +#: ../src/xz/xz.1:2477 ../src/xz/xz.1:2478 +#, no-wrap +msgid "12 MiB" +msgstr "12 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2480 +#, no-wrap +msgid "26 MiB" +msgstr "26 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2481 +#, no-wrap +msgid "45 MiB" +msgstr "45 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2482 +#, no-wrap +msgid "83 MiB" +msgstr "83 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2483 +#, no-wrap +msgid "159 MiB" +msgstr "159 МіБ" + +#. type: tbl table +#: ../src/xz/xz.1:2484 +#, no-wrap +msgid "311 MiB" +msgstr "311 МіБ" + +#. type: Plain text +#: ../src/xz/xz.1:2493 +msgid "The default preset level in LZMA Utils is B<-7> while in XZ Utils it is B<-6>, so both use an 8 MiB dictionary by default." +msgstr "Типовим рівнем стискання у LZMA Utils є B<-7>, а у XZ Utils — B<-6>, отже, обидва комплекти програм типово використовують словник розміром у 8 МіБ." + +#. type: SS +#: ../src/xz/xz.1:2494 +#, no-wrap +msgid "Streamed vs. non-streamed .lzma files" +msgstr "Потокові і непотокові файл .lzma" + +#. type: Plain text +#: ../src/xz/xz.1:2504 +msgid "The uncompressed size of the file can be stored in the B<.lzma> header. LZMA Utils does that when compressing regular files. The alternative is to mark that uncompressed size is unknown and use end-of-payload marker to indicate where the decompressor should stop. LZMA Utils uses this method when uncompressed size isn't known, which is the case, for example, in pipes." +msgstr "Розмір нестисненого файла може бути збережено у заголовку B<.lzma>. LZMA Utils зберігають дані при стисканні звичайних файлів. Альтернативним підходом є позначення нестисненого розміру як невідомого і використання позначки кінця вмісту для позначення місця, де засіб розпаковування має зупинитися. У LZMA Utils цей спосіб використовують, якщо нестиснений розмір є невідомим, що трапляється, наприклад, для конвеєрів обробки даних." + +#. type: Plain text +#: ../src/xz/xz.1:2525 +msgid "B supports decompressing B<.lzma> files with or without end-of-payload marker, but all B<.lzma> files created by B will use end-of-payload marker and have uncompressed size marked as unknown in the B<.lzma> header. This may be a problem in some uncommon situations. For example, a B<.lzma> decompressor in an embedded device might work only with files that have known uncompressed size. If you hit this problem, you need to use LZMA Utils or LZMA SDK to create B<.lzma> files with known uncompressed size." +msgstr "У B передбачено підтримку розпаковування файлів B<.lzma> з позначкою кінця вмісту та без неї, але усі файли B<.lzma>, які створено за допомогою B, використовують позначку кінця вмісту, а нестиснений розмір у заголовку B<.lzma> позначають як невідомий. Це може призвести до проблем у деяких нетипових ситуаціях. Наприклад, розпакувальник B<.lzma> у вбудованому пристрої може працювати лише з файлами, для яких відомий нестиснений розмір. Якщо ви зіткнулися з цією проблемою, вам слід скористатися LZMA Utils або LZMA SDK для створення файлів B<.lzma> із відомим розміром нестиснених даних." + +#. type: SS +#: ../src/xz/xz.1:2526 +#, no-wrap +msgid "Unsupported .lzma files" +msgstr "Непідтримувані файли .lzma" + +#. type: Plain text +#: ../src/xz/xz.1:2549 +msgid "The B<.lzma> format allows I values up to 8, and I values up to 4. LZMA Utils can decompress files with any I and I, but always creates files with B and B. Creating files with other I and I is possible with B and with LZMA SDK." +msgstr "У форматі B<.lzma> можливі значення I аж до 8 і значення I аж до 4. LZMA Utils можуть розпаковувати файли із будь-якими значеннями I і I, але завжди створюють файли з B і B. Створення файлів з іншими значеннями I і I є можливим за допомогою B і LZMA SDK." + +#. type: Plain text +#: ../src/xz/xz.1:2560 +msgid "The implementation of the LZMA1 filter in liblzma requires that the sum of I and I must not exceed 4. Thus, B<.lzma> files, which exceed this limitation, cannot be decompressed with B." +msgstr "Реалізація фільтра LZMA1 у liblzma потребує, щоби сума I і I не перевищувала 4. Отже, файли B<.lzma>, у яких перевищено обмеження, не може бути розпаковано за допомогою B." + +#. type: Plain text +#: ../src/xz/xz.1:2575 +msgid "LZMA Utils creates only B<.lzma> files which have a dictionary size of 2^I (a power of 2) but accepts files with any dictionary size. liblzma accepts only B<.lzma> files which have a dictionary size of 2^I or 2^I + 2^(I-1). This is to decrease false positives when detecting B<.lzma> files." +msgstr "LZMA Utils створюють лише файли B<.lzma>, які мають розмір словника у 2^I (степінь 2), але приймають файли із будь-яким розміром словника. liblzma приймає лише файли B<.lzma>, які мають розмір словника 2^I або 2^I + 2^(I-1). Так зроблено для зменшення помилок при виявленні файлів B<.lzma>." + +#. type: Plain text +#: ../src/xz/xz.1:2580 +msgid "These limitations shouldn't be a problem in practice, since practically all B<.lzma> files have been compressed with settings that liblzma will accept." +msgstr "Ці обмеження не мають призводити до проблем на практиці, оскільки практично усі файли B<.lzma> було стиснено з використанням параметрів, які приймає liblzma." + +#. type: SS +#: ../src/xz/xz.1:2581 +#, no-wrap +msgid "Trailing garbage" +msgstr "Кінцевий мотлох" + +#. type: Plain text +#: ../src/xz/xz.1:2591 +msgid "When decompressing, LZMA Utils silently ignore everything after the first B<.lzma> stream. In most situations, this is a bug. This also means that LZMA Utils don't support decompressing concatenated B<.lzma> files." +msgstr "При розпаковуванні LZMA Utils без повідомлень ігнорують усі дані після першого потоку B<.lzma>. У більшості випадків це пов'язано із вадою у програмі. Це також означає, що у LZMA Utils не передбачено підтримки розпаковування з'єднаних файлів B<.lzma>." + +#. type: Plain text +#: ../src/xz/xz.1:2601 +msgid "If there is data left after the first B<.lzma> stream, B considers the file to be corrupt unless B<--single-stream> was used. This may break obscure scripts which have assumed that trailing garbage is ignored." +msgstr "Якщо після першого потоку B<.lzma> лишилися дані, B вважатиме файл пошкодженим, якщо не було використано B<--single-stream>. Це може зашкодити роботі скриптів, де зроблено припущення, що кінцеві зайві дані буде проігноровано." + +#. type: SH +#: ../src/xz/xz.1:2602 ../src/xzdec/xzdec.1:117 +#, no-wrap +msgid "NOTES" +msgstr "ПРИМІТКИ" + +#. type: SS +#: ../src/xz/xz.1:2604 +#, no-wrap +msgid "Compressed output may vary" +msgstr "Стискання даних може бути різним" + +#. type: Plain text +#: ../src/xz/xz.1:2615 +msgid "The exact compressed output produced from the same uncompressed input file may vary between XZ Utils versions even if compression options are identical. This is because the encoder can be improved (faster or better compression) without affecting the file format. The output can vary even between different builds of the same XZ Utils version, if different build options are used." +msgstr "Точні стиснені дані, які створено на основі того самого нестисненого файла вхідних даних, можуть бути різними для різних версій XZ Utils, навіть якщо використано однакові параметри стискання. Причиною цього є удосконалення у кодувальнику (пришвидшення або краще стискання) без зміни формату файлів. Виведені дані можуть бути різними навіть для різних збірок тієї самої версії XZ Utils, якщо використано різні параметри збирання." + +#. type: Plain text +#: ../src/xz/xz.1:2625 +msgid "The above means that once B<--rsyncable> has been implemented, the resulting files won't necessarily be rsyncable unless both old and new files have been compressed with the same xz version. This problem can be fixed if a part of the encoder implementation is frozen to keep rsyncable output stable across xz versions." +msgstr "Написане вище означає, що після реалізації B<--rsyncable> файли-результати не обов'язково можна буде синхронізувати за допомогою rsyncable, якщо старий і новий файли було стиснено за допомогою тієї самої версії xz. Цю проблему можна усунути, якщо буде заморожено частину реалізації кодувальника, щоб введені для rsync дані були стабільними між версіями xz." + +#. type: SS +#: ../src/xz/xz.1:2626 +#, no-wrap +msgid "Embedded .xz decompressors" +msgstr "Вбудовані розпакувальники .xz" + +#. type: Plain text +#: ../src/xz/xz.1:2643 +msgid "Embedded B<.xz> decompressor implementations like XZ Embedded don't necessarily support files created with integrity I types other than B and B. Since the default is B<--check=crc64>, you must use B<--check=none> or B<--check=crc32> when creating files for embedded systems." +msgstr "У вбудованих реалізаціях розпакувальника B<.xz>, подібних до XZ Embedded, не обов'язково передбачено підтримку файлів, які створено із типами I<перевірки> цілісності, відмінними від B і B. Оскільки типовим є B<--check=crc64>, вам слід використовувати B<--check=none> або B<--check=crc32> при створенні файлів для вбудованих систем." + +#. type: Plain text +#: ../src/xz/xz.1:2653 +msgid "Outside embedded systems, all B<.xz> format decompressors support all the I types, or at least are able to decompress the file without verifying the integrity check if the particular I is not supported." +msgstr "Поза вбудованими системами, в усіх засобах розпаковування формату B<.xz> передбачено підтримку усіх типів I<перевірок> або принаймні можливість розпакувати файл без перевірки цілісності, якщо підтримки певної I<перевірки> не передбачено." + +#. type: Plain text +#: ../src/xz/xz.1:2656 +msgid "XZ Embedded supports BCJ filters, but only with the default start offset." +msgstr "У XZ Embedded передбачено підтримку BCJ, але лише з типовим початковим зсувом." + +#. type: SH +#: ../src/xz/xz.1:2657 +#, no-wrap +msgid "EXAMPLES" +msgstr "ПРИКЛАДИ" + +#. type: SS +#: ../src/xz/xz.1:2659 +#, no-wrap +msgid "Basics" +msgstr "Основи" + +#. type: Plain text +#: ../src/xz/xz.1:2669 +msgid "Compress the file I into I using the default compression level (B<-6>), and remove I if compression is successful:" +msgstr "Стиснути файл I до I за допомогою типового рівня стискання (B<-6>) і вилучити I, якщо стискання відбулося успішно:" + +#. type: Plain text +#: ../src/xz/xz.1:2674 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2685 +msgid "Decompress I into I and don't remove I even if decompression is successful:" +msgstr "Розпакувати I до I і не вилучати I, навіть якщо розпаковування відбулося успішно:" + +#. type: Plain text +#: ../src/xz/xz.1:2690 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2703 +msgid "Create I with the preset B<-4e> (B<-4 --extreme>), which is slower than the default B<-6>, but needs less memory for compression and decompression (48\\ MiB and 5\\ MiB, respectively):" +msgstr "Створити I з використанням шаблона B<-4e> (B<-4 --extreme>), який є повільнішими за типовий B<-6>, але потребує менше пам'яті для стискання та розпаковування (48\\ МіБ та 5\\ МіБ, відповідно):" + +#. type: Plain text +#: ../src/xz/xz.1:2708 +#, no-wrap +msgid "CW baz.tar.xz>\n" +msgstr "CW baz.tar.xz>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2714 +msgid "A mix of compressed and uncompressed files can be decompressed to standard output with a single command:" +msgstr "Суміш стиснених і нестиснених файлів можна розпакувати до стандартного виведення за допомогою єдиної команди:" + +#. type: Plain text +#: ../src/xz/xz.1:2719 +#, no-wrap +msgid "CW abcd.txt>\n" +msgstr "CW abcd.txt>\n" + +#. type: SS +#: ../src/xz/xz.1:2723 +#, no-wrap +msgid "Parallel compression of many files" +msgstr "Паралельне стискання багатьох файлів" + +#. type: Plain text +#: ../src/xz/xz.1:2729 +msgid "On GNU and *BSD, B(1) and B(1) can be used to parallelize compression of many files:" +msgstr "У GNU і *BSD можна скористатися B(1) і B(1) для паралельного стискання багатьох файлів:" + +#. type: Plain text +#: ../src/xz/xz.1:2735 +#, no-wrap +msgid "" +"CW\n" +msgstr "" +"CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2757 +msgid "The B<-P> option to B(1) sets the number of parallel B processes. The best value for the B<-n> option depends on how many files there are to be compressed. If there are only a couple of files, the value should probably be 1; with tens of thousands of files, 100 or even more may be appropriate to reduce the number of B processes that B(1) will eventually create." +msgstr "Параметр B<-P> B(1) встановлює кількість паралельних процесів B. Найкраще значення параметра B<-n> залежить від того, скільки файлів має бути стиснено. Якщо файлів мало, значенням, ймовірно, має бути 1. Якщо файлів десятки тисяч, може знадобитися значення 100 або навіть більше, щоб зменшити кількість процесів B, які врешті створить B(1)." + +#. type: Plain text +#: ../src/xz/xz.1:2765 +msgid "The option B<-T1> for B is there to force it to single-threaded mode, because B(1) is used to control the amount of parallelization." +msgstr "Параметр B<-T1> для B тут для примусового встановлення однопотокового режиму, оскільки для керування рівнем паралелізації використано B(1)." + +#. type: SS +#: ../src/xz/xz.1:2766 +#, no-wrap +msgid "Robot mode" +msgstr "Режим робота" + +#. type: Plain text +#: ../src/xz/xz.1:2769 +msgid "Calculate how many bytes have been saved in total after compressing multiple files:" +msgstr "Обчислити скільки байтів було заощаджено загалом після стискання декількох файлів:" + +#. type: Plain text +#: ../src/xz/xz.1:2774 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2789 +msgid "A script may want to know that it is using new enough B. The following B(1) script checks that the version number of the B tool is at least 5.0.0. This method is compatible with old beta versions, which didn't support the B<--robot> option:" +msgstr "Скрипту можуть знадобитися дані щодо того, що використано достатньо нову версію B. У наведеному нижче скрипті B(1) виконано перевірку того, що номер версії засобу B є принаймні рівним 5.0.0. Цей спосіб є сумісним зі старими тестовими версіями, де не передбачено підтримки параметра B<--robot>:" + +#. type: Plain text +#: ../src/xz/xz.1:2798 +#, no-wrap +msgid "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" +msgstr "" +"CW /dev/null)\" ||\n" +" [ \"$XZ_VERSION\" -lt 50000002 ]; then\n" +" echo \"Your xz is too old.\"\n" +"fi\n" +"unset XZ_VERSION LIBLZMA_VERSION>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2805 +msgid "Set a memory usage limit for decompression using B, but if a limit has already been set, don't increase it:" +msgstr "Встановити обмеження на використання пам'яті для розпаковування за допомогою B, але якщо обмеження вже було встановлено, не збільшувати його:" + +#. type: Plain text +#: ../src/xz/xz.1:2815 +#, no-wrap +msgid "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" +msgstr "" +"CWE 20))\\ \\ # 123 MiB\n" +"OLDLIM=$(xz --robot --info-memory | cut -f3)\n" +"if [ $OLDLIM -eq 0 -o $OLDLIM -gt $NEWLIM ]; then\n" +" XZ_OPT=\"$XZ_OPT --memlimit-decompress=$NEWLIM\"\n" +" export XZ_OPT\n" +"fi>\n" + +#. type: Plain text +#: ../src/xz/xz.1:2825 +msgid "The simplest use for custom filter chains is customizing a LZMA2 preset. This can be useful, because the presets cover only a subset of the potentially useful combinations of compression settings." +msgstr "Найпростішим використанням ланцюжка фільтрів є налаштовування шаблона LZMA2. Це може бути корисним, оскільки у шаблонах використано лише підмножину потенційно корисних комбінацій параметрів стискання." + +#. type: Plain text +#: ../src/xz/xz.1:2833 +msgid "The CompCPU columns of the tables from the descriptions of the options B<-0> ... B<-9> and B<--extreme> are useful when customizing LZMA2 presets. Here are the relevant parts collected from those two tables:" +msgstr "При налаштовуванні шаблонів LZMA2 корисними є стовпчики CompCPU таблиць з описів параметрів B<-0> ... B<-9> і B<--extreme>. Ось відповідні частини з цих двох таблиць:" + +#. type: Plain text +#: ../src/xz/xz.1:2858 +msgid "If you know that a file requires somewhat big dictionary (for example, 32\\ MiB) to compress well, but you want to compress it quicker than B would do, a preset with a low CompCPU value (for example, 1) can be modified to use a bigger dictionary:" +msgstr "Якщо вам відомо, що певний файл потребує дещо більшого словника (наприклад, 32\\ МіБ) для якісного стискання, але ви хочете стиснути його швидше за команду B, можна внести зміни до шаблона із нижчим значенням CompCPU (наприклад, 1) для використання більшого словника:" + +#. type: Plain text +#: ../src/xz/xz.1:2863 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2879 +msgid "With certain files, the above command may be faster than B while compressing significantly better. However, it must be emphasized that only some files benefit from a big dictionary while keeping the CompCPU value low. The most obvious situation, where a big dictionary can help a lot, is an archive containing very similar files of at least a few megabytes each. The dictionary size has to be significantly bigger than any individual file to allow LZMA2 to take full advantage of the similarities between consecutive files." +msgstr "Для певних файлів наведена вище команда може працювати швидше за B і стискати дані значно краще. Втім, слід наголосити, переваги більшого словника з одночасним низьким значенням CompCPU проявляються лише для деяких файлів. Найочевиднішим випадком, коли великий словник є корисним, є випадок, коли архів містить дуже подібні файли розміром у принаймні декілька мегабайтів. Розмір словника має бути значно більшим за будь-який окремий файл, щоб у LZMA2 було використано усі переваги подібностей між послідовними файлами." + +#. type: Plain text +#: ../src/xz/xz.1:2886 +msgid "If very high compressor and decompressor memory usage is fine, and the file being compressed is at least several hundred megabytes, it may be useful to use an even bigger dictionary than the 64 MiB that B would use:" +msgstr "Якщо дуже високий рівень використання пам'яті у засобі стискання або розпаковування не є проблемою, і файли, який стискають має об'єм у принаймні декілька десятків мегабайтів, може бути корисним використання навіть більшого за 64 МіБ словника, який використано у B:" + +#. type: Plain text +#: ../src/xz/xz.1:2891 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2904 +msgid "Using B<-vv> (B<--verbose --verbose>) like in the above example can be useful to see the memory requirements of the compressor and decompressor. Remember that using a dictionary bigger than the size of the uncompressed file is waste of memory, so the above command isn't useful for small files." +msgstr "Використання B<-vv> (B<--verbose --verbose>), подібно до наведеного вище прикладу, може бути корисним для перегляду вимог з боку засобів стискання та розпаковування до пам'яті. Пам'ятайте, що використання словника, розмір якого перевищує розмір файла, який стискають, є простоюю витратою пам'яті, отже наведену вище команду не варто використовувати для малих файлів." + +#. type: Plain text +#: ../src/xz/xz.1:2916 +msgid "Sometimes the compression time doesn't matter, but the decompressor memory usage has to be kept low, for example, to make it possible to decompress the file on an embedded system. The following command uses B<-6e> (B<-6 --extreme>) as a base and sets the dictionary to only 64\\ KiB. The resulting file can be decompressed with XZ Embedded (that's why there is B<--check=crc32>) using about 100\\ KiB of memory." +msgstr "Іноді час стискання не має значення, але використання пам'яті засобом розпаковування має бути низьким для того, щоб, наприклад, уможливити розпаковування файла у вбудованій системі. У наведеній нижче команді використано B<-6e> (B<-6 --extreme>) як основу і встановлено розмір словника лише у 64\\ КіБ. Файл-результат можна розпакувати за допомогою XZ Embedded (ось чому використано B<--check=crc32>) з використанням лише 100\\ КіБ пам'яті." + +#. type: Plain text +#: ../src/xz/xz.1:2921 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2944 +msgid "If you want to squeeze out as many bytes as possible, adjusting the number of literal context bits (I) and number of position bits (I) can sometimes help. Adjusting the number of literal position bits (I) might help too, but usually I and I are more important. For example, a source code archive contains mostly US-ASCII text, so something like the following might give slightly (like 0.1\\ %) smaller file than B (try also without B):" +msgstr "Якщо вам потрібно витиснути зі стискання максимальну кількість байтів, може допомогти коригування кількості бітів контексту літералів (I) та кількість позиційних бітів (I). Також може допомогти коригування кількості бітів позиції літералів (I), але, зазвичай, важливішими є I і I. Наприклад, в архівах зі початковим кодом міститься здебільшого текст US-ASCII, щось подібне до наведеного нижче може дещо (на щось близьке до 0,1\\ %) зменшити файл, порівняно із B (спробуйте також без B):" + +#. type: Plain text +#: ../src/xz/xz.1:2949 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2957 +msgid "Using another filter together with LZMA2 can improve compression with certain file types. For example, to compress a x86-32 or x86-64 shared library using the x86 BCJ filter:" +msgstr "Використання іншого фільтра разом із LZMA2 може покращити стискання для певних типів файлів. Наприклад, для стискання бібліотеки спільного користування x86-32 або x86-64 з використанням фільтра BCJ x86 скористайтеся такою командою:" + +#. type: Plain text +#: ../src/xz/xz.1:2962 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:2976 +msgid "Note that the order of the filter options is significant. If B<--x86> is specified after B<--lzma2>, B will give an error, because there cannot be any filter after LZMA2, and also because the x86 BCJ filter cannot be used as the last filter in the chain." +msgstr "Зауважте, що порядок параметрів фільтрування має значення. Якщо B<--x86> вказано після B<--lzma2>, B повідомить про помилку, оскільки після LZMA2 не може бути жодного фільтра, а також оскільки фільтр BCJ x86 не можна використовувати як останній фільтр у ланцюжку." + +#. type: Plain text +#: ../src/xz/xz.1:2982 +msgid "The Delta filter together with LZMA2 can give good results with bitmap images. It should usually beat PNG, which has a few more advanced filters than simple delta but uses Deflate for the actual compression." +msgstr "Фільтр Delta разом із LZMA2 може дати добрі результати для растрових зображень. Зазвичай, результати є кращими за формат PNG, у якого є декілька більш досконалих фільтрів, ніж проста дельта, але там використовують для стискання Deflate." + +#. type: Plain text +#: ../src/xz/xz.1:2992 +msgid "The image has to be saved in uncompressed format, for example, as uncompressed TIFF. The distance parameter of the Delta filter is set to match the number of bytes per pixel in the image. For example, 24-bit RGB bitmap needs B, and it is also good to pass B to LZMA2 to accommodate the three-byte alignment:" +msgstr "Зображення слід берегти у нестисненому форматі, наприклад, як нестиснений TIFF. Параметр відстані фільтра Delta встановлюють так, щоб він збігався із кількістю байтів на піксель у зображенні. Наприклад, для 24-бітового растрового зображення RGB слід вказати B, а також добре передати B до LZMA2 для пристосовування до трибайтового вирівнювання:" + +#. type: Plain text +#: ../src/xz/xz.1:2997 +#, no-wrap +msgid "CW\n" +msgstr "CW\n" + +#. type: Plain text +#: ../src/xz/xz.1:3005 +msgid "If multiple images have been put into a single archive (for example, B<.tar>), the Delta filter will work on that too as long as all images have the same number of bytes per pixel." +msgstr "Якщо в один архів запаковано декілька зображень (наприклад, в архів B<.tar>), фільтр Delta також даватиме добрі результати, якщо у всіх зображеннях однакова кількість байтів для кожного пікселя." + +#. type: SH +#: ../src/xz/xz.1:3006 ../src/xzdec/xzdec.1:143 ../src/lzmainfo/lzmainfo.1:59 +#: ../src/scripts/xzdiff.1:65 ../src/scripts/xzgrep.1:106 +#: ../src/scripts/xzless.1:65 ../src/scripts/xzmore.1:51 +#, no-wrap +msgid "SEE ALSO" +msgstr "ДИВ. ТАКОЖ" + +#. type: Plain text +#: ../src/xz/xz.1:3015 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B<7z>(1)" + +#. type: Plain text +#: ../src/xz/xz.1:3017 +msgid "XZ Utils: Ehttps://tukaani.org/xz/E" +msgstr "XZ Utils: Ehttps://tukaani.org/xz/E" + +#. type: Plain text +#: ../src/xz/xz.1:3019 ../src/xzdec/xzdec.1:146 +msgid "XZ Embedded: Ehttps://tukaani.org/xz/embedded.htmlE" +msgstr "Вбудовуваний XZ: Ehttps://tukaani.org/xz/embedded.htmlE" + +#. type: Plain text +#: ../src/xz/xz.1:3020 +msgid "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" +msgstr "LZMA SDK: Ehttp://7-zip.org/sdk.htmlE" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "XZDEC" +msgstr "XZDEC" + +#. type: TH +#: ../src/xzdec/xzdec.1:7 +#, no-wrap +msgid "2017-04-19" +msgstr "19 квітня 2017 року" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:10 +msgid "xzdec, lzmadec - Small .xz and .lzma decompressors" +msgstr "xzdec, lzmadec — невеличкі розпакувальники .xz і .lzma" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:14 +msgid "B [I] [I]" +msgstr "B [I<параметр...>] [I<файл...>]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:18 +msgid "B [I] [I]" +msgstr "B [I<параметр...>] [I<файл...>]" + +#. type: Plain text +#: ../src/xzdec/xzdec.1:44 +msgid "B is a liblzma-based decompression-only tool for B<.xz> (and only B<.xz>) files. B is intended to work as a drop-in replacement for B(1) in the most common situations where a script has been written to use B (and possibly a few other commonly used options) to decompress B<.xz> files. B is identical to B except that B supports B<.lzma> files instead of B<.xz> files." +msgstr "B є інструментом на основі liblzma, який призначено лише для розпаковування файлів B<.xz> (і лише файлів B<.xz>). B призначено для того, щоб працювати як повноцінний замінник B(1) у більшості типових ситуацій, де скрипт було написано для використання B (і, можливо, декількох інших типових параметрів), для розпаковування файлів B<.xz>. B є тотожним до B, але у B передбачено підтримку файлів B<.lzma>, замість файлів B<.xz>." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:61 +msgid "To reduce the size of the executable, B doesn't support multithreading or localization, and doesn't read options from B and B environment variables. B doesn't support displaying intermediate progress information: sending B to B does nothing, but sending B terminates the process instead of displaying progress information." +msgstr "Щоб зменшити розмір виконуваного файла, у B не передбачено підтримки багатопотокової обробки та локалізації, а також читання параметрів зі змінних середовища B і B. У B не передбачено підтримки показу проміжних даних щодо поступу: надсилання B до B не призводить ні до яких наслідків, але надсилання B перериває процес, замість показу даних щодо поступу." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:69 +msgid "Ignored for B(1) compatibility. B supports only decompression." +msgstr "Буде проігноровано для сумісності з B(1). У B передбачено підтримку лише розпаковування." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:76 +msgid "Ignored for B(1) compatibility. B never creates or removes any files." +msgstr "Буде проігноровано. Призначено для сумісності з B(1). B ніколи не створюватиме і ніколи не вилучатиме ці файли." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:83 +msgid "Ignored for B(1) compatibility. B always writes the decompressed data to standard output." +msgstr "Буде проігноровано. Для сумісності з B(1). B завжди записує розпаковані дані до стандартного виведення." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:89 +msgid "Specifying this once does nothing since B never displays any warnings or notices. Specify this twice to suppress errors." +msgstr "Якщо цей параметр вказано один раз, нічого не станеться, оскільки B ніколи не показуватиме жодних попереджень або нотаток. Вкажіть параметр двічі, щоб придушити повідомлення про помилки." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:96 +msgid "Ignored for B(1) compatibility. B never uses the exit status 2." +msgstr "Буде проігноровано для сумісності із B(1). B ніколи не використовує стан виходу 2." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:99 +msgid "Display a help message and exit successfully." +msgstr "Вивести довідкове повідомлення і успішно завершити роботу." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:104 +msgid "Display the version number of B and liblzma." +msgstr "Вивести номер версії B та liblzma." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:108 +msgid "All was good." +msgstr "Усе добре." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:117 +msgid "B doesn't have any warning messages like B(1) has, thus the exit status 2 is not used by B." +msgstr "B не має жодних повідомлень із попередженнями, на відміну від B(1), тому у B стан виходу 2 не використовується." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:131 +msgid "Use B(1) instead of B or B for normal everyday use. B or B are meant only for situations where it is important to have a smaller decompressor than the full-featured B(1)." +msgstr "Користуйтеся B(1), замість B або B, для щоденних потреб. B та B призначено лише для тих ситуацій, коли важливо мати меншу програму для розпаковування, ніж B(1)." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:143 +msgid "B and B are not really that small. The size can be reduced further by dropping features from liblzma at compile time, but that shouldn't usually be done for executables distributed in typical non-embedded operating system distributions. If you need a truly small B<.xz> decompressor, consider using XZ Embedded." +msgstr "B і B не такі вже і малі програми. Їхній розмір можна зменшити викиданням можливостей з liblzma під час збирання, але цього зазвичай не роблять для виконуваних файлів, які поширюються у типових, не вбудованих, дистрибутивах операційних систем. Якщо вам потрібний дуже мала програма для розпаковування B<.xz>, варто скористатися XZ Embedded." + +#. type: Plain text +#: ../src/xzdec/xzdec.1:145 ../src/lzmainfo/lzmainfo.1:60 +msgid "B(1)" +msgstr "B(1)" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 +#, no-wrap +msgid "LZMAINFO" +msgstr "LZMAINFO" + +#. type: TH +#: ../src/lzmainfo/lzmainfo.1:7 ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "2013-06-30" +msgstr "30 червня 2013 року" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:10 +msgid "lzmainfo - show information stored in the .lzma file header" +msgstr "lzmainfo — показ відомостей, які зберігаються у заголовку файла .lzma" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:15 +msgid "B [B<--help>] [B<--version>] [I]" +msgstr "B [B<--help>] [B<--version>] [I<файл...>]" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:31 +msgid "B shows information stored in the B<.lzma> file header. It reads the first 13 bytes from the specified I, decodes the header, and prints it to standard output in human readable format. If no I are given or I is B<->, standard input is read." +msgstr "B показує дані, що зберігаються у заголовку файла B<.lzma>. Вона читає перші 13 байтів із вказаного I<файла>, розкодовує заголовок і виводить його до стандартного виведення у зручному для читання форматі. Якщо не вказано жодного I<файла> або замість I<файла> вказано B<->, дані буде прочитано зі стандартного вхідного джерела даних." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:40 +msgid "Usually the most interesting information is the uncompressed size and the dictionary size. Uncompressed size can be shown only if the file is in the non-streamed B<.lzma> format variant. The amount of memory required to decompress the file is a few dozen kilobytes plus the dictionary size." +msgstr "Зазвичай, найцікавішою інформацією є розпакований розмір та розмір словника. Розпакований розмір може бути показано, лише якщо файл записано у непотоковому варіанті формату B<.lzma>. Об'єм пам'яті, потрібний для розпаковування файла, складає декілька десятків кілобайтів плюс розмір словника." + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:44 +msgid "B is included in XZ Utils primarily for backward compatibility with LZMA Utils." +msgstr "B включено до XZ Utils в основному для зворотної сумісності із LZMA Utils." + +#. type: SH +#: ../src/lzmainfo/lzmainfo.1:51 ../src/scripts/xzdiff.1:74 +#, no-wrap +msgid "BUGS" +msgstr "ВАДИ" + +#. type: Plain text +#: ../src/lzmainfo/lzmainfo.1:59 +msgid "B uses B while the correct suffix would be B (2^20 bytes). This is to keep the output compatible with LZMA Utils." +msgstr "B використовує B, хоча правильним суфіксом мав би бути B (2^20 байтів). Так зроблено, щоб зберегти сумісність виведених даних із LZMA Utils." + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "XZDIFF" +msgstr "XZDIFF" + +#. type: TH +#: ../src/scripts/xzdiff.1:9 +#, no-wrap +msgid "2021-06-04" +msgstr "4 червня 2021 року" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:12 +msgid "xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files" +msgstr "xzcmp, xzdiff, lzcmp, lzdiff — порівняння стиснених файлів" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:15 +msgid "B [I] I [I]" +msgstr "B [I<параметри_cmp>] I<файл1> [I<файл2>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:18 +msgid "B [I] I [I]" +msgstr "B [I<параметри_diff>] I<файл1> [I<файл2>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:21 +msgid "B [I] I [I]" +msgstr "B [I<параметри_cmp>] I<файл1> [I<файл2>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:24 +msgid "B [I] I [I]" +msgstr "B [I<параметри_diff>] I<файл1> [I<файл2>]" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:59 +msgid "B and B invoke B(1) or B(1) on files compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1) or B(1). If only one file is specified, then the files compared are I (which must have a suffix of a supported compression format) and I from which the compression format suffix has been stripped. If two files are specified, then they are uncompressed if necessary and fed to B(1) or B(1). The exit status from B(1) or B(1) is preserved unless a decompression error occurs; then exit status is 2." +msgstr "B і B викликають B(1) або B(1) для файлів, які стиснено за допомогою B(1), B(1), B(1), B(1), B(1) або B(1). Усі вказані параметри передаються безпосередньо B(1) або B(1). Якщо вказано лише один файл, порівнюваними файлами будуть I<файл1> (який повинен мати суфікс підтримуваного файла стискання) і I<файл1>, з назви якого вилучено суфікс формату стискання. Якщо вказано два файли, їх буде, якщо потрібно, розпаковано і передано B(1) або B(1). Стан виходу B(1) або B(1) буде збережено, якщо не станеться помилок розпаковування. Якщо станеться помилка розпаковування, станом виходу буде 2." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:65 +msgid "The names B and B are provided for backward compatibility with LZMA Utils." +msgstr "Працездатність назв B і B забезпечено для зворотної сумісності із LZMA Utils." + +#. type: Plain text +#: ../src/scripts/xzdiff.1:74 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: Plain text +#: ../src/scripts/xzdiff.1:79 +msgid "Messages from the B(1) or B(1) programs refer to temporary filenames instead of those specified." +msgstr "Повідомлення від програм B(1) або B(1) посилатимуться на назви тимчасових файлів, а не вказані назви." + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "XZGREP" +msgstr "XZGREP" + +#. type: TH +#: ../src/scripts/xzgrep.1:9 +#, no-wrap +msgid "2022-07-19" +msgstr "19 липня 2022 року" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:12 +msgid "xzgrep - search compressed files for a regular expression" +msgstr "xzgrep — пошук у стиснених файлах формального виразу" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:18 +msgid "B [I] [B<-e>] I [I]" +msgstr "B [I<параметри_grep>] [B<-e>] I<взірець> [I<файл...>]" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:21 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:24 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:27 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:30 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:33 +msgid "B \\&..." +msgstr "B \\&..." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:49 +msgid "B invokes B(1) on I which may be either uncompressed or compressed with B(1), B(1), B(1), B(1), B(1), or B(1). All options specified are passed directly to B(1)." +msgstr "B викликає B(1) для I<файлів>, які можуть бути розпакованими або запакованими за допомогою B(1), B(1), B(1), B(1), B(1) або B(1). Усі вказані параметри передаються безпосередньо B(1)." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:62 +msgid "If no I is specified, then standard input is decompressed if necessary and fed to B(1). When reading from standard input, B(1), B(1), B(1), and B(1) compressed files are not supported." +msgstr "Якщо не вказано жодного I<файла>, буде розпаковано дані зі стандартного джерела вхідних даних і передано ці дані B(1). Якщо дані буде прочитано зі стандартного джерела вхідних даних, підтримку стиснених файлів B(1), B(1), B(1) та B(1) буде вимкнено." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:81 +msgid "If B is invoked as B or B then B or B is used instead of B(1). The same applies to names B, B, and B, which are provided for backward compatibility with LZMA Utils." +msgstr "Якщо B викликано як B або B, буде використано B або B замість B(1). Те саме стосується програм із назвами B, B та B, які створено для зворотної сумісності з LZMA Utils." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:86 +msgid "At least one match was found from at least one of the input files. No errors occurred." +msgstr "В одному з файлів вхідних даних знайдено принаймні одну відповідність. Помилок не сталося." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:90 +msgid "No matches were found from any of the input files. No errors occurred." +msgstr "У жодному з файлів вхідних даних не знайдено відповідника. Не сталося ніяких помилок." + +#. type: TP +#: ../src/scripts/xzgrep.1:90 +#, no-wrap +msgid "E1" +msgstr "E1" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:94 +msgid "One or more errors occurred. It is unknown if matches were found." +msgstr "Сталася одна або декілька помилок. Невідомо, чи було знайдено відповідники критерію пошуку." + +#. type: TP +#: ../src/scripts/xzgrep.1:95 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzgrep.1:106 +msgid "If the B environment variable is set, B uses it instead of B(1), B, or B." +msgstr "Якщо встановлено значення змінної середовища B, буде використано це значення B, замість B(1), B або B." + +#. type: Plain text +#: ../src/scripts/xzgrep.1:113 +msgid "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "XZLESS" +msgstr "XZLESS" + +#. type: TH +#: ../src/scripts/xzless.1:10 +#, no-wrap +msgid "2010-09-27" +msgstr "27 вересня 2010 року" + +#. type: Plain text +#: ../src/scripts/xzless.1:13 +msgid "xzless, lzless - view xz or lzma compressed (text) files" +msgstr "xzless, lzless — перегляд стиснених xz або lzma (текстових) файлів" + +#. type: Plain text +#: ../src/scripts/xzless.1:16 +msgid "B [I...]" +msgstr "B [I<файл>...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:19 +msgid "B [I...]" +msgstr "B [I<файл>...]" + +#. type: Plain text +#: ../src/scripts/xzless.1:31 +msgid "B is a filter that displays text from compressed files to a terminal. It works on files compressed with B(1) or B(1). If no I are given, B reads from standard input." +msgstr "B є фільтром, який показує текст зі стиснених файлів у терміналі. Працює для файлів, які стиснуто за допомогою B(1) або B(1). Якщо не вказано жодного I<файла>, B читатиме дані зі стандартного джерела вхідних даних." + +#. type: Plain text +#: ../src/scripts/xzless.1:48 +msgid "B uses B(1) to present its output. Unlike B, its choice of pager cannot be altered by setting an environment variable. Commands are based on both B(1) and B(1) and allow back and forth movement and searching. See the B(1) manual for more information." +msgstr "Для показу виведених даних B використовує B(1). На відміну від B, вибір програми для поділу на сторінки не можна змінити за допомогою змінної середовища. Команди засновано на B(1) і B(1). За допомогою команд можна просуватися назад і вперед даними та шукати дані. Щоб дізнатися більше, ознайомтеся із підручником з B(1)." + +#. type: Plain text +#: ../src/scripts/xzless.1:52 +msgid "The command named B is provided for backward compatibility with LZMA Utils." +msgstr "Команду B реалізовано для забезпечення зворотної сумісності з LZMA Utils." + +#. type: TP +#: ../src/scripts/xzless.1:53 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:59 +msgid "A list of characters special to the shell. Set by B unless it is already set in the environment." +msgstr "Список символів, які є особливими символами командної оболонки. Встановлюється B, якщо його ще не встановлено у середовищі." + +#. type: TP +#: ../src/scripts/xzless.1:59 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzless.1:65 +msgid "Set to a command line to invoke the B(1) decompressor for preprocessing the input files to B(1)." +msgstr "Має значення рядка команди для виклику засобу розпаковування B(1) для обробки вхідних файлів B(1)." + +#. type: Plain text +#: ../src/scripts/xzless.1:69 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" + +#. type: TH +#: ../src/scripts/xzmore.1:7 +#, no-wrap +msgid "XZMORE" +msgstr "XZMORE" + +#. type: Plain text +#: ../src/scripts/xzmore.1:10 +msgid "xzmore, lzmore - view xz or lzma compressed (text) files" +msgstr "xzmore, lzmore — перегляд стиснених xz або lzma (текстових) файлів" + +#. type: Plain text +#: ../src/scripts/xzmore.1:13 +msgid "B [I]" +msgstr "B [I<файл...>]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:16 +msgid "B [I]" +msgstr "B [I<файл...>]" + +#. type: Plain text +#: ../src/scripts/xzmore.1:24 +msgid "B is a filter which allows examination of B(1) or B(1) compressed text files one screenful at a time on a soft-copy terminal." +msgstr "B є фільтром, за допомогою якого можна вивчати стиснені B(1) або B(1) текстові файли поекранно на терміналах із м'яким копіюванням." + +#. type: Plain text +#: ../src/scripts/xzmore.1:33 +msgid "To use a pager other than the default B set environment variable B to the name of the desired program. The name B is provided for backward compatibility with LZMA Utils." +msgstr "Щоб скористатися засобом поділу на сторінки, відмінним від типового B, встановіть для змінної середовища B значення назви бажаної програми. Команду B реалізовано для забезпечення зворотної сумісності з LZMA Utils." + +#. type: TP +#: ../src/scripts/xzmore.1:33 +#, no-wrap +msgid "B or B" +msgstr "B або B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:40 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to exit." +msgstr "Якщо виведено запит --More--(Наступний файл: I<файл>), ця команда наказує B завершити роботу." + +#. type: TP +#: ../src/scripts/xzmore.1:40 +#, no-wrap +msgid "B" +msgstr "B" + +#. type: Plain text +#: ../src/scripts/xzmore.1:47 +msgid "When the prompt --More--(Next file: I) is printed, this command causes B to skip the next file and continue." +msgstr "Якщо виведено запит --More--(Наступний файл: I<файл>), ця команда наказує B перейти до наступного файла і продовжити показ даних." + +#. type: Plain text +#: ../src/scripts/xzmore.1:51 +msgid "For list of keyboard commands supported while actually viewing the content of a file, refer to manual of the pager you use, usually B(1)." +msgstr "Список клавіатурних команд, якими можна скористатися під час перегляду вмісту файла, наведено на сторінці засобу поділу файла на сторінки, яким ви користуєтеся, зазвичай, на сторінці B(1)." + +#. type: Plain text +#: ../src/scripts/xzmore.1:55 +msgid "B(1), B(1), B(1), B(1)" +msgstr "B(1), B(1), B(1), B(1)" diff --git a/po4a/update-po b/po4a/update-po new file mode 100644 index 0000000..3c99307 --- /dev/null +++ b/po4a/update-po @@ -0,0 +1,45 @@ +#!/bin/sh +# +############################################################################# +# +# Updates xz-man.pot and the *.po files, and generates translated man pages. +# These are done using the program po4a. If po4a is missing, it is still +# possible to build the package without translated man pages. +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +if type po4a > /dev/null 2>&1; then + : +else + echo "po4a/update-po: The program 'po4a' was not found." >&2 + echo "po4a/update-po: Translated man pages were not generated." >&2 + exit 1 +fi + +if test ! -f po4a.conf; then + cd `dirname "$0"` || exit 1 + if test ! -f po4a.conf; then + echo "update-po: Error: Cannot find po4a.conf." >&2 + exit 1 + fi +fi + +PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1 + +# Using --force to get up-to-date version numbers in the output files +# when nothing else has changed. This makes it slower but it's fine +# as long as this isn't run every time when "make" is run at the +# top level directory. (po4a isn't super-fast even without --force). +set -x +po4a --force --verbose \ + --package-name="XZ Utils" \ + --package-version="$PACKAGE_VERSION" \ + --copyright-holder="[See the headers in the input files.]" \ + po4a.conf diff --git a/src/common/common_w32res.rc b/src/common/common_w32res.rc new file mode 100644 index 0000000..d05d22e --- /dev/null +++ b/src/common/common_w32res.rc @@ -0,0 +1,52 @@ +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#define LZMA_H_INTERNAL +#define LZMA_H_INTERNAL_RC +#include "lzma/version.h" + +#ifndef MY_BUILD +# define MY_BUILD 0 +#endif +#define MY_VERSION LZMA_VERSION_MAJOR,LZMA_VERSION_MINOR,LZMA_VERSION_PATCH,MY_BUILD + +#define MY_FILENAME MY_NAME MY_SUFFIX +#define MY_COMPANY "The Tukaani Project " +#define MY_PRODUCT PACKAGE_NAME " <" PACKAGE_URL ">" + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +VS_VERSION_INFO VERSIONINFO + FILEVERSION MY_VERSION + PRODUCTVERSION MY_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_NT_WINDOWS32 + FILETYPE MY_TYPE + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", MY_COMPANY + VALUE "FileDescription", MY_DESC + VALUE "FileVersion", LZMA_VERSION_STRING + VALUE "InternalName", MY_NAME + VALUE "OriginalFilename", MY_FILENAME + VALUE "ProductName", MY_PRODUCT + VALUE "ProductVersion", LZMA_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/common/mythread.h b/src/common/mythread.h new file mode 100644 index 0000000..2d60b23 --- /dev/null +++ b/src/common/mythread.h @@ -0,0 +1,528 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file mythread.h +/// \brief Some threading related helper macros and functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef MYTHREAD_H +#define MYTHREAD_H + +#include "sysdefs.h" + +// If any type of threading is enabled, #define MYTHREAD_ENABLED. +#if defined(MYTHREAD_POSIX) || defined(MYTHREAD_WIN95) \ + || defined(MYTHREAD_VISTA) +# define MYTHREAD_ENABLED 1 +#endif + + +#ifdef MYTHREAD_ENABLED + +//////////////////////////////////////// +// Shared between all threading types // +//////////////////////////////////////// + +// Locks a mutex for a duration of a block. +// +// Perform mythread_mutex_lock(&mutex) in the beginning of a block +// and mythread_mutex_unlock(&mutex) at the end of the block. "break" +// may be used to unlock the mutex and jump out of the block. +// mythread_sync blocks may be nested. +// +// Example: +// +// mythread_sync(mutex) { +// foo(); +// if (some_error) +// break; // Skips bar() +// bar(); +// } +// +// At least GCC optimizes the loops completely away so it doesn't slow +// things down at all compared to plain mythread_mutex_lock(&mutex) +// and mythread_mutex_unlock(&mutex) calls. +// +#define mythread_sync(mutex) mythread_sync_helper1(mutex, __LINE__) +#define mythread_sync_helper1(mutex, line) mythread_sync_helper2(mutex, line) +#define mythread_sync_helper2(mutex, line) \ + for (unsigned int mythread_i_ ## line = 0; \ + mythread_i_ ## line \ + ? (mythread_mutex_unlock(&(mutex)), 0) \ + : (mythread_mutex_lock(&(mutex)), 1); \ + mythread_i_ ## line = 1) \ + for (unsigned int mythread_j_ ## line = 0; \ + !mythread_j_ ## line; \ + mythread_j_ ## line = 1) +#endif + + +#if !defined(MYTHREAD_ENABLED) + +////////////////// +// No threading // +////////////////// + +// Calls the given function once. This isn't thread safe. +#define mythread_once(func) \ +do { \ + static bool once_ = false; \ + if (!once_) { \ + func(); \ + once_ = true; \ + } \ +} while (0) + + +#if !(defined(_WIN32) && !defined(__CYGWIN__)) +// Use sigprocmask() to set the signal mask in single-threaded programs. +#include + +static inline void +mythread_sigmask(int how, const sigset_t *restrict set, + sigset_t *restrict oset) +{ + int ret = sigprocmask(how, set, oset); + assert(ret == 0); + (void)ret; +} +#endif + + +#elif defined(MYTHREAD_POSIX) + +//////////////////// +// Using pthreads // +//////////////////// + +#include +#include +#include +#include + +// If clock_gettime() isn't available, use gettimeofday() from +// as a fallback. gettimeofday() is in SUSv2 and thus is supported on all +// relevant POSIX systems. +#ifndef HAVE_CLOCK_GETTIME +# include +#endif + +#define MYTHREAD_RET_TYPE void * +#define MYTHREAD_RET_VALUE NULL + +typedef pthread_t mythread; +typedef pthread_mutex_t mythread_mutex; + +typedef struct { + pthread_cond_t cond; +#ifdef HAVE_CLOCK_GETTIME + // Clock ID (CLOCK_REALTIME or CLOCK_MONOTONIC) associated with + // the condition variable. + clockid_t clk_id; +#endif +} mythread_cond; + +typedef struct timespec mythread_condtime; + + +// Calls the given function once in a thread-safe way. +#define mythread_once(func) \ + do { \ + static pthread_once_t once_ = PTHREAD_ONCE_INIT; \ + pthread_once(&once_, &func); \ + } while (0) + + +// Use pthread_sigmask() to set the signal mask in multi-threaded programs. +// Do nothing on OpenVMS since it lacks pthread_sigmask(). +static inline void +mythread_sigmask(int how, const sigset_t *restrict set, + sigset_t *restrict oset) +{ +#ifdef __VMS + (void)how; + (void)set; + (void)oset; +#else + int ret = pthread_sigmask(how, set, oset); + assert(ret == 0); + (void)ret; +#endif +} + + +// Creates a new thread with all signals blocked. Returns zero on success +// and non-zero on error. +static inline int +mythread_create(mythread *thread, void *(*func)(void *arg), void *arg) +{ + sigset_t old; + sigset_t all; + sigfillset(&all); + + mythread_sigmask(SIG_SETMASK, &all, &old); + const int ret = pthread_create(thread, NULL, func, arg); + mythread_sigmask(SIG_SETMASK, &old, NULL); + + return ret; +} + +// Joins a thread. Returns zero on success and non-zero on error. +static inline int +mythread_join(mythread thread) +{ + return pthread_join(thread, NULL); +} + + +// Initiatlizes a mutex. Returns zero on success and non-zero on error. +static inline int +mythread_mutex_init(mythread_mutex *mutex) +{ + return pthread_mutex_init(mutex, NULL); +} + +static inline void +mythread_mutex_destroy(mythread_mutex *mutex) +{ + int ret = pthread_mutex_destroy(mutex); + assert(ret == 0); + (void)ret; +} + +static inline void +mythread_mutex_lock(mythread_mutex *mutex) +{ + int ret = pthread_mutex_lock(mutex); + assert(ret == 0); + (void)ret; +} + +static inline void +mythread_mutex_unlock(mythread_mutex *mutex) +{ + int ret = pthread_mutex_unlock(mutex); + assert(ret == 0); + (void)ret; +} + + +// Initializes a condition variable. +// +// Using CLOCK_MONOTONIC instead of the default CLOCK_REALTIME makes the +// timeout in pthread_cond_timedwait() work correctly also if system time +// is suddenly changed. Unfortunately CLOCK_MONOTONIC isn't available +// everywhere while the default CLOCK_REALTIME is, so the default is +// used if CLOCK_MONOTONIC isn't available. +// +// If clock_gettime() isn't available at all, gettimeofday() will be used. +static inline int +mythread_cond_init(mythread_cond *mycond) +{ +#ifdef HAVE_CLOCK_GETTIME +# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && \ + defined(HAVE_CLOCK_MONOTONIC) + struct timespec ts; + pthread_condattr_t condattr; + + // POSIX doesn't seem to *require* that pthread_condattr_setclock() + // will fail if given an unsupported clock ID. Test that + // CLOCK_MONOTONIC really is supported using clock_gettime(). + if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0 + && pthread_condattr_init(&condattr) == 0) { + int ret = pthread_condattr_setclock( + &condattr, CLOCK_MONOTONIC); + if (ret == 0) + ret = pthread_cond_init(&mycond->cond, &condattr); + + pthread_condattr_destroy(&condattr); + + if (ret == 0) { + mycond->clk_id = CLOCK_MONOTONIC; + return 0; + } + } + + // If anything above fails, fall back to the default CLOCK_REALTIME. + // POSIX requires that all implementations of clock_gettime() must + // support at least CLOCK_REALTIME. +# endif + + mycond->clk_id = CLOCK_REALTIME; +#endif + + return pthread_cond_init(&mycond->cond, NULL); +} + +static inline void +mythread_cond_destroy(mythread_cond *cond) +{ + int ret = pthread_cond_destroy(&cond->cond); + assert(ret == 0); + (void)ret; +} + +static inline void +mythread_cond_signal(mythread_cond *cond) +{ + int ret = pthread_cond_signal(&cond->cond); + assert(ret == 0); + (void)ret; +} + +static inline void +mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex) +{ + int ret = pthread_cond_wait(&cond->cond, mutex); + assert(ret == 0); + (void)ret; +} + +// Waits on a condition or until a timeout expires. If the timeout expires, +// non-zero is returned, otherwise zero is returned. +static inline int +mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex, + const mythread_condtime *condtime) +{ + int ret = pthread_cond_timedwait(&cond->cond, mutex, condtime); + assert(ret == 0 || ret == ETIMEDOUT); + return ret; +} + +// Sets condtime to the absolute time that is timeout_ms milliseconds +// in the future. The type of the clock to use is taken from cond. +static inline void +mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond, + uint32_t timeout_ms) +{ + condtime->tv_sec = timeout_ms / 1000; + condtime->tv_nsec = (timeout_ms % 1000) * 1000000; + +#ifdef HAVE_CLOCK_GETTIME + struct timespec now; + int ret = clock_gettime(cond->clk_id, &now); + assert(ret == 0); + (void)ret; + + condtime->tv_sec += now.tv_sec; + condtime->tv_nsec += now.tv_nsec; +#else + (void)cond; + + struct timeval now; + gettimeofday(&now, NULL); + + condtime->tv_sec += now.tv_sec; + condtime->tv_nsec += now.tv_usec * 1000L; +#endif + + // tv_nsec must stay in the range [0, 999_999_999]. + if (condtime->tv_nsec >= 1000000000L) { + condtime->tv_nsec -= 1000000000L; + ++condtime->tv_sec; + } +} + + +#elif defined(MYTHREAD_WIN95) || defined(MYTHREAD_VISTA) + +///////////////////// +// Windows threads // +///////////////////// + +#define WIN32_LEAN_AND_MEAN +#ifdef MYTHREAD_VISTA +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0600 +#endif +#include +#include + +#define MYTHREAD_RET_TYPE unsigned int __stdcall +#define MYTHREAD_RET_VALUE 0 + +typedef HANDLE mythread; +typedef CRITICAL_SECTION mythread_mutex; + +#ifdef MYTHREAD_WIN95 +typedef HANDLE mythread_cond; +#else +typedef CONDITION_VARIABLE mythread_cond; +#endif + +typedef struct { + // Tick count (milliseconds) in the beginning of the timeout. + // NOTE: This is 32 bits so it wraps around after 49.7 days. + // Multi-day timeouts may not work as expected. + DWORD start; + + // Length of the timeout in milliseconds. The timeout expires + // when the current tick count minus "start" is equal or greater + // than "timeout". + DWORD timeout; +} mythread_condtime; + + +// mythread_once() is only available with Vista threads. +#ifdef MYTHREAD_VISTA +#define mythread_once(func) \ + do { \ + static INIT_ONCE once_ = INIT_ONCE_STATIC_INIT; \ + BOOL pending_; \ + if (!InitOnceBeginInitialize(&once_, 0, &pending_, NULL)) \ + abort(); \ + if (pending_) { \ + func(); \ + if (!InitOnceComplete(&once_, 0, NULL)) \ + abort(); \ + } \ + } while (0) +#endif + + +// mythread_sigmask() isn't available on Windows. Even a dummy version would +// make no sense because the other POSIX signal functions are missing anyway. + + +static inline int +mythread_create(mythread *thread, + unsigned int (__stdcall *func)(void *arg), void *arg) +{ + uintptr_t ret = _beginthreadex(NULL, 0, func, arg, 0, NULL); + if (ret == 0) + return -1; + + *thread = (HANDLE)ret; + return 0; +} + +static inline int +mythread_join(mythread thread) +{ + int ret = 0; + + if (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0) + ret = -1; + + if (!CloseHandle(thread)) + ret = -1; + + return ret; +} + + +static inline int +mythread_mutex_init(mythread_mutex *mutex) +{ + InitializeCriticalSection(mutex); + return 0; +} + +static inline void +mythread_mutex_destroy(mythread_mutex *mutex) +{ + DeleteCriticalSection(mutex); +} + +static inline void +mythread_mutex_lock(mythread_mutex *mutex) +{ + EnterCriticalSection(mutex); +} + +static inline void +mythread_mutex_unlock(mythread_mutex *mutex) +{ + LeaveCriticalSection(mutex); +} + + +static inline int +mythread_cond_init(mythread_cond *cond) +{ +#ifdef MYTHREAD_WIN95 + *cond = CreateEvent(NULL, FALSE, FALSE, NULL); + return *cond == NULL ? -1 : 0; +#else + InitializeConditionVariable(cond); + return 0; +#endif +} + +static inline void +mythread_cond_destroy(mythread_cond *cond) +{ +#ifdef MYTHREAD_WIN95 + CloseHandle(*cond); +#else + (void)cond; +#endif +} + +static inline void +mythread_cond_signal(mythread_cond *cond) +{ +#ifdef MYTHREAD_WIN95 + SetEvent(*cond); +#else + WakeConditionVariable(cond); +#endif +} + +static inline void +mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex) +{ +#ifdef MYTHREAD_WIN95 + LeaveCriticalSection(mutex); + WaitForSingleObject(*cond, INFINITE); + EnterCriticalSection(mutex); +#else + BOOL ret = SleepConditionVariableCS(cond, mutex, INFINITE); + assert(ret); + (void)ret; +#endif +} + +static inline int +mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex, + const mythread_condtime *condtime) +{ +#ifdef MYTHREAD_WIN95 + LeaveCriticalSection(mutex); +#endif + + DWORD elapsed = GetTickCount() - condtime->start; + DWORD timeout = elapsed >= condtime->timeout + ? 0 : condtime->timeout - elapsed; + +#ifdef MYTHREAD_WIN95 + DWORD ret = WaitForSingleObject(*cond, timeout); + assert(ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT); + + EnterCriticalSection(mutex); + + return ret == WAIT_TIMEOUT; +#else + BOOL ret = SleepConditionVariableCS(cond, mutex, timeout); + assert(ret || GetLastError() == ERROR_TIMEOUT); + return !ret; +#endif +} + +static inline void +mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond, + uint32_t timeout) +{ + (void)cond; + condtime->start = GetTickCount(); + condtime->timeout = timeout; +} + +#endif + +#endif diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h new file mode 100644 index 0000000..97be4ee --- /dev/null +++ b/src/common/sysdefs.h @@ -0,0 +1,189 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sysdefs.h +/// \brief Common includes, definitions, system-specific things etc. +/// +/// This file is used also by the lzma command line tool, that's why this +/// file is separate from common.h. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SYSDEFS_H +#define LZMA_SYSDEFS_H + +////////////// +// Includes // +////////////// + +#ifdef HAVE_CONFIG_H +# include +#endif + +// Get standard-compliant stdio functions under MinGW and MinGW-w64. +#ifdef __MINGW32__ +# define __USE_MINGW_ANSI_STDIO 1 +#endif + +// size_t and NULL +#include + +#ifdef HAVE_INTTYPES_H +# include +#endif + +// C99 says that inttypes.h always includes stdint.h, but some systems +// don't do that, and require including stdint.h separately. +#ifdef HAVE_STDINT_H +# include +#endif + +// Some pre-C99 systems have SIZE_MAX in limits.h instead of stdint.h. The +// limits are also used to figure out some macros missing from pre-C99 systems. +#include + +// Be more compatible with systems that have non-conforming inttypes.h. +// We assume that int is 32-bit and that long is either 32-bit or 64-bit. +// Full Autoconf test could be more correct, but this should work well enough. +// Note that this duplicates some code from lzma.h, but this is better since +// we can work without inttypes.h thanks to Autoconf tests. +#ifndef UINT32_C +# if UINT_MAX != 4294967295U +# error UINT32_C is not defined and unsigned int is not 32-bit. +# endif +# define UINT32_C(n) n ## U +#endif +#ifndef UINT32_MAX +# define UINT32_MAX UINT32_C(4294967295) +#endif +#ifndef PRIu32 +# define PRIu32 "u" +#endif +#ifndef PRIx32 +# define PRIx32 "x" +#endif +#ifndef PRIX32 +# define PRIX32 "X" +#endif + +#if ULONG_MAX == 4294967295UL +# ifndef UINT64_C +# define UINT64_C(n) n ## ULL +# endif +# ifndef PRIu64 +# define PRIu64 "llu" +# endif +# ifndef PRIx64 +# define PRIx64 "llx" +# endif +# ifndef PRIX64 +# define PRIX64 "llX" +# endif +#else +# ifndef UINT64_C +# define UINT64_C(n) n ## UL +# endif +# ifndef PRIu64 +# define PRIu64 "lu" +# endif +# ifndef PRIx64 +# define PRIx64 "lx" +# endif +# ifndef PRIX64 +# define PRIX64 "lX" +# endif +#endif +#ifndef UINT64_MAX +# define UINT64_MAX UINT64_C(18446744073709551615) +#endif + +// Incorrect(?) SIZE_MAX: +// - Interix headers typedef size_t to unsigned long, +// but a few lines later define SIZE_MAX to INT32_MAX. +// - SCO OpenServer (x86) headers typedef size_t to unsigned int +// but define SIZE_MAX to INT32_MAX. +#if defined(__INTERIX) || defined(_SCO_DS) +# undef SIZE_MAX +#endif + +// The code currently assumes that size_t is either 32-bit or 64-bit. +#ifndef SIZE_MAX +# if SIZEOF_SIZE_T == 4 +# define SIZE_MAX UINT32_MAX +# elif SIZEOF_SIZE_T == 8 +# define SIZE_MAX UINT64_MAX +# else +# error size_t is not 32-bit or 64-bit +# endif +#endif +#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX +# error size_t is not 32-bit or 64-bit +#endif + +#include +#include + +// Pre-C99 systems lack stdbool.h. All the code in XZ Utils must be written +// so that it works with fake bool type, for example: +// +// bool foo = (flags & 0x100) != 0; +// bool bar = !!(flags & 0x100); +// +// This works with the real C99 bool but breaks with fake bool: +// +// bool baz = (flags & 0x100); +// +#ifdef HAVE_STDBOOL_H +# include +#else +# if ! HAVE__BOOL +typedef unsigned char _Bool; +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif + +#include + +// As of MSVC 2013, inline and restrict are supported with +// non-standard keywords. +#if defined(_WIN32) && defined(_MSC_VER) +# ifndef inline +# define inline __inline +# endif +# ifndef restrict +# define restrict __restrict +# endif +#endif + +//////////// +// Macros // +//////////// + +#undef memzero +#define memzero(s, n) memset(s, 0, n) + +// NOTE: Avoid using MIN() and MAX(), because even conditionally defining +// those macros can cause some portability trouble, since on some systems +// the system headers insist defining their own versions. +#define my_min(x, y) ((x) < (y) ? (x) : (y)) +#define my_max(x, y) ((x) > (y) ? (x) : (y)) + +#ifndef ARRAY_SIZE +# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif + +#if defined(__GNUC__) \ + && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4) +# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x))) +#else +# define lzma_attr_alloc_size(x) +#endif + +#endif diff --git a/src/common/tuklib_common.h b/src/common/tuklib_common.h new file mode 100644 index 0000000..b1f531e --- /dev/null +++ b/src/common/tuklib_common.h @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_common.h +/// \brief Common definitions for tuklib modules +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_COMMON_H +#define TUKLIB_COMMON_H + +// The config file may be replaced by a package-specific file. +// It should include at least stddef.h, stdbool.h, inttypes.h, and limits.h. +#include "tuklib_config.h" + +// TUKLIB_SYMBOL_PREFIX is prefixed to all symbols exported by +// the tuklib modules. If you use a tuklib module in a library, +// you should use TUKLIB_SYMBOL_PREFIX to make sure that there +// are no symbol conflicts in case someone links your library +// into application that also uses the same tuklib module. +#ifndef TUKLIB_SYMBOL_PREFIX +# define TUKLIB_SYMBOL_PREFIX +#endif + +#define TUKLIB_CAT_X(a, b) a ## b +#define TUKLIB_CAT(a, b) TUKLIB_CAT_X(a, b) + +#ifndef TUKLIB_SYMBOL +# define TUKLIB_SYMBOL(sym) TUKLIB_CAT(TUKLIB_SYMBOL_PREFIX, sym) +#endif + +#ifndef TUKLIB_DECLS_BEGIN +# ifdef __cplusplus +# define TUKLIB_DECLS_BEGIN extern "C" { +# else +# define TUKLIB_DECLS_BEGIN +# endif +#endif + +#ifndef TUKLIB_DECLS_END +# ifdef __cplusplus +# define TUKLIB_DECLS_END } +# else +# define TUKLIB_DECLS_END +# endif +#endif + +#if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define TUKLIB_GNUC_REQ(major, minor) \ + ((__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)) \ + || __GNUC__ > (major)) +#else +# define TUKLIB_GNUC_REQ(major, minor) 0 +#endif + +#if TUKLIB_GNUC_REQ(2, 5) +# define tuklib_attr_noreturn __attribute__((__noreturn__)) +#else +# define tuklib_attr_noreturn +#endif + +#if (defined(_WIN32) && !defined(__CYGWIN__)) \ + || defined(__OS2__) || defined(__MSDOS__) +# define TUKLIB_DOSLIKE 1 +#endif + +#endif diff --git a/src/common/tuklib_config.h b/src/common/tuklib_config.h new file mode 100644 index 0000000..9d470ba --- /dev/null +++ b/src/common/tuklib_config.h @@ -0,0 +1,10 @@ +// If config.h isn't available, assume that the headers required by +// tuklib_common.h are available. This is required by crc32_tablegen.c. +#ifdef HAVE_CONFIG_H +# include "sysdefs.h" +#else +# include +# include +# include +# include +#endif diff --git a/src/common/tuklib_cpucores.c b/src/common/tuklib_cpucores.c new file mode 100644 index 0000000..bb3f2f7 --- /dev/null +++ b/src/common/tuklib_cpucores.c @@ -0,0 +1,109 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_cpucores.c +/// \brief Get the number of CPU cores online +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_cpucores.h" + +#if defined(_WIN32) || defined(__CYGWIN__) +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +# include + +// glibc >= 2.9 +#elif defined(TUKLIB_CPUCORES_SCHED_GETAFFINITY) +# include + +// FreeBSD +#elif defined(TUKLIB_CPUCORES_CPUSET) +# include +# include + +#elif defined(TUKLIB_CPUCORES_SYSCTL) +# ifdef HAVE_SYS_PARAM_H +# include +# endif +# include + +#elif defined(TUKLIB_CPUCORES_SYSCONF) +# include + +// HP-UX +#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC) +# include +# include +#endif + + +extern uint32_t +tuklib_cpucores(void) +{ + uint32_t ret = 0; + +#if defined(_WIN32) || defined(__CYGWIN__) + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + ret = sysinfo.dwNumberOfProcessors; + +#elif defined(TUKLIB_CPUCORES_SCHED_GETAFFINITY) + cpu_set_t cpu_mask; + if (sched_getaffinity(0, sizeof(cpu_mask), &cpu_mask) == 0) + ret = (uint32_t)CPU_COUNT(&cpu_mask); + +#elif defined(TUKLIB_CPUCORES_CPUSET) + cpuset_t set; + if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(set), &set) == 0) { +# ifdef CPU_COUNT + ret = (uint32_t)CPU_COUNT(&set); +# else + for (unsigned i = 0; i < CPU_SETSIZE; ++i) + if (CPU_ISSET(i, &set)) + ++ret; +# endif + } + +#elif defined(TUKLIB_CPUCORES_SYSCTL) + // On OpenBSD HW_NCPUONLINE tells the number of processor cores that + // are online so it is preferred over HW_NCPU which also counts cores + // that aren't currently available. The number of cores online is + // often less than HW_NCPU because OpenBSD disables simultaneous + // multi-threading (SMT) by default. +# ifdef HW_NCPUONLINE + int name[2] = { CTL_HW, HW_NCPUONLINE }; +# else + int name[2] = { CTL_HW, HW_NCPU }; +# endif + int cpus; + size_t cpus_size = sizeof(cpus); + if (sysctl(name, 2, &cpus, &cpus_size, NULL, 0) != -1 + && cpus_size == sizeof(cpus) && cpus > 0) + ret = (uint32_t)cpus; + +#elif defined(TUKLIB_CPUCORES_SYSCONF) +# ifdef _SC_NPROCESSORS_ONLN + // Most systems + const long cpus = sysconf(_SC_NPROCESSORS_ONLN); +# else + // IRIX + const long cpus = sysconf(_SC_NPROC_ONLN); +# endif + if (cpus > 0) + ret = (uint32_t)cpus; + +#elif defined(TUKLIB_CPUCORES_PSTAT_GETDYNAMIC) + struct pst_dynamic pst; + if (pstat_getdynamic(&pst, sizeof(pst), 1, 0) != -1) + ret = (uint32_t)pst.psd_proc_cnt; +#endif + + return ret; +} diff --git a/src/common/tuklib_cpucores.h b/src/common/tuklib_cpucores.h new file mode 100644 index 0000000..be1ce1c --- /dev/null +++ b/src/common/tuklib_cpucores.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_cpucores.h +/// \brief Get the number of CPU cores online +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_CPUCORES_H +#define TUKLIB_CPUCORES_H + +#include "tuklib_common.h" +TUKLIB_DECLS_BEGIN + +#define tuklib_cpucores TUKLIB_SYMBOL(tuklib_cpucores) +extern uint32_t tuklib_cpucores(void); + +TUKLIB_DECLS_END +#endif diff --git a/src/common/tuklib_exit.c b/src/common/tuklib_exit.c new file mode 100644 index 0000000..aa55620 --- /dev/null +++ b/src/common/tuklib_exit.c @@ -0,0 +1,58 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_exit.c +/// \brief Close stdout and stderr, and exit +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_common.h" + +#include +#include +#include + +#include "tuklib_gettext.h" +#include "tuklib_progname.h" +#include "tuklib_exit.h" + + +extern void +tuklib_exit(int status, int err_status, int show_error) +{ + if (status != err_status) { + // Close stdout. If something goes wrong, + // print an error message to stderr. + const int ferror_err = ferror(stdout); + const int fclose_err = fclose(stdout); + if (ferror_err || fclose_err) { + status = err_status; + + // If it was fclose() that failed, we have the reason + // in errno. If only ferror() indicated an error, + // we have no idea what the reason was. + if (show_error) + fprintf(stderr, "%s: %s: %s\n", progname, + _("Writing to standard " + "output failed"), + fclose_err ? strerror(errno) + : _("Unknown error")); + } + } + + if (status != err_status) { + // Close stderr. If something goes wrong, there's + // nothing where we could print an error message. + // Just set the exit status. + const int ferror_err = ferror(stderr); + const int fclose_err = fclose(stderr); + if (fclose_err || ferror_err) + status = err_status; + } + + exit(status); +} diff --git a/src/common/tuklib_exit.h b/src/common/tuklib_exit.h new file mode 100644 index 0000000..b11776f --- /dev/null +++ b/src/common/tuklib_exit.h @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_exit.h +/// \brief Close stdout and stderr, and exit +/// \note Requires tuklib_progname and tuklib_gettext modules +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_EXIT_H +#define TUKLIB_EXIT_H + +#include "tuklib_common.h" +TUKLIB_DECLS_BEGIN + +#define tuklib_exit TUKLIB_SYMBOL(tuklib_exit) +extern void tuklib_exit(int status, int err_status, int show_error) + tuklib_attr_noreturn; + +TUKLIB_DECLS_END +#endif diff --git a/src/common/tuklib_gettext.h b/src/common/tuklib_gettext.h new file mode 100644 index 0000000..ff18904 --- /dev/null +++ b/src/common/tuklib_gettext.h @@ -0,0 +1,44 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_gettext.h +/// \brief Wrapper for gettext and friends +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_GETTEXT_H +#define TUKLIB_GETTEXT_H + +#include "tuklib_common.h" +#include + +#ifndef TUKLIB_GETTEXT +# ifdef ENABLE_NLS +# define TUKLIB_GETTEXT 1 +# else +# define TUKLIB_GETTEXT 0 +# endif +#endif + +#if TUKLIB_GETTEXT +# include +# define tuklib_gettext_init(package, localedir) \ + do { \ + setlocale(LC_ALL, ""); \ + bindtextdomain(package, localedir); \ + textdomain(package); \ + } while (0) +# define _(msgid) gettext(msgid) +#else +# define tuklib_gettext_init(package, localedir) \ + setlocale(LC_ALL, "") +# define _(msgid) (msgid) +# define ngettext(msgid1, msgid2, n) ((n) == 1 ? (msgid1) : (msgid2)) +#endif +#define N_(msgid) msgid + +#endif diff --git a/src/common/tuklib_integer.h b/src/common/tuklib_integer.h new file mode 100644 index 0000000..b58ef68 --- /dev/null +++ b/src/common/tuklib_integer.h @@ -0,0 +1,784 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_integer.h +/// \brief Various integer and bit operations +/// +/// This file provides macros or functions to do some basic integer and bit +/// operations. +/// +/// Native endian inline functions (XX = 16, 32, or 64): +/// - Unaligned native endian reads: readXXne(ptr) +/// - Unaligned native endian writes: writeXXne(ptr, num) +/// - Aligned native endian reads: aligned_readXXne(ptr) +/// - Aligned native endian writes: aligned_writeXXne(ptr, num) +/// +/// Endianness-converting integer operations (these can be macros!) +/// (XX = 16, 32, or 64; Y = b or l): +/// - Byte swapping: bswapXX(num) +/// - Byte order conversions to/from native (byteswaps if Y isn't +/// the native endianness): convXXYe(num) +/// - Unaligned reads: readXXYe(ptr) +/// - Unaligned writes: writeXXYe(ptr, num) +/// - Aligned reads: aligned_readXXYe(ptr) +/// - Aligned writes: aligned_writeXXYe(ptr, num) +/// +/// Since the above can macros, the arguments should have no side effects +/// because they may be evaluated more than once. +/// +/// Bit scan operations for non-zero 32-bit integers (inline functions): +/// - Bit scan reverse (find highest non-zero bit): bsr32(num) +/// - Count leading zeros: clz32(num) +/// - Count trailing zeros: ctz32(num) +/// - Bit scan forward (simply an alias for ctz32()): bsf32(num) +/// +/// The above bit scan operations return 0-31. If num is zero, +/// the result is undefined. +// +// Authors: Lasse Collin +// Joachim Henke +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_INTEGER_H +#define TUKLIB_INTEGER_H + +#include "tuklib_common.h" +#include + +// Newer Intel C compilers require immintrin.h for _bit_scan_reverse() +// and such functions. +#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) +# include +#endif + + +/////////////////// +// Byte swapping // +/////////////////// + +#if defined(HAVE___BUILTIN_BSWAPXX) + // GCC >= 4.8 and Clang +# define bswap16(n) __builtin_bswap16(n) +# define bswap32(n) __builtin_bswap32(n) +# define bswap64(n) __builtin_bswap64(n) + +#elif defined(HAVE_BYTESWAP_H) + // glibc, uClibc, dietlibc +# include +# ifdef HAVE_BSWAP_16 +# define bswap16(num) bswap_16(num) +# endif +# ifdef HAVE_BSWAP_32 +# define bswap32(num) bswap_32(num) +# endif +# ifdef HAVE_BSWAP_64 +# define bswap64(num) bswap_64(num) +# endif + +#elif defined(HAVE_SYS_ENDIAN_H) + // *BSDs and Darwin +# include + +#elif defined(HAVE_SYS_BYTEORDER_H) + // Solaris +# include +# ifdef BSWAP_16 +# define bswap16(num) BSWAP_16(num) +# endif +# ifdef BSWAP_32 +# define bswap32(num) BSWAP_32(num) +# endif +# ifdef BSWAP_64 +# define bswap64(num) BSWAP_64(num) +# endif +# ifdef BE_16 +# define conv16be(num) BE_16(num) +# endif +# ifdef BE_32 +# define conv32be(num) BE_32(num) +# endif +# ifdef BE_64 +# define conv64be(num) BE_64(num) +# endif +# ifdef LE_16 +# define conv16le(num) LE_16(num) +# endif +# ifdef LE_32 +# define conv32le(num) LE_32(num) +# endif +# ifdef LE_64 +# define conv64le(num) LE_64(num) +# endif +#endif + +#ifndef bswap16 +# define bswap16(n) (uint16_t)( \ + (((n) & 0x00FFU) << 8) \ + | (((n) & 0xFF00U) >> 8) \ + ) +#endif + +#ifndef bswap32 +# define bswap32(n) (uint32_t)( \ + (((n) & UINT32_C(0x000000FF)) << 24) \ + | (((n) & UINT32_C(0x0000FF00)) << 8) \ + | (((n) & UINT32_C(0x00FF0000)) >> 8) \ + | (((n) & UINT32_C(0xFF000000)) >> 24) \ + ) +#endif + +#ifndef bswap64 +# define bswap64(n) (uint64_t)( \ + (((n) & UINT64_C(0x00000000000000FF)) << 56) \ + | (((n) & UINT64_C(0x000000000000FF00)) << 40) \ + | (((n) & UINT64_C(0x0000000000FF0000)) << 24) \ + | (((n) & UINT64_C(0x00000000FF000000)) << 8) \ + | (((n) & UINT64_C(0x000000FF00000000)) >> 8) \ + | (((n) & UINT64_C(0x0000FF0000000000)) >> 24) \ + | (((n) & UINT64_C(0x00FF000000000000)) >> 40) \ + | (((n) & UINT64_C(0xFF00000000000000)) >> 56) \ + ) +#endif + +// Define conversion macros using the basic byte swapping macros. +#ifdef WORDS_BIGENDIAN +# ifndef conv16be +# define conv16be(num) ((uint16_t)(num)) +# endif +# ifndef conv32be +# define conv32be(num) ((uint32_t)(num)) +# endif +# ifndef conv64be +# define conv64be(num) ((uint64_t)(num)) +# endif +# ifndef conv16le +# define conv16le(num) bswap16(num) +# endif +# ifndef conv32le +# define conv32le(num) bswap32(num) +# endif +# ifndef conv64le +# define conv64le(num) bswap64(num) +# endif +#else +# ifndef conv16be +# define conv16be(num) bswap16(num) +# endif +# ifndef conv32be +# define conv32be(num) bswap32(num) +# endif +# ifndef conv64be +# define conv64be(num) bswap64(num) +# endif +# ifndef conv16le +# define conv16le(num) ((uint16_t)(num)) +# endif +# ifndef conv32le +# define conv32le(num) ((uint32_t)(num)) +# endif +# ifndef conv64le +# define conv64le(num) ((uint64_t)(num)) +# endif +#endif + + +//////////////////////////////// +// Unaligned reads and writes // +//////////////////////////////// + +// The traditional way of casting e.g. *(const uint16_t *)uint8_pointer +// is bad even if the uint8_pointer is properly aligned because this kind +// of casts break strict aliasing rules and result in undefined behavior. +// With unaligned pointers it's even worse: compilers may emit vector +// instructions that require aligned pointers even if non-vector +// instructions work with unaligned pointers. +// +// Using memcpy() is the standard compliant way to do unaligned access. +// Many modern compilers inline it so there is no function call overhead. +// For those compilers that don't handle the memcpy() method well, the +// old casting method (that violates strict aliasing) can be requested at +// build time. A third method, casting to a packed struct, would also be +// an option but isn't provided to keep things simpler (it's already a mess). +// Hopefully this is flexible enough in practice. + +static inline uint16_t +read16ne(const uint8_t *buf) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + return *(const uint16_t *)buf; +#else + uint16_t num; + memcpy(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline uint32_t +read32ne(const uint8_t *buf) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + return *(const uint32_t *)buf; +#else + uint32_t num; + memcpy(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline uint64_t +read64ne(const uint8_t *buf) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + return *(const uint64_t *)buf; +#else + uint64_t num; + memcpy(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline void +write16ne(uint8_t *buf, uint16_t num) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + *(uint16_t *)buf = num; +#else + memcpy(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline void +write32ne(uint8_t *buf, uint32_t num) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + *(uint32_t *)buf = num; +#else + memcpy(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline void +write64ne(uint8_t *buf, uint64_t num) +{ +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) + *(uint64_t *)buf = num; +#else + memcpy(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline uint16_t +read16be(const uint8_t *buf) +{ +#if defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint16_t num = read16ne(buf); + return conv16be(num); +#else + uint16_t num = ((uint16_t)buf[0] << 8) | (uint16_t)buf[1]; + return num; +#endif +} + + +static inline uint16_t +read16le(const uint8_t *buf) +{ +#if !defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint16_t num = read16ne(buf); + return conv16le(num); +#else + uint16_t num = ((uint16_t)buf[0]) | ((uint16_t)buf[1] << 8); + return num; +#endif +} + + +static inline uint32_t +read32be(const uint8_t *buf) +{ +#if defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint32_t num = read32ne(buf); + return conv32be(num); +#else + uint32_t num = (uint32_t)buf[0] << 24; + num |= (uint32_t)buf[1] << 16; + num |= (uint32_t)buf[2] << 8; + num |= (uint32_t)buf[3]; + return num; +#endif +} + + +static inline uint32_t +read32le(const uint8_t *buf) +{ +#if !defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint32_t num = read32ne(buf); + return conv32le(num); +#else + uint32_t num = (uint32_t)buf[0]; + num |= (uint32_t)buf[1] << 8; + num |= (uint32_t)buf[2] << 16; + num |= (uint32_t)buf[3] << 24; + return num; +#endif +} + + +static inline uint64_t +read64be(const uint8_t *buf) +{ +#if defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint64_t num = read64ne(buf); + return conv64be(num); +#else + uint64_t num = (uint64_t)buf[0] << 56; + num |= (uint64_t)buf[1] << 48; + num |= (uint64_t)buf[2] << 40; + num |= (uint64_t)buf[3] << 32; + num |= (uint64_t)buf[4] << 24; + num |= (uint64_t)buf[5] << 16; + num |= (uint64_t)buf[6] << 8; + num |= (uint64_t)buf[7]; + return num; +#endif +} + + +static inline uint64_t +read64le(const uint8_t *buf) +{ +#if !defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) + uint64_t num = read64ne(buf); + return conv64le(num); +#else + uint64_t num = (uint64_t)buf[0]; + num |= (uint64_t)buf[1] << 8; + num |= (uint64_t)buf[2] << 16; + num |= (uint64_t)buf[3] << 24; + num |= (uint64_t)buf[4] << 32; + num |= (uint64_t)buf[5] << 40; + num |= (uint64_t)buf[6] << 48; + num |= (uint64_t)buf[7] << 56; + return num; +#endif +} + + +// NOTE: Possible byte swapping must be done in a macro to allow the compiler +// to optimize byte swapping of constants when using glibc's or *BSD's +// byte swapping macros. The actual write is done in an inline function +// to make type checking of the buf pointer possible. +#if defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) +# define write16be(buf, num) write16ne(buf, conv16be(num)) +# define write32be(buf, num) write32ne(buf, conv32be(num)) +# define write64be(buf, num) write64ne(buf, conv64be(num)) +#endif + +#if !defined(WORDS_BIGENDIAN) || defined(TUKLIB_FAST_UNALIGNED_ACCESS) +# define write16le(buf, num) write16ne(buf, conv16le(num)) +# define write32le(buf, num) write32ne(buf, conv32le(num)) +# define write64le(buf, num) write64ne(buf, conv64le(num)) +#endif + + +#ifndef write16be +static inline void +write16be(uint8_t *buf, uint16_t num) +{ + buf[0] = (uint8_t)(num >> 8); + buf[1] = (uint8_t)num; + return; +} +#endif + + +#ifndef write16le +static inline void +write16le(uint8_t *buf, uint16_t num) +{ + buf[0] = (uint8_t)num; + buf[1] = (uint8_t)(num >> 8); + return; +} +#endif + + +#ifndef write32be +static inline void +write32be(uint8_t *buf, uint32_t num) +{ + buf[0] = (uint8_t)(num >> 24); + buf[1] = (uint8_t)(num >> 16); + buf[2] = (uint8_t)(num >> 8); + buf[3] = (uint8_t)num; + return; +} +#endif + + +#ifndef write32le +static inline void +write32le(uint8_t *buf, uint32_t num) +{ + buf[0] = (uint8_t)num; + buf[1] = (uint8_t)(num >> 8); + buf[2] = (uint8_t)(num >> 16); + buf[3] = (uint8_t)(num >> 24); + return; +} +#endif + + +////////////////////////////// +// Aligned reads and writes // +////////////////////////////// + +// Separate functions for aligned reads and writes are provided since on +// strict-align archs aligned access is much faster than unaligned access. +// +// Just like in the unaligned case, memcpy() is needed to avoid +// strict aliasing violations. However, on archs that don't support +// unaligned access the compiler cannot know that the pointers given +// to memcpy() are aligned which results in slow code. As of C11 there is +// no standard way to tell the compiler that we know that the address is +// aligned but some compilers have language extensions to do that. With +// such language extensions the memcpy() method gives excellent results. +// +// What to do on a strict-align system when no known language extentensions +// are available? Falling back to byte-by-byte access would be safe but ruin +// optimizations that have been made specifically with aligned access in mind. +// As a compromise, aligned reads will fall back to non-compliant type punning +// but aligned writes will be byte-by-byte, that is, fast reads are preferred +// over fast writes. This obviously isn't great but hopefully it's a working +// compromise for now. +// +// __builtin_assume_aligned is support by GCC >= 4.7 and clang >= 3.6. +#ifdef HAVE___BUILTIN_ASSUME_ALIGNED +# define tuklib_memcpy_aligned(dest, src, size) \ + memcpy(dest, __builtin_assume_aligned(src, size), size) +#else +# define tuklib_memcpy_aligned(dest, src, size) \ + memcpy(dest, src, size) +# ifndef TUKLIB_FAST_UNALIGNED_ACCESS +# define TUKLIB_USE_UNSAFE_ALIGNED_READS 1 +# endif +#endif + + +static inline uint16_t +aligned_read16ne(const uint8_t *buf) +{ +#if defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) \ + || defined(TUKLIB_USE_UNSAFE_ALIGNED_READS) + return *(const uint16_t *)buf; +#else + uint16_t num; + tuklib_memcpy_aligned(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline uint32_t +aligned_read32ne(const uint8_t *buf) +{ +#if defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) \ + || defined(TUKLIB_USE_UNSAFE_ALIGNED_READS) + return *(const uint32_t *)buf; +#else + uint32_t num; + tuklib_memcpy_aligned(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline uint64_t +aligned_read64ne(const uint8_t *buf) +{ +#if defined(TUKLIB_USE_UNSAFE_TYPE_PUNNING) \ + || defined(TUKLIB_USE_UNSAFE_ALIGNED_READS) + return *(const uint64_t *)buf; +#else + uint64_t num; + tuklib_memcpy_aligned(&num, buf, sizeof(num)); + return num; +#endif +} + + +static inline void +aligned_write16ne(uint8_t *buf, uint16_t num) +{ +#ifdef TUKLIB_USE_UNSAFE_TYPE_PUNNING + *(uint16_t *)buf = num; +#else + tuklib_memcpy_aligned(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline void +aligned_write32ne(uint8_t *buf, uint32_t num) +{ +#ifdef TUKLIB_USE_UNSAFE_TYPE_PUNNING + *(uint32_t *)buf = num; +#else + tuklib_memcpy_aligned(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline void +aligned_write64ne(uint8_t *buf, uint64_t num) +{ +#ifdef TUKLIB_USE_UNSAFE_TYPE_PUNNING + *(uint64_t *)buf = num; +#else + tuklib_memcpy_aligned(buf, &num, sizeof(num)); +#endif + return; +} + + +static inline uint16_t +aligned_read16be(const uint8_t *buf) +{ + uint16_t num = aligned_read16ne(buf); + return conv16be(num); +} + + +static inline uint16_t +aligned_read16le(const uint8_t *buf) +{ + uint16_t num = aligned_read16ne(buf); + return conv16le(num); +} + + +static inline uint32_t +aligned_read32be(const uint8_t *buf) +{ + uint32_t num = aligned_read32ne(buf); + return conv32be(num); +} + + +static inline uint32_t +aligned_read32le(const uint8_t *buf) +{ + uint32_t num = aligned_read32ne(buf); + return conv32le(num); +} + + +static inline uint64_t +aligned_read64be(const uint8_t *buf) +{ + uint64_t num = aligned_read64ne(buf); + return conv64be(num); +} + + +static inline uint64_t +aligned_read64le(const uint8_t *buf) +{ + uint64_t num = aligned_read64ne(buf); + return conv64le(num); +} + + +// These need to be macros like in the unaligned case. +#define aligned_write16be(buf, num) aligned_write16ne((buf), conv16be(num)) +#define aligned_write16le(buf, num) aligned_write16ne((buf), conv16le(num)) +#define aligned_write32be(buf, num) aligned_write32ne((buf), conv32be(num)) +#define aligned_write32le(buf, num) aligned_write32ne((buf), conv32le(num)) +#define aligned_write64be(buf, num) aligned_write64ne((buf), conv64be(num)) +#define aligned_write64le(buf, num) aligned_write64ne((buf), conv64le(num)) + + +//////////////////// +// Bit operations // +//////////////////// + +static inline uint32_t +bsr32(uint32_t n) +{ + // Check for ICC first, since it tends to define __GNUC__ too. +#if defined(__INTEL_COMPILER) + return _bit_scan_reverse(n); + +#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX + // GCC >= 3.4 has __builtin_clz(), which gives good results on + // multiple architectures. On x86, __builtin_clz() ^ 31U becomes + // either plain BSR (so the XOR gets optimized away) or LZCNT and + // XOR (if -march indicates that SSE4a instructions are supported). + return (uint32_t)__builtin_clz(n) ^ 31U; + +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + uint32_t i; + __asm__("bsrl %1, %0" : "=r" (i) : "rm" (n)); + return i; + +#elif defined(_MSC_VER) + unsigned long i; + _BitScanReverse(&i, n); + return i; + +#else + uint32_t i = 31; + + if ((n & 0xFFFF0000) == 0) { + n <<= 16; + i = 15; + } + + if ((n & 0xFF000000) == 0) { + n <<= 8; + i -= 8; + } + + if ((n & 0xF0000000) == 0) { + n <<= 4; + i -= 4; + } + + if ((n & 0xC0000000) == 0) { + n <<= 2; + i -= 2; + } + + if ((n & 0x80000000) == 0) + --i; + + return i; +#endif +} + + +static inline uint32_t +clz32(uint32_t n) +{ +#if defined(__INTEL_COMPILER) + return _bit_scan_reverse(n) ^ 31U; + +#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX == UINT32_MAX + return (uint32_t)__builtin_clz(n); + +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + uint32_t i; + __asm__("bsrl %1, %0\n\t" + "xorl $31, %0" + : "=r" (i) : "rm" (n)); + return i; + +#elif defined(_MSC_VER) + unsigned long i; + _BitScanReverse(&i, n); + return i ^ 31U; + +#else + uint32_t i = 0; + + if ((n & 0xFFFF0000) == 0) { + n <<= 16; + i = 16; + } + + if ((n & 0xFF000000) == 0) { + n <<= 8; + i += 8; + } + + if ((n & 0xF0000000) == 0) { + n <<= 4; + i += 4; + } + + if ((n & 0xC0000000) == 0) { + n <<= 2; + i += 2; + } + + if ((n & 0x80000000) == 0) + ++i; + + return i; +#endif +} + + +static inline uint32_t +ctz32(uint32_t n) +{ +#if defined(__INTEL_COMPILER) + return _bit_scan_forward(n); + +#elif TUKLIB_GNUC_REQ(3, 4) && UINT_MAX >= UINT32_MAX + return (uint32_t)__builtin_ctz(n); + +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + uint32_t i; + __asm__("bsfl %1, %0" : "=r" (i) : "rm" (n)); + return i; + +#elif defined(_MSC_VER) + unsigned long i; + _BitScanForward(&i, n); + return i; + +#else + uint32_t i = 0; + + if ((n & 0x0000FFFF) == 0) { + n >>= 16; + i = 16; + } + + if ((n & 0x000000FF) == 0) { + n >>= 8; + i += 8; + } + + if ((n & 0x0000000F) == 0) { + n >>= 4; + i += 4; + } + + if ((n & 0x00000003) == 0) { + n >>= 2; + i += 2; + } + + if ((n & 0x00000001) == 0) + ++i; + + return i; +#endif +} + +#define bsf32 ctz32 + +#endif diff --git a/src/common/tuklib_mbstr.h b/src/common/tuklib_mbstr.h new file mode 100644 index 0000000..dde9305 --- /dev/null +++ b/src/common/tuklib_mbstr.h @@ -0,0 +1,66 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_mbstr.h +/// \brief Utility functions for handling multibyte strings +/// +/// If not enough multibyte string support is available in the C library, +/// these functions keep working with the assumption that all strings +/// are in a single-byte character set without combining characters, e.g. +/// US-ASCII or ISO-8859-*. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_MBSTR_H +#define TUKLIB_MBSTR_H + +#include "tuklib_common.h" +TUKLIB_DECLS_BEGIN + +#define tuklib_mbstr_width TUKLIB_SYMBOL(tuklib_mbstr_width) +extern size_t tuklib_mbstr_width(const char *str, size_t *bytes); +///< +/// \brief Get the number of columns needed for the multibyte string +/// +/// This is somewhat similar to wcswidth() but works on multibyte strings. +/// +/// \param str String whose width is to be calculated. If the +/// current locale uses a multibyte character set +/// that has shift states, the string must begin +/// and end in the initial shift state. +/// \param bytes If this is not NULL, *bytes is set to the +/// value returned by strlen(str) (even if an +/// error occurs when calculating the width). +/// +/// \return On success, the number of columns needed to display the +/// string e.g. in a terminal emulator is returned. On error, +/// (size_t)-1 is returned. Possible errors include invalid, +/// partial, or non-printable multibyte character in str, or +/// that str doesn't end in the initial shift state. + +#define tuklib_mbstr_fw TUKLIB_SYMBOL(tuklib_mbstr_fw) +extern int tuklib_mbstr_fw(const char *str, int columns_min); +///< +/// \brief Get the field width for printf() e.g. to align table columns +/// +/// Printing simple tables to a terminal can be done using the field field +/// feature in the printf() format string, but it works only with single-byte +/// character sets. To do the same with multibyte strings, tuklib_mbstr_fw() +/// can be used to calculate appropriate field width. +/// +/// The behavior of this function is undefined, if +/// - str is NULL or not terminated with '\0'; +/// - columns_min <= 0; or +/// - the calculated field width exceeds INT_MAX. +/// +/// \return If tuklib_mbstr_width(str, NULL) fails, -1 is returned. +/// If str needs more columns than columns_min, zero is returned. +/// Otherwise a positive integer is returned, which can be +/// used as the field width, e.g. printf("%*s", fw, str). + +TUKLIB_DECLS_END +#endif diff --git a/src/common/tuklib_mbstr_fw.c b/src/common/tuklib_mbstr_fw.c new file mode 100644 index 0000000..af80dc1 --- /dev/null +++ b/src/common/tuklib_mbstr_fw.c @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_mbstr_fw.c +/// \brief Get the field width for printf() e.g. to align table columns +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_mbstr.h" + + +extern int +tuklib_mbstr_fw(const char *str, int columns_min) +{ + size_t len; + const size_t width = tuklib_mbstr_width(str, &len); + if (width == (size_t)-1) + return -1; + + if (width > (size_t)columns_min) + return 0; + + if (width < (size_t)columns_min) + len += (size_t)columns_min - width; + + return len; +} diff --git a/src/common/tuklib_mbstr_width.c b/src/common/tuklib_mbstr_width.c new file mode 100644 index 0000000..69d159e --- /dev/null +++ b/src/common/tuklib_mbstr_width.c @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_mbstr_width.c +/// \brief Calculate width of a multibyte string +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_mbstr.h" +#include + +#if defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH) +# include +#endif + + +extern size_t +tuklib_mbstr_width(const char *str, size_t *bytes) +{ + const size_t len = strlen(str); + if (bytes != NULL) + *bytes = len; + +#if !(defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)) + // In single-byte mode, the width of the string is the same + // as its length. + return len; + +#else + mbstate_t state; + memset(&state, 0, sizeof(state)); + + size_t width = 0; + size_t i = 0; + + // Convert one multibyte character at a time to wchar_t + // and get its width using wcwidth(). + while (i < len) { + wchar_t wc; + const size_t ret = mbrtowc(&wc, str + i, len - i, &state); + if (ret < 1 || ret > len) + return (size_t)-1; + + i += ret; + + const int wc_width = wcwidth(wc); + if (wc_width < 0) + return (size_t)-1; + + width += (size_t)wc_width; + } + + // Require that the string ends in the initial shift state. + // This way the caller can be combine the string with other + // strings without needing to worry about the shift states. + if (!mbsinit(&state)) + return (size_t)-1; + + return width; +#endif +} diff --git a/src/common/tuklib_open_stdxxx.c b/src/common/tuklib_open_stdxxx.c new file mode 100644 index 0000000..26702a6 --- /dev/null +++ b/src/common/tuklib_open_stdxxx.c @@ -0,0 +1,57 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_open_stdxxx.c +/// \brief Make sure that file descriptors 0, 1, and 2 are open +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_open_stdxxx.h" + +#ifndef TUKLIB_DOSLIKE +# include +# include +# include +# include +#endif + + +extern void +tuklib_open_stdxxx(int err_status) +{ +#ifdef TUKLIB_DOSLIKE + // Do nothing, just silence warnings. + (void)err_status; + +#else + for (int i = 0; i <= 2; ++i) { + // We use fcntl() to check if the file descriptor is open. + if (fcntl(i, F_GETFD) == -1 && errno == EBADF) { + // With stdin, we could use /dev/full so that + // writing to stdin would fail. However, /dev/full + // is Linux specific, and if the program tries to + // write to stdin, there's already a problem anyway. + const int fd = open("/dev/null", O_NOCTTY + | (i == 0 ? O_WRONLY : O_RDONLY)); + + if (fd != i) { + if (fd != -1) + (void)close(fd); + + // Something went wrong. Exit with the + // exit status we were given. Don't try + // to print an error message, since stderr + // may very well be non-existent. This + // error should be extremely rare. + exit(err_status); + } + } + } +#endif + + return; +} diff --git a/src/common/tuklib_open_stdxxx.h b/src/common/tuklib_open_stdxxx.h new file mode 100644 index 0000000..b911616 --- /dev/null +++ b/src/common/tuklib_open_stdxxx.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_open_stdxxx.h +/// \brief Make sure that file descriptors 0, 1, and 2 are open +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_OPEN_STDXXX_H +#define TUKLIB_OPEN_STDXXX_H + +#include "tuklib_common.h" +TUKLIB_DECLS_BEGIN + +#define tuklib_open_stdxx TUKLIB_SYMBOL(tuklib_open_stdxxx) +extern void tuklib_open_stdxxx(int err_status); + +TUKLIB_DECLS_END +#endif diff --git a/src/common/tuklib_physmem.c b/src/common/tuklib_physmem.c new file mode 100644 index 0000000..a1bccb2 --- /dev/null +++ b/src/common/tuklib_physmem.c @@ -0,0 +1,216 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_physmem.c +/// \brief Get the amount of physical memory +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_physmem.h" + +// We want to use Windows-specific code on Cygwin, which also has memory +// information available via sysconf(), but on Cygwin 1.5 and older it +// gives wrong results (from our point of view). +#if defined(_WIN32) || defined(__CYGWIN__) +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +# include + +#elif defined(__OS2__) +# define INCL_DOSMISC +# include + +#elif defined(__DJGPP__) +# include + +#elif defined(__VMS) +# include +# include +# include + +#elif defined(AMIGA) || defined(__AROS__) +# define __USE_INLINE__ +# include + +#elif defined(__QNX__) +# include +# include + +#elif defined(TUKLIB_PHYSMEM_AIX) +# include + +#elif defined(TUKLIB_PHYSMEM_SYSCONF) +# include + +#elif defined(TUKLIB_PHYSMEM_SYSCTL) +# ifdef HAVE_SYS_PARAM_H +# include +# endif +# include + +// Tru64 +#elif defined(TUKLIB_PHYSMEM_GETSYSINFO) +# include +# include + +// HP-UX +#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC) +# include +# include + +// IRIX +#elif defined(TUKLIB_PHYSMEM_GETINVENT_R) +# include + +// This sysinfo() is Linux-specific. +#elif defined(TUKLIB_PHYSMEM_SYSINFO) +# include +#endif + + +extern uint64_t +tuklib_physmem(void) +{ + uint64_t ret = 0; + +#if defined(_WIN32) || defined(__CYGWIN__) + if ((GetVersion() & 0xFF) >= 5) { + // Windows 2000 and later have GlobalMemoryStatusEx() which + // supports reporting values greater than 4 GiB. To keep the + // code working also on older Windows versions, use + // GlobalMemoryStatusEx() conditionally. + HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); + if (kernel32 != NULL) { + typedef BOOL (WINAPI *gmse_type)(LPMEMORYSTATUSEX); + gmse_type gmse = (gmse_type)GetProcAddress( + kernel32, "GlobalMemoryStatusEx"); + if (gmse != NULL) { + MEMORYSTATUSEX meminfo; + meminfo.dwLength = sizeof(meminfo); + if (gmse(&meminfo)) + ret = meminfo.ullTotalPhys; + } + } + } + + if (ret == 0) { + // GlobalMemoryStatus() is supported by Windows 95 and later, + // so it is fine to link against it unconditionally. Note that + // GlobalMemoryStatus() has no return value. + MEMORYSTATUS meminfo; + meminfo.dwLength = sizeof(meminfo); + GlobalMemoryStatus(&meminfo); + ret = meminfo.dwTotalPhys; + } + +#elif defined(__OS2__) + unsigned long mem; + if (DosQuerySysInfo(QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, + &mem, sizeof(mem)) == 0) + ret = mem; + +#elif defined(__DJGPP__) + __dpmi_free_mem_info meminfo; + if (__dpmi_get_free_memory_information(&meminfo) == 0 + && meminfo.total_number_of_physical_pages + != (unsigned long)-1) + ret = (uint64_t)meminfo.total_number_of_physical_pages * 4096; + +#elif defined(__VMS) + int vms_mem; + int val = SYI$_MEMSIZE; + if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL) + ret = (uint64_t)vms_mem * 8192; + +#elif defined(AMIGA) || defined(__AROS__) + ret = AvailMem(MEMF_TOTAL); + +#elif defined(__QNX__) + const struct asinfo_entry *entries = SYSPAGE_ENTRY(asinfo); + size_t count = SYSPAGE_ENTRY_SIZE(asinfo) / sizeof(struct asinfo_entry); + const char *strings = SYSPAGE_ENTRY(strings)->data; + + for (size_t i = 0; i < count; ++i) + if (strcmp(strings + entries[i].name, "ram") == 0) + ret += entries[i].end - entries[i].start + 1; + +#elif defined(TUKLIB_PHYSMEM_AIX) + ret = _system_configuration.physmem; + +#elif defined(TUKLIB_PHYSMEM_SYSCONF) + const long pagesize = sysconf(_SC_PAGESIZE); + const long pages = sysconf(_SC_PHYS_PAGES); + if (pagesize != -1 && pages != -1) + // According to docs, pagesize * pages can overflow. + // Simple case is 32-bit box with 4 GiB or more RAM, + // which may report exactly 4 GiB of RAM, and "long" + // being 32-bit will overflow. Casting to uint64_t + // hopefully avoids overflows in the near future. + ret = (uint64_t)pagesize * (uint64_t)pages; + +#elif defined(TUKLIB_PHYSMEM_SYSCTL) + int name[2] = { + CTL_HW, +#ifdef HW_PHYSMEM64 + HW_PHYSMEM64 +#else + HW_PHYSMEM +#endif + }; + union { + uint32_t u32; + uint64_t u64; + } mem; + size_t mem_ptr_size = sizeof(mem.u64); + if (sysctl(name, 2, &mem.u64, &mem_ptr_size, NULL, 0) != -1) { + // IIRC, 64-bit "return value" is possible on some 64-bit + // BSD systems even with HW_PHYSMEM (instead of HW_PHYSMEM64), + // so support both. + if (mem_ptr_size == sizeof(mem.u64)) + ret = mem.u64; + else if (mem_ptr_size == sizeof(mem.u32)) + ret = mem.u32; + } + +#elif defined(TUKLIB_PHYSMEM_GETSYSINFO) + // Docs are unclear if "start" is needed, but it doesn't hurt + // much to have it. + int memkb; + int start = 0; + if (getsysinfo(GSI_PHYSMEM, (caddr_t)&memkb, sizeof(memkb), &start) + != -1) + ret = (uint64_t)memkb * 1024; + +#elif defined(TUKLIB_PHYSMEM_PSTAT_GETSTATIC) + struct pst_static pst; + if (pstat_getstatic(&pst, sizeof(pst), 1, 0) != -1) + ret = (uint64_t)pst.physical_memory * (uint64_t)pst.page_size; + +#elif defined(TUKLIB_PHYSMEM_GETINVENT_R) + inv_state_t *st = NULL; + if (setinvent_r(&st) != -1) { + inventory_t *i; + while ((i = getinvent_r(st)) != NULL) { + if (i->inv_class == INV_MEMORY + && i->inv_type == INV_MAIN_MB) { + ret = (uint64_t)i->inv_state << 20; + break; + } + } + + endinvent_r(st); + } + +#elif defined(TUKLIB_PHYSMEM_SYSINFO) + struct sysinfo si; + if (sysinfo(&si) == 0) + ret = (uint64_t)si.totalram * si.mem_unit; +#endif + + return ret; +} diff --git a/src/common/tuklib_physmem.h b/src/common/tuklib_physmem.h new file mode 100644 index 0000000..09e2a51 --- /dev/null +++ b/src/common/tuklib_physmem.h @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_physmem.h +/// \brief Get the amount of physical memory +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_PHYSMEM_H +#define TUKLIB_PHYSMEM_H + +#include "tuklib_common.h" +TUKLIB_DECLS_BEGIN + +#define tuklib_physmem TUKLIB_SYMBOL(tuklib_physmem) +extern uint64_t tuklib_physmem(void); +///< +/// \brief Get the amount of physical memory in bytes +/// +/// \return Amount of physical memory in bytes. On error, zero is +/// returned. + +TUKLIB_DECLS_END +#endif diff --git a/src/common/tuklib_progname.c b/src/common/tuklib_progname.c new file mode 100644 index 0000000..e2ef4e5 --- /dev/null +++ b/src/common/tuklib_progname.c @@ -0,0 +1,50 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_progname.c +/// \brief Program name to be displayed in messages +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tuklib_progname.h" +#include + + +#ifndef HAVE_PROGRAM_INVOCATION_NAME +char *progname = NULL; +#endif + + +extern void +tuklib_progname_init(char **argv) +{ +#ifdef TUKLIB_DOSLIKE + // On these systems, argv[0] always has the full path and .exe + // suffix even if the user just types the plain program name. + // We modify argv[0] to make it nicer to read. + + // Strip the leading path. + char *p = argv[0] + strlen(argv[0]); + while (argv[0] < p && p[-1] != '/' && p[-1] != '\\') + --p; + + argv[0] = p; + + // Strip the .exe suffix. + p = strrchr(p, '.'); + if (p != NULL) + *p = '\0'; + + // Make it lowercase. + for (p = argv[0]; *p != '\0'; ++p) + if (*p >= 'A' && *p <= 'Z') + *p = *p - 'A' + 'a'; +#endif + + progname = argv[0]; + return; +} diff --git a/src/common/tuklib_progname.h b/src/common/tuklib_progname.h new file mode 100644 index 0000000..bb80f25 --- /dev/null +++ b/src/common/tuklib_progname.h @@ -0,0 +1,32 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuklib_progname.h +/// \brief Program name to be displayed in messages +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKLIB_PROGNAME_H +#define TUKLIB_PROGNAME_H + +#include "tuklib_common.h" +#include + +TUKLIB_DECLS_BEGIN + +#ifdef HAVE_PROGRAM_INVOCATION_NAME +# define progname program_invocation_name +#else +# define progname TUKLIB_SYMBOL(tuklib_progname) + extern char *progname; +#endif + +#define tuklib_progname_init TUKLIB_SYMBOL(tuklib_progname_init) +extern void tuklib_progname_init(char **argv); + +TUKLIB_DECLS_END +#endif diff --git a/src/liblzma/.gitignore b/src/liblzma/.gitignore new file mode 100644 index 0000000..675acaa --- /dev/null +++ b/src/liblzma/.gitignore @@ -0,0 +1,218 @@ +# Aurora's general purpose JS/TS/C/C++/Go vs/vscode/intellij/codelite gitignore reference +# Almost usable for Java and Qt + +# Aurora build configuration +Build_CompilerWorkingDirectory/* +Build_Developers/* +Build_Ship/* +Build_Internal/* +Build_Develop/* +Build_Stage/* +Build_Ship/* +Build_Workspace/* +Build_Symbols/* +Build_Link/* +Build/Developers/* +Build/Ship/* +Build/Develop/* +Build/Stage/* +Build/Ship/* +Build/Workspace/* +Build/Symbols/* +Build/Link/* + +# License Headers VS extension +*.licenseheader + +# Binaries / object files +*.dll +*.exe +*.obj +*.so +*.so.* +*.la +*.lai +*.pdb +*.idb +*.exe~ +*.obj +*.dynlib +*.dylib +*.lib +*.d +*.o +*.a +*.la +*.slo +*.lo +*.out +# go unit test +*.test + +# Autogenerated project files +compile_flags.txt +*.mk +*.project +*cmake +Makefile +*.vcxproj +*.xcodeproj + +# IDE trash +.vscode +.vs +/*.gcno +.intellij +.clion +*.vcxproj.filters +*.vcxproj.user +*.tlog + +# OSX +.DS_Store +.AppleDouble +.LSOverride +xcuserdata/ + +# Win32 +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db +*.lnk + +# Linux is trash and cant hotswap like NT +.nfs* +.fuse_hidden* + +# Ninja +.ninja_deps +.ninja_log + +# PID locks +*.pid +*.pid.lock + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# JetBrains +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-*/ + +# Android Studio +.idea/caches/build_file_checksums.ser + +# why would we ever ship this dir? +.idea/caches/* + +# NodeJS +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# node-waf configuration +.lock-wscript + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# VS Code Extensions +.vscode-test + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc + +# QT cache and user files +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc + +# Java trash +hs_err_pid* +.gradle +gradle-app.setting +!gradle-wrapper.jar +.gradletasknamecache +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/liblzma/Aurora.json b/src/liblzma/Aurora.json new file mode 100644 index 0000000..f8ce00e --- /dev/null +++ b/src/liblzma/Aurora.json @@ -0,0 +1,36 @@ +{ + "name": "liblzma", + "type": "generic", + "include": ["../common", "api"], + "sources": ["rangecoder/price_table.c", + "simple/simple_coder.c ", "simple/simple_coder.h", "simple/simple_private.h", + "simple/simple_encoder.c", "simple/simple_encoder.h", + "simple/simple_decoder.c", "simple/simple_decoder.h", + "lz/**.*", + "delta/**.*", + "common/**.*", + "check/**.*", + "../common/*.*"], + "implInclude": ["./", "rangecoder", "lzma", "common", "delta", "check", "simple", "lz"], + "defines": ["HAVE_STRINGS_H", "HAVE_STDLIB_H", "HAVE_CHECK_CRC32", "HAVE_CHECK_CRC64", "HAVE_CHECK_SHA256", "HAVE__BOOL", "HAVE_STDBOOL_H", "HAVE_STDINT_H", "HAVE_ENCODER_LZMA1", "HAVE_ENCODER_LZMA2", "HAVE_DECODER_LZMA1", "HAVE_DECODER_LZMA2", "HAVE_DECODER_DELTA", "HAVE_ENCODER_DELTA"], + "excludes": ["check/crc32_small.*", "check/crc32_x86.S", "check/crc64_x86.S", "check/crc64_small.*", "../common/common_w32res.rc"], + "actions": [ + { + "filter": { + "archs": ["x86_64", "x86_32"] + }, + "then": { + "defines": ["COND_FILTER_X86", "HAVE_ENCODER_X86", "HAVE_ENCODER_X86", "HAVE_FILTER_X86", "HAVE_DECODER_X86", "HAVE_DECODER_X86"], + "sources": "simple/x86.c" + } + }, + { + "filter": { + "platforms": "win32" + }, + "then": { + "defines": ["MYTHREAD_VISTA"] + } + } + ] +} \ No newline at end of file diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h new file mode 100644 index 0000000..8fbd9a8 --- /dev/null +++ b/src/liblzma/api/lzma.h @@ -0,0 +1,327 @@ +/** + * \file api/lzma.h + * \brief The public API of liblzma data compression library + * + * liblzma is a public domain general-purpose data compression library with + * a zlib-like API. The native file format is .xz, but also the old .lzma + * format and raw (no headers) streams are supported. Multiple compression + * algorithms (filters) are supported. Currently LZMA2 is the primary filter. + * + * liblzma is part of XZ Utils . XZ Utils includes + * a gzip-like command line tool named xz and some other tools. XZ Utils + * is developed and maintained by Lasse Collin. + * + * Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK + * . + * + * The SHA-256 implementation is based on the public domain code found from + * 7-Zip , which has a modified version of the public + * domain SHA-256 code found from Crypto++ . + * The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef LZMA_H +#define LZMA_H + +/***************************** + * Required standard headers * + *****************************/ + +/* + * liblzma API headers need some standard types and macros. To allow + * including lzma.h without requiring the application to include other + * headers first, lzma.h includes the required standard headers unless + * they already seem to be included already or if LZMA_MANUAL_HEADERS + * has been defined. + * + * Here's what types and macros are needed and from which headers: + * - stddef.h: size_t, NULL + * - stdint.h: uint8_t, uint32_t, uint64_t, UINT32_C(n), uint64_C(n), + * UINT32_MAX, UINT64_MAX + * + * However, inttypes.h is a little more portable than stdint.h, although + * inttypes.h declares some unneeded things compared to plain stdint.h. + * + * The hacks below aren't perfect, specifically they assume that inttypes.h + * exists and that it typedefs at least uint8_t, uint32_t, and uint64_t, + * and that, in case of incomplete inttypes.h, unsigned int is 32-bit. + * If the application already takes care of setting up all the types and + * macros properly (for example by using gnulib's stdint.h or inttypes.h), + * we try to detect that the macros are already defined and don't include + * inttypes.h here again. However, you may define LZMA_MANUAL_HEADERS to + * force this file to never include any system headers. + * + * Some could argue that liblzma API should provide all the required types, + * for example lzma_uint64, LZMA_UINT64_C(n), and LZMA_UINT64_MAX. This was + * seen as an unnecessary mess, since most systems already provide all the + * necessary types and macros in the standard headers. + * + * Note that liblzma API still has lzma_bool, because using stdbool.h would + * break C89 and C++ programs on many systems. sizeof(bool) in C99 isn't + * necessarily the same as sizeof(bool) in C++. + */ + +#ifndef LZMA_MANUAL_HEADERS + /* + * I suppose this works portably also in C++. Note that in C++, + * we need to get size_t into the global namespace. + */ +# include + + /* + * Skip inttypes.h if we already have all the required macros. If we + * have the macros, we assume that we have the matching typedefs too. + */ +# if !defined(UINT32_C) || !defined(UINT64_C) \ + || !defined(UINT32_MAX) || !defined(UINT64_MAX) + /* + * MSVC versions older than 2013 have no C99 support, and + * thus they cannot be used to compile liblzma. Using an + * existing liblzma.dll with old MSVC can work though(*), + * but we need to define the required standard integer + * types here in a MSVC-specific way. + * + * (*) If you do this, the existing liblzma.dll probably uses + * a different runtime library than your MSVC-built + * application. Mixing runtimes is generally bad, but + * in this case it should work as long as you avoid + * the few rarely-needed liblzma functions that allocate + * memory and expect the caller to free it using free(). + */ +# if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1800 + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; +# else + /* Use the standard inttypes.h. */ +# ifdef __cplusplus + /* + * C99 sections 7.18.2 and 7.18.4 specify + * that C++ implementations define the limit + * and constant macros only if specifically + * requested. Note that if you want the + * format macros (PRIu64 etc.) too, you need + * to define __STDC_FORMAT_MACROS before + * including lzma.h, since re-including + * inttypes.h with __STDC_FORMAT_MACROS + * defined doesn't necessarily work. + */ +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS 1 +# endif +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 +# endif +# endif + +# include +# endif + + /* + * Some old systems have only the typedefs in inttypes.h, and + * lack all the macros. For those systems, we need a few more + * hacks. We assume that unsigned int is 32-bit and unsigned + * long is either 32-bit or 64-bit. If these hacks aren't + * enough, the application has to setup the types manually + * before including lzma.h. + */ +# ifndef UINT32_C +# if defined(_WIN32) && defined(_MSC_VER) +# define UINT32_C(n) n ## UI32 +# else +# define UINT32_C(n) n ## U +# endif +# endif + +# ifndef UINT64_C +# if defined(_WIN32) && defined(_MSC_VER) +# define UINT64_C(n) n ## UI64 +# else + /* Get ULONG_MAX. */ +# include +# if ULONG_MAX == 4294967295UL +# define UINT64_C(n) n ## ULL +# else +# define UINT64_C(n) n ## UL +# endif +# endif +# endif + +# ifndef UINT32_MAX +# define UINT32_MAX (UINT32_C(4294967295)) +# endif + +# ifndef UINT64_MAX +# define UINT64_MAX (UINT64_C(18446744073709551615)) +# endif +# endif +#endif /* ifdef LZMA_MANUAL_HEADERS */ + + +/****************** + * LZMA_API macro * + ******************/ + +/* + * Some systems require that the functions and function pointers are + * declared specially in the headers. LZMA_API_IMPORT is for importing + * symbols and LZMA_API_CALL is to specify the calling convention. + * + * By default it is assumed that the application will link dynamically + * against liblzma. #define LZMA_API_STATIC in your application if you + * want to link against static liblzma. If you don't care about portability + * to operating systems like Windows, or at least don't care about linking + * against static liblzma on them, don't worry about LZMA_API_STATIC. That + * is, most developers will never need to use LZMA_API_STATIC. + * + * The GCC variants are a special case on Windows (Cygwin and MinGW). + * We rely on GCC doing the right thing with its auto-import feature, + * and thus don't use __declspec(dllimport). This way developers don't + * need to worry about LZMA_API_STATIC. Also the calling convention is + * omitted on Cygwin but not on MinGW. + */ +#ifndef LZMA_API_IMPORT +# if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__) +# define LZMA_API_IMPORT __declspec(dllimport) +# else +# define LZMA_API_IMPORT +# endif +#endif + +#ifndef LZMA_API_CALL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define LZMA_API_CALL __cdecl +# else +# define LZMA_API_CALL +# endif +#endif + +#ifndef LZMA_API +# define LZMA_API(type) LZMA_API_IMPORT type LZMA_API_CALL +#endif + + +/*********** + * nothrow * + ***********/ + +/* + * None of the functions in liblzma may throw an exception. Even + * the functions that use callback functions won't throw exceptions, + * because liblzma would break if a callback function threw an exception. + */ +#ifndef lzma_nothrow +# if defined(__cplusplus) +# if __cplusplus >= 201103L || (defined(_MSVC_LANG) \ + && _MSVC_LANG >= 201103L) +# define lzma_nothrow noexcept +# else +# define lzma_nothrow throw() +# endif +# elif defined(__GNUC__) && (__GNUC__ > 3 \ + || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +# define lzma_nothrow __attribute__((__nothrow__)) +# else +# define lzma_nothrow +# endif +#endif + + +/******************** + * GNU C extensions * + ********************/ + +/* + * GNU C extensions are used conditionally in the public API. It doesn't + * break anything if these are sometimes enabled and sometimes not, only + * affects warnings and optimizations. + */ +#if defined(__GNUC__) && __GNUC__ >= 3 +# ifndef lzma_attribute +# define lzma_attribute(attr) __attribute__(attr) +# endif + + /* warn_unused_result was added in GCC 3.4. */ +# ifndef lzma_attr_warn_unused_result +# if __GNUC__ == 3 && __GNUC_MINOR__ < 4 +# define lzma_attr_warn_unused_result +# endif +# endif + +#else +# ifndef lzma_attribute +# define lzma_attribute(attr) +# endif +#endif + + +#ifndef lzma_attr_pure +# define lzma_attr_pure lzma_attribute((__pure__)) +#endif + +#ifndef lzma_attr_const +# define lzma_attr_const lzma_attribute((__const__)) +#endif + +#ifndef lzma_attr_warn_unused_result +# define lzma_attr_warn_unused_result \ + lzma_attribute((__warn_unused_result__)) +#endif + + +/************** + * Subheaders * + **************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Subheaders check that this is defined. It is to prevent including + * them directly from applications. + */ +#define LZMA_H_INTERNAL 1 + +/* Basic features */ +#include "lzma/version.h" +#include "lzma/base.h" +#include "lzma/vli.h" +#include "lzma/check.h" + +/* Filters */ +#include "lzma/filter.h" +#include "lzma/bcj.h" +#include "lzma/delta.h" +#include "lzma/lzma12.h" + +/* Container formats */ +#include "lzma/container.h" + +/* Advanced features */ +#include "lzma/stream_flags.h" +#include "lzma/block.h" +#include "lzma/index.h" +#include "lzma/index_hash.h" + +/* Hardware information */ +#include "lzma/hardware.h" + +/* + * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications + * re-including the subheaders. + */ +#undef LZMA_H_INTERNAL + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef LZMA_H */ diff --git a/src/liblzma/api/lzma/base.h b/src/liblzma/api/lzma/base.h new file mode 100644 index 0000000..ff2d869 --- /dev/null +++ b/src/liblzma/api/lzma/base.h @@ -0,0 +1,712 @@ +/** + * \file lzma/base.h + * \brief Data types and functions used in many places in liblzma API + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Boolean + * + * This is here because C89 doesn't have stdbool.h. To set a value for + * variables having type lzma_bool, you can use + * - C99's `true' and `false' from stdbool.h; + * - C++'s internal `true' and `false'; or + * - integers one (true) and zero (false). + */ +typedef unsigned char lzma_bool; + + +/** + * \brief Type of reserved enumeration variable in structures + * + * To avoid breaking library ABI when new features are added, several + * structures contain extra variables that may be used in future. Since + * sizeof(enum) can be different than sizeof(int), and sizeof(enum) may + * even vary depending on the range of enumeration constants, we specify + * a separate type to be used for reserved enumeration variables. All + * enumeration constants in liblzma API will be non-negative and less + * than 128, which should guarantee that the ABI won't break even when + * new constants are added to existing enumerations. + */ +typedef enum { + LZMA_RESERVED_ENUM = 0 +} lzma_reserved_enum; + + +/** + * \brief Return values used by several functions in liblzma + * + * Check the descriptions of specific functions to find out which return + * values they can return. With some functions the return values may have + * more specific meanings than described here; those differences are + * described per-function basis. + */ +typedef enum { + LZMA_OK = 0, + /**< + * \brief Operation completed successfully + */ + + LZMA_STREAM_END = 1, + /**< + * \brief End of stream was reached + * + * In encoder, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or + * LZMA_FINISH was finished. In decoder, this indicates + * that all the data was successfully decoded. + * + * In all cases, when LZMA_STREAM_END is returned, the last + * output bytes should be picked from strm->next_out. + */ + + LZMA_NO_CHECK = 2, + /**< + * \brief Input stream has no integrity check + * + * This return value can be returned only if the + * LZMA_TELL_NO_CHECK flag was used when initializing + * the decoder. LZMA_NO_CHECK is just a warning, and + * the decoding can be continued normally. + * + * It is possible to call lzma_get_check() immediately after + * lzma_code has returned LZMA_NO_CHECK. The result will + * naturally be LZMA_CHECK_NONE, but the possibility to call + * lzma_get_check() may be convenient in some applications. + */ + + LZMA_UNSUPPORTED_CHECK = 3, + /**< + * \brief Cannot calculate the integrity check + * + * The usage of this return value is different in encoders + * and decoders. + * + * Encoders can return this value only from the initialization + * function. If initialization fails with this value, the + * encoding cannot be done, because there's no way to produce + * output with the correct integrity check. + * + * Decoders can return this value only from lzma_code() and + * only if the LZMA_TELL_UNSUPPORTED_CHECK flag was used when + * initializing the decoder. The decoding can still be + * continued normally even if the check type is unsupported, + * but naturally the check will not be validated, and possible + * errors may go undetected. + * + * With decoder, it is possible to call lzma_get_check() + * immediately after lzma_code() has returned + * LZMA_UNSUPPORTED_CHECK. This way it is possible to find + * out what the unsupported Check ID was. + */ + + LZMA_GET_CHECK = 4, + /**< + * \brief Integrity check type is now available + * + * This value can be returned only by the lzma_code() function + * and only if the decoder was initialized with the + * LZMA_TELL_ANY_CHECK flag. LZMA_GET_CHECK tells the + * application that it may now call lzma_get_check() to find + * out the Check ID. This can be used, for example, to + * implement a decoder that accepts only files that have + * strong enough integrity check. + */ + + LZMA_MEM_ERROR = 5, + /**< + * \brief Cannot allocate memory + * + * Memory allocation failed, or the size of the allocation + * would be greater than SIZE_MAX. + * + * Due to internal implementation reasons, the coding cannot + * be continued even if more memory were made available after + * LZMA_MEM_ERROR. + */ + + LZMA_MEMLIMIT_ERROR = 6, + /** + * \brief Memory usage limit was reached + * + * Decoder would need more memory than allowed by the + * specified memory usage limit. To continue decoding, + * the memory usage limit has to be increased with + * lzma_memlimit_set(). + * + * liblzma 5.2.6 and earlier had a bug in single-threaded .xz + * decoder (lzma_stream_decoder()) which made it impossible + * to continue decoding after LZMA_MEMLIMIT_ERROR even if + * the limit was increased using lzma_memlimit_set(). + * Other decoders worked correctly. + */ + + LZMA_FORMAT_ERROR = 7, + /**< + * \brief File format not recognized + * + * The decoder did not recognize the input as supported file + * format. This error can occur, for example, when trying to + * decode .lzma format file with lzma_stream_decoder, + * because lzma_stream_decoder accepts only the .xz format. + */ + + LZMA_OPTIONS_ERROR = 8, + /**< + * \brief Invalid or unsupported options + * + * Invalid or unsupported options, for example + * - unsupported filter(s) or filter options; or + * - reserved bits set in headers (decoder only). + * + * Rebuilding liblzma with more features enabled, or + * upgrading to a newer version of liblzma may help. + */ + + LZMA_DATA_ERROR = 9, + /**< + * \brief Data is corrupt + * + * The usage of this return value is different in encoders + * and decoders. In both encoder and decoder, the coding + * cannot continue after this error. + * + * Encoders return this if size limits of the target file + * format would be exceeded. These limits are huge, thus + * getting this error from an encoder is mostly theoretical. + * For example, the maximum compressed and uncompressed + * size of a .xz Stream is roughly 8 EiB (2^63 bytes). + * + * Decoders return this error if the input data is corrupt. + * This can mean, for example, invalid CRC32 in headers + * or invalid check of uncompressed data. + */ + + LZMA_BUF_ERROR = 10, + /**< + * \brief No progress is possible + * + * This error code is returned when the coder cannot consume + * any new input and produce any new output. The most common + * reason for this error is that the input stream being + * decoded is truncated or corrupt. + * + * This error is not fatal. Coding can be continued normally + * by providing more input and/or more output space, if + * possible. + * + * Typically the first call to lzma_code() that can do no + * progress returns LZMA_OK instead of LZMA_BUF_ERROR. Only + * the second consecutive call doing no progress will return + * LZMA_BUF_ERROR. This is intentional. + * + * With zlib, Z_BUF_ERROR may be returned even if the + * application is doing nothing wrong, so apps will need + * to handle Z_BUF_ERROR specially. The above hack + * guarantees that liblzma never returns LZMA_BUF_ERROR + * to properly written applications unless the input file + * is truncated or corrupt. This should simplify the + * applications a little. + */ + + LZMA_PROG_ERROR = 11, + /**< + * \brief Programming error + * + * This indicates that the arguments given to the function are + * invalid or the internal state of the decoder is corrupt. + * - Function arguments are invalid or the structures + * pointed by the argument pointers are invalid + * e.g. if strm->next_out has been set to NULL and + * strm->avail_out > 0 when calling lzma_code(). + * - lzma_* functions have been called in wrong order + * e.g. lzma_code() was called right after lzma_end(). + * - If errors occur randomly, the reason might be flaky + * hardware. + * + * If you think that your code is correct, this error code + * can be a sign of a bug in liblzma. See the documentation + * how to report bugs. + */ + + LZMA_SEEK_NEEDED = 12, + /**< + * \brief Request to change the input file position + * + * Some coders can do random access in the input file. The + * initialization functions of these coders take the file size + * as an argument. No other coders can return LZMA_SEEK_NEEDED. + * + * When this value is returned, the application must seek to + * the file position given in lzma_stream.seek_pos. This value + * is guaranteed to never exceed the file size that was + * specified at the coder initialization. + * + * After seeking the application should read new input and + * pass it normally via lzma_stream.next_in and .avail_in. + */ + + /* + * These eumerations may be used internally by liblzma + * but they will never be returned to applications. + */ + LZMA_RET_INTERNAL1 = 101, + LZMA_RET_INTERNAL2 = 102, + LZMA_RET_INTERNAL3 = 103, + LZMA_RET_INTERNAL4 = 104, + LZMA_RET_INTERNAL5 = 105, + LZMA_RET_INTERNAL6 = 106, + LZMA_RET_INTERNAL7 = 107, + LZMA_RET_INTERNAL8 = 108 +} lzma_ret; + + +/** + * \brief The `action' argument for lzma_code() + * + * After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER, + * or LZMA_FINISH, the same `action' must is used until lzma_code() returns + * LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must + * not be modified by the application until lzma_code() returns + * LZMA_STREAM_END. Changing the `action' or modifying the amount of input + * will make lzma_code() return LZMA_PROG_ERROR. + */ +typedef enum { + LZMA_RUN = 0, + /**< + * \brief Continue coding + * + * Encoder: Encode as much input as possible. Some internal + * buffering will probably be done (depends on the filter + * chain in use), which causes latency: the input used won't + * usually be decodeable from the output of the same + * lzma_code() call. + * + * Decoder: Decode as much input as possible and produce as + * much output as possible. + */ + + LZMA_SYNC_FLUSH = 1, + /**< + * \brief Make all the input available at output + * + * Normally the encoder introduces some latency. + * LZMA_SYNC_FLUSH forces all the buffered data to be + * available at output without resetting the internal + * state of the encoder. This way it is possible to use + * compressed stream for example for communication over + * network. + * + * Only some filters support LZMA_SYNC_FLUSH. Trying to use + * LZMA_SYNC_FLUSH with filters that don't support it will + * make lzma_code() return LZMA_OPTIONS_ERROR. For example, + * LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does. + * + * Using LZMA_SYNC_FLUSH very often can dramatically reduce + * the compression ratio. With some filters (for example, + * LZMA2), fine-tuning the compression options may help + * mitigate this problem significantly (for example, + * match finder with LZMA2). + * + * Decoders don't support LZMA_SYNC_FLUSH. + */ + + LZMA_FULL_FLUSH = 2, + /**< + * \brief Finish encoding of the current Block + * + * All the input data going to the current Block must have + * been given to the encoder (the last bytes can still be + * pending in *next_in). Call lzma_code() with LZMA_FULL_FLUSH + * until it returns LZMA_STREAM_END. Then continue normally + * with LZMA_RUN or finish the Stream with LZMA_FINISH. + * + * This action is currently supported only by Stream encoder + * and easy encoder (which uses Stream encoder). If there is + * no unfinished Block, no empty Block is created. + */ + + LZMA_FULL_BARRIER = 4, + /**< + * \brief Finish encoding of the current Block + * + * This is like LZMA_FULL_FLUSH except that this doesn't + * necessarily wait until all the input has been made + * available via the output buffer. That is, lzma_code() + * might return LZMA_STREAM_END as soon as all the input + * has been consumed (avail_in == 0). + * + * LZMA_FULL_BARRIER is useful with a threaded encoder if + * one wants to split the .xz Stream into Blocks at specific + * offsets but doesn't care if the output isn't flushed + * immediately. Using LZMA_FULL_BARRIER allows keeping + * the threads busy while LZMA_FULL_FLUSH would make + * lzma_code() wait until all the threads have finished + * until more data could be passed to the encoder. + * + * With a lzma_stream initialized with the single-threaded + * lzma_stream_encoder() or lzma_easy_encoder(), + * LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH. + */ + + LZMA_FINISH = 3 + /**< + * \brief Finish the coding operation + * + * All the input data must have been given to the encoder + * (the last bytes can still be pending in next_in). + * Call lzma_code() with LZMA_FINISH until it returns + * LZMA_STREAM_END. Once LZMA_FINISH has been used, + * the amount of input must no longer be changed by + * the application. + * + * When decoding, using LZMA_FINISH is optional unless the + * LZMA_CONCATENATED flag was used when the decoder was + * initialized. When LZMA_CONCATENATED was not used, the only + * effect of LZMA_FINISH is that the amount of input must not + * be changed just like in the encoder. + */ +} lzma_action; + + +/** + * \brief Custom functions for memory handling + * + * A pointer to lzma_allocator may be passed via lzma_stream structure + * to liblzma, and some advanced functions take a pointer to lzma_allocator + * as a separate function argument. The library will use the functions + * specified in lzma_allocator for memory handling instead of the default + * malloc() and free(). C++ users should note that the custom memory + * handling functions must not throw exceptions. + * + * Single-threaded mode only: liblzma doesn't make an internal copy of + * lzma_allocator. Thus, it is OK to change these function pointers in + * the middle of the coding process, but obviously it must be done + * carefully to make sure that the replacement `free' can deallocate + * memory allocated by the earlier `alloc' function(s). + * + * Multithreaded mode: liblzma might internally store pointers to the + * lzma_allocator given via the lzma_stream structure. The application + * must not change the allocator pointer in lzma_stream or the contents + * of the pointed lzma_allocator structure until lzma_end() has been used + * to free the memory associated with that lzma_stream. The allocation + * functions might be called simultaneously from multiple threads, and + * thus they must be thread safe. + */ +typedef struct { + /** + * \brief Pointer to a custom memory allocation function + * + * If you don't want a custom allocator, but still want + * custom free(), set this to NULL and liblzma will use + * the standard malloc(). + * + * \param opaque lzma_allocator.opaque (see below) + * \param nmemb Number of elements like in calloc(). liblzma + * will always set nmemb to 1, so it is safe to + * ignore nmemb in a custom allocator if you like. + * The nmemb argument exists only for + * compatibility with zlib and libbzip2. + * \param size Size of an element in bytes. + * liblzma never sets this to zero. + * + * \return Pointer to the beginning of a memory block of + * `size' bytes, or NULL if allocation fails + * for some reason. When allocation fails, functions + * of liblzma return LZMA_MEM_ERROR. + * + * The allocator should not waste time zeroing the allocated buffers. + * This is not only about speed, but also memory usage, since the + * operating system kernel doesn't necessarily allocate the requested + * memory in physical memory until it is actually used. With small + * input files, liblzma may actually need only a fraction of the + * memory that it requested for allocation. + * + * \note LZMA_MEM_ERROR is also used when the size of the + * allocation would be greater than SIZE_MAX. Thus, + * don't assume that the custom allocator must have + * returned NULL if some function from liblzma + * returns LZMA_MEM_ERROR. + */ + void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size); + + /** + * \brief Pointer to a custom memory freeing function + * + * If you don't want a custom freeing function, but still + * want a custom allocator, set this to NULL and liblzma + * will use the standard free(). + * + * \param opaque lzma_allocator.opaque (see below) + * \param ptr Pointer returned by lzma_allocator.alloc(), + * or when it is set to NULL, a pointer returned + * by the standard malloc(). + */ + void (LZMA_API_CALL *free)(void *opaque, void *ptr); + + /** + * \brief Pointer passed to .alloc() and .free() + * + * opaque is passed as the first argument to lzma_allocator.alloc() + * and lzma_allocator.free(). This intended to ease implementing + * custom memory allocation functions for use with liblzma. + * + * If you don't need this, you should set this to NULL. + */ + void *opaque; + +} lzma_allocator; + + +/** + * \brief Internal data structure + * + * The contents of this structure is not visible outside the library. + */ +typedef struct lzma_internal_s lzma_internal; + + +/** + * \brief Passing data to and from liblzma + * + * The lzma_stream structure is used for + * - passing pointers to input and output buffers to liblzma; + * - defining custom memory handler functions; and + * - holding a pointer to coder-specific internal data structures. + * + * Typical usage: + * + * - After allocating lzma_stream (on stack or with malloc()), it must be + * initialized to LZMA_STREAM_INIT (see LZMA_STREAM_INIT for details). + * + * - Initialize a coder to the lzma_stream, for example by using + * lzma_easy_encoder() or lzma_auto_decoder(). Some notes: + * - In contrast to zlib, strm->next_in and strm->next_out are + * ignored by all initialization functions, thus it is safe + * to not initialize them yet. + * - The initialization functions always set strm->total_in and + * strm->total_out to zero. + * - If the initialization function fails, no memory is left allocated + * that would require freeing with lzma_end() even if some memory was + * associated with the lzma_stream structure when the initialization + * function was called. + * + * - Use lzma_code() to do the actual work. + * + * - Once the coding has been finished, the existing lzma_stream can be + * reused. It is OK to reuse lzma_stream with different initialization + * function without calling lzma_end() first. Old allocations are + * automatically freed. + * + * - Finally, use lzma_end() to free the allocated memory. lzma_end() never + * frees the lzma_stream structure itself. + * + * Application may modify the values of total_in and total_out as it wants. + * They are updated by liblzma to match the amount of data read and + * written but aren't used for anything else except as a possible return + * values from lzma_get_progress(). + */ +typedef struct { + const uint8_t *next_in; /**< Pointer to the next input byte. */ + size_t avail_in; /**< Number of available input bytes in next_in. */ + uint64_t total_in; /**< Total number of bytes read by liblzma. */ + + uint8_t *next_out; /**< Pointer to the next output position. */ + size_t avail_out; /**< Amount of free space in next_out. */ + uint64_t total_out; /**< Total number of bytes written by liblzma. */ + + /** + * \brief Custom memory allocation functions + * + * In most cases this is NULL which makes liblzma use + * the standard malloc() and free(). + * + * \note In 5.0.x this is not a const pointer. + */ + const lzma_allocator *allocator; + + /** Internal state is not visible to applications. */ + lzma_internal *internal; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. Excluding the initialization of this structure, + * you should not touch these, because the names of these variables + * may change. + */ + void *reserved_ptr1; + void *reserved_ptr2; + void *reserved_ptr3; + void *reserved_ptr4; + + /** + * \brief New seek input position for LZMA_SEEK_NEEDED + * + * When lzma_code() returns LZMA_SEEK_NEEDED, the new input position + * needed by liblzma will be available seek_pos. The value is + * guaranteed to not exceed the file size that was specified when + * this lzma_stream was initialized. + * + * In all other situations the value of this variable is undefined. + */ + uint64_t seek_pos; + + uint64_t reserved_int2; + size_t reserved_int3; + size_t reserved_int4; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + +} lzma_stream; + + +/** + * \brief Initialization for lzma_stream + * + * When you declare an instance of lzma_stream, you can immediately + * initialize it so that initialization functions know that no memory + * has been allocated yet: + * + * lzma_stream strm = LZMA_STREAM_INIT; + * + * If you need to initialize a dynamically allocated lzma_stream, you can use + * memset(strm_pointer, 0, sizeof(lzma_stream)). Strictly speaking, this + * violates the C standard since NULL may have different internal + * representation than zero, but it should be portable enough in practice. + * Anyway, for maximum portability, you can use something like this: + * + * lzma_stream tmp = LZMA_STREAM_INIT; + * *strm = tmp; + */ +#define LZMA_STREAM_INIT \ + { NULL, 0, 0, NULL, 0, 0, NULL, NULL, \ + NULL, NULL, NULL, NULL, 0, 0, 0, 0, \ + LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM } + + +/** + * \brief Encode or decode data + * + * Once the lzma_stream has been successfully initialized (e.g. with + * lzma_stream_encoder()), the actual encoding or decoding is done + * using this function. The application has to update strm->next_in, + * strm->avail_in, strm->next_out, and strm->avail_out to pass input + * to and get output from liblzma. + * + * See the description of the coder-specific initialization function to find + * out what `action' values are supported by the coder. + */ +extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Free memory allocated for the coder data structures + * + * \param strm Pointer to lzma_stream that is at least initialized + * with LZMA_STREAM_INIT. + * + * After lzma_end(strm), strm->internal is guaranteed to be NULL. No other + * members of the lzma_stream structure are touched. + * + * \note zlib indicates an error if application end()s unfinished + * stream structure. liblzma doesn't do this, and assumes that + * application knows what it is doing. + */ +extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow; + + +/** + * \brief Get progress information + * + * In single-threaded mode, applications can get progress information from + * strm->total_in and strm->total_out. In multi-threaded mode this is less + * useful because a significant amount of both input and output data gets + * buffered internally by liblzma. This makes total_in and total_out give + * misleading information and also makes the progress indicator updates + * non-smooth. + * + * This function gives realistic progress information also in multi-threaded + * mode by taking into account the progress made by each thread. In + * single-threaded mode *progress_in and *progress_out are set to + * strm->total_in and strm->total_out, respectively. + */ +extern LZMA_API(void) lzma_get_progress(lzma_stream *strm, + uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow; + + +/** + * \brief Get the memory usage of decoder filter chain + * + * This function is currently supported only when *strm has been initialized + * with a function that takes a memlimit argument. With other functions, you + * should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage() + * to estimate the memory requirements. + * + * This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how big + * the memory usage limit should have been to decode the input. Note that + * this may give misleading information if decoding .xz Streams that have + * multiple Blocks, because each Block can have different memory requirements. + * + * \return How much memory is currently allocated for the filter + * decoders. If no filter chain is currently allocated, + * some non-zero value is still returned, which is less than + * or equal to what any filter chain would indicate as its + * memory requirement. + * + * If this function isn't supported by *strm or some other error + * occurs, zero is returned. + */ +extern LZMA_API(uint64_t) lzma_memusage(const lzma_stream *strm) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the current memory usage limit + * + * This function is supported only when *strm has been initialized with + * a function that takes a memlimit argument. + * + * \return On success, the current memory usage limit is returned + * (always non-zero). On error, zero is returned. + */ +extern LZMA_API(uint64_t) lzma_memlimit_get(const lzma_stream *strm) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Set the memory usage limit + * + * This function is supported only when *strm has been initialized with + * a function that takes a memlimit argument. + * + * liblzma 5.2.3 and earlier has a bug where memlimit value of 0 causes + * this function to do nothing (leaving the limit unchanged) and still + * return LZMA_OK. Later versions treat 0 as if 1 had been specified (so + * lzma_memlimit_get() will return 1 even if you specify 0 here). + * + * liblzma 5.2.6 and earlier had a bug in single-threaded .xz decoder + * (lzma_stream_decoder()) which made it impossible to continue decoding + * after LZMA_MEMLIMIT_ERROR even if the limit was increased using + * lzma_memlimit_set(). Other decoders worked correctly. + * + * \return - LZMA_OK: New memory usage limit successfully set. + * - LZMA_MEMLIMIT_ERROR: The new limit is too small. + * The limit was not changed. + * - LZMA_PROG_ERROR: Invalid arguments, e.g. *strm doesn't + * support memory usage limit. + */ +extern LZMA_API(lzma_ret) lzma_memlimit_set( + lzma_stream *strm, uint64_t memlimit) lzma_nothrow; diff --git a/src/liblzma/api/lzma/bcj.h b/src/liblzma/api/lzma/bcj.h new file mode 100644 index 0000000..a1738d9 --- /dev/null +++ b/src/liblzma/api/lzma/bcj.h @@ -0,0 +1,94 @@ +/** + * \file lzma/bcj.h + * \brief Branch/Call/Jump conversion filters + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/* Filter IDs for lzma_filter.id */ + +#define LZMA_FILTER_X86 LZMA_VLI_C(0x04) + /**< + * Filter for x86 binaries + */ + +#define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05) + /**< + * Filter for Big endian PowerPC binaries + */ + +#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06) + /**< + * Filter for IA-64 (Itanium) binaries. + */ + +#define LZMA_FILTER_ARM LZMA_VLI_C(0x07) + /**< + * Filter for ARM binaries. + */ + +#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08) + /**< + * Filter for ARM-Thumb binaries. + */ + +#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09) + /**< + * Filter for SPARC binaries. + */ + +#define LZMA_FILTER_ARM64 LZMA_VLI_C(0x0A) + /**< + * Filter for ARM64 binaries. + */ + +/** + * \brief Options for BCJ filters (except ARM64) + * + * The BCJ filters never change the size of the data. Specifying options + * for them is optional: if pointer to options is NULL, default value is + * used. You probably never need to specify options to BCJ filters, so just + * set the options pointer to NULL and be happy. + * + * If options with non-default values have been specified when encoding, + * the same options must also be specified when decoding. + * + * \note At the moment, none of the BCJ filters support + * LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified, + * LZMA_OPTIONS_ERROR will be returned. If there is need, + * partial support for LZMA_SYNC_FLUSH can be added in future. + * Partial means that flushing would be possible only at + * offsets that are multiple of 2, 4, or 16 depending on + * the filter, except x86 which cannot be made to support + * LZMA_SYNC_FLUSH predictably. + */ +typedef struct { + /** + * \brief Start offset for conversions + * + * This setting is useful only when the same filter is used + * _separately_ for multiple sections of the same executable file, + * and the sections contain cross-section branch/call/jump + * instructions. In that case it is beneficial to set the start + * offset of the non-first sections so that the relative addresses + * of the cross-section branch/call/jump instructions will use the + * same absolute addresses as in the first section. + * + * When the pointer to options is NULL, the default value (zero) + * is used. + */ + uint32_t start_offset; + +} lzma_options_bcj; diff --git a/src/liblzma/api/lzma/block.h b/src/liblzma/api/lzma/block.h new file mode 100644 index 0000000..082e558 --- /dev/null +++ b/src/liblzma/api/lzma/block.h @@ -0,0 +1,578 @@ +/** + * \file lzma/block.h + * \brief .xz Block handling + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Options for the Block and Block Header encoders and decoders + * + * Different Block handling functions use different parts of this structure. + * Some read some members, other functions write, and some do both. Only the + * members listed for reading need to be initialized when the specified + * functions are called. The members marked for writing will be assigned + * new values at some point either by calling the given function or by + * later calls to lzma_code(). + */ +typedef struct { + /** + * \brief Block format version + * + * To prevent API and ABI breakages when new features are needed, + * a version number is used to indicate which fields in this + * structure are in use: + * - liblzma >= 5.0.0: version = 0 is supported. + * - liblzma >= 5.1.4beta: Support for version = 1 was added, + * which adds the ignore_check field. + * + * If version is greater than one, most Block related functions + * will return LZMA_OPTIONS_ERROR (lzma_block_header_decode() works + * with any version value). + * + * Read by: + * - All functions that take pointer to lzma_block as argument, + * including lzma_block_header_decode(). + * + * Written by: + * - lzma_block_header_decode() + */ + uint32_t version; + + /** + * \brief Size of the Block Header field + * + * This is always a multiple of four. + * + * Read by: + * - lzma_block_header_encode() + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_size() + * - lzma_block_buffer_encode() + */ + uint32_t header_size; +# define LZMA_BLOCK_HEADER_SIZE_MIN 8 +# define LZMA_BLOCK_HEADER_SIZE_MAX 1024 + + /** + * \brief Type of integrity Check + * + * The Check ID is not stored into the Block Header, thus its value + * must be provided also when decoding. + * + * Read by: + * - lzma_block_header_encode() + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_check check; + + /** + * \brief Size of the Compressed Data in bytes + * + * Encoding: If this is not LZMA_VLI_UNKNOWN, Block Header encoder + * will store this value to the Block Header. Block encoder doesn't + * care about this value, but will set it once the encoding has been + * finished. + * + * Decoding: If this is not LZMA_VLI_UNKNOWN, Block decoder will + * verify that the size of the Compressed Data field matches + * compressed_size. + * + * Usually you don't know this value when encoding in streamed mode, + * and thus cannot write this field into the Block Header. + * + * In non-streamed mode you can reserve space for this field before + * encoding the actual Block. After encoding the data, finish the + * Block by encoding the Block Header. Steps in detail: + * + * - Set compressed_size to some big enough value. If you don't know + * better, use LZMA_VLI_MAX, but remember that bigger values take + * more space in Block Header. + * + * - Call lzma_block_header_size() to see how much space you need to + * reserve for the Block Header. + * + * - Encode the Block using lzma_block_encoder() and lzma_code(). + * It sets compressed_size to the correct value. + * + * - Use lzma_block_header_encode() to encode the Block Header. + * Because space was reserved in the first step, you don't need + * to call lzma_block_header_size() anymore, because due to + * reserving, header_size has to be big enough. If it is "too big", + * lzma_block_header_encode() will add enough Header Padding to + * make Block Header to match the size specified by header_size. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_compressed_size() + * - lzma_block_unpadded_size() + * - lzma_block_total_size() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + * - lzma_block_compressed_size() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_vli compressed_size; + + /** + * \brief Uncompressed Size in bytes + * + * This is handled very similarly to compressed_size above. + * + * uncompressed_size is needed by fewer functions than + * compressed_size. This is because uncompressed_size isn't + * needed to validate that Block stays within proper limits. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + lzma_vli uncompressed_size; + + /** + * \brief Array of filters + * + * There can be 1-4 filters. The end of the array is marked with + * .id = LZMA_VLI_UNKNOWN. + * + * Read by: + * - lzma_block_header_size() + * - lzma_block_header_encode() + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + * + * Written by: + * - lzma_block_header_decode(): Note that this does NOT free() + * the old filter options structures. All unused filters[] will + * have .id == LZMA_VLI_UNKNOWN and .options == NULL. If + * decoding fails, all filters[] are guaranteed to be + * LZMA_VLI_UNKNOWN and NULL. + * + * \note Because of the array is terminated with + * .id = LZMA_VLI_UNKNOWN, the actual array must + * have LZMA_FILTERS_MAX + 1 members or the Block + * Header decoder will overflow the buffer. + */ + lzma_filter *filters; + + /** + * \brief Raw value stored in the Check field + * + * After successful coding, the first lzma_check_size(check) bytes + * of this array contain the raw value stored in the Check field. + * + * Note that CRC32 and CRC64 are stored in little endian byte order. + * Take it into account if you display the Check values to the user. + * + * Written by: + * - lzma_block_encoder() + * - lzma_block_decoder() + * - lzma_block_buffer_encode() + * - lzma_block_buffer_decode() + */ + uint8_t raw_check[LZMA_CHECK_SIZE_MAX]; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * with the currently supported options, so it is safe to leave these + * uninitialized. + */ + void *reserved_ptr1; + void *reserved_ptr2; + void *reserved_ptr3; + uint32_t reserved_int1; + uint32_t reserved_int2; + lzma_vli reserved_int3; + lzma_vli reserved_int4; + lzma_vli reserved_int5; + lzma_vli reserved_int6; + lzma_vli reserved_int7; + lzma_vli reserved_int8; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + + /** + * \brief A flag to Block decoder to not verify the Check field + * + * This field is supported by liblzma >= 5.1.4beta if .version >= 1. + * + * If this is set to true, the integrity check won't be calculated + * and verified. Unless you know what you are doing, you should + * leave this to false. (A reason to set this to true is when the + * file integrity is verified externally anyway and you want to + * speed up the decompression, which matters mostly when using + * SHA-256 as the integrity check.) + * + * If .version >= 1, read by: + * - lzma_block_decoder() + * - lzma_block_buffer_decode() + * + * Written by (.version is ignored): + * - lzma_block_header_decode() always sets this to false + */ + lzma_bool ignore_check; + + lzma_bool reserved_bool2; + lzma_bool reserved_bool3; + lzma_bool reserved_bool4; + lzma_bool reserved_bool5; + lzma_bool reserved_bool6; + lzma_bool reserved_bool7; + lzma_bool reserved_bool8; + +} lzma_block; + + +/** + * \brief Decode the Block Header Size field + * + * To decode Block Header using lzma_block_header_decode(), the size of the + * Block Header has to be known and stored into lzma_block.header_size. + * The size can be calculated from the first byte of a Block using this macro. + * Note that if the first byte is 0x00, it indicates beginning of Index; use + * this macro only when the byte is not 0x00. + * + * There is no encoding macro, because Block Header encoder is enough for that. + */ +#define lzma_block_header_size_decode(b) (((uint32_t)(b) + 1) * 4) + + +/** + * \brief Calculate Block Header Size + * + * Calculate the minimum size needed for the Block Header field using the + * settings specified in the lzma_block structure. Note that it is OK to + * increase the calculated header_size value as long as it is a multiple of + * four and doesn't exceed LZMA_BLOCK_HEADER_SIZE_MAX. Increasing header_size + * just means that lzma_block_header_encode() will add Header Padding. + * + * \return - LZMA_OK: Size calculated successfully and stored to + * block->header_size. + * - LZMA_OPTIONS_ERROR: Unsupported version, filters or + * filter options. + * - LZMA_PROG_ERROR: Invalid values like compressed_size == 0. + * + * \note This doesn't check that all the options are valid i.e. this + * may return LZMA_OK even if lzma_block_header_encode() or + * lzma_block_encoder() would fail. If you want to validate the + * filter chain, consider using lzma_memlimit_encoder() which as + * a side-effect validates the filter chain. + */ +extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Block Header + * + * The caller must have calculated the size of the Block Header already with + * lzma_block_header_size(). If a value larger than the one calculated by + * lzma_block_header_size() is used, the Block Header will be padded to the + * specified size. + * + * \param out Beginning of the output buffer. This must be + * at least block->header_size bytes. + * \param block Block options to be encoded. + * + * \return - LZMA_OK: Encoding was successful. block->header_size + * bytes were written to output buffer. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. + * - LZMA_PROG_ERROR: Invalid arguments, for example + * block->header_size is invalid or block->filters is NULL. + */ +extern LZMA_API(lzma_ret) lzma_block_header_encode( + const lzma_block *block, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Block Header + * + * block->version should (usually) be set to the highest value supported + * by the application. If the application sets block->version to a value + * higher than supported by the current liblzma version, this function will + * downgrade block->version to the highest value supported by it. Thus one + * should check the value of block->version after calling this function if + * block->version was set to a non-zero value and the application doesn't + * otherwise know that the liblzma version being used is new enough to + * support the specified block->version. + * + * The size of the Block Header must have already been decoded with + * lzma_block_header_size_decode() macro and stored to block->header_size. + * + * The integrity check type from Stream Header must have been stored + * to block->check. + * + * block->filters must have been allocated, but they don't need to be + * initialized (possible existing filter options are not freed). + * + * \param block Destination for Block options. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() (and also free() + * if an error occurs). + * \param in Beginning of the input buffer. This must be + * at least block->header_size bytes. + * + * \return - LZMA_OK: Decoding was successful. block->header_size + * bytes were read from the input buffer. + * - LZMA_OPTIONS_ERROR: The Block Header specifies some + * unsupported options such as unsupported filters. This can + * happen also if block->version was set to a too low value + * compared to what would be required to properly represent + * the information stored in the Block Header. + * - LZMA_DATA_ERROR: Block Header is corrupt, for example, + * the CRC32 doesn't match. + * - LZMA_PROG_ERROR: Invalid arguments, for example + * block->header_size is invalid or block->filters is NULL. + */ +extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block, + const lzma_allocator *allocator, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Validate and set Compressed Size according to Unpadded Size + * + * Block Header stores Compressed Size, but Index has Unpadded Size. If the + * application has already parsed the Index and is now decoding Blocks, + * it can calculate Compressed Size from Unpadded Size. This function does + * exactly that with error checking: + * + * - Compressed Size calculated from Unpadded Size must be positive integer, + * that is, Unpadded Size must be big enough that after Block Header and + * Check fields there's still at least one byte for Compressed Size. + * + * - If Compressed Size was present in Block Header, the new value + * calculated from Unpadded Size is compared against the value + * from Block Header. + * + * \note This function must be called _after_ decoding the Block Header + * field so that it can properly validate Compressed Size if it + * was present in Block Header. + * + * \return - LZMA_OK: block->compressed_size was set successfully. + * - LZMA_DATA_ERROR: unpadded_size is too small compared to + * block->header_size and lzma_check_size(block->check). + * - LZMA_PROG_ERROR: Some values are invalid. For example, + * block->header_size must be a multiple of four and + * between 8 and 1024 inclusive. + */ +extern LZMA_API(lzma_ret) lzma_block_compressed_size( + lzma_block *block, lzma_vli unpadded_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate Unpadded Size + * + * The Index field stores Unpadded Size and Uncompressed Size. The latter + * can be taken directly from the lzma_block structure after coding a Block, + * but Unpadded Size needs to be calculated from Block Header Size, + * Compressed Size, and size of the Check field. This is where this function + * is needed. + * + * \return Unpadded Size on success, or zero on error. + */ +extern LZMA_API(lzma_vli) lzma_block_unpadded_size(const lzma_block *block) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate the total encoded size of a Block + * + * This is equivalent to lzma_block_unpadded_size() except that the returned + * value includes the size of the Block Padding field. + * + * \return On success, total encoded size of the Block. On error, + * zero is returned. + */ +extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize .xz Block encoder + * + * Valid actions for lzma_code() are LZMA_RUN, LZMA_SYNC_FLUSH (only if the + * filter chain supports it), and LZMA_FINISH. + * + * \return - LZMA_OK: All good, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID + * that is not supported by this build of liblzma. Initializing + * the encoder failed. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_encoder( + lzma_stream *strm, lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Block decoder + * + * Valid actions for lzma_code() are LZMA_RUN and LZMA_FINISH. Using + * LZMA_FINISH is not required. It is supported only for convenience. + * + * \return - LZMA_OK: All good, continue with lzma_code(). + * - LZMA_PROG_ERROR + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_decoder( + lzma_stream *strm, lzma_block *block) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate maximum output size for single-call Block encoding + * + * This is equivalent to lzma_stream_buffer_bound() but for .xz Blocks. + * See the documentation of lzma_stream_buffer_bound(). + */ +extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size) + lzma_nothrow; + + +/** + * \brief Single-call .xz Block encoder + * + * In contrast to the multi-call encoder initialized with + * lzma_block_encoder(), this function encodes also the Block Header. This + * is required to make it possible to write appropriate Block Header also + * in case the data isn't compressible, and different filter chain has to be + * used to encode the data in uncompressed form using uncompressed chunks + * of the LZMA2 filter. + * + * When the data isn't compressible, header_size, compressed_size, and + * uncompressed_size are set just like when the data was compressible, but + * it is possible that header_size is too small to hold the filter chain + * specified in block->filters, because that isn't necessarily the filter + * chain that was actually used to encode the data. lzma_block_unpadded_size() + * still works normally, because it doesn't read the filters array. + * + * \param block Block options: block->version, block->check, + * and block->filters must have been initialized. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_UNSUPPORTED_CHECK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_buffer_encode( + lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call uncompressed .xz Block encoder + * + * This is like lzma_block_buffer_encode() except this doesn't try to + * compress the data and instead encodes the data using LZMA2 uncompressed + * chunks. The required output buffer size can be determined with + * lzma_block_buffer_bound(). + * + * Since the data won't be compressed, this function ignores block->filters. + * This function doesn't take lzma_allocator because this function doesn't + * allocate any memory from the heap. + */ +extern LZMA_API(lzma_ret) lzma_block_uncomp_encode(lzma_block *block, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Block decoder + * + * This is single-call equivalent of lzma_block_decoder(), and requires that + * the caller has already decoded Block Header and checked its memory usage. + * + * \param block Block options just like with lzma_block_decoder(). + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_OPTIONS_ERROR + * - LZMA_DATA_ERROR + * - LZMA_MEM_ERROR + * - LZMA_BUF_ERROR: Output buffer was too small. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_block_buffer_decode( + lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow; diff --git a/src/liblzma/api/lzma/check.h b/src/liblzma/api/lzma/check.h new file mode 100644 index 0000000..6a243db --- /dev/null +++ b/src/liblzma/api/lzma/check.h @@ -0,0 +1,150 @@ +/** + * \file lzma/check.h + * \brief Integrity checks + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Type of the integrity check (Check ID) + * + * The .xz format supports multiple types of checks that are calculated + * from the uncompressed data. They vary in both speed and ability to + * detect errors. + */ +typedef enum { + LZMA_CHECK_NONE = 0, + /**< + * No Check is calculated. + * + * Size of the Check field: 0 bytes + */ + + LZMA_CHECK_CRC32 = 1, + /**< + * CRC32 using the polynomial from the IEEE 802.3 standard + * + * Size of the Check field: 4 bytes + */ + + LZMA_CHECK_CRC64 = 4, + /**< + * CRC64 using the polynomial from the ECMA-182 standard + * + * Size of the Check field: 8 bytes + */ + + LZMA_CHECK_SHA256 = 10 + /**< + * SHA-256 + * + * Size of the Check field: 32 bytes + */ +} lzma_check; + + +/** + * \brief Maximum valid Check ID + * + * The .xz file format specification specifies 16 Check IDs (0-15). Some + * of them are only reserved, that is, no actual Check algorithm has been + * assigned. When decoding, liblzma still accepts unknown Check IDs for + * future compatibility. If a valid but unsupported Check ID is detected, + * liblzma can indicate a warning; see the flags LZMA_TELL_NO_CHECK, + * LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_TELL_ANY_CHECK in container.h. + */ +#define LZMA_CHECK_ID_MAX 15 + + +/** + * \brief Test if the given Check ID is supported + * + * Return true if the given Check ID is supported by this liblzma build. + * Otherwise false is returned. It is safe to call this with a value that + * is not in the range [0, 15]; in that case the return value is always false. + * + * You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always + * supported (even if liblzma is built with limited features). + */ +extern LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check check) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Get the size of the Check field with the given Check ID + * + * Although not all Check IDs have a check algorithm associated, the size of + * every Check is already frozen. This function returns the size (in bytes) of + * the Check field with the specified Check ID. The values are: + * { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 } + * + * If the argument is not in the range [0, 15], UINT32_MAX is returned. + */ +extern LZMA_API(uint32_t) lzma_check_size(lzma_check check) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Maximum size of a Check field + */ +#define LZMA_CHECK_SIZE_MAX 64 + + +/** + * \brief Calculate CRC32 + * + * Calculate CRC32 using the polynomial from the IEEE 802.3 standard. + * + * \param buf Pointer to the input buffer + * \param size Size of the input buffer + * \param crc Previously returned CRC value. This is used to + * calculate the CRC of a big buffer in smaller chunks. + * Set to zero when starting a new calculation. + * + * \return Updated CRC value, which can be passed to this function + * again to continue CRC calculation. + */ +extern LZMA_API(uint32_t) lzma_crc32( + const uint8_t *buf, size_t size, uint32_t crc) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate CRC64 + * + * Calculate CRC64 using the polynomial from the ECMA-182 standard. + * + * This function is used similarly to lzma_crc32(). See its documentation. + */ +extern LZMA_API(uint64_t) lzma_crc64( + const uint8_t *buf, size_t size, uint64_t crc) + lzma_nothrow lzma_attr_pure; + + +/* + * SHA-256 functions are currently not exported to public API. + * Contact Lasse Collin if you think it should be. + */ + + +/** + * \brief Get the type of the integrity check + * + * This function can be called only immediately after lzma_code() has + * returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK. + * Calling this function in any other situation has undefined behavior. + */ +extern LZMA_API(lzma_check) lzma_get_check(const lzma_stream *strm) + lzma_nothrow; diff --git a/src/liblzma/api/lzma/container.h b/src/liblzma/api/lzma/container.h new file mode 100644 index 0000000..6e432a1 --- /dev/null +++ b/src/liblzma/api/lzma/container.h @@ -0,0 +1,904 @@ +/** + * \file lzma/container.h + * \brief File formats + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/************ + * Encoding * + ************/ + +/** + * \brief Default compression preset + * + * It's not straightforward to recommend a default preset, because in some + * cases keeping the resource usage relatively low is more important that + * getting the maximum compression ratio. + */ +#define LZMA_PRESET_DEFAULT UINT32_C(6) + + +/** + * \brief Mask for preset level + * + * This is useful only if you need to extract the level from the preset + * variable. That should be rare. + */ +#define LZMA_PRESET_LEVEL_MASK UINT32_C(0x1F) + + +/* + * Preset flags + * + * Currently only one flag is defined. + */ + +/** + * \brief Extreme compression preset + * + * This flag modifies the preset to make the encoding significantly slower + * while improving the compression ratio only marginally. This is useful + * when you don't mind wasting time to get as small result as possible. + * + * This flag doesn't affect the memory usage requirements of the decoder (at + * least not significantly). The memory usage of the encoder may be increased + * a little but only at the lowest preset levels (0-3). + */ +#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31) + + +/** + * \brief Multithreading options + */ +typedef struct { + /** + * \brief Flags + * + * Set this to zero if no flags are wanted. + * + * Encoder: No flags are currently supported. + * + * Decoder: Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_TELL_ANY_CHECK, LZMA_IGNORE_CHECK, + * LZMA_CONCATENATED, LZMA_FAIL_FAST + */ + uint32_t flags; + + /** + * \brief Number of worker threads to use + */ + uint32_t threads; + + /** + * \brief Encoder only: Maximum uncompressed size of a Block + * + * The encoder will start a new .xz Block every block_size bytes. + * Using LZMA_FULL_FLUSH or LZMA_FULL_BARRIER with lzma_code() + * the caller may tell liblzma to start a new Block earlier. + * + * With LZMA2, a recommended block size is 2-4 times the LZMA2 + * dictionary size. With very small dictionaries, it is recommended + * to use at least 1 MiB block size for good compression ratio, even + * if this is more than four times the dictionary size. Note that + * these are only recommendations for typical use cases; feel free + * to use other values. Just keep in mind that using a block size + * less than the LZMA2 dictionary size is waste of RAM. + * + * Set this to 0 to let liblzma choose the block size depending + * on the compression options. For LZMA2 it will be 3*dict_size + * or 1 MiB, whichever is more. + * + * For each thread, about 3 * block_size bytes of memory will be + * allocated. This may change in later liblzma versions. If so, + * the memory usage will probably be reduced, not increased. + */ + uint64_t block_size; + + /** + * \brief Timeout to allow lzma_code() to return early + * + * Multithreading can make liblzma to consume input and produce + * output in a very bursty way: it may first read a lot of input + * to fill internal buffers, then no input or output occurs for + * a while. + * + * In single-threaded mode, lzma_code() won't return until it has + * either consumed all the input or filled the output buffer. If + * this is done in multithreaded mode, it may cause a call + * lzma_code() to take even tens of seconds, which isn't acceptable + * in all applications. + * + * To avoid very long blocking times in lzma_code(), a timeout + * (in milliseconds) may be set here. If lzma_code() would block + * longer than this number of milliseconds, it will return with + * LZMA_OK. Reasonable values are 100 ms or more. The xz command + * line tool uses 300 ms. + * + * If long blocking times are fine for you, set timeout to a special + * value of 0, which will disable the timeout mechanism and will make + * lzma_code() block until all the input is consumed or the output + * buffer has been filled. + * + * \note Even with a timeout, lzma_code() might sometimes take + * somewhat long time to return. No timing guarantees + * are made. + */ + uint32_t timeout; + + /** + * \brief Encoder only: Compression preset + * + * The preset is set just like with lzma_easy_encoder(). + * The preset is ignored if filters below is non-NULL. + */ + uint32_t preset; + + /** + * \brief Encoder only: Filter chain (alternative to a preset) + * + * If this is NULL, the preset above is used. Otherwise the preset + * is ignored and the filter chain specified here is used. + */ + const lzma_filter *filters; + + /** + * \brief Encoder only: Integrity check type + * + * See check.h for available checks. The xz command line tool + * defaults to LZMA_CHECK_CRC64, which is a good choice if you + * are unsure. + */ + lzma_check check; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * with the currently supported options, so it is safe to leave these + * uninitialized. + */ + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + + /** + * \brief Memory usage limit to reduce the number of threads + * + * Encoder: Ignored. + * + * Decoder: + * + * If the number of threads has been set so high that more than + * memlimit_threading bytes of memory would be needed, the number + * of threads will be reduced so that the memory usage will not exceed + * memlimit_threading bytes. However, if memlimit_threading cannot + * be met even in single-threaded mode, then decoding will continue + * in single-threaded mode and memlimit_threading may be exceeded + * even by a large amount. That is, memlimit_threading will never make + * lzma_code() return LZMA_MEMLIMIT_ERROR. To truly cap the memory + * usage, see memlimit_stop below. + * + * Setting memlimit_threading to UINT64_MAX or a similar huge value + * means that liblzma is allowed to keep the whole compressed file + * and the whole uncompressed file in memory in addition to the memory + * needed by the decompressor data structures used by each thread! + * In other words, a reasonable value limit must be set here or it + * will cause problems sooner or later. If you have no idea what + * a reasonable value could be, try lzma_physmem() / 4 as a starting + * point. Setting this limit will never prevent decompression of + * a file; this will only reduce the number of threads. + * + * If memlimit_threading is greater than memlimit_stop, then the value + * of memlimit_stop will be used for both. + */ + uint64_t memlimit_threading; + + /** + * \brief Memory usage limit that should never be exceeded + * + * Encoder: Ignored. + * + * Decoder: If decompressing will need more than this amount of + * memory even in the single-threaded mode, then lzma_code() will + * return LZMA_MEMLIMIT_ERROR. + */ + uint64_t memlimit_stop; + + uint64_t reserved_int7; + uint64_t reserved_int8; + void *reserved_ptr1; + void *reserved_ptr2; + void *reserved_ptr3; + void *reserved_ptr4; + +} lzma_mt; + + +/** + * \brief Calculate approximate memory usage of easy encoder + * + * This function is a wrapper for lzma_raw_encoder_memusage(). + * + * \param preset Compression preset (level and possible flags) + * + * \return Number of bytes of memory required for the given + * preset when encoding. If an error occurs, for example + * due to unsupported preset, UINT64_MAX is returned. + */ +extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate approximate decoder memory usage of a preset + * + * This function is a wrapper for lzma_raw_decoder_memusage(). + * + * \param preset Compression preset (level and possible flags) + * + * \return Number of bytes of memory required to decompress a file + * that was compressed using the given preset. If an error + * occurs, for example due to unsupported preset, UINT64_MAX + * is returned. + */ +extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize .xz Stream encoder using a preset number + * + * This function is intended for those who just want to use the basic features + * if liblzma (that is, most developers out there). + * + * \param strm Pointer to lzma_stream that is at least initialized + * with LZMA_STREAM_INIT. + * \param preset Compression preset to use. A preset consist of level + * number and zero or more flags. Usually flags aren't + * used, so preset is simply a number [0, 9] which match + * the options -0 ... -9 of the xz command line tool. + * Additional flags can be be set using bitwise-or with + * the preset level number, e.g. 6 | LZMA_PRESET_EXTREME. + * \param check Integrity check type to use. See check.h for available + * checks. The xz command line tool defaults to + * LZMA_CHECK_CRC64, which is a good choice if you are + * unsure. LZMA_CHECK_CRC32 is good too as long as the + * uncompressed file is not many gigabytes. + * + * \return - LZMA_OK: Initialization succeeded. Use lzma_code() to + * encode your data. + * - LZMA_MEM_ERROR: Memory allocation failed. + * - LZMA_OPTIONS_ERROR: The given compression preset is not + * supported by this build of liblzma. + * - LZMA_UNSUPPORTED_CHECK: The given check type is not + * supported by this liblzma build. + * - LZMA_PROG_ERROR: One or more of the parameters have values + * that will never be valid. For example, strm == NULL. + * + * If initialization fails (return value is not LZMA_OK), all the memory + * allocated for *strm by liblzma is always freed. Thus, there is no need + * to call lzma_end() after failed initialization. + * + * If initialization succeeds, use lzma_code() to do the actual encoding. + * Valid values for `action' (the second argument of lzma_code()) are + * LZMA_RUN, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, and LZMA_FINISH. In future, + * there may be compression levels or flags that don't support LZMA_SYNC_FLUSH. + */ +extern LZMA_API(lzma_ret) lzma_easy_encoder( + lzma_stream *strm, uint32_t preset, lzma_check check) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Stream encoding using a preset number + * + * The maximum required output buffer size can be calculated with + * lzma_stream_buffer_bound(). + * + * \param preset Compression preset to use. See the description + * in lzma_easy_encoder(). + * \param check Type of the integrity check to calculate from + * uncompressed data. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_UNSUPPORTED_CHECK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_easy_buffer_encode( + uint32_t preset, lzma_check check, + const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Initialize .xz Stream encoder using a custom filter chain + * + * \param strm Pointer to properly prepared lzma_stream + * \param filters Array of filters. This must be terminated with + * filters[n].id = LZMA_VLI_UNKNOWN. See filter.h for + * more information. + * \param check Type of the integrity check to calculate from + * uncompressed data. + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR + * - LZMA_UNSUPPORTED_CHECK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm, + const lzma_filter *filters, lzma_check check) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate approximate memory usage of multithreaded .xz encoder + * + * Since doing the encoding in threaded mode doesn't affect the memory + * requirements of single-threaded decompressor, you can use + * lzma_easy_decoder_memusage(options->preset) or + * lzma_raw_decoder_memusage(options->filters) to calculate + * the decompressor memory requirements. + * + * \param options Compression options + * + * \return Number of bytes of memory required for encoding with the + * given options. If an error occurs, for example due to + * unsupported preset or filter chain, UINT64_MAX is returned. + */ +extern LZMA_API(uint64_t) lzma_stream_encoder_mt_memusage( + const lzma_mt *options) lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize multithreaded .xz Stream encoder + * + * This provides the functionality of lzma_easy_encoder() and + * lzma_stream_encoder() as a single function for multithreaded use. + * + * The supported actions for lzma_code() are LZMA_RUN, LZMA_FULL_FLUSH, + * LZMA_FULL_BARRIER, and LZMA_FINISH. Support for LZMA_SYNC_FLUSH might be + * added in the future. + * + * \param strm Pointer to properly prepared lzma_stream + * \param options Pointer to multithreaded compression options + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_UNSUPPORTED_CHECK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_encoder_mt( + lzma_stream *strm, const lzma_mt *options) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .lzma encoder (legacy file format) + * + * The .lzma format is sometimes called the LZMA_Alone format, which is the + * reason for the name of this function. The .lzma format supports only the + * LZMA1 filter. There is no support for integrity checks like CRC32. + * + * Use this function if and only if you need to create files readable by + * legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format + * is strongly recommended. + * + * The valid action values for lzma_code() are LZMA_RUN and LZMA_FINISH. + * No kind of flushing is supported, because the file format doesn't make + * it possible. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_alone_encoder( + lzma_stream *strm, const lzma_options_lzma *options) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Calculate output buffer size for single-call Stream encoder + * + * When trying to compress uncompressible data, the encoded size will be + * slightly bigger than the input data. This function calculates how much + * output buffer space is required to be sure that lzma_stream_buffer_encode() + * doesn't return LZMA_BUF_ERROR. + * + * The calculated value is not exact, but it is guaranteed to be big enough. + * The actual maximum output space required may be slightly smaller (up to + * about 100 bytes). This should not be a problem in practice. + * + * If the calculated maximum size doesn't fit into size_t or would make the + * Stream grow past LZMA_VLI_MAX (which should never happen in practice), + * zero is returned to indicate the error. + * + * \note The limit calculated by this function applies only to + * single-call encoding. Multi-call encoding may (and probably + * will) have larger maximum expansion when encoding + * uncompressible data. Currently there is no function to + * calculate the maximum expansion of multi-call encoding. + */ +extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size) + lzma_nothrow; + + +/** + * \brief Single-call .xz Stream encoder + * + * \param filters Array of filters. This must be terminated with + * filters[n].id = LZMA_VLI_UNKNOWN. See filter.h + * for more information. + * \param check Type of the integrity check to calculate from + * uncompressed data. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_UNSUPPORTED_CHECK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_buffer_encode( + lzma_filter *filters, lzma_check check, + const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief MicroLZMA encoder + * + * The MicroLZMA format is a raw LZMA stream whose first byte (always 0x00) + * has been replaced with bitwise-negation of the LZMA properties (lc/lp/pb). + * This encoding ensures that the first byte of MicroLZMA stream is never + * 0x00. There is no end of payload marker and thus the uncompressed size + * must be stored separately. For the best error detection the dictionary + * size should be stored separately as well but alternatively one may use + * the uncompressed size as the dictionary size when decoding. + * + * With the MicroLZMA encoder, lzma_code() behaves slightly unusually. + * The action argument must be LZMA_FINISH and the return value will never be + * LZMA_OK. Thus the encoding is always done with a single lzma_code() after + * the initialization. The benefit of the combination of initialization + * function and lzma_code() is that memory allocations can be re-used for + * better performance. + * + * lzma_code() will try to encode as much input as is possible to fit into + * the given output buffer. If not all input can be encoded, the stream will + * be finished without encoding all the input. The caller must check both + * input and output buffer usage after lzma_code() (total_in and total_out + * in lzma_stream can be convenient). Often lzma_code() can fill the output + * buffer completely if there is a lot of input, but sometimes a few bytes + * may remain unused because the next LZMA symbol would require more space. + * + * lzma_stream.avail_out must be at least 6. Otherwise LZMA_PROG_ERROR + * will be returned. + * + * The LZMA dictionary should be reasonably low to speed up the encoder + * re-initialization. A good value is bigger than the resulting + * uncompressed size of most of the output chunks. For example, if output + * size is 4 KiB, dictionary size of 32 KiB or 64 KiB is good. If the + * data compresses extremely well, even 128 KiB may be useful. + * + * The MicroLZMA format and this encoder variant were made with the EROFS + * file system in mind. This format may be convenient in other embedded + * uses too where many small streams are needed. XZ Embedded includes a + * decoder for this format. + * + * \return - LZMA_STREAM_END: All good. Check the amounts of input used + * and output produced. Store the amount of input used + * (uncompressed size) as it needs to be known to decompress + * the data. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR: In addition to the generic reasons for this + * error code, this may also be returned if there isn't enough + * output space (6 bytes) to create a valid MicroLZMA stream. + */ +extern LZMA_API(lzma_ret) lzma_microlzma_encoder( + lzma_stream *strm, const lzma_options_lzma *options); + + +/************ + * Decoding * + ************/ + +/** + * This flag makes lzma_code() return LZMA_NO_CHECK if the input stream + * being decoded has no integrity check. Note that when used with + * lzma_auto_decoder(), all .lzma files will trigger LZMA_NO_CHECK + * if LZMA_TELL_NO_CHECK is used. + */ +#define LZMA_TELL_NO_CHECK UINT32_C(0x01) + + +/** + * This flag makes lzma_code() return LZMA_UNSUPPORTED_CHECK if the input + * stream has an integrity check, but the type of the integrity check is not + * supported by this liblzma version or build. Such files can still be + * decoded, but the integrity check cannot be verified. + */ +#define LZMA_TELL_UNSUPPORTED_CHECK UINT32_C(0x02) + + +/** + * This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type + * of the integrity check is known. The type can then be got with + * lzma_get_check(). + */ +#define LZMA_TELL_ANY_CHECK UINT32_C(0x04) + + +/** + * This flag makes lzma_code() not calculate and verify the integrity check + * of the compressed data in .xz files. This means that invalid integrity + * check values won't be detected and LZMA_DATA_ERROR won't be returned in + * such cases. + * + * This flag only affects the checks of the compressed data itself; the CRC32 + * values in the .xz headers will still be verified normally. + * + * Don't use this flag unless you know what you are doing. Possible reasons + * to use this flag: + * + * - Trying to recover data from a corrupt .xz file. + * + * - Speeding up decompression, which matters mostly with SHA-256 + * or with files that have compressed extremely well. It's recommended + * to not use this flag for this purpose unless the file integrity is + * verified externally in some other way. + * + * Support for this flag was added in liblzma 5.1.4beta. + */ +#define LZMA_IGNORE_CHECK UINT32_C(0x10) + + +/** + * This flag enables decoding of concatenated files with file formats that + * allow concatenating compressed files as is. From the formats currently + * supported by liblzma, only the .xz and .lz formats allow concatenated + * files. Concatenated files are not allowed with the legacy .lzma format. + * + * This flag also affects the usage of the `action' argument for lzma_code(). + * When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END + * unless LZMA_FINISH is used as `action'. Thus, the application has to set + * LZMA_FINISH in the same way as it does when encoding. + * + * If LZMA_CONCATENATED is not used, the decoders still accept LZMA_FINISH + * as `action' for lzma_code(), but the usage of LZMA_FINISH isn't required. + */ +#define LZMA_CONCATENATED UINT32_C(0x08) + + +/** + * This flag makes the threaded decoder report errors (like LZMA_DATA_ERROR) + * as soon as they are detected. This saves time when the application has no + * interest in a partially decompressed truncated or corrupt file. Note that + * due to timing randomness, if the same truncated or corrupt input is + * decompressed multiple times with this flag, a different amount of output + * may be produced by different runs, and even the error code might vary. + * + * When using LZMA_FAIL_FAST, it is recommended to use LZMA_FINISH to tell + * the decoder when no more input will be coming because it can help fast + * detection and reporting of truncated files. Note that in this situation + * truncated files might be diagnosed with LZMA_DATA_ERROR instead of + * LZMA_OK or LZMA_BUF_ERROR! + * + * Without this flag the threaded decoder will provide as much output as + * possible at first and then report the pending error. This default behavior + * matches the single-threaded decoder and provides repeatable behavior + * with truncated or corrupt input. There are a few special cases where the + * behavior can still differ like memory allocation failures (LZMA_MEM_ERROR). + * + * Single-threaded decoders currently ignore this flag. + * + * Support for this flag was added in liblzma 5.3.3alpha. Note that in older + * versions this flag isn't supported (LZMA_OPTIONS_ERROR) even by functions + * that ignore this flag in newer liblzma versions. + */ +#define LZMA_FAIL_FAST UINT32_C(0x20) + + +/** + * \brief Initialize .xz Stream decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Memory usage limit as bytes. Use UINT64_MAX + * to effectively disable the limiter. liblzma + * 5.2.3 and earlier don't allow 0 here and return + * LZMA_PROG_ERROR; later versions treat 0 as if 1 + * had been specified. + * \param flags Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_TELL_ANY_CHECK, LZMA_IGNORE_CHECK, + * LZMA_CONCATENATED, LZMA_FAIL_FAST + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_OPTIONS_ERROR: Unsupported flags + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_decoder( + lzma_stream *strm, uint64_t memlimit, uint32_t flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize multithreaded .xz Stream decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param options Pointer to multithreaded compression options + * + * The decoder can decode multiple Blocks in parallel. This requires that each + * Block Header contains the Compressed Size and Uncompressed size fields + * which are added by the multi-threaded encoder, see lzma_stream_encoder_mt(). + * + * A Stream with one Block will only utilize one thread. A Stream with multiple + * Blocks but without size information in Block Headers will be processed in + * single-threaded mode in the same way as done by lzma_stream_decoder(). + * Concatenated Streams are processed one Stream at a time; no inter-Stream + * parallelization is done. + * + * This function behaves like lzma_stream_decoder() when options->threads == 1 + * and options->memlimit_threading <= 1. + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * - LZMA_OPTIONS_ERROR: Unsupported flags. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_decoder_mt( + lzma_stream *strm, const lzma_mt *options) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode .xz, .lzma, and .lz (lzip) files with autodetection + * + * This decoder autodetects between the .xz, .lzma, and .lz file formats, + * and calls lzma_stream_decoder(), lzma_alone_decoder(), or + * lzma_lzip_decoder() once the type of the input file has been detected. + * + * Support for .lz was added in 5.4.0. + * + * If the flag LZMA_CONCATENATED is used and the input is a .lzma file: + * For historical reasons concatenated .lzma files aren't supported. + * If there is trailing data after one .lzma stream, lzma_code() will + * return LZMA_DATA_ERROR. (lzma_alone_decoder() doesn't have such a check + * as it doesn't support any decoder flags. It will return LZMA_STREAM_END + * after one .lzma stream.) + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Memory usage limit as bytes. Use UINT64_MAX + * to effectively disable the limiter. liblzma + * 5.2.3 and earlier don't allow 0 here and return + * LZMA_PROG_ERROR; later versions treat 0 as if 1 + * had been specified. + * \param flags Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_TELL_ANY_CHECK, LZMA_IGNORE_CHECK, + * LZMA_CONCATENATED, LZMA_FAIL_FAST + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_OPTIONS_ERROR: Unsupported flags + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_auto_decoder( + lzma_stream *strm, uint64_t memlimit, uint32_t flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .lzma decoder (legacy file format) + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Memory usage limit as bytes. Use UINT64_MAX + * to effectively disable the limiter. liblzma + * 5.2.3 and earlier don't allow 0 here and return + * LZMA_PROG_ERROR; later versions treat 0 as if 1 + * had been specified. + * + * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. + * There is no need to use LZMA_FINISH, but it's allowed because it may + * simplify certain types of applications. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_alone_decoder( + lzma_stream *strm, uint64_t memlimit) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .lz (lzip) decoder (a foreign file format) + * + * \param strm Pointer to properly prepared lzma_stream + * \param memlimit Memory usage limit as bytes. Use UINT64_MAX + * to effectively disable the limiter. + * \param flags Bitwise-or of flags, or zero for no flags. + * All decoder flags listed above are supported + * although only LZMA_CONCATENATED and (in very rare + * cases) LZMA_IGNORE_CHECK are actually useful. + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * and LZMA_FAIL_FAST do nothing. LZMA_TELL_ANY_CHECK + * is supported for consistency only as CRC32 is + * always used in the .lz format. + * + * This decoder supports the .lz format version 0 and the unextended .lz + * format version 1: + * + * - Files in the format version 0 were produced by lzip 1.3 and older. + * Such files aren't common but may be found from file archives + * as a few source packages were released in this format. People + * might have old personal files in this format too. Decompression + * support for the format version 0 was removed in lzip 1.18. + * + * - lzip 1.3 added decompression support for .lz format version 1 files. + * Compression support was added in lzip 1.4. In lzip 1.6 the .lz format + * version 1 was extended to support the Sync Flush marker. This extension + * is not supported by liblzma. lzma_code() will return LZMA_DATA_ERROR + * at the location of the Sync Flush marker. In practice files with + * the Sync Flush marker are very rare and thus liblzma can decompress + * almost all .lz files. + * + * Just like with lzma_stream_decoder() for .xz files, LZMA_CONCATENATED + * should be used when decompressing normal standalone .lz files. + * + * The .lz format allows putting non-.lz data at the end of a file after at + * least one valid .lz member. That is, one can append custom data at the end + * of a .lz file and the decoder is required to ignore it. In liblzma this + * is relevant only when LZMA_CONCATENATED is used. In that case lzma_code() + * will return LZMA_STREAM_END and leave lzma_stream.next_in pointing to + * the first byte of the non-.lz data. An exception to this is if the first + * 1-3 bytes of the non-.lz data are identical to the .lz magic bytes + * (0x4C, 0x5A, 0x49, 0x50; "LZIP" in US-ASCII). In such a case the 1-3 bytes + * will have been ignored by lzma_code(). If one wishes to locate the non-.lz + * data reliably, one must ensure that the first byte isn't 0x4C. Actually + * one should ensure that none of the first four bytes of trailing data are + * equal to the magic bytes because lzip >= 1.20 requires it by default. + * + * \return - LZMA_OK: Initialization was successful. + * - LZMA_MEM_ERROR: Cannot allocate memory. + * - LZMA_OPTIONS_ERROR: Unsupported flags + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_lzip_decoder( + lzma_stream *strm, uint64_t memlimit, uint32_t flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Stream decoder + * + * \param memlimit Pointer to how much memory the decoder is allowed + * to allocate. The value pointed by this pointer is + * modified if and only if LZMA_MEMLIMIT_ERROR is + * returned. + * \param flags Bitwise-or of zero or more of the decoder flags: + * LZMA_TELL_NO_CHECK, LZMA_TELL_UNSUPPORTED_CHECK, + * LZMA_IGNORE_CHECK, LZMA_CONCATENATED, + * LZMA_FAIL_FAST. Note that LZMA_TELL_ANY_CHECK + * is not allowed and will return LZMA_PROG_ERROR. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if decoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_DATA_ERROR + * - LZMA_NO_CHECK: This can be returned only if using + * the LZMA_TELL_NO_CHECK flag. + * - LZMA_UNSUPPORTED_CHECK: This can be returned only if using + * the LZMA_TELL_UNSUPPORTED_CHECK flag. + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * The minimum required memlimit value was stored to *memlimit. + * - LZMA_BUF_ERROR: Output buffer was too small. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_stream_buffer_decode( + uint64_t *memlimit, uint32_t flags, + const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief MicroLZMA decoder + * + * See lzma_microlzma_decoder() for more information. + * + * The lzma_code() usage with this decoder is completely normal. The + * special behavior of lzma_code() applies to lzma_microlzma_encoder() only. + * + * \param strm Pointer to properly prepared lzma_stream + * \param comp_size Compressed size of the MicroLZMA stream. + * The caller must somehow know this exactly. + * \param uncomp_size Uncompressed size of the MicroLZMA stream. + * If the exact uncompressed size isn't known, this + * can be set to a value that is at most as big as + * the exact uncompressed size would be, but then the + * next argument uncomp_size_is_exact must be false. + * \param uncomp_size_is_exact + * If true, uncomp_size must be exactly correct. + * This will improve error detection at the end of + * the stream. If the exact uncompressed size isn't + * known, this must be false. uncomp_size must still + * be at most as big as the exact uncompressed size + * is. Setting this to false when the exact size is + * known will work but error detection at the end of + * the stream will be weaker. + * \param dict_size LZMA dictionary size that was used when + * compressing the data. It is OK to use a bigger + * value too but liblzma will then allocate more + * memory than would actually be required and error + * detection will be slightly worse. (Note that with + * the implementation in XZ Embedded it doesn't + * affect the memory usage if one specifies bigger + * dictionary than actually required.) + */ +extern LZMA_API(lzma_ret) lzma_microlzma_decoder( + lzma_stream *strm, uint64_t comp_size, + uint64_t uncomp_size, lzma_bool uncomp_size_is_exact, + uint32_t dict_size); diff --git a/src/liblzma/api/lzma/delta.h b/src/liblzma/api/lzma/delta.h new file mode 100644 index 0000000..592fc4f --- /dev/null +++ b/src/liblzma/api/lzma/delta.h @@ -0,0 +1,77 @@ +/** + * \file lzma/delta.h + * \brief Delta filter + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Filter ID + * + * Filter ID of the Delta filter. This is used as lzma_filter.id. + */ +#define LZMA_FILTER_DELTA LZMA_VLI_C(0x03) + + +/** + * \brief Type of the delta calculation + * + * Currently only byte-wise delta is supported. Other possible types could + * be, for example, delta of 16/32/64-bit little/big endian integers, but + * these are not currently planned since byte-wise delta is almost as good. + */ +typedef enum { + LZMA_DELTA_TYPE_BYTE +} lzma_delta_type; + + +/** + * \brief Options for the Delta filter + * + * These options are needed by both encoder and decoder. + */ +typedef struct { + /** For now, this must always be LZMA_DELTA_TYPE_BYTE. */ + lzma_delta_type type; + + /** + * \brief Delta distance + * + * With the only currently supported type, LZMA_DELTA_TYPE_BYTE, + * the distance is as bytes. + * + * Examples: + * - 16-bit stereo audio: distance = 4 bytes + * - 24-bit RGB image data: distance = 3 bytes + */ + uint32_t dist; +# define LZMA_DELTA_DIST_MIN 1 +# define LZMA_DELTA_DIST_MAX 256 + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * when type is LZMA_DELTA_TYPE_BYTE, so it is safe to leave these + * uninitialized. + */ + uint32_t reserved_int1; + uint32_t reserved_int2; + uint32_t reserved_int3; + uint32_t reserved_int4; + void *reserved_ptr1; + void *reserved_ptr2; + +} lzma_options_delta; diff --git a/src/liblzma/api/lzma/filter.h b/src/liblzma/api/lzma/filter.h new file mode 100644 index 0000000..58c83bf --- /dev/null +++ b/src/liblzma/api/lzma/filter.h @@ -0,0 +1,714 @@ +/** + * \file lzma/filter.h + * \brief Common filter related types and functions + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Maximum number of filters in a chain + * + * A filter chain can have 1-4 filters, of which three are allowed to change + * the size of the data. Usually only one or two filters are needed. + */ +#define LZMA_FILTERS_MAX 4 + + +/** + * \brief Filter options + * + * This structure is used to pass Filter ID and a pointer filter's + * options to liblzma. A few functions work with a single lzma_filter + * structure, while most functions expect a filter chain. + * + * A filter chain is indicated with an array of lzma_filter structures. + * The array is terminated with .id = LZMA_VLI_UNKNOWN. Thus, the filter + * array must have LZMA_FILTERS_MAX + 1 elements (that is, five) to + * be able to hold any arbitrary filter chain. This is important when + * using lzma_block_header_decode() from block.h, because too small + * array would make liblzma write past the end of the filters array. + */ +typedef struct { + /** + * \brief Filter ID + * + * Use constants whose name begin with `LZMA_FILTER_' to specify + * different filters. In an array of lzma_filter structures, use + * LZMA_VLI_UNKNOWN to indicate end of filters. + * + * \note This is not an enum, because on some systems enums + * cannot be 64-bit. + */ + lzma_vli id; + + /** + * \brief Pointer to filter-specific options structure + * + * If the filter doesn't need options, set this to NULL. If id is + * set to LZMA_VLI_UNKNOWN, options is ignored, and thus + * doesn't need be initialized. + */ + void *options; + +} lzma_filter; + + +/** + * \brief Test if the given Filter ID is supported for encoding + * + * Return true if the give Filter ID is supported for encoding by this + * liblzma build. Otherwise false is returned. + * + * There is no way to list which filters are available in this particular + * liblzma version and build. It would be useless, because the application + * couldn't know what kind of options the filter would need. + */ +extern LZMA_API(lzma_bool) lzma_filter_encoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Test if the given Filter ID is supported for decoding + * + * Return true if the give Filter ID is supported for decoding by this + * liblzma build. Otherwise false is returned. + */ +extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Copy the filters array + * + * Copy the Filter IDs and filter-specific options from src to dest. + * Up to LZMA_FILTERS_MAX filters are copied, plus the terminating + * .id == LZMA_VLI_UNKNOWN. Thus, dest should have at least + * LZMA_FILTERS_MAX + 1 elements space unless the caller knows that + * src is smaller than that. + * + * Unless the filter-specific options is NULL, the Filter ID has to be + * supported by liblzma, because liblzma needs to know the size of every + * filter-specific options structure. The filter-specific options are not + * validated. If options is NULL, any unsupported Filter IDs are copied + * without returning an error. + * + * Old filter-specific options in dest are not freed, so dest doesn't + * need to be initialized by the caller in any way. + * + * If an error occurs, memory possibly already allocated by this function + * is always freed. liblzma versions older than 5.2.7 may modify the dest + * array and leave its contents in an undefined state if an error occurs. + * liblzma 5.2.7 and newer only modify the dest array when returning LZMA_OK. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR: Unsupported Filter ID and its options + * is not NULL. + * - LZMA_PROG_ERROR: src or dest is NULL. + */ +extern LZMA_API(lzma_ret) lzma_filters_copy( + const lzma_filter *src, lzma_filter *dest, + const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Free the options in the array of lzma_filter structures + * + * This frees the filter chain options. The filters array itself is not freed. + * + * The filters array must have at most LZMA_FILTERS_MAX + 1 elements + * including the terminating element which must have .id = LZMA_VLI_UNKNOWN. + * For all elements before the terminating element: + * - options will be freed using the given lzma_allocator or, + * if allocator is NULL, using free(). + * - options will be set to NULL. + * - id will be set to LZMA_VLI_UNKNOWN. + * + * If filters is NULL, this does nothing but remember that this never frees + * the filters array itself. + */ +extern LZMA_API(void) lzma_filters_free( + lzma_filter *filters, const lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Calculate approximate memory requirements for raw encoder + * + * This function can be used to calculate the memory requirements for + * Block and Stream encoders too because Block and Stream encoders don't + * need significantly more memory than raw encoder. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Number of bytes of memory required for the given + * filter chain when encoding. If an error occurs, + * for example due to unsupported filter chain, + * UINT64_MAX is returned. + */ +extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Calculate approximate memory requirements for raw decoder + * + * This function can be used to calculate the memory requirements for + * Block and Stream decoders too because Block and Stream decoders don't + * need significantly more memory than raw decoder. + * + * \param filters Array of filters terminated with + * .id == LZMA_VLI_UNKNOWN. + * + * \return Number of bytes of memory required for the given + * filter chain when decoding. If an error occurs, + * for example due to unsupported filter chain, + * UINT64_MAX is returned. + */ +extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize raw encoder + * + * This function may be useful when implementing custom file formats. + * + * \param strm Pointer to properly prepared lzma_stream + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * + * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the + * filter chain supports it), or LZMA_FINISH. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_encoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize raw decoder + * + * The initialization of raw decoder goes similarly to raw encoder. + * + * The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using + * LZMA_FINISH is not required, it is supported just for convenience. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_raw_decoder( + lzma_stream *strm, const lzma_filter *filters) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Update the filter chain in the encoder + * + * This function may be called after lzma_code() has returned LZMA_STREAM_END + * when LZMA_FULL_BARRIER, LZMA_FULL_FLUSH, or LZMA_SYNC_FLUSH was used: + * + * - After LZMA_FULL_BARRIER or LZMA_FULL_FLUSH: Single-threaded .xz Stream + * encoder (lzma_stream_encoder()) and (since liblzma 5.4.0) multi-threaded + * Stream encoder (lzma_stream_encoder_mt()) allow setting a new filter + * chain to be used for the next Block(s). + * + * - After LZMA_SYNC_FLUSH: Raw encoder (lzma_raw_encoder()), + * Block encocder (lzma_block_encoder()), and single-threaded .xz Stream + * encoder (lzma_stream_encoder()) allow changing certain filter-specific + * options in the middle of encoding. The actual filters in the chain + * (Filter IDs) must not be changed! Currently only the lc, lp, and pb + * options of LZMA2 (not LZMA1) can be changed this way. + * + * - In the future some filters might allow changing some of their options + * without any barrier or flushing but currently such filters don't exist. + * + * This function may also be called when no data has been compressed yet + * although this is rarely useful. In that case, this function will behave + * as if LZMA_FULL_FLUSH (Stream encoders) or LZMA_SYNC_FLUSH (Raw or Block + * encoder) had been used right before calling this function. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_filters_update( + lzma_stream *strm, const lzma_filter *filters) lzma_nothrow; + + +/** + * \brief Single-call raw encoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_size Size of the input buffer + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Not enough output buffer space. + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + * + * \note There is no function to calculate how big output buffer + * would surely be big enough. (lzma_stream_buffer_bound() + * works only for lzma_stream_buffer_encode(); raw encoder + * won't necessarily meet that bound.) + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_encode( + const lzma_filter *filters, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, uint8_t *out, + size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call raw decoder + * + * \param filters Array of lzma_filter structures. The end of the + * array must be marked with .id = LZMA_VLI_UNKNOWN. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + */ +extern LZMA_API(lzma_ret) lzma_raw_buffer_decode( + const lzma_filter *filters, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Get the size of the Filter Properties field + * + * This function may be useful when implementing custom file formats + * using the raw encoder and decoder. + * + * \param size Pointer to uint32_t to hold the size of the properties + * \param filter Filter ID and options (the size of the properties may + * vary depending on the options) + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note This function validates the Filter ID, but does not + * necessarily validate the options. Thus, it is possible + * that this returns LZMA_OK while the following call to + * lzma_properties_encode() returns LZMA_OPTIONS_ERROR. + */ +extern LZMA_API(lzma_ret) lzma_properties_size( + uint32_t *size, const lzma_filter *filter) lzma_nothrow; + + +/** + * \brief Encode the Filter Properties field + * + * \param filter Filter ID and options + * \param props Buffer to hold the encoded options. The size of + * buffer must have been already determined with + * lzma_properties_size(). + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_PROG_ERROR + * + * \note Even this function won't validate more options than actually + * necessary. Thus, it is possible that encoding the properties + * succeeds but using the same options to initialize the encoder + * will fail. + * + * \note If lzma_properties_size() indicated that the size + * of the Filter Properties field is zero, calling + * lzma_properties_encode() is not required, but it + * won't do any harm either. + */ +extern LZMA_API(lzma_ret) lzma_properties_encode( + const lzma_filter *filter, uint8_t *props) lzma_nothrow; + + +/** + * \brief Decode the Filter Properties field + * + * \param filter filter->id must have been set to the correct + * Filter ID. filter->options doesn't need to be + * initialized (it's not freed by this function). The + * decoded options will be stored in filter->options; + * it's application's responsibility to free it when + * appropriate. filter->options is set to NULL if + * there are no properties or if an error occurs. + * \param allocator Custom memory allocator used to allocate the + * options. Set to NULL to use the default malloc(), + * and in case of an error, also free(). + * \param props Input buffer containing the properties. + * \param props_size Size of the properties. This must be the exact + * size; giving too much or too little input will + * return LZMA_OPTIONS_ERROR. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + */ +extern LZMA_API(lzma_ret) lzma_properties_decode( + lzma_filter *filter, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) lzma_nothrow; + + +/** + * \brief Calculate encoded size of a Filter Flags field + * + * Knowing the size of Filter Flags is useful to know when allocating + * memory to hold the encoded Filter Flags. + * + * \param size Pointer to integer to hold the calculated size + * \param filter Filter ID and associated options whose encoded + * size is to be calculated + * + * \return - LZMA_OK: *size set successfully. Note that this doesn't + * guarantee that filter->options is valid, thus + * lzma_filter_flags_encode() may still fail. + * - LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options. + * - LZMA_PROG_ERROR: Invalid options + * + * \note If you need to calculate size of List of Filter Flags, + * you need to loop over every lzma_filter entry. + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_size( + uint32_t *size, const lzma_filter *filter) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Filter Flags into given buffer + * + * In contrast to some functions, this doesn't allocate the needed buffer. + * This is due to how this function is used internally by liblzma. + * + * \param filter Filter ID and options to be encoded + * \param out Beginning of the output buffer + * \param out_pos out[*out_pos] is the next write position. This + * is updated by the encoder. + * \param out_size out[out_size] is the first byte to not write. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. + * - LZMA_PROG_ERROR: Invalid options or not enough output + * buffer space (you should have checked it with + * lzma_filter_flags_size()). + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filter, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Filter Flags from given buffer + * + * The decoded result is stored into *filter. The old value of + * filter->options is not free()d. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_filter_flags_decode( + lzma_filter *filter, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/*********** + * Strings * + ***********/ + +/** + * \brief Allow or show all filters + * + * By default only the filters supported in the .xz format are accept by + * lzma_str_to_filters() or shown by lzma_str_list_filters(). + */ +#define LZMA_STR_ALL_FILTERS UINT32_C(0x01) + + +/** + * \brief Do not validate the filter chain in lzma_str_to_filters() + * + * By default lzma_str_to_filters() can return an error if the filter chain + * as a whole isn't usable in the .xz format or in the raw encoder or decoder. + * With this flag the validation is skipped (this doesn't affect the handling + * of the individual filter options). + */ +#define LZMA_STR_NO_VALIDATION UINT32_C(0x02) + + +/** + * \brief Stringify encoder options + * + * Show the filter-specific options that the encoder will use. + * This may be useful for verbose diagnostic messages. + * + * Note that if options were decoded from .xz headers then the encoder options + * may be undefined. This flag shouldn't be used in such a situation. + */ +#define LZMA_STR_ENCODER UINT32_C(0x10) + + +/** + * \brief Stringify decoder options + * + * Show the filter-specific options that the decoder will use. + * This may be useful for showing what filter options were decoded + * from file headers. + */ +#define LZMA_STR_DECODER UINT32_C(0x20) + + +/** + * \brief Produce xz-compatible getopt_long() syntax + * + * That is, "delta:dist=2 lzma2:dict=4MiB,pb=1,lp=1" becomes + * "--delta=dist=2 --lzma2=dict=4MiB,pb=1,lp=1". + * + * This syntax is compatible with xz 5.0.0 as long as the filters and + * their options are supported too. + */ +#define LZMA_STR_GETOPT_LONG UINT32_C(0x40) + + +/** + * \brief Use two dashes "--" instead of a space to separate filters + * + * That is, "delta:dist=2 lzma2:pb=1,lp=1" becomes + * "delta:dist=2--lzma2:pb=1,lp=1". This looks slightly odd but this + * kind of strings should be usable on the command line without quoting. + * However, it is possible that future versions with new filter options + * might produce strings that require shell quoting anyway as the exact + * set of possible characters isn't frozen for now. + * + * It is guaranteed that the single quote (') will never be used in + * filter chain strings (even if LZMA_STR_NO_SPACES isn't used). + */ +#define LZMA_STR_NO_SPACES UINT32_C(0x80) + + +/** + * \brief Convert a string to a filter chain + * + * This tries to make it easier to write applications that allow users + * to set custom compression options. This only handles the filter + * configuration (including presets) but not the number of threads, + * block size, check type, or memory limits. + * + * The input string can be either a preset or a filter chain. Presets + * begin with a digit 0-9 and may be followed by zero or more flags + * which are lower-case letters. Currently only "e" is supported, matching + * LZMA_PRESET_EXTREME. For partial xz command line syntax compatibility, + * a preset string may start with a single dash "-". + * + * A filter chain consists of one or more "filtername:opt1=value1,opt2=value2" + * strings separated by one or more spaces. Leading and trailing spaces are + * ignored. All names and values must be lower-case. Extra commas in the + * option list are ignored. The order of filters is significant: when + * encoding, the uncompressed input data goes to the leftmost filter first. + * Normally "lzma2" is the last filter in the chain. + * + * If one wishes to avoid spaces, for example, to avoid shell quoting, + * it is possible to use two dashes "--" instead of spaces to separate + * the filters. + * + * For xz command line compatibility, each filter may be prefixed with + * two dashes "--" and the colon ":" separating the filter name from + * the options may be replaced with an equals sign "=". + * + * By default, only filters that can be used in the .xz format are accepted. + * To allow all filters (LZMA1) use the flag LZMA_STR_ALL_FILTERS. + * + * By default, very basic validation is done for the filter chain as a whole, + * for example, that LZMA2 is only used as the last filter in the chain. + * The validation isn't perfect though and it's possible that this function + * succeeds but using the filter chain for encoding or decoding will still + * result in LZMA_OPTIONS_ERROR. To disable this validation, use the flag + * LZMA_STR_NO_VALIDATION. + * + * The available filter names and their options are available via + * lzma_str_list_filters(). See the xz man page for the description + * of filter names and options. + * + * \param str User-supplied string describing a preset or + * a filter chain. If a default value is needed and + * you don't know what would be good, use "6" since + * that is the default preset in xz too. + * \param error_pos If this isn't NULL, this value will be set on + * both success and on all errors. This tells the + * location of the error in the string. This is + * an int to make it straightforward to use this + * as printf() field width. The value is guaranteed + * to be in the range [0, INT_MAX] even if strlen(str) + * somehow was greater than INT_MAX. + * \param filters An array of lzma_filter structures. There must + * be LZMA_FILTERS_MAX + 1 (that is, five) elements + * in the array. The old contents are ignored so it + * doesn't need to be initialized. This array is + * modified only if this function returns LZMA_OK. + * Once the allocated filter options are no longer + * needed, lzma_filters_free() can be used to free the + * options (it doesn't free the filters array itself). + * \param flags Bitwise-or of zero or more of the flags + * LZMA_STR_ALL_FILTERS and LZMA_STR_NO_VALIDATION. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * + * \return On success, NULL is returned. On error, a statically-allocated + * error message is returned which together with the error_pos + * should give some idea what is wrong. + * + * For command line applications, below is an example how an error message + * can be displayed. Note the use of an empty string for the field width. + * If "^" was used there it would create an off-by-one error except at + * the very beginning of the line. + * + * \code{.c} + * const char *str = ...; // From user + * lzma_filter filters[LZMA_FILTERS_MAX + 1]; + * int pos; + * const char *msg = lzma_str_to_filters(str, &pos, filters, 0, NULL); + * if (msg != NULL) { + * printf("%s: Error in XZ compression options:\n", argv[0]); + * printf("%s: %s\n", argv[0], str); + * printf("%s: %*s^\n", argv[0], errpos, ""); + * printf("%s: %s\n", argv[0], msg); + * } + * \endcode + */ +extern LZMA_API(const char *) lzma_str_to_filters( + const char *str, int *error_pos, lzma_filter *filters, + uint32_t flags, const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Convert a filter chain to a string + * + * Use cases: + * + * - Verbose output showing the full encoder options to the user + * (use LZMA_STR_ENCODER in flags) + * + * - Showing the filters and options that are required to decode a file + * (use LZMA_STR_DECODER in flags) + * + * - Showing the filter names without any options in informational messages + * where the technical details aren't important (no flags). In this case + * the .options in the filters array are ignored and may be NULL even if + * a filter has a mandatory options structure. + * + * Note that even if the filter chain was specified using a preset, + * the resulting filter chain isn't reversed to a preset. So if you + * specify "6" to lzma_str_to_filters() then lzma_str_from_filters() + * will produce a string containing "lzma2". + * + * \param str On success *str will be set to point to an + * allocated string describing the given filter + * chain. Old value is ignored. On error *str is + * always set to NULL. + * \param filters Array of 1-4 filters and a terminating element + * with .id = LZMA_VLI_UNKNOWN. + * \param flags Bitwise-or of zero or more of the flags + * LZMA_STR_ENCODER, LZMA_STR_DECODER, + * LZMA_STR_GETOPT_LONG, and LZMA_STR_NO_SPACES. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR: Empty filter chain + * (filters[0].id == LZMA_VLI_UNKNOWN) or the filter chain + * includes a Filter ID that is not supported by this function. + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_str_from_filters( + char **str, const lzma_filter *filters, uint32_t flags, + const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief List available filters and/or their options (for help message) + * + * If a filter_id is given then only one line is created which contains the + * filter name. If LZMA_STR_ENCODER or LZMA_STR_DECODER is used then the + * options required for encoding or decoding are listed on the same line too. + * + * If filter_id is LZMA_VLI_UNKNOWN then all supported .xz-compatible filters + * are listed: + * + * - If neither LZMA_STR_ENCODER nor LZMA_STR_DECODER is used then + * the supported filter names are listed on a single line separated + * by spaces. + * + * - If LZMA_STR_ENCODER or LZMA_STR_DECODER is used then filters and + * the supported options are listed one filter per line. There won't + * be a '\n' after the last filter. + * + * - If LZMA_STR_ALL_FILTERS is used then the list will include also + * those filters that cannot be used in the .xz format (LZMA1). + * + * \param str On success *str will be set to point to an + * allocated string listing the filters and options. + * Old value is ignored. On error *str is always set + * to NULL. + * \param filter_id Filter ID or LZMA_VLI_UNKNOWN. + * \param flags Bitwise-or of zero or more of the flags + * LZMA_STR_ALL_FILTERS, LZMA_STR_ENCODER, + * LZMA_STR_DECODER, and LZMA_STR_GETOPT_LONG. + * \param allocator lzma_allocator for custom allocator functions. + * Set to NULL to use malloc() and free(). + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR: Unsupported filter_id or flags + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_str_list_filters( + char **str, lzma_vli filter_id, uint32_t flags, + const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; diff --git a/src/liblzma/api/lzma/hardware.h b/src/liblzma/api/lzma/hardware.h new file mode 100644 index 0000000..7040aae --- /dev/null +++ b/src/liblzma/api/lzma/hardware.h @@ -0,0 +1,64 @@ +/** + * \file lzma/hardware.h + * \brief Hardware information + * + * Since liblzma can consume a lot of system resources, it also provides + * ways to limit the resource usage. Applications linking against liblzma + * need to do the actual decisions how much resources to let liblzma to use. + * To ease making these decisions, liblzma provides functions to find out + * the relevant capabilities of the underlying hardware. Currently there + * is only a function to find out the amount of RAM, but in the future there + * will be also a function to detect how many concurrent threads the system + * can run. + * + * \note On some operating systems, these function may temporarily + * load a shared library or open file descriptor(s) to find out + * the requested hardware information. Unless the application + * assumes that specific file descriptors are not touched by + * other threads, this should have no effect on thread safety. + * Possible operations involving file descriptors will restart + * the syscalls if they return EINTR. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Get the total amount of physical memory (RAM) in bytes + * + * This function may be useful when determining a reasonable memory + * usage limit for decompressing or how much memory it is OK to use + * for compressing. + * + * \return On success, the total amount of physical memory in bytes + * is returned. If the amount of RAM cannot be determined, + * zero is returned. This can happen if an error occurs + * or if there is no code in liblzma to detect the amount + * of RAM on the specific operating system. + */ +extern LZMA_API(uint64_t) lzma_physmem(void) lzma_nothrow; + + +/** + * \brief Get the number of processor cores or threads + * + * This function may be useful when determining how many threads to use. + * If the hardware supports more than one thread per CPU core, the number + * of hardware threads is returned if that information is available. + * + * \return On success, the number of available CPU threads or cores is + * returned. If this information isn't available or an error + * occurs, zero is returned. + */ +extern LZMA_API(uint32_t) lzma_cputhreads(void) lzma_nothrow; diff --git a/src/liblzma/api/lzma/index.h b/src/liblzma/api/lzma/index.h new file mode 100644 index 0000000..144d416 --- /dev/null +++ b/src/liblzma/api/lzma/index.h @@ -0,0 +1,752 @@ +/** + * \file lzma/index.h + * \brief Handling of .xz Index and related information + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Opaque data type to hold the Index(es) and other information + * + * lzma_index often holds just one .xz Index and possibly the Stream Flags + * of the same Stream and size of the Stream Padding field. However, + * multiple lzma_indexes can be concatenated with lzma_index_cat() and then + * there may be information about multiple Streams in the same lzma_index. + * + * Notes about thread safety: Only one thread may modify lzma_index at + * a time. All functions that take non-const pointer to lzma_index + * modify it. As long as no thread is modifying the lzma_index, getting + * information from the same lzma_index can be done from multiple threads + * at the same time with functions that take a const pointer to + * lzma_index or use lzma_index_iter. The same iterator must be used + * only by one thread at a time, of course, but there can be as many + * iterators for the same lzma_index as needed. + */ +typedef struct lzma_index_s lzma_index; + + +/** + * \brief Iterator to get information about Blocks and Streams + */ +typedef struct { + struct { + /** + * \brief Pointer to Stream Flags + * + * This is NULL if Stream Flags have not been set for + * this Stream with lzma_index_stream_flags(). + */ + const lzma_stream_flags *flags; + + const void *reserved_ptr1; + const void *reserved_ptr2; + const void *reserved_ptr3; + + /** + * \brief Stream number in the lzma_index + * + * The first Stream is 1. + */ + lzma_vli number; + + /** + * \brief Number of Blocks in the Stream + * + * If this is zero, the block structure below has + * undefined values. + */ + lzma_vli block_count; + + /** + * \brief Compressed start offset of this Stream + * + * The offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + */ + lzma_vli compressed_offset; + + /** + * \brief Uncompressed start offset of this Stream + * + * The offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + */ + lzma_vli uncompressed_offset; + + /** + * \brief Compressed size of this Stream + * + * This includes all headers except the possible + * Stream Padding after this Stream. + */ + lzma_vli compressed_size; + + /** + * \brief Uncompressed size of this Stream + */ + lzma_vli uncompressed_size; + + /** + * \brief Size of Stream Padding after this Stream + * + * If it hasn't been set with lzma_index_stream_padding(), + * this defaults to zero. Stream Padding is always + * a multiple of four bytes. + */ + lzma_vli padding; + + lzma_vli reserved_vli1; + lzma_vli reserved_vli2; + lzma_vli reserved_vli3; + lzma_vli reserved_vli4; + } stream; + + struct { + /** + * \brief Block number in the file + * + * The first Block is 1. + */ + lzma_vli number_in_file; + + /** + * \brief Compressed start offset of this Block + * + * This offset is relative to the beginning of the + * lzma_index (i.e. usually the beginning of the .xz file). + * Normally this is where you should seek in the .xz file + * to start decompressing this Block. + */ + lzma_vli compressed_file_offset; + + /** + * \brief Uncompressed start offset of this Block + * + * This offset is relative to the beginning of the lzma_index + * (i.e. usually the beginning of the .xz file). + * + * When doing random-access reading, it is possible that + * the target offset is not exactly at Block boundary. One + * will need to compare the target offset against + * uncompressed_file_offset or uncompressed_stream_offset, + * and possibly decode and throw away some amount of data + * before reaching the target offset. + */ + lzma_vli uncompressed_file_offset; + + /** + * \brief Block number in this Stream + * + * The first Block is 1. + */ + lzma_vli number_in_stream; + + /** + * \brief Compressed start offset of this Block + * + * This offset is relative to the beginning of the Stream + * containing this Block. + */ + lzma_vli compressed_stream_offset; + + /** + * \brief Uncompressed start offset of this Block + * + * This offset is relative to the beginning of the Stream + * containing this Block. + */ + lzma_vli uncompressed_stream_offset; + + /** + * \brief Uncompressed size of this Block + * + * You should pass this to the Block decoder if you will + * decode this Block. It will allow the Block decoder to + * validate the uncompressed size. + */ + lzma_vli uncompressed_size; + + /** + * \brief Unpadded size of this Block + * + * You should pass this to the Block decoder if you will + * decode this Block. It will allow the Block decoder to + * validate the unpadded size. + */ + lzma_vli unpadded_size; + + /** + * \brief Total compressed size + * + * This includes all headers and padding in this Block. + * This is useful if you need to know how many bytes + * the Block decoder will actually read. + */ + lzma_vli total_size; + + lzma_vli reserved_vli1; + lzma_vli reserved_vli2; + lzma_vli reserved_vli3; + lzma_vli reserved_vli4; + + const void *reserved_ptr1; + const void *reserved_ptr2; + const void *reserved_ptr3; + const void *reserved_ptr4; + } block; + + /* + * Internal data which is used to store the state of the iterator. + * The exact format may vary between liblzma versions, so don't + * touch these in any way. + */ + union { + const void *p; + size_t s; + lzma_vli v; + } internal[6]; +} lzma_index_iter; + + +/** + * \brief Operation mode for lzma_index_iter_next() + */ +typedef enum { + LZMA_INDEX_ITER_ANY = 0, + /**< + * \brief Get the next Block or Stream + * + * Go to the next Block if the current Stream has at least + * one Block left. Otherwise go to the next Stream even if + * it has no Blocks. If the Stream has no Blocks + * (lzma_index_iter.stream.block_count == 0), + * lzma_index_iter.block will have undefined values. + */ + + LZMA_INDEX_ITER_STREAM = 1, + /**< + * \brief Get the next Stream + * + * Go to the next Stream even if the current Stream has + * unread Blocks left. If the next Stream has at least one + * Block, the iterator will point to the first Block. + * If there are no Blocks, lzma_index_iter.block will have + * undefined values. + */ + + LZMA_INDEX_ITER_BLOCK = 2, + /**< + * \brief Get the next Block + * + * Go to the next Block if the current Stream has at least + * one Block left. If the current Stream has no Blocks left, + * the next Stream with at least one Block is located and + * the iterator will be made to point to the first Block of + * that Stream. + */ + + LZMA_INDEX_ITER_NONEMPTY_BLOCK = 3 + /**< + * \brief Get the next non-empty Block + * + * This is like LZMA_INDEX_ITER_BLOCK except that it will + * skip Blocks whose Uncompressed Size is zero. + */ + +} lzma_index_iter_mode; + + +/** + * \brief Calculate memory usage of lzma_index + * + * On disk, the size of the Index field depends on both the number of Records + * stored and how big values the Records store (due to variable-length integer + * encoding). When the Index is kept in lzma_index structure, the memory usage + * depends only on the number of Records/Blocks stored in the Index(es), and + * in case of concatenated lzma_indexes, the number of Streams. The size in + * RAM is almost always significantly bigger than in the encoded form on disk. + * + * This function calculates an approximate amount of memory needed hold + * the given number of Streams and Blocks in lzma_index structure. This + * value may vary between CPU architectures and also between liblzma versions + * if the internal implementation is modified. + */ +extern LZMA_API(uint64_t) lzma_index_memusage( + lzma_vli streams, lzma_vli blocks) lzma_nothrow; + + +/** + * \brief Calculate the memory usage of an existing lzma_index + * + * This is a shorthand for lzma_index_memusage(lzma_index_stream_count(i), + * lzma_index_block_count(i)). + */ +extern LZMA_API(uint64_t) lzma_index_memused(const lzma_index *i) + lzma_nothrow; + + +/** + * \brief Allocate and initialize a new lzma_index structure + * + * \return On success, a pointer to an empty initialized lzma_index is + * returned. If allocation fails, NULL is returned. + */ +extern LZMA_API(lzma_index *) lzma_index_init(const lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Deallocate lzma_index + * + * If i is NULL, this does nothing. + */ +extern LZMA_API(void) lzma_index_end( + lzma_index *i, const lzma_allocator *allocator) lzma_nothrow; + + +/** + * \brief Add a new Block to lzma_index + * + * \param i Pointer to a lzma_index structure + * \param allocator Pointer to lzma_allocator, or NULL to + * use malloc() + * \param unpadded_size Unpadded Size of a Block. This can be + * calculated with lzma_block_unpadded_size() + * after encoding or decoding the Block. + * \param uncompressed_size Uncompressed Size of a Block. This can be + * taken directly from lzma_block structure + * after encoding or decoding the Block. + * + * Appending a new Block does not invalidate iterators. For example, + * if an iterator was pointing to the end of the lzma_index, after + * lzma_index_append() it is possible to read the next Block with + * an existing iterator. + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_append( + lzma_index *i, const lzma_allocator *allocator, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Set the Stream Flags + * + * Set the Stream Flags of the last (and typically the only) Stream + * in lzma_index. This can be useful when reading information from the + * lzma_index, because to decode Blocks, knowing the integrity check type + * is needed. + * + * The given Stream Flags are copied into internal preallocated structure + * in the lzma_index, thus the caller doesn't need to keep the *stream_flags + * available after calling this function. + * + * \return - LZMA_OK + * - LZMA_OPTIONS_ERROR: Unsupported stream_flags->version. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_stream_flags( + lzma_index *i, const lzma_stream_flags *stream_flags) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the types of integrity Checks + * + * If lzma_index_stream_flags() is used to set the Stream Flags for + * every Stream, lzma_index_checks() can be used to get a bitmask to + * indicate which Check types have been used. It can be useful e.g. if + * showing the Check types to the user. + * + * The bitmask is 1 << check_id, e.g. CRC32 is 1 << 1 and SHA-256 is 1 << 10. + */ +extern LZMA_API(uint32_t) lzma_index_checks(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Set the amount of Stream Padding + * + * Set the amount of Stream Padding of the last (and typically the only) + * Stream in the lzma_index. This is needed when planning to do random-access + * reading within multiple concatenated Streams. + * + * By default, the amount of Stream Padding is assumed to be zero bytes. + * + * \return - LZMA_OK + * - LZMA_DATA_ERROR: The file size would grow too big. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_stream_padding( + lzma_index *i, lzma_vli stream_padding) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the number of Streams + */ +extern LZMA_API(lzma_vli) lzma_index_stream_count(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the number of Blocks + * + * This returns the total number of Blocks in lzma_index. To get number + * of Blocks in individual Streams, use lzma_index_iter. + */ +extern LZMA_API(lzma_vli) lzma_index_block_count(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Stream + * + * If multiple lzma_indexes have been combined, this works as if the Blocks + * were in a single Stream. This is useful if you are going to combine + * Blocks from multiple Streams into a single new Stream. + */ +extern LZMA_API(lzma_vli) lzma_index_stream_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the Blocks + * + * This doesn't include the Stream Header, Stream Footer, Stream Padding, + * or Index fields. + */ +extern LZMA_API(lzma_vli) lzma_index_total_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the total size of the file + * + * When no lzma_indexes have been combined with lzma_index_cat() and there is + * no Stream Padding, this function is identical to lzma_index_stream_size(). + * If multiple lzma_indexes have been combined, this includes also the headers + * of each separate Stream and the possible Stream Padding fields. + */ +extern LZMA_API(lzma_vli) lzma_index_file_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Get the uncompressed size of the file + */ +extern LZMA_API(lzma_vli) lzma_index_uncompressed_size(const lzma_index *i) + lzma_nothrow lzma_attr_pure; + + +/** + * \brief Initialize an iterator + * + * \param iter Pointer to a lzma_index_iter structure + * \param i lzma_index to which the iterator will be associated + * + * This function associates the iterator with the given lzma_index, and calls + * lzma_index_iter_rewind() on the iterator. + * + * This function doesn't allocate any memory, thus there is no + * lzma_index_iter_end(). The iterator is valid as long as the + * associated lzma_index is valid, that is, until lzma_index_end() or + * using it as source in lzma_index_cat(). Specifically, lzma_index doesn't + * become invalid if new Blocks are added to it with lzma_index_append() or + * if it is used as the destination in lzma_index_cat(). + * + * It is safe to make copies of an initialized lzma_index_iter, for example, + * to easily restart reading at some particular position. + */ +extern LZMA_API(void) lzma_index_iter_init( + lzma_index_iter *iter, const lzma_index *i) lzma_nothrow; + + +/** + * \brief Rewind the iterator + * + * Rewind the iterator so that next call to lzma_index_iter_next() will + * return the first Block or Stream. + */ +extern LZMA_API(void) lzma_index_iter_rewind(lzma_index_iter *iter) + lzma_nothrow; + + +/** + * \brief Get the next Block or Stream + * + * \param iter Iterator initialized with lzma_index_iter_init() + * \param mode Specify what kind of information the caller wants + * to get. See lzma_index_iter_mode for details. + * + * \return If next Block or Stream matching the mode was found, *iter + * is updated and this function returns false. If no Block or + * Stream matching the mode is found, *iter is not modified + * and this function returns true. If mode is set to an unknown + * value, *iter is not modified and this function returns true. + */ +extern LZMA_API(lzma_bool) lzma_index_iter_next( + lzma_index_iter *iter, lzma_index_iter_mode mode) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Locate a Block + * + * If it is possible to seek in the .xz file, it is possible to parse + * the Index field(s) and use lzma_index_iter_locate() to do random-access + * reading with granularity of Block size. + * + * \param iter Iterator that was earlier initialized with + * lzma_index_iter_init(). + * \param target Uncompressed target offset which the caller would + * like to locate from the Stream + * + * If the target is smaller than the uncompressed size of the Stream (can be + * checked with lzma_index_uncompressed_size()): + * - Information about the Stream and Block containing the requested + * uncompressed offset is stored into *iter. + * - Internal state of the iterator is adjusted so that + * lzma_index_iter_next() can be used to read subsequent Blocks or Streams. + * - This function returns false. + * + * If target is greater than the uncompressed size of the Stream, *iter + * is not modified, and this function returns true. + */ +extern LZMA_API(lzma_bool) lzma_index_iter_locate( + lzma_index_iter *iter, lzma_vli target) lzma_nothrow; + + +/** + * \brief Concatenate lzma_indexes + * + * Concatenating lzma_indexes is useful when doing random-access reading in + * multi-Stream .xz file, or when combining multiple Streams into single + * Stream. + * + * \param dest lzma_index after which src is appended + * \param src lzma_index to be appended after dest. If this + * function succeeds, the memory allocated for src + * is freed or moved to be part of dest, and all + * iterators pointing to src will become invalid. + * \param allocator Custom memory allocator; can be NULL to use + * malloc() and free(). + * + * \return - LZMA_OK: lzma_indexes were concatenated successfully. + * src is now a dangling pointer. + * - LZMA_DATA_ERROR: *dest would grow too big. + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *dest, lzma_index *src, + const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Duplicate lzma_index + * + * \return A copy of the lzma_index, or NULL if memory allocation failed. + */ +extern LZMA_API(lzma_index *) lzma_index_dup( + const lzma_index *i, const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Index encoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i Pointer to lzma_index which should be encoded. + * + * The valid `action' values for lzma_code() are LZMA_RUN and LZMA_FINISH. + * It is enough to use only one of them (you can choose freely). + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_encoder( + lzma_stream *strm, const lzma_index *i) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Initialize .xz Index decoder + * + * \param strm Pointer to properly prepared lzma_stream + * \param i The decoded Index will be made available via + * this pointer. Initially this function will + * set *i to NULL (the old value is ignored). If + * decoding succeeds (lzma_code() returns + * LZMA_STREAM_END), *i will be set to point + * to a new lzma_index, which the application + * has to later free with lzma_index_end(). + * \param memlimit How much memory the resulting lzma_index is + * allowed to require. liblzma 5.2.3 and earlier + * don't allow 0 here and return LZMA_PROG_ERROR; + * later versions treat 0 as if 1 had been specified. + * + * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. + * There is no need to use LZMA_FINISH, but it's allowed because it may + * simplify certain types of applications. + * + * \return - LZMA_OK: Initialization succeeded, continue with lzma_code(). + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + * + * liblzma 5.2.3 and older list also LZMA_MEMLIMIT_ERROR here + * but that error code has never been possible from this + * initialization function. + */ +extern LZMA_API(lzma_ret) lzma_index_decoder( + lzma_stream *strm, lzma_index **i, uint64_t memlimit) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Single-call .xz Index encoder + * + * \param i lzma_index to be encoded + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * *out_pos is updated only if encoding succeeds. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_BUF_ERROR: Output buffer is too small. Use + * lzma_index_size() to find out how much output + * space is needed. + * - LZMA_PROG_ERROR + * + * \note This function doesn't take allocator argument since all + * the internal data is allocated on stack. + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Single-call .xz Index decoder + * + * \param i If decoding succeeds, *i will point to a new + * lzma_index, which the application has to + * later free with lzma_index_end(). If an error + * occurs, *i will be NULL. The old value of *i + * is always ignored and thus doesn't need to be + * initialized by the caller. + * \param memlimit Pointer to how much memory the resulting + * lzma_index is allowed to require. The value + * pointed by this pointer is modified if and only + * if LZMA_MEMLIMIT_ERROR is returned. + * \param allocator Pointer to lzma_allocator, or NULL to use malloc() + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * *in_pos is updated only if decoding succeeds. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. + * The minimum required memlimit value was stored to *memlimit. + * - LZMA_DATA_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i, + uint64_t *memlimit, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow; + + +/** + * \brief Initialize a .xz file information decoder + * + * \param strm Pointer to a properly prepared lzma_stream + * \param dest_index Pointer to a pointer where the decoder will put + * the decoded lzma_index. The old value + * of *dest_index is ignored (not freed). + * \param memlimit How much memory the resulting lzma_index is + * allowed to require. Use UINT64_MAX to + * effectively disable the limiter. + * \param file_size Size of the input .xz file + * + * This decoder decodes the Stream Header, Stream Footer, Index, and + * Stream Padding field(s) from the input .xz file and stores the resulting + * combined index in *dest_index. This information can be used to get the + * uncompressed file size with lzma_index_uncompressed_size(*dest_index) or, + * for example, to implement random access reading by locating the Blocks + * in the Streams. + * + * To get the required information from the .xz file, lzma_code() may ask + * the application to seek in the input file by returning LZMA_SEEK_NEEDED + * and having the target file position specified in lzma_stream.seek_pos. + * The number of seeks required depends on the input file and how big buffers + * the application provides. When possible, the decoder will seek backward + * and forward in the given buffer to avoid useless seek requests. Thus, if + * the application provides the whole file at once, no external seeking will + * be required (that is, lzma_code() won't return LZMA_SEEK_NEEDED). + * + * The value in lzma_stream.total_in can be used to estimate how much data + * liblzma had to read to get the file information. However, due to seeking + * and the way total_in is updated, the value of total_in will be somewhat + * inaccurate (a little too big). Thus, total_in is a good estimate but don't + * expect to see the same exact value for the same file if you change the + * input buffer size or switch to a different liblzma version. + * + * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH. + * You only need to use LZMA_RUN; LZMA_FINISH is only supported because it + * might be convenient for some applications. If you use LZMA_FINISH and if + * lzma_code() asks the application to seek, remember to reset `action' back + * to LZMA_RUN unless you hit the end of the file again. + * + * Possible return values from lzma_code(): + * - LZMA_OK: All OK so far, more input needed + * - LZMA_SEEK_NEEDED: Provide more input starting from the absolute + * file position strm->seek_pos + * - LZMA_STREAM_END: Decoding was successful, *dest_index has been set + * - LZMA_FORMAT_ERROR: The input file is not in the .xz format (the + * expected magic bytes were not found from the beginning of the file) + * - LZMA_OPTIONS_ERROR: File looks valid but contains headers that aren't + * supported by this version of liblzma + * - LZMA_DATA_ERROR: File is corrupt + * - LZMA_BUF_ERROR + * - LZMA_MEM_ERROR + * - LZMA_MEMLIMIT_ERROR + * - LZMA_PROG_ERROR + * + * \return - LZMA_OK + * - LZMA_MEM_ERROR + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_file_info_decoder( + lzma_stream *strm, lzma_index **dest_index, + uint64_t memlimit, uint64_t file_size) + lzma_nothrow; diff --git a/src/liblzma/api/lzma/index_hash.h b/src/liblzma/api/lzma/index_hash.h new file mode 100644 index 0000000..8ff4163 --- /dev/null +++ b/src/liblzma/api/lzma/index_hash.h @@ -0,0 +1,107 @@ +/** + * \file lzma/index_hash.h + * \brief Validate Index by using a hash function + * + * Hashing makes it possible to use constant amount of memory to validate + * Index of arbitrary size. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + +/** + * \brief Opaque data type to hold the Index hash + */ +typedef struct lzma_index_hash_s lzma_index_hash; + + +/** + * \brief Allocate and initialize a new lzma_index_hash structure + * + * If index_hash is NULL, a new lzma_index_hash structure is allocated, + * initialized, and a pointer to it returned. If allocation fails, NULL + * is returned. + * + * If index_hash is non-NULL, it is reinitialized and the same pointer + * returned. In this case, return value cannot be NULL or a different + * pointer than the index_hash that was given as an argument. + */ +extern LZMA_API(lzma_index_hash *) lzma_index_hash_init( + lzma_index_hash *index_hash, const lzma_allocator *allocator) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Deallocate lzma_index_hash structure + */ +extern LZMA_API(void) lzma_index_hash_end( + lzma_index_hash *index_hash, const lzma_allocator *allocator) + lzma_nothrow; + + +/** + * \brief Add a new Record to an Index hash + * + * \param index_hash Pointer to a lzma_index_hash structure + * \param unpadded_size Unpadded Size of a Block + * \param uncompressed_size Uncompressed Size of a Block + * + * \return - LZMA_OK + * - LZMA_DATA_ERROR: Compressed or uncompressed size of the + * Stream or size of the Index field would grow too big. + * - LZMA_PROG_ERROR: Invalid arguments or this function is being + * used when lzma_index_hash_decode() has already been used. + */ +extern LZMA_API(lzma_ret) lzma_index_hash_append(lzma_index_hash *index_hash, + lzma_vli unpadded_size, lzma_vli uncompressed_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode and validate the Index field + * + * After telling the sizes of all Blocks with lzma_index_hash_append(), + * the actual Index field is decoded with this function. Specifically, + * once decoding of the Index field has been started, no more Records + * can be added using lzma_index_hash_append(). + * + * This function doesn't use lzma_stream structure to pass the input data. + * Instead, the input buffer is specified using three arguments. This is + * because it matches better the internal APIs of liblzma. + * + * \param index_hash Pointer to a lzma_index_hash structure + * \param in Pointer to the beginning of the input buffer + * \param in_pos in[*in_pos] is the next byte to process + * \param in_size in[in_size] is the first byte not to process + * + * \return - LZMA_OK: So far good, but more input is needed. + * - LZMA_STREAM_END: Index decoded successfully and it matches + * the Records given with lzma_index_hash_append(). + * - LZMA_DATA_ERROR: Index is corrupt or doesn't match the + * information given with lzma_index_hash_append(). + * - LZMA_BUF_ERROR: Cannot progress because *in_pos >= in_size. + * - LZMA_PROG_ERROR + */ +extern LZMA_API(lzma_ret) lzma_index_hash_decode(lzma_index_hash *index_hash, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Get the size of the Index field as bytes + * + * This is needed to verify the Backward Size field in the Stream Footer. + */ +extern LZMA_API(lzma_vli) lzma_index_hash_size( + const lzma_index_hash *index_hash) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/api/lzma/lzma12.h b/src/liblzma/api/lzma/lzma12.h new file mode 100644 index 0000000..d34e783 --- /dev/null +++ b/src/liblzma/api/lzma/lzma12.h @@ -0,0 +1,529 @@ +/** + * \file lzma/lzma12.h + * \brief LZMA1 and LZMA2 filters + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief LZMA1 Filter ID (for raw encoder/decoder only, not in .xz) + * + * LZMA1 is the very same thing as what was called just LZMA in LZMA Utils, + * 7-Zip, and LZMA SDK. It's called LZMA1 here to prevent developers from + * accidentally using LZMA when they actually want LZMA2. + */ +#define LZMA_FILTER_LZMA1 LZMA_VLI_C(0x4000000000000001) + +/** + * \brief LZMA1 Filter ID with extended options (for raw encoder/decoder) + * + * This is like LZMA_FILTER_LZMA1 but with this ID a few extra options + * are supported in the lzma_options_lzma structure: + * + * - A flag to tell the encoder if the end of payload marker (EOPM) alias + * end of stream (EOS) marker must be written at the end of the stream. + * In contrast, LZMA_FILTER_LZMA1 always writes the end marker. + * + * - Decoder needs to be told the uncompressed size of the stream + * or that it is unknown (using the special value UINT64_MAX). + * If the size is known, a flag can be set to allow the presence of + * the end marker anyway. In contrast, LZMA_FILTER_LZMA1 always + * behaves as if the uncompressed size was unknown. + * + * This allows handling file formats where LZMA1 streams are used but where + * the end marker isn't allowed or where it might not (always) be present. + * This extended LZMA1 functionality is provided as a Filter ID for raw + * encoder and decoder instead of adding new encoder and decoder initialization + * functions because this way it is possible to also use extra filters, + * for example, LZMA_FILTER_X86 in a filter chain with LZMA_FILTER_LZMA1EXT, + * which might be needed to handle some file formats. + */ +#define LZMA_FILTER_LZMA1EXT LZMA_VLI_C(0x4000000000000002) + +/** + * \brief LZMA2 Filter ID + * + * Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds + * support for LZMA_SYNC_FLUSH, uncompressed chunks (smaller expansion + * when trying to compress uncompressible data), possibility to change + * lc/lp/pb in the middle of encoding, and some other internal improvements. + */ +#define LZMA_FILTER_LZMA2 LZMA_VLI_C(0x21) + + +/** + * \brief Match finders + * + * Match finder has major effect on both speed and compression ratio. + * Usually hash chains are faster than binary trees. + * + * If you will use LZMA_SYNC_FLUSH often, the hash chains may be a better + * choice, because binary trees get much higher compression ratio penalty + * with LZMA_SYNC_FLUSH. + * + * The memory usage formulas are only rough estimates, which are closest to + * reality when dict_size is a power of two. The formulas are more complex + * in reality, and can also change a little between liblzma versions. Use + * lzma_raw_encoder_memusage() to get more accurate estimate of memory usage. + */ +typedef enum { + LZMA_MF_HC3 = 0x03, + /**< + * \brief Hash Chain with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 7.5 + * - dict_size > 16 MiB: dict_size * 5.5 + 64 MiB + */ + + LZMA_MF_HC4 = 0x04, + /**< + * \brief Hash Chain with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: + * - dict_size <= 32 MiB: dict_size * 7.5 + * - dict_size > 32 MiB: dict_size * 6.5 + */ + + LZMA_MF_BT2 = 0x12, + /**< + * \brief Binary Tree with 2-byte hashing + * + * Minimum nice_len: 2 + * + * Memory usage: dict_size * 9.5 + */ + + LZMA_MF_BT3 = 0x13, + /**< + * \brief Binary Tree with 2- and 3-byte hashing + * + * Minimum nice_len: 3 + * + * Memory usage: + * - dict_size <= 16 MiB: dict_size * 11.5 + * - dict_size > 16 MiB: dict_size * 9.5 + 64 MiB + */ + + LZMA_MF_BT4 = 0x14 + /**< + * \brief Binary Tree with 2-, 3-, and 4-byte hashing + * + * Minimum nice_len: 4 + * + * Memory usage: + * - dict_size <= 32 MiB: dict_size * 11.5 + * - dict_size > 32 MiB: dict_size * 10.5 + */ +} lzma_match_finder; + + +/** + * \brief Test if given match finder is supported + * + * Return true if the given match finder is supported by this liblzma build. + * Otherwise false is returned. It is safe to call this with a value that + * isn't listed in lzma_match_finder enumeration; the return value will be + * false. + * + * There is no way to list which match finders are available in this + * particular liblzma version and build. It would be useless, because + * a new match finder, which the application developer wasn't aware, + * could require giving additional options to the encoder that the older + * match finders don't need. + */ +extern LZMA_API(lzma_bool) lzma_mf_is_supported(lzma_match_finder match_finder) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Compression modes + * + * This selects the function used to analyze the data produced by the match + * finder. + */ +typedef enum { + LZMA_MODE_FAST = 1, + /**< + * \brief Fast compression + * + * Fast mode is usually at its best when combined with + * a hash chain match finder. + */ + + LZMA_MODE_NORMAL = 2 + /**< + * \brief Normal compression + * + * This is usually notably slower than fast mode. Use this + * together with binary tree match finders to expose the + * full potential of the LZMA1 or LZMA2 encoder. + */ +} lzma_mode; + + +/** + * \brief Test if given compression mode is supported + * + * Return true if the given compression mode is supported by this liblzma + * build. Otherwise false is returned. It is safe to call this with a value + * that isn't listed in lzma_mode enumeration; the return value will be false. + * + * There is no way to list which modes are available in this particular + * liblzma version and build. It would be useless, because a new compression + * mode, which the application developer wasn't aware, could require giving + * additional options to the encoder that the older modes don't need. + */ +extern LZMA_API(lzma_bool) lzma_mode_is_supported(lzma_mode mode) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Options specific to the LZMA1 and LZMA2 filters + * + * Since LZMA1 and LZMA2 share most of the code, it's simplest to share + * the options structure too. For encoding, all but the reserved variables + * need to be initialized unless specifically mentioned otherwise. + * lzma_lzma_preset() can be used to get a good starting point. + * + * For raw decoding, both LZMA1 and LZMA2 need dict_size, preset_dict, and + * preset_dict_size (if preset_dict != NULL). LZMA1 needs also lc, lp, and pb. + */ +typedef struct { + /** + * \brief Dictionary size in bytes + * + * Dictionary size indicates how many bytes of the recently processed + * uncompressed data is kept in memory. One method to reduce size of + * the uncompressed data is to store distance-length pairs, which + * indicate what data to repeat from the dictionary buffer. Thus, + * the bigger the dictionary, the better the compression ratio + * usually is. + * + * Maximum size of the dictionary depends on multiple things: + * - Memory usage limit + * - Available address space (not a problem on 64-bit systems) + * - Selected match finder (encoder only) + * + * Currently the maximum dictionary size for encoding is 1.5 GiB + * (i.e. (UINT32_C(1) << 30) + (UINT32_C(1) << 29)) even on 64-bit + * systems for certain match finder implementation reasons. In the + * future, there may be match finders that support bigger + * dictionaries. + * + * Decoder already supports dictionaries up to 4 GiB - 1 B (i.e. + * UINT32_MAX), so increasing the maximum dictionary size of the + * encoder won't cause problems for old decoders. + * + * Because extremely small dictionaries sizes would have unneeded + * overhead in the decoder, the minimum dictionary size is 4096 bytes. + * + * \note When decoding, too big dictionary does no other harm + * than wasting memory. + */ + uint32_t dict_size; +# define LZMA_DICT_SIZE_MIN UINT32_C(4096) +# define LZMA_DICT_SIZE_DEFAULT (UINT32_C(1) << 23) + + /** + * \brief Pointer to an initial dictionary + * + * It is possible to initialize the LZ77 history window using + * a preset dictionary. It is useful when compressing many + * similar, relatively small chunks of data independently from + * each other. The preset dictionary should contain typical + * strings that occur in the files being compressed. The most + * probable strings should be near the end of the preset dictionary. + * + * This feature should be used only in special situations. For + * now, it works correctly only with raw encoding and decoding. + * Currently none of the container formats supported by + * liblzma allow preset dictionary when decoding, thus if + * you create a .xz or .lzma file with preset dictionary, it + * cannot be decoded with the regular decoder functions. In the + * future, the .xz format will likely get support for preset + * dictionary though. + */ + const uint8_t *preset_dict; + + /** + * \brief Size of the preset dictionary + * + * Specifies the size of the preset dictionary. If the size is + * bigger than dict_size, only the last dict_size bytes are + * processed. + * + * This variable is read only when preset_dict is not NULL. + * If preset_dict is not NULL but preset_dict_size is zero, + * no preset dictionary is used (identical to only setting + * preset_dict to NULL). + */ + uint32_t preset_dict_size; + + /** + * \brief Number of literal context bits + * + * How many of the highest bits of the previous uncompressed + * eight-bit byte (also known as `literal') are taken into + * account when predicting the bits of the next literal. + * + * E.g. in typical English text, an upper-case letter is + * often followed by a lower-case letter, and a lower-case + * letter is usually followed by another lower-case letter. + * In the US-ASCII character set, the highest three bits are 010 + * for upper-case letters and 011 for lower-case letters. + * When lc is at least 3, the literal coding can take advantage of + * this property in the uncompressed data. + * + * There is a limit that applies to literal context bits and literal + * position bits together: lc + lp <= 4. Without this limit the + * decoding could become very slow, which could have security related + * results in some cases like email servers doing virus scanning. + * This limit also simplifies the internal implementation in liblzma. + * + * There may be LZMA1 streams that have lc + lp > 4 (maximum possible + * lc would be 8). It is not possible to decode such streams with + * liblzma. + */ + uint32_t lc; +# define LZMA_LCLP_MIN 0 +# define LZMA_LCLP_MAX 4 +# define LZMA_LC_DEFAULT 3 + + /** + * \brief Number of literal position bits + * + * lp affects what kind of alignment in the uncompressed data is + * assumed when encoding literals. A literal is a single 8-bit byte. + * See pb below for more information about alignment. + */ + uint32_t lp; +# define LZMA_LP_DEFAULT 0 + + /** + * \brief Number of position bits + * + * pb affects what kind of alignment in the uncompressed data is + * assumed in general. The default means four-byte alignment + * (2^ pb =2^2=4), which is often a good choice when there's + * no better guess. + * + * When the alignment is known, setting pb accordingly may reduce + * the file size a little. E.g. with text files having one-byte + * alignment (US-ASCII, ISO-8859-*, UTF-8), setting pb=0 can + * improve compression slightly. For UTF-16 text, pb=1 is a good + * choice. If the alignment is an odd number like 3 bytes, pb=0 + * might be the best choice. + * + * Even though the assumed alignment can be adjusted with pb and + * lp, LZMA1 and LZMA2 still slightly favor 16-byte alignment. + * It might be worth taking into account when designing file formats + * that are likely to be often compressed with LZMA1 or LZMA2. + */ + uint32_t pb; +# define LZMA_PB_MIN 0 +# define LZMA_PB_MAX 4 +# define LZMA_PB_DEFAULT 2 + + /** Compression mode */ + lzma_mode mode; + + /** + * \brief Nice length of a match + * + * This determines how many bytes the encoder compares from the match + * candidates when looking for the best match. Once a match of at + * least nice_len bytes long is found, the encoder stops looking for + * better candidates and encodes the match. (Naturally, if the found + * match is actually longer than nice_len, the actual length is + * encoded; it's not truncated to nice_len.) + * + * Bigger values usually increase the compression ratio and + * compression time. For most files, 32 to 128 is a good value, + * which gives very good compression ratio at good speed. + * + * The exact minimum value depends on the match finder. The maximum + * is 273, which is the maximum length of a match that LZMA1 and + * LZMA2 can encode. + */ + uint32_t nice_len; + + /** Match finder ID */ + lzma_match_finder mf; + + /** + * \brief Maximum search depth in the match finder + * + * For every input byte, match finder searches through the hash chain + * or binary tree in a loop, each iteration going one step deeper in + * the chain or tree. The searching stops if + * - a match of at least nice_len bytes long is found; + * - all match candidates from the hash chain or binary tree have + * been checked; or + * - maximum search depth is reached. + * + * Maximum search depth is needed to prevent the match finder from + * wasting too much time in case there are lots of short match + * candidates. On the other hand, stopping the search before all + * candidates have been checked can reduce compression ratio. + * + * Setting depth to zero tells liblzma to use an automatic default + * value, that depends on the selected match finder and nice_len. + * The default is in the range [4, 200] or so (it may vary between + * liblzma versions). + * + * Using a bigger depth value than the default can increase + * compression ratio in some cases. There is no strict maximum value, + * but high values (thousands or millions) should be used with care: + * the encoder could remain fast enough with typical input, but + * malicious input could cause the match finder to slow down + * dramatically, possibly creating a denial of service attack. + */ + uint32_t depth; + + /** + * \brief For LZMA_FILTER_LZMA1EXT: Extended flags + * + * This is used only with LZMA_FILTER_LZMA1EXT. + * + * Currently only one flag is supported, LZMA_LZMA1EXT_ALLOW_EOPM: + * + * - Encoder: If the flag is set, then end marker is written just + * like it is with LZMA_FILTER_LZMA1. Without this flag the + * end marker isn't written and the application has to store + * the uncompressed size somewhere outside the compressed stream. + * To decompress streams without the end marker, the appliation + * has to set the correct uncompressed size in ext_size_low and + * ext_size_high. + * + * - Decoder: If the uncompressed size in ext_size_low and + * ext_size_high is set to the special value UINT64_MAX + * (indicating unknown uncompressed size) then this flag is + * ignored and the end marker must always be present, that is, + * the behavior is identical to LZMA_FILTER_LZMA1. + * + * Otherwise, if this flag isn't set, then the input stream + * must not have the end marker; if the end marker is detected + * then it will result in LZMA_DATA_ERROR. This is useful when + * it is known that the stream must not have the end marker and + * strict validation is wanted. + * + * If this flag is set, then it is autodetected if the end marker + * is present after the specified number of uncompressed bytes + * has been decompressed (ext_size_low and ext_size_high). The + * end marker isn't allowed in any other position. This behavior + * is useful when uncompressed size is known but the end marker + * may or may not be present. This is the case, for example, + * in .7z files (valid .7z files that have the end marker in + * LZMA1 streams are rare but they do exist). + */ + uint32_t ext_flags; +# define LZMA_LZMA1EXT_ALLOW_EOPM UINT32_C(0x01) + + /** + * \brief For LZMA_FILTER_LZMA1EXT: Uncompressed size (low bits) + * + * The 64-bit uncompressed size is needed for decompression with + * LZMA_FILTER_LZMA1EXT. The size is ignored by the encoder. + * + * The special value UINT64_MAX indicates that the uncompressed size + * is unknown and that the end of payload marker (also known as + * end of stream marker) must be present to indicate the end of + * the LZMA1 stream. Any other value indicates the expected + * uncompressed size of the LZMA1 stream. (If LZMA1 was used together + * with filters that change the size of the data then the uncompressed + * size of the LZMA1 stream could be different than the final + * uncompressed size of the filtered stream.) + * + * ext_size_low holds the least significant 32 bits of the + * uncompressed size. The most significant 32 bits must be set + * in ext_size_high. The macro lzma_ext_size_set(opt_lzma, u64size) + * can be used to set these members. + * + * The 64-bit uncompressed size is split into two uint32_t variables + * because there were no reserved uint64_t members and using the + * same options structure for LZMA_FILTER_LZMA1, LZMA_FILTER_LZMA1EXT, + * and LZMA_FILTER_LZMA2 was otherwise more convenient than having + * a new options structure for LZMA_FILTER_LZMA1EXT. (Replacing two + * uint32_t members with one uint64_t changes the ABI on some systems + * as the alignment of this struct can increase from 4 bytes to 8.) + */ + uint32_t ext_size_low; + + /** + * \brief For LZMA_FILTER_LZMA1EXT: Uncompressed size (high bits) + * + * This holds the most significant 32 bits of the uncompressed size. + */ + uint32_t ext_size_high; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the names + * of these variables may change. These are and will never be used + * with the currently supported options, so it is safe to leave these + * uninitialized. + */ + uint32_t reserved_int4; + uint32_t reserved_int5; + uint32_t reserved_int6; + uint32_t reserved_int7; + uint32_t reserved_int8; + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + void *reserved_ptr1; + void *reserved_ptr2; + +} lzma_options_lzma; + + +/** + * \brief Macro to set the 64-bit uncompressed size in ext_size_* + * + * This might be convenient when decoding using LZMA_FILTER_LZMA1EXT. + * This isn't used with LZMA_FILTER_LZMA1 or LZMA_FILTER_LZMA2. + */ +#define lzma_set_ext_size(opt_lzma2, u64size) \ +do { \ + (opt_lzma2).ext_size_low = (uint32_t)(u64size); \ + (opt_lzma2).ext_size_high = (uint32_t)((uint64_t)(u64size) >> 32); \ +} while (0) + + +/** + * \brief Set a compression preset to lzma_options_lzma structure + * + * 0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 + * of the xz command line tool. In addition, it is possible to bitwise-or + * flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. + * The flags are defined in container.h, because the flags are used also + * with lzma_easy_encoder(). + * + * The preset values are subject to changes between liblzma versions. + * + * This function is available only if LZMA1 or LZMA2 encoder has been enabled + * when building liblzma. + * + * \return On success, false is returned. If the preset is not + * supported, true is returned. + */ +extern LZMA_API(lzma_bool) lzma_lzma_preset( + lzma_options_lzma *options, uint32_t preset) lzma_nothrow; diff --git a/src/liblzma/api/lzma/stream_flags.h b/src/liblzma/api/lzma/stream_flags.h new file mode 100644 index 0000000..bbdd408 --- /dev/null +++ b/src/liblzma/api/lzma/stream_flags.h @@ -0,0 +1,223 @@ +/** + * \file lzma/stream_flags.h + * \brief .xz Stream Header and Stream Footer encoder and decoder + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Size of Stream Header and Stream Footer + * + * Stream Header and Stream Footer have the same size and they are not + * going to change even if a newer version of the .xz file format is + * developed in future. + */ +#define LZMA_STREAM_HEADER_SIZE 12 + + +/** + * \brief Options for encoding/decoding Stream Header and Stream Footer + */ +typedef struct { + /** + * \brief Stream Flags format version + * + * To prevent API and ABI breakages if new features are needed in + * Stream Header or Stream Footer, a version number is used to + * indicate which fields in this structure are in use. For now, + * version must always be zero. With non-zero version, the + * lzma_stream_header_encode() and lzma_stream_footer_encode() + * will return LZMA_OPTIONS_ERROR. + * + * lzma_stream_header_decode() and lzma_stream_footer_decode() + * will always set this to the lowest value that supports all the + * features indicated by the Stream Flags field. The application + * must check that the version number set by the decoding functions + * is supported by the application. Otherwise it is possible that + * the application will decode the Stream incorrectly. + */ + uint32_t version; + + /** + * \brief Backward Size + * + * Backward Size must be a multiple of four bytes. In this Stream + * format version, Backward Size is the size of the Index field. + * + * Backward Size isn't actually part of the Stream Flags field, but + * it is convenient to include in this structure anyway. Backward + * Size is present only in the Stream Footer. There is no need to + * initialize backward_size when encoding Stream Header. + * + * lzma_stream_header_decode() always sets backward_size to + * LZMA_VLI_UNKNOWN so that it is convenient to use + * lzma_stream_flags_compare() when both Stream Header and Stream + * Footer have been decoded. + */ + lzma_vli backward_size; +# define LZMA_BACKWARD_SIZE_MIN 4 +# define LZMA_BACKWARD_SIZE_MAX (LZMA_VLI_C(1) << 34) + + /** + * \brief Check ID + * + * This indicates the type of the integrity check calculated from + * uncompressed data. + */ + lzma_check check; + + /* + * Reserved space to allow possible future extensions without + * breaking the ABI. You should not touch these, because the + * names of these variables may change. + * + * (We will never be able to use all of these since Stream Flags + * is just two bytes plus Backward Size of four bytes. But it's + * nice to have the proper types when they are needed.) + */ + lzma_reserved_enum reserved_enum1; + lzma_reserved_enum reserved_enum2; + lzma_reserved_enum reserved_enum3; + lzma_reserved_enum reserved_enum4; + lzma_bool reserved_bool1; + lzma_bool reserved_bool2; + lzma_bool reserved_bool3; + lzma_bool reserved_bool4; + lzma_bool reserved_bool5; + lzma_bool reserved_bool6; + lzma_bool reserved_bool7; + lzma_bool reserved_bool8; + uint32_t reserved_int1; + uint32_t reserved_int2; + +} lzma_stream_flags; + + +/** + * \brief Encode Stream Header + * + * \param options Stream Header options to be encoded. + * options->backward_size is ignored and doesn't + * need to be initialized. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Encode Stream Footer + * + * \param options Stream Footer options to be encoded. + * \param out Beginning of the output buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Encoding was successful. + * - LZMA_OPTIONS_ERROR: options->version is not supported by + * this liblzma version. + * - LZMA_PROG_ERROR: Invalid options. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_encode( + const lzma_stream_flags *options, uint8_t *out) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Header + * + * \param options Target for the decoded Stream Header options. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * options->backward_size is always set to LZMA_VLI_UNKNOWN. This is to + * help comparing Stream Flags from Stream Header and Stream Footer with + * lzma_stream_flags_compare(). + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Header. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the header + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in the header. + * + * \note When decoding .xz files that contain multiple Streams, it may + * make sense to print "file format not recognized" only if + * decoding of the Stream Header of the _first_ Stream gives + * LZMA_FORMAT_ERROR. If non-first Stream Header gives + * LZMA_FORMAT_ERROR, the message used for LZMA_DATA_ERROR is + * probably more appropriate. + * + * For example, Stream decoder in liblzma uses LZMA_DATA_ERROR if + * LZMA_FORMAT_ERROR is returned by lzma_stream_header_decode() + * when decoding non-first Stream. + */ +extern LZMA_API(lzma_ret) lzma_stream_header_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Decode Stream Footer + * + * \param options Target for the decoded Stream Header options. + * \param in Beginning of the input buffer of + * LZMA_STREAM_HEADER_SIZE bytes. + * + * \return - LZMA_OK: Decoding was successful. + * - LZMA_FORMAT_ERROR: Magic bytes don't match, thus the given + * buffer cannot be Stream Footer. + * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the Stream Footer + * is corrupt. + * - LZMA_OPTIONS_ERROR: Unsupported options are present + * in Stream Footer. + * + * \note If Stream Header was already decoded successfully, but + * decoding Stream Footer returns LZMA_FORMAT_ERROR, the + * application should probably report some other error message + * than "file format not recognized", since the file more likely + * is corrupt (possibly truncated). Stream decoder in liblzma + * uses LZMA_DATA_ERROR in this situation. + */ +extern LZMA_API(lzma_ret) lzma_stream_footer_decode( + lzma_stream_flags *options, const uint8_t *in) + lzma_nothrow lzma_attr_warn_unused_result; + + +/** + * \brief Compare two lzma_stream_flags structures + * + * backward_size values are compared only if both are not + * LZMA_VLI_UNKNOWN. + * + * \return - LZMA_OK: Both are equal. If either had backward_size set + * to LZMA_VLI_UNKNOWN, backward_size values were not + * compared or validated. + * - LZMA_DATA_ERROR: The structures differ. + * - LZMA_OPTIONS_ERROR: version in either structure is greater + * than the maximum supported version (currently zero). + * - LZMA_PROG_ERROR: Invalid value, e.g. invalid check or + * backward_size. + */ +extern LZMA_API(lzma_ret) lzma_stream_flags_compare( + const lzma_stream_flags *a, const lzma_stream_flags *b) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/api/lzma/version.h b/src/liblzma/api/lzma/version.h new file mode 100644 index 0000000..0dd90fc --- /dev/null +++ b/src/liblzma/api/lzma/version.h @@ -0,0 +1,121 @@ +/** + * \file lzma/version.h + * \brief Version number + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/* + * Version number split into components + */ +#define LZMA_VERSION_MAJOR 5 +#define LZMA_VERSION_MINOR 4 +#define LZMA_VERSION_PATCH 1 +#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE + +#ifndef LZMA_VERSION_COMMIT +# define LZMA_VERSION_COMMIT "" +#endif + + +/* + * Map symbolic stability levels to integers. + */ +#define LZMA_VERSION_STABILITY_ALPHA 0 +#define LZMA_VERSION_STABILITY_BETA 1 +#define LZMA_VERSION_STABILITY_STABLE 2 + + +/** + * \brief Compile-time version number + * + * The version number is of format xyyyzzzs where + * - x = major + * - yyy = minor + * - zzz = revision + * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable + * + * The same xyyyzzz triplet is never reused with different stability levels. + * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta + * or 5.1.0 stable. + * + * \note The version number of liblzma has nothing to with + * the version number of Igor Pavlov's LZMA SDK. + */ +#define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \ + + LZMA_VERSION_MINOR * UINT32_C(10000) \ + + LZMA_VERSION_PATCH * UINT32_C(10) \ + + LZMA_VERSION_STABILITY) + + +/* + * Macros to construct the compile-time version string + */ +#if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA +# define LZMA_VERSION_STABILITY_STRING "alpha" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA +# define LZMA_VERSION_STABILITY_STRING "beta" +#elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE +# define LZMA_VERSION_STABILITY_STRING "" +#else +# error Incorrect LZMA_VERSION_STABILITY +#endif + +#define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \ + #major "." #minor "." #patch stability commit + +#define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \ + LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) + + +/** + * \brief Compile-time version as a string + * + * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable + * versions don't have any "stable" suffix). In future, a snapshot built + * from source code repository may include an additional suffix, for example + * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form + * in LZMA_VERSION macro. + */ +#define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \ + LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \ + LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \ + LZMA_VERSION_COMMIT) + + +/* #ifndef is needed for use with windres (MinGW or Cygwin). */ +#ifndef LZMA_H_INTERNAL_RC + +/** + * \brief Run-time version number as an integer + * + * Return the value of LZMA_VERSION macro at the compile time of liblzma. + * This allows the application to compare if it was built against the same, + * older, or newer version of liblzma that is currently running. + */ +extern LZMA_API(uint32_t) lzma_version_number(void) + lzma_nothrow lzma_attr_const; + + +/** + * \brief Run-time version as a string + * + * This function may be useful if you want to display which version of + * liblzma your application is currently using. + */ +extern LZMA_API(const char *) lzma_version_string(void) + lzma_nothrow lzma_attr_const; + +#endif diff --git a/src/liblzma/api/lzma/vli.h b/src/liblzma/api/lzma/vli.h new file mode 100644 index 0000000..7a0a803 --- /dev/null +++ b/src/liblzma/api/lzma/vli.h @@ -0,0 +1,168 @@ +/** + * \file lzma/vli.h + * \brief Variable-length integer handling + * + * In the .xz format, most integers are encoded in a variable-length + * representation, which is sometimes called little endian base-128 encoding. + * This saves space when smaller values are more likely than bigger values. + * + * The encoding scheme encodes seven bits to every byte, using minimum + * number of bytes required to represent the given value. Encodings that use + * non-minimum number of bytes are invalid, thus every integer has exactly + * one encoded representation. The maximum number of bits in a VLI is 63, + * thus the vli argument must be less than or equal to UINT64_MAX / 2. You + * should use LZMA_VLI_MAX for clarity. + */ + +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * See ../lzma.h for information about liblzma as a whole. + */ + +#ifndef LZMA_H_INTERNAL +# error Never include this file directly. Use instead. +#endif + + +/** + * \brief Maximum supported value of a variable-length integer + */ +#define LZMA_VLI_MAX (UINT64_MAX / 2) + +/** + * \brief VLI value to denote that the value is unknown + */ +#define LZMA_VLI_UNKNOWN UINT64_MAX + +/** + * \brief Maximum supported encoded length of variable length integers + */ +#define LZMA_VLI_BYTES_MAX 9 + +/** + * \brief VLI constant suffix + */ +#define LZMA_VLI_C(n) UINT64_C(n) + + +/** + * \brief Variable-length integer type + * + * Valid VLI values are in the range [0, LZMA_VLI_MAX]. Unknown value is + * indicated with LZMA_VLI_UNKNOWN, which is the maximum value of the + * underlying integer type. + * + * lzma_vli will be uint64_t for the foreseeable future. If a bigger size + * is needed in the future, it is guaranteed that 2 * LZMA_VLI_MAX will + * not overflow lzma_vli. This simplifies integer overflow detection. + */ +typedef uint64_t lzma_vli; + + +/** + * \brief Validate a variable-length integer + * + * This is useful to test that application has given acceptable values + * for example in the uncompressed_size and compressed_size variables. + * + * \return True if the integer is representable as VLI or if it + * indicates unknown value. + */ +#define lzma_vli_is_valid(vli) \ + ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN) + + +/** + * \brief Encode a variable-length integer + * + * This function has two modes: single-call and multi-call. Single-call mode + * encodes the whole integer at once; it is an error if the output buffer is + * too small. Multi-call mode saves the position in *vli_pos, and thus it is + * possible to continue encoding if the buffer becomes full before the whole + * integer has been encoded. + * + * \param vli Integer to be encoded + * \param vli_pos How many VLI-encoded bytes have already been written + * out. When starting to encode a new integer in + * multi-call mode, *vli_pos must be set to zero. + * To use single-call encoding, set vli_pos to NULL. + * \param out Beginning of the output buffer + * \param out_pos The next byte will be written to out[*out_pos]. + * \param out_size Size of the out buffer; the first byte into + * which no data is written to is out[out_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully encoded. + * - LZMA_PROG_ERROR: Arguments are not sane. This can be due + * to too little output space; single-call mode doesn't use + * LZMA_BUF_ERROR, since the application should have checked + * the encoded size with lzma_vli_size(). + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely written out yet. + * - LZMA_STREAM_END: Integer successfully encoded. + * - LZMA_BUF_ERROR: No output space was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_encode(lzma_vli vli, size_t *vli_pos, + uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow; + + +/** + * \brief Decode a variable-length integer + * + * Like lzma_vli_encode(), this function has single-call and multi-call modes. + * + * \param vli Pointer to decoded integer. The decoder will + * initialize it to zero when *vli_pos == 0, so + * application isn't required to initialize *vli. + * \param vli_pos How many bytes have already been decoded. When + * starting to decode a new integer in multi-call + * mode, *vli_pos must be initialized to zero. To + * use single-call decoding, set vli_pos to NULL. + * \param in Beginning of the input buffer + * \param in_pos The next byte will be read from in[*in_pos]. + * \param in_size Size of the input buffer; the first byte that + * won't be read is in[in_size]. + * + * \return Slightly different return values are used in multi-call and + * single-call modes. + * + * Single-call (vli_pos == NULL): + * - LZMA_OK: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. This includes hitting + * the end of the input buffer before the whole integer was + * decoded; providing no input at all will use LZMA_DATA_ERROR. + * - LZMA_PROG_ERROR: Arguments are not sane. + * + * Multi-call (vli_pos != NULL): + * - LZMA_OK: So far all OK, but the integer is not + * completely decoded yet. + * - LZMA_STREAM_END: Integer successfully decoded. + * - LZMA_DATA_ERROR: Integer is corrupt. + * - LZMA_BUF_ERROR: No input was provided. + * - LZMA_PROG_ERROR: Arguments are not sane. + */ +extern LZMA_API(lzma_ret) lzma_vli_decode(lzma_vli *vli, size_t *vli_pos, + const uint8_t *in, size_t *in_pos, size_t in_size) + lzma_nothrow; + + +/** + * \brief Get the number of bytes required to encode a VLI + * + * \param vli Integer whose encoded size is to be determined + * + * \return Number of bytes on success (1-9). If vli isn't valid, + * zero is returned. + */ +extern LZMA_API(uint32_t) lzma_vli_size(lzma_vli vli) + lzma_nothrow lzma_attr_pure; diff --git a/src/liblzma/check/check.c b/src/liblzma/check/check.c new file mode 100644 index 0000000..428ddae --- /dev/null +++ b/src/liblzma/check/check.c @@ -0,0 +1,174 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file check.c +/// \brief Single API to access different integrity checks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +extern LZMA_API(lzma_bool) +lzma_check_is_supported(lzma_check type) +{ + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return false; + + static const lzma_bool available_checks[LZMA_CHECK_ID_MAX + 1] = { + true, // LZMA_CHECK_NONE + +#ifdef HAVE_CHECK_CRC32 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + +#ifdef HAVE_CHECK_CRC64 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + +#ifdef HAVE_CHECK_SHA256 + true, +#else + false, +#endif + + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + false, // Reserved + }; + + return available_checks[(unsigned int)(type)]; +} + + +extern LZMA_API(uint32_t) +lzma_check_size(lzma_check type) +{ + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return UINT32_MAX; + + // See file-format.txt section 2.1.1.2. + static const uint8_t check_sizes[LZMA_CHECK_ID_MAX + 1] = { + 0, + 4, 4, 4, + 8, 8, 8, + 16, 16, 16, + 32, 32, 32, + 64, 64, 64 + }; + + return check_sizes[(unsigned int)(type)]; +} + + +extern void +lzma_check_init(lzma_check_state *check, lzma_check type) +{ + switch (type) { + case LZMA_CHECK_NONE: + break; + +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->state.crc32 = 0; + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->state.crc64 = 0; + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_init(check); + break; +#endif + + default: + break; + } + + return; +} + + +extern void +lzma_check_update(lzma_check_state *check, lzma_check type, + const uint8_t *buf, size_t size) +{ + switch (type) { +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->state.crc32 = lzma_crc32(buf, size, check->state.crc32); + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->state.crc64 = lzma_crc64(buf, size, check->state.crc64); + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_update(buf, size, check); + break; +#endif + + default: + break; + } + + return; +} + + +extern void +lzma_check_finish(lzma_check_state *check, lzma_check type) +{ + switch (type) { +#ifdef HAVE_CHECK_CRC32 + case LZMA_CHECK_CRC32: + check->buffer.u32[0] = conv32le(check->state.crc32); + break; +#endif + +#ifdef HAVE_CHECK_CRC64 + case LZMA_CHECK_CRC64: + check->buffer.u64[0] = conv64le(check->state.crc64); + break; +#endif + +#ifdef HAVE_CHECK_SHA256 + case LZMA_CHECK_SHA256: + lzma_sha256_finish(check); + break; +#endif + + default: + break; + } + + return; +} diff --git a/src/liblzma/check/check.h b/src/liblzma/check/check.h new file mode 100644 index 0000000..3007d88 --- /dev/null +++ b/src/liblzma/check/check.h @@ -0,0 +1,172 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file check.h +/// \brief Internal API to different integrity check functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_CHECK_H +#define LZMA_CHECK_H + +#include "common.h" + +// If the function for external SHA-256 is missing, use the internal SHA-256 +// code. Due to how configure works, these defines can only get defined when +// both a usable header and a type have already been found. +#if !(defined(HAVE_CC_SHA256_INIT) \ + || defined(HAVE_SHA256_INIT) \ + || defined(HAVE_SHA256INIT)) +# define HAVE_INTERNAL_SHA256 1 +#endif + +#if defined(HAVE_INTERNAL_SHA256) +// Nothing +#elif defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H) +# include +#elif defined(HAVE_SHA256_H) +# include +# include +#elif defined(HAVE_SHA2_H) +# include +# include +#endif + +#if defined(HAVE_INTERNAL_SHA256) +/// State for the internal SHA-256 implementation +typedef struct { + /// Internal state + uint32_t state[8]; + + /// Size of the message excluding padding + uint64_t size; +} lzma_sha256_state; +#elif defined(HAVE_CC_SHA256_CTX) +typedef CC_SHA256_CTX lzma_sha256_state; +#elif defined(HAVE_SHA256_CTX) +typedef SHA256_CTX lzma_sha256_state; +#elif defined(HAVE_SHA2_CTX) +typedef SHA2_CTX lzma_sha256_state; +#endif + +#if defined(HAVE_INTERNAL_SHA256) +// Nothing +#elif defined(HAVE_CC_SHA256_INIT) +# define LZMA_SHA256FUNC(x) CC_SHA256_ ## x +#elif defined(HAVE_SHA256_INIT) +# define LZMA_SHA256FUNC(x) SHA256_ ## x +#elif defined(HAVE_SHA256INIT) +# define LZMA_SHA256FUNC(x) SHA256 ## x +#endif + +// Index hashing needs the best possible hash function (preferably +// a cryptographic hash) for maximum reliability. +#if defined(HAVE_CHECK_SHA256) +# define LZMA_CHECK_BEST LZMA_CHECK_SHA256 +#elif defined(HAVE_CHECK_CRC64) +# define LZMA_CHECK_BEST LZMA_CHECK_CRC64 +#else +# define LZMA_CHECK_BEST LZMA_CHECK_CRC32 +#endif + + +/// \brief Structure to hold internal state of the check being calculated +/// +/// \note This is not in the public API because this structure may +/// change in future if new integrity check algorithms are added. +typedef struct { + /// Buffer to hold the final result and a temporary buffer for SHA256. + union { + uint8_t u8[64]; + uint32_t u32[16]; + uint64_t u64[8]; + } buffer; + + /// Check-specific data + union { + uint32_t crc32; + uint64_t crc64; + lzma_sha256_state sha256; + } state; + +} lzma_check_state; + + +/// lzma_crc32_table[0] is needed by LZ encoder so we need to keep +/// the array two-dimensional. +#ifdef HAVE_SMALL +extern uint32_t lzma_crc32_table[1][256]; +extern void lzma_crc32_init(void); +#else +extern const uint32_t lzma_crc32_table[8][256]; +extern const uint64_t lzma_crc64_table[4][256]; +#endif + + +/// \brief Initialize *check depending on type +/// +/// \return LZMA_OK on success. LZMA_UNSUPPORTED_CHECK if the type is not +/// supported by the current version or build of liblzma. +/// LZMA_PROG_ERROR if type > LZMA_CHECK_ID_MAX. +extern void lzma_check_init(lzma_check_state *check, lzma_check type); + +/// Update the check state +extern void lzma_check_update(lzma_check_state *check, lzma_check type, + const uint8_t *buf, size_t size); + +/// Finish the check calculation and store the result to check->buffer.u8. +extern void lzma_check_finish(lzma_check_state *check, lzma_check type); + + +#ifndef LZMA_SHA256FUNC + +/// Prepare SHA-256 state for new input. +extern void lzma_sha256_init(lzma_check_state *check); + +/// Update the SHA-256 hash state +extern void lzma_sha256_update( + const uint8_t *buf, size_t size, lzma_check_state *check); + +/// Finish the SHA-256 calculation and store the result to check->buffer.u8. +extern void lzma_sha256_finish(lzma_check_state *check); + + +#else + +static inline void +lzma_sha256_init(lzma_check_state *check) +{ + LZMA_SHA256FUNC(Init)(&check->state.sha256); +} + + +static inline void +lzma_sha256_update(const uint8_t *buf, size_t size, lzma_check_state *check) +{ +#if defined(HAVE_CC_SHA256_INIT) && SIZE_MAX > UINT32_MAX + // Darwin's CC_SHA256_Update takes uint32_t as the buffer size, + // so use a loop to support size_t. + while (size > UINT32_MAX) { + LZMA_SHA256FUNC(Update)(&check->state.sha256, buf, UINT32_MAX); + buf += UINT32_MAX; + size -= UINT32_MAX; + } +#endif + + LZMA_SHA256FUNC(Update)(&check->state.sha256, buf, size); +} + + +static inline void +lzma_sha256_finish(lzma_check_state *check) +{ + LZMA_SHA256FUNC(Final)(check->buffer.u8, &check->state.sha256); +} + +#endif + +#endif diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c new file mode 100644 index 0000000..eed7350 --- /dev/null +++ b/src/liblzma/check/crc32_fast.c @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32.c +/// \brief CRC32 calculation +/// +/// Calculate the CRC32 using the slice-by-eight algorithm. +/// It is explained in this document: +/// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf +/// The code in this file is not the same as in Intel's paper, but +/// the basic principle is identical. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" +#include "crc_macros.h" + + +// If you make any changes, do some benchmarking! Seemingly unrelated +// changes can very easily ruin the performance (and very probably is +// very compiler dependent). +extern LZMA_API(uint32_t) +lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) +{ + crc = ~crc; + +#ifdef WORDS_BIGENDIAN + crc = bswap32(crc); +#endif + + if (size > 8) { + // Fix the alignment, if needed. The if statement above + // ensures that this won't read past the end of buf[]. + while ((uintptr_t)(buf) & 7) { + crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); + --size; + } + + // Calculate the position where to stop. + const uint8_t *const limit = buf + (size & ~(size_t)(7)); + + // Calculate how many bytes must be calculated separately + // before returning the result. + size &= (size_t)(7); + + // Calculate the CRC32 using the slice-by-eight algorithm. + while (buf < limit) { + crc ^= aligned_read32ne(buf); + buf += 4; + + crc = lzma_crc32_table[7][A(crc)] + ^ lzma_crc32_table[6][B(crc)] + ^ lzma_crc32_table[5][C(crc)] + ^ lzma_crc32_table[4][D(crc)]; + + const uint32_t tmp = aligned_read32ne(buf); + buf += 4; + + // At least with some compilers, it is critical for + // performance, that the crc variable is XORed + // between the two table-lookup pairs. + crc = lzma_crc32_table[3][A(tmp)] + ^ lzma_crc32_table[2][B(tmp)] + ^ crc + ^ lzma_crc32_table[1][C(tmp)] + ^ lzma_crc32_table[0][D(tmp)]; + } + } + + while (size-- != 0) + crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc); + +#ifdef WORDS_BIGENDIAN + crc = bswap32(crc); +#endif + + return ~crc; +} diff --git a/src/liblzma/check/crc32_small.c b/src/liblzma/check/crc32_small.c new file mode 100644 index 0000000..186966e --- /dev/null +++ b/src/liblzma/check/crc32_small.c @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_small.c +/// \brief CRC32 calculation (size-optimized) +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +uint32_t lzma_crc32_table[1][256]; + + +#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR +__attribute__((__constructor__)) +#endif +static void +crc32_init(void) +{ + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + for (size_t b = 0; b < 256; ++b) { + uint32_t r = b; + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + lzma_crc32_table[0][b] = r; + } + + return; +} + + +#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR +extern void +lzma_crc32_init(void) +{ + mythread_once(crc32_init); + return; +} +#endif + + +extern LZMA_API(uint32_t) +lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) +{ +#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR + lzma_crc32_init(); +#endif + + crc = ~crc; + + while (size != 0) { + crc = lzma_crc32_table[0][*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} diff --git a/src/liblzma/check/crc32_table.c b/src/liblzma/check/crc32_table.c new file mode 100644 index 0000000..b11762a --- /dev/null +++ b/src/liblzma/check/crc32_table.c @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_table.c +/// \brief Precalculated CRC32 table with correct endianness +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + +// Having the declaration here silences clang -Wmissing-variable-declarations. +extern const uint32_t lzma_crc32_table[8][256]; + +#ifdef WORDS_BIGENDIAN +# include "crc32_table_be.h" +#else +# include "crc32_table_le.h" +#endif diff --git a/src/liblzma/check/crc32_table_be.h b/src/liblzma/check/crc32_table_be.h new file mode 100644 index 0000000..c483cb6 --- /dev/null +++ b/src/liblzma/check/crc32_table_be.h @@ -0,0 +1,525 @@ +/* This file has been automatically generated by crc32_tablegen.c. */ + +const uint32_t lzma_crc32_table[8][256] = { + { + 0x00000000, 0x96300777, 0x2C610EEE, 0xBA510999, + 0x19C46D07, 0x8FF46A70, 0x35A563E9, 0xA395649E, + 0x3288DB0E, 0xA4B8DC79, 0x1EE9D5E0, 0x88D9D297, + 0x2B4CB609, 0xBD7CB17E, 0x072DB8E7, 0x911DBF90, + 0x6410B71D, 0xF220B06A, 0x4871B9F3, 0xDE41BE84, + 0x7DD4DA1A, 0xEBE4DD6D, 0x51B5D4F4, 0xC785D383, + 0x56986C13, 0xC0A86B64, 0x7AF962FD, 0xECC9658A, + 0x4F5C0114, 0xD96C0663, 0x633D0FFA, 0xF50D088D, + 0xC8206E3B, 0x5E10694C, 0xE44160D5, 0x727167A2, + 0xD1E4033C, 0x47D4044B, 0xFD850DD2, 0x6BB50AA5, + 0xFAA8B535, 0x6C98B242, 0xD6C9BBDB, 0x40F9BCAC, + 0xE36CD832, 0x755CDF45, 0xCF0DD6DC, 0x593DD1AB, + 0xAC30D926, 0x3A00DE51, 0x8051D7C8, 0x1661D0BF, + 0xB5F4B421, 0x23C4B356, 0x9995BACF, 0x0FA5BDB8, + 0x9EB80228, 0x0888055F, 0xB2D90CC6, 0x24E90BB1, + 0x877C6F2F, 0x114C6858, 0xAB1D61C1, 0x3D2D66B6, + 0x9041DC76, 0x0671DB01, 0xBC20D298, 0x2A10D5EF, + 0x8985B171, 0x1FB5B606, 0xA5E4BF9F, 0x33D4B8E8, + 0xA2C90778, 0x34F9000F, 0x8EA80996, 0x18980EE1, + 0xBB0D6A7F, 0x2D3D6D08, 0x976C6491, 0x015C63E6, + 0xF4516B6B, 0x62616C1C, 0xD8306585, 0x4E0062F2, + 0xED95066C, 0x7BA5011B, 0xC1F40882, 0x57C40FF5, + 0xC6D9B065, 0x50E9B712, 0xEAB8BE8B, 0x7C88B9FC, + 0xDF1DDD62, 0x492DDA15, 0xF37CD38C, 0x654CD4FB, + 0x5861B24D, 0xCE51B53A, 0x7400BCA3, 0xE230BBD4, + 0x41A5DF4A, 0xD795D83D, 0x6DC4D1A4, 0xFBF4D6D3, + 0x6AE96943, 0xFCD96E34, 0x468867AD, 0xD0B860DA, + 0x732D0444, 0xE51D0333, 0x5F4C0AAA, 0xC97C0DDD, + 0x3C710550, 0xAA410227, 0x10100BBE, 0x86200CC9, + 0x25B56857, 0xB3856F20, 0x09D466B9, 0x9FE461CE, + 0x0EF9DE5E, 0x98C9D929, 0x2298D0B0, 0xB4A8D7C7, + 0x173DB359, 0x810DB42E, 0x3B5CBDB7, 0xAD6CBAC0, + 0x2083B8ED, 0xB6B3BF9A, 0x0CE2B603, 0x9AD2B174, + 0x3947D5EA, 0xAF77D29D, 0x1526DB04, 0x8316DC73, + 0x120B63E3, 0x843B6494, 0x3E6A6D0D, 0xA85A6A7A, + 0x0BCF0EE4, 0x9DFF0993, 0x27AE000A, 0xB19E077D, + 0x44930FF0, 0xD2A30887, 0x68F2011E, 0xFEC20669, + 0x5D5762F7, 0xCB676580, 0x71366C19, 0xE7066B6E, + 0x761BD4FE, 0xE02BD389, 0x5A7ADA10, 0xCC4ADD67, + 0x6FDFB9F9, 0xF9EFBE8E, 0x43BEB717, 0xD58EB060, + 0xE8A3D6D6, 0x7E93D1A1, 0xC4C2D838, 0x52F2DF4F, + 0xF167BBD1, 0x6757BCA6, 0xDD06B53F, 0x4B36B248, + 0xDA2B0DD8, 0x4C1B0AAF, 0xF64A0336, 0x607A0441, + 0xC3EF60DF, 0x55DF67A8, 0xEF8E6E31, 0x79BE6946, + 0x8CB361CB, 0x1A8366BC, 0xA0D26F25, 0x36E26852, + 0x95770CCC, 0x03470BBB, 0xB9160222, 0x2F260555, + 0xBE3BBAC5, 0x280BBDB2, 0x925AB42B, 0x046AB35C, + 0xA7FFD7C2, 0x31CFD0B5, 0x8B9ED92C, 0x1DAEDE5B, + 0xB0C2649B, 0x26F263EC, 0x9CA36A75, 0x0A936D02, + 0xA906099C, 0x3F360EEB, 0x85670772, 0x13570005, + 0x824ABF95, 0x147AB8E2, 0xAE2BB17B, 0x381BB60C, + 0x9B8ED292, 0x0DBED5E5, 0xB7EFDC7C, 0x21DFDB0B, + 0xD4D2D386, 0x42E2D4F1, 0xF8B3DD68, 0x6E83DA1F, + 0xCD16BE81, 0x5B26B9F6, 0xE177B06F, 0x7747B718, + 0xE65A0888, 0x706A0FFF, 0xCA3B0666, 0x5C0B0111, + 0xFF9E658F, 0x69AE62F8, 0xD3FF6B61, 0x45CF6C16, + 0x78E20AA0, 0xEED20DD7, 0x5483044E, 0xC2B30339, + 0x612667A7, 0xF71660D0, 0x4D476949, 0xDB776E3E, + 0x4A6AD1AE, 0xDC5AD6D9, 0x660BDF40, 0xF03BD837, + 0x53AEBCA9, 0xC59EBBDE, 0x7FCFB247, 0xE9FFB530, + 0x1CF2BDBD, 0x8AC2BACA, 0x3093B353, 0xA6A3B424, + 0x0536D0BA, 0x9306D7CD, 0x2957DE54, 0xBF67D923, + 0x2E7A66B3, 0xB84A61C4, 0x021B685D, 0x942B6F2A, + 0x37BE0BB4, 0xA18E0CC3, 0x1BDF055A, 0x8DEF022D + }, { + 0x00000000, 0x41311B19, 0x82623632, 0xC3532D2B, + 0x04C56C64, 0x45F4777D, 0x86A75A56, 0xC796414F, + 0x088AD9C8, 0x49BBC2D1, 0x8AE8EFFA, 0xCBD9F4E3, + 0x0C4FB5AC, 0x4D7EAEB5, 0x8E2D839E, 0xCF1C9887, + 0x5112C24A, 0x1023D953, 0xD370F478, 0x9241EF61, + 0x55D7AE2E, 0x14E6B537, 0xD7B5981C, 0x96848305, + 0x59981B82, 0x18A9009B, 0xDBFA2DB0, 0x9ACB36A9, + 0x5D5D77E6, 0x1C6C6CFF, 0xDF3F41D4, 0x9E0E5ACD, + 0xA2248495, 0xE3159F8C, 0x2046B2A7, 0x6177A9BE, + 0xA6E1E8F1, 0xE7D0F3E8, 0x2483DEC3, 0x65B2C5DA, + 0xAAAE5D5D, 0xEB9F4644, 0x28CC6B6F, 0x69FD7076, + 0xAE6B3139, 0xEF5A2A20, 0x2C09070B, 0x6D381C12, + 0xF33646DF, 0xB2075DC6, 0x715470ED, 0x30656BF4, + 0xF7F32ABB, 0xB6C231A2, 0x75911C89, 0x34A00790, + 0xFBBC9F17, 0xBA8D840E, 0x79DEA925, 0x38EFB23C, + 0xFF79F373, 0xBE48E86A, 0x7D1BC541, 0x3C2ADE58, + 0x054F79F0, 0x447E62E9, 0x872D4FC2, 0xC61C54DB, + 0x018A1594, 0x40BB0E8D, 0x83E823A6, 0xC2D938BF, + 0x0DC5A038, 0x4CF4BB21, 0x8FA7960A, 0xCE968D13, + 0x0900CC5C, 0x4831D745, 0x8B62FA6E, 0xCA53E177, + 0x545DBBBA, 0x156CA0A3, 0xD63F8D88, 0x970E9691, + 0x5098D7DE, 0x11A9CCC7, 0xD2FAE1EC, 0x93CBFAF5, + 0x5CD76272, 0x1DE6796B, 0xDEB55440, 0x9F844F59, + 0x58120E16, 0x1923150F, 0xDA703824, 0x9B41233D, + 0xA76BFD65, 0xE65AE67C, 0x2509CB57, 0x6438D04E, + 0xA3AE9101, 0xE29F8A18, 0x21CCA733, 0x60FDBC2A, + 0xAFE124AD, 0xEED03FB4, 0x2D83129F, 0x6CB20986, + 0xAB2448C9, 0xEA1553D0, 0x29467EFB, 0x687765E2, + 0xF6793F2F, 0xB7482436, 0x741B091D, 0x352A1204, + 0xF2BC534B, 0xB38D4852, 0x70DE6579, 0x31EF7E60, + 0xFEF3E6E7, 0xBFC2FDFE, 0x7C91D0D5, 0x3DA0CBCC, + 0xFA368A83, 0xBB07919A, 0x7854BCB1, 0x3965A7A8, + 0x4B98833B, 0x0AA99822, 0xC9FAB509, 0x88CBAE10, + 0x4F5DEF5F, 0x0E6CF446, 0xCD3FD96D, 0x8C0EC274, + 0x43125AF3, 0x022341EA, 0xC1706CC1, 0x804177D8, + 0x47D73697, 0x06E62D8E, 0xC5B500A5, 0x84841BBC, + 0x1A8A4171, 0x5BBB5A68, 0x98E87743, 0xD9D96C5A, + 0x1E4F2D15, 0x5F7E360C, 0x9C2D1B27, 0xDD1C003E, + 0x120098B9, 0x533183A0, 0x9062AE8B, 0xD153B592, + 0x16C5F4DD, 0x57F4EFC4, 0x94A7C2EF, 0xD596D9F6, + 0xE9BC07AE, 0xA88D1CB7, 0x6BDE319C, 0x2AEF2A85, + 0xED796BCA, 0xAC4870D3, 0x6F1B5DF8, 0x2E2A46E1, + 0xE136DE66, 0xA007C57F, 0x6354E854, 0x2265F34D, + 0xE5F3B202, 0xA4C2A91B, 0x67918430, 0x26A09F29, + 0xB8AEC5E4, 0xF99FDEFD, 0x3ACCF3D6, 0x7BFDE8CF, + 0xBC6BA980, 0xFD5AB299, 0x3E099FB2, 0x7F3884AB, + 0xB0241C2C, 0xF1150735, 0x32462A1E, 0x73773107, + 0xB4E17048, 0xF5D06B51, 0x3683467A, 0x77B25D63, + 0x4ED7FACB, 0x0FE6E1D2, 0xCCB5CCF9, 0x8D84D7E0, + 0x4A1296AF, 0x0B238DB6, 0xC870A09D, 0x8941BB84, + 0x465D2303, 0x076C381A, 0xC43F1531, 0x850E0E28, + 0x42984F67, 0x03A9547E, 0xC0FA7955, 0x81CB624C, + 0x1FC53881, 0x5EF42398, 0x9DA70EB3, 0xDC9615AA, + 0x1B0054E5, 0x5A314FFC, 0x996262D7, 0xD85379CE, + 0x174FE149, 0x567EFA50, 0x952DD77B, 0xD41CCC62, + 0x138A8D2D, 0x52BB9634, 0x91E8BB1F, 0xD0D9A006, + 0xECF37E5E, 0xADC26547, 0x6E91486C, 0x2FA05375, + 0xE836123A, 0xA9070923, 0x6A542408, 0x2B653F11, + 0xE479A796, 0xA548BC8F, 0x661B91A4, 0x272A8ABD, + 0xE0BCCBF2, 0xA18DD0EB, 0x62DEFDC0, 0x23EFE6D9, + 0xBDE1BC14, 0xFCD0A70D, 0x3F838A26, 0x7EB2913F, + 0xB924D070, 0xF815CB69, 0x3B46E642, 0x7A77FD5B, + 0xB56B65DC, 0xF45A7EC5, 0x370953EE, 0x763848F7, + 0xB1AE09B8, 0xF09F12A1, 0x33CC3F8A, 0x72FD2493 + }, { + 0x00000000, 0x376AC201, 0x6ED48403, 0x59BE4602, + 0xDCA80907, 0xEBC2CB06, 0xB27C8D04, 0x85164F05, + 0xB851130E, 0x8F3BD10F, 0xD685970D, 0xE1EF550C, + 0x64F91A09, 0x5393D808, 0x0A2D9E0A, 0x3D475C0B, + 0x70A3261C, 0x47C9E41D, 0x1E77A21F, 0x291D601E, + 0xAC0B2F1B, 0x9B61ED1A, 0xC2DFAB18, 0xF5B56919, + 0xC8F23512, 0xFF98F713, 0xA626B111, 0x914C7310, + 0x145A3C15, 0x2330FE14, 0x7A8EB816, 0x4DE47A17, + 0xE0464D38, 0xD72C8F39, 0x8E92C93B, 0xB9F80B3A, + 0x3CEE443F, 0x0B84863E, 0x523AC03C, 0x6550023D, + 0x58175E36, 0x6F7D9C37, 0x36C3DA35, 0x01A91834, + 0x84BF5731, 0xB3D59530, 0xEA6BD332, 0xDD011133, + 0x90E56B24, 0xA78FA925, 0xFE31EF27, 0xC95B2D26, + 0x4C4D6223, 0x7B27A022, 0x2299E620, 0x15F32421, + 0x28B4782A, 0x1FDEBA2B, 0x4660FC29, 0x710A3E28, + 0xF41C712D, 0xC376B32C, 0x9AC8F52E, 0xADA2372F, + 0xC08D9A70, 0xF7E75871, 0xAE591E73, 0x9933DC72, + 0x1C259377, 0x2B4F5176, 0x72F11774, 0x459BD575, + 0x78DC897E, 0x4FB64B7F, 0x16080D7D, 0x2162CF7C, + 0xA4748079, 0x931E4278, 0xCAA0047A, 0xFDCAC67B, + 0xB02EBC6C, 0x87447E6D, 0xDEFA386F, 0xE990FA6E, + 0x6C86B56B, 0x5BEC776A, 0x02523168, 0x3538F369, + 0x087FAF62, 0x3F156D63, 0x66AB2B61, 0x51C1E960, + 0xD4D7A665, 0xE3BD6464, 0xBA032266, 0x8D69E067, + 0x20CBD748, 0x17A11549, 0x4E1F534B, 0x7975914A, + 0xFC63DE4F, 0xCB091C4E, 0x92B75A4C, 0xA5DD984D, + 0x989AC446, 0xAFF00647, 0xF64E4045, 0xC1248244, + 0x4432CD41, 0x73580F40, 0x2AE64942, 0x1D8C8B43, + 0x5068F154, 0x67023355, 0x3EBC7557, 0x09D6B756, + 0x8CC0F853, 0xBBAA3A52, 0xE2147C50, 0xD57EBE51, + 0xE839E25A, 0xDF53205B, 0x86ED6659, 0xB187A458, + 0x3491EB5D, 0x03FB295C, 0x5A456F5E, 0x6D2FAD5F, + 0x801B35E1, 0xB771F7E0, 0xEECFB1E2, 0xD9A573E3, + 0x5CB33CE6, 0x6BD9FEE7, 0x3267B8E5, 0x050D7AE4, + 0x384A26EF, 0x0F20E4EE, 0x569EA2EC, 0x61F460ED, + 0xE4E22FE8, 0xD388EDE9, 0x8A36ABEB, 0xBD5C69EA, + 0xF0B813FD, 0xC7D2D1FC, 0x9E6C97FE, 0xA90655FF, + 0x2C101AFA, 0x1B7AD8FB, 0x42C49EF9, 0x75AE5CF8, + 0x48E900F3, 0x7F83C2F2, 0x263D84F0, 0x115746F1, + 0x944109F4, 0xA32BCBF5, 0xFA958DF7, 0xCDFF4FF6, + 0x605D78D9, 0x5737BAD8, 0x0E89FCDA, 0x39E33EDB, + 0xBCF571DE, 0x8B9FB3DF, 0xD221F5DD, 0xE54B37DC, + 0xD80C6BD7, 0xEF66A9D6, 0xB6D8EFD4, 0x81B22DD5, + 0x04A462D0, 0x33CEA0D1, 0x6A70E6D3, 0x5D1A24D2, + 0x10FE5EC5, 0x27949CC4, 0x7E2ADAC6, 0x494018C7, + 0xCC5657C2, 0xFB3C95C3, 0xA282D3C1, 0x95E811C0, + 0xA8AF4DCB, 0x9FC58FCA, 0xC67BC9C8, 0xF1110BC9, + 0x740744CC, 0x436D86CD, 0x1AD3C0CF, 0x2DB902CE, + 0x4096AF91, 0x77FC6D90, 0x2E422B92, 0x1928E993, + 0x9C3EA696, 0xAB546497, 0xF2EA2295, 0xC580E094, + 0xF8C7BC9F, 0xCFAD7E9E, 0x9613389C, 0xA179FA9D, + 0x246FB598, 0x13057799, 0x4ABB319B, 0x7DD1F39A, + 0x3035898D, 0x075F4B8C, 0x5EE10D8E, 0x698BCF8F, + 0xEC9D808A, 0xDBF7428B, 0x82490489, 0xB523C688, + 0x88649A83, 0xBF0E5882, 0xE6B01E80, 0xD1DADC81, + 0x54CC9384, 0x63A65185, 0x3A181787, 0x0D72D586, + 0xA0D0E2A9, 0x97BA20A8, 0xCE0466AA, 0xF96EA4AB, + 0x7C78EBAE, 0x4B1229AF, 0x12AC6FAD, 0x25C6ADAC, + 0x1881F1A7, 0x2FEB33A6, 0x765575A4, 0x413FB7A5, + 0xC429F8A0, 0xF3433AA1, 0xAAFD7CA3, 0x9D97BEA2, + 0xD073C4B5, 0xE71906B4, 0xBEA740B6, 0x89CD82B7, + 0x0CDBCDB2, 0x3BB10FB3, 0x620F49B1, 0x55658BB0, + 0x6822D7BB, 0x5F4815BA, 0x06F653B8, 0x319C91B9, + 0xB48ADEBC, 0x83E01CBD, 0xDA5E5ABF, 0xED3498BE + }, { + 0x00000000, 0x6567BCB8, 0x8BC809AA, 0xEEAFB512, + 0x5797628F, 0x32F0DE37, 0xDC5F6B25, 0xB938D79D, + 0xEF28B4C5, 0x8A4F087D, 0x64E0BD6F, 0x018701D7, + 0xB8BFD64A, 0xDDD86AF2, 0x3377DFE0, 0x56106358, + 0x9F571950, 0xFA30A5E8, 0x149F10FA, 0x71F8AC42, + 0xC8C07BDF, 0xADA7C767, 0x43087275, 0x266FCECD, + 0x707FAD95, 0x1518112D, 0xFBB7A43F, 0x9ED01887, + 0x27E8CF1A, 0x428F73A2, 0xAC20C6B0, 0xC9477A08, + 0x3EAF32A0, 0x5BC88E18, 0xB5673B0A, 0xD00087B2, + 0x6938502F, 0x0C5FEC97, 0xE2F05985, 0x8797E53D, + 0xD1878665, 0xB4E03ADD, 0x5A4F8FCF, 0x3F283377, + 0x8610E4EA, 0xE3775852, 0x0DD8ED40, 0x68BF51F8, + 0xA1F82BF0, 0xC49F9748, 0x2A30225A, 0x4F579EE2, + 0xF66F497F, 0x9308F5C7, 0x7DA740D5, 0x18C0FC6D, + 0x4ED09F35, 0x2BB7238D, 0xC518969F, 0xA07F2A27, + 0x1947FDBA, 0x7C204102, 0x928FF410, 0xF7E848A8, + 0x3D58149B, 0x583FA823, 0xB6901D31, 0xD3F7A189, + 0x6ACF7614, 0x0FA8CAAC, 0xE1077FBE, 0x8460C306, + 0xD270A05E, 0xB7171CE6, 0x59B8A9F4, 0x3CDF154C, + 0x85E7C2D1, 0xE0807E69, 0x0E2FCB7B, 0x6B4877C3, + 0xA20F0DCB, 0xC768B173, 0x29C70461, 0x4CA0B8D9, + 0xF5986F44, 0x90FFD3FC, 0x7E5066EE, 0x1B37DA56, + 0x4D27B90E, 0x284005B6, 0xC6EFB0A4, 0xA3880C1C, + 0x1AB0DB81, 0x7FD76739, 0x9178D22B, 0xF41F6E93, + 0x03F7263B, 0x66909A83, 0x883F2F91, 0xED589329, + 0x546044B4, 0x3107F80C, 0xDFA84D1E, 0xBACFF1A6, + 0xECDF92FE, 0x89B82E46, 0x67179B54, 0x027027EC, + 0xBB48F071, 0xDE2F4CC9, 0x3080F9DB, 0x55E74563, + 0x9CA03F6B, 0xF9C783D3, 0x176836C1, 0x720F8A79, + 0xCB375DE4, 0xAE50E15C, 0x40FF544E, 0x2598E8F6, + 0x73888BAE, 0x16EF3716, 0xF8408204, 0x9D273EBC, + 0x241FE921, 0x41785599, 0xAFD7E08B, 0xCAB05C33, + 0x3BB659ED, 0x5ED1E555, 0xB07E5047, 0xD519ECFF, + 0x6C213B62, 0x094687DA, 0xE7E932C8, 0x828E8E70, + 0xD49EED28, 0xB1F95190, 0x5F56E482, 0x3A31583A, + 0x83098FA7, 0xE66E331F, 0x08C1860D, 0x6DA63AB5, + 0xA4E140BD, 0xC186FC05, 0x2F294917, 0x4A4EF5AF, + 0xF3762232, 0x96119E8A, 0x78BE2B98, 0x1DD99720, + 0x4BC9F478, 0x2EAE48C0, 0xC001FDD2, 0xA566416A, + 0x1C5E96F7, 0x79392A4F, 0x97969F5D, 0xF2F123E5, + 0x05196B4D, 0x607ED7F5, 0x8ED162E7, 0xEBB6DE5F, + 0x528E09C2, 0x37E9B57A, 0xD9460068, 0xBC21BCD0, + 0xEA31DF88, 0x8F566330, 0x61F9D622, 0x049E6A9A, + 0xBDA6BD07, 0xD8C101BF, 0x366EB4AD, 0x53090815, + 0x9A4E721D, 0xFF29CEA5, 0x11867BB7, 0x74E1C70F, + 0xCDD91092, 0xA8BEAC2A, 0x46111938, 0x2376A580, + 0x7566C6D8, 0x10017A60, 0xFEAECF72, 0x9BC973CA, + 0x22F1A457, 0x479618EF, 0xA939ADFD, 0xCC5E1145, + 0x06EE4D76, 0x6389F1CE, 0x8D2644DC, 0xE841F864, + 0x51792FF9, 0x341E9341, 0xDAB12653, 0xBFD69AEB, + 0xE9C6F9B3, 0x8CA1450B, 0x620EF019, 0x07694CA1, + 0xBE519B3C, 0xDB362784, 0x35999296, 0x50FE2E2E, + 0x99B95426, 0xFCDEE89E, 0x12715D8C, 0x7716E134, + 0xCE2E36A9, 0xAB498A11, 0x45E63F03, 0x208183BB, + 0x7691E0E3, 0x13F65C5B, 0xFD59E949, 0x983E55F1, + 0x2106826C, 0x44613ED4, 0xAACE8BC6, 0xCFA9377E, + 0x38417FD6, 0x5D26C36E, 0xB389767C, 0xD6EECAC4, + 0x6FD61D59, 0x0AB1A1E1, 0xE41E14F3, 0x8179A84B, + 0xD769CB13, 0xB20E77AB, 0x5CA1C2B9, 0x39C67E01, + 0x80FEA99C, 0xE5991524, 0x0B36A036, 0x6E511C8E, + 0xA7166686, 0xC271DA3E, 0x2CDE6F2C, 0x49B9D394, + 0xF0810409, 0x95E6B8B1, 0x7B490DA3, 0x1E2EB11B, + 0x483ED243, 0x2D596EFB, 0xC3F6DBE9, 0xA6916751, + 0x1FA9B0CC, 0x7ACE0C74, 0x9461B966, 0xF10605DE + }, { + 0x00000000, 0xB029603D, 0x6053C07A, 0xD07AA047, + 0xC0A680F5, 0x708FE0C8, 0xA0F5408F, 0x10DC20B2, + 0xC14B7030, 0x7162100D, 0xA118B04A, 0x1131D077, + 0x01EDF0C5, 0xB1C490F8, 0x61BE30BF, 0xD1975082, + 0x8297E060, 0x32BE805D, 0xE2C4201A, 0x52ED4027, + 0x42316095, 0xF21800A8, 0x2262A0EF, 0x924BC0D2, + 0x43DC9050, 0xF3F5F06D, 0x238F502A, 0x93A63017, + 0x837A10A5, 0x33537098, 0xE329D0DF, 0x5300B0E2, + 0x042FC1C1, 0xB406A1FC, 0x647C01BB, 0xD4556186, + 0xC4894134, 0x74A02109, 0xA4DA814E, 0x14F3E173, + 0xC564B1F1, 0x754DD1CC, 0xA537718B, 0x151E11B6, + 0x05C23104, 0xB5EB5139, 0x6591F17E, 0xD5B89143, + 0x86B821A1, 0x3691419C, 0xE6EBE1DB, 0x56C281E6, + 0x461EA154, 0xF637C169, 0x264D612E, 0x96640113, + 0x47F35191, 0xF7DA31AC, 0x27A091EB, 0x9789F1D6, + 0x8755D164, 0x377CB159, 0xE706111E, 0x572F7123, + 0x4958F358, 0xF9719365, 0x290B3322, 0x9922531F, + 0x89FE73AD, 0x39D71390, 0xE9ADB3D7, 0x5984D3EA, + 0x88138368, 0x383AE355, 0xE8404312, 0x5869232F, + 0x48B5039D, 0xF89C63A0, 0x28E6C3E7, 0x98CFA3DA, + 0xCBCF1338, 0x7BE67305, 0xAB9CD342, 0x1BB5B37F, + 0x0B6993CD, 0xBB40F3F0, 0x6B3A53B7, 0xDB13338A, + 0x0A846308, 0xBAAD0335, 0x6AD7A372, 0xDAFEC34F, + 0xCA22E3FD, 0x7A0B83C0, 0xAA712387, 0x1A5843BA, + 0x4D773299, 0xFD5E52A4, 0x2D24F2E3, 0x9D0D92DE, + 0x8DD1B26C, 0x3DF8D251, 0xED827216, 0x5DAB122B, + 0x8C3C42A9, 0x3C152294, 0xEC6F82D3, 0x5C46E2EE, + 0x4C9AC25C, 0xFCB3A261, 0x2CC90226, 0x9CE0621B, + 0xCFE0D2F9, 0x7FC9B2C4, 0xAFB31283, 0x1F9A72BE, + 0x0F46520C, 0xBF6F3231, 0x6F159276, 0xDF3CF24B, + 0x0EABA2C9, 0xBE82C2F4, 0x6EF862B3, 0xDED1028E, + 0xCE0D223C, 0x7E244201, 0xAE5EE246, 0x1E77827B, + 0x92B0E6B1, 0x2299868C, 0xF2E326CB, 0x42CA46F6, + 0x52166644, 0xE23F0679, 0x3245A63E, 0x826CC603, + 0x53FB9681, 0xE3D2F6BC, 0x33A856FB, 0x838136C6, + 0x935D1674, 0x23747649, 0xF30ED60E, 0x4327B633, + 0x102706D1, 0xA00E66EC, 0x7074C6AB, 0xC05DA696, + 0xD0818624, 0x60A8E619, 0xB0D2465E, 0x00FB2663, + 0xD16C76E1, 0x614516DC, 0xB13FB69B, 0x0116D6A6, + 0x11CAF614, 0xA1E39629, 0x7199366E, 0xC1B05653, + 0x969F2770, 0x26B6474D, 0xF6CCE70A, 0x46E58737, + 0x5639A785, 0xE610C7B8, 0x366A67FF, 0x864307C2, + 0x57D45740, 0xE7FD377D, 0x3787973A, 0x87AEF707, + 0x9772D7B5, 0x275BB788, 0xF72117CF, 0x470877F2, + 0x1408C710, 0xA421A72D, 0x745B076A, 0xC4726757, + 0xD4AE47E5, 0x648727D8, 0xB4FD879F, 0x04D4E7A2, + 0xD543B720, 0x656AD71D, 0xB510775A, 0x05391767, + 0x15E537D5, 0xA5CC57E8, 0x75B6F7AF, 0xC59F9792, + 0xDBE815E9, 0x6BC175D4, 0xBBBBD593, 0x0B92B5AE, + 0x1B4E951C, 0xAB67F521, 0x7B1D5566, 0xCB34355B, + 0x1AA365D9, 0xAA8A05E4, 0x7AF0A5A3, 0xCAD9C59E, + 0xDA05E52C, 0x6A2C8511, 0xBA562556, 0x0A7F456B, + 0x597FF589, 0xE95695B4, 0x392C35F3, 0x890555CE, + 0x99D9757C, 0x29F01541, 0xF98AB506, 0x49A3D53B, + 0x983485B9, 0x281DE584, 0xF86745C3, 0x484E25FE, + 0x5892054C, 0xE8BB6571, 0x38C1C536, 0x88E8A50B, + 0xDFC7D428, 0x6FEEB415, 0xBF941452, 0x0FBD746F, + 0x1F6154DD, 0xAF4834E0, 0x7F3294A7, 0xCF1BF49A, + 0x1E8CA418, 0xAEA5C425, 0x7EDF6462, 0xCEF6045F, + 0xDE2A24ED, 0x6E0344D0, 0xBE79E497, 0x0E5084AA, + 0x5D503448, 0xED795475, 0x3D03F432, 0x8D2A940F, + 0x9DF6B4BD, 0x2DDFD480, 0xFDA574C7, 0x4D8C14FA, + 0x9C1B4478, 0x2C322445, 0xFC488402, 0x4C61E43F, + 0x5CBDC48D, 0xEC94A4B0, 0x3CEE04F7, 0x8CC764CA + }, { + 0x00000000, 0xA5D35CCB, 0x0BA1C84D, 0xAE729486, + 0x1642919B, 0xB391CD50, 0x1DE359D6, 0xB830051D, + 0x6D8253EC, 0xC8510F27, 0x66239BA1, 0xC3F0C76A, + 0x7BC0C277, 0xDE139EBC, 0x70610A3A, 0xD5B256F1, + 0x9B02D603, 0x3ED18AC8, 0x90A31E4E, 0x35704285, + 0x8D404798, 0x28931B53, 0x86E18FD5, 0x2332D31E, + 0xF68085EF, 0x5353D924, 0xFD214DA2, 0x58F21169, + 0xE0C21474, 0x451148BF, 0xEB63DC39, 0x4EB080F2, + 0x3605AC07, 0x93D6F0CC, 0x3DA4644A, 0x98773881, + 0x20473D9C, 0x85946157, 0x2BE6F5D1, 0x8E35A91A, + 0x5B87FFEB, 0xFE54A320, 0x502637A6, 0xF5F56B6D, + 0x4DC56E70, 0xE81632BB, 0x4664A63D, 0xE3B7FAF6, + 0xAD077A04, 0x08D426CF, 0xA6A6B249, 0x0375EE82, + 0xBB45EB9F, 0x1E96B754, 0xB0E423D2, 0x15377F19, + 0xC08529E8, 0x65567523, 0xCB24E1A5, 0x6EF7BD6E, + 0xD6C7B873, 0x7314E4B8, 0xDD66703E, 0x78B52CF5, + 0x6C0A580F, 0xC9D904C4, 0x67AB9042, 0xC278CC89, + 0x7A48C994, 0xDF9B955F, 0x71E901D9, 0xD43A5D12, + 0x01880BE3, 0xA45B5728, 0x0A29C3AE, 0xAFFA9F65, + 0x17CA9A78, 0xB219C6B3, 0x1C6B5235, 0xB9B80EFE, + 0xF7088E0C, 0x52DBD2C7, 0xFCA94641, 0x597A1A8A, + 0xE14A1F97, 0x4499435C, 0xEAEBD7DA, 0x4F388B11, + 0x9A8ADDE0, 0x3F59812B, 0x912B15AD, 0x34F84966, + 0x8CC84C7B, 0x291B10B0, 0x87698436, 0x22BAD8FD, + 0x5A0FF408, 0xFFDCA8C3, 0x51AE3C45, 0xF47D608E, + 0x4C4D6593, 0xE99E3958, 0x47ECADDE, 0xE23FF115, + 0x378DA7E4, 0x925EFB2F, 0x3C2C6FA9, 0x99FF3362, + 0x21CF367F, 0x841C6AB4, 0x2A6EFE32, 0x8FBDA2F9, + 0xC10D220B, 0x64DE7EC0, 0xCAACEA46, 0x6F7FB68D, + 0xD74FB390, 0x729CEF5B, 0xDCEE7BDD, 0x793D2716, + 0xAC8F71E7, 0x095C2D2C, 0xA72EB9AA, 0x02FDE561, + 0xBACDE07C, 0x1F1EBCB7, 0xB16C2831, 0x14BF74FA, + 0xD814B01E, 0x7DC7ECD5, 0xD3B57853, 0x76662498, + 0xCE562185, 0x6B857D4E, 0xC5F7E9C8, 0x6024B503, + 0xB596E3F2, 0x1045BF39, 0xBE372BBF, 0x1BE47774, + 0xA3D47269, 0x06072EA2, 0xA875BA24, 0x0DA6E6EF, + 0x4316661D, 0xE6C53AD6, 0x48B7AE50, 0xED64F29B, + 0x5554F786, 0xF087AB4D, 0x5EF53FCB, 0xFB266300, + 0x2E9435F1, 0x8B47693A, 0x2535FDBC, 0x80E6A177, + 0x38D6A46A, 0x9D05F8A1, 0x33776C27, 0x96A430EC, + 0xEE111C19, 0x4BC240D2, 0xE5B0D454, 0x4063889F, + 0xF8538D82, 0x5D80D149, 0xF3F245CF, 0x56211904, + 0x83934FF5, 0x2640133E, 0x883287B8, 0x2DE1DB73, + 0x95D1DE6E, 0x300282A5, 0x9E701623, 0x3BA34AE8, + 0x7513CA1A, 0xD0C096D1, 0x7EB20257, 0xDB615E9C, + 0x63515B81, 0xC682074A, 0x68F093CC, 0xCD23CF07, + 0x189199F6, 0xBD42C53D, 0x133051BB, 0xB6E30D70, + 0x0ED3086D, 0xAB0054A6, 0x0572C020, 0xA0A19CEB, + 0xB41EE811, 0x11CDB4DA, 0xBFBF205C, 0x1A6C7C97, + 0xA25C798A, 0x078F2541, 0xA9FDB1C7, 0x0C2EED0C, + 0xD99CBBFD, 0x7C4FE736, 0xD23D73B0, 0x77EE2F7B, + 0xCFDE2A66, 0x6A0D76AD, 0xC47FE22B, 0x61ACBEE0, + 0x2F1C3E12, 0x8ACF62D9, 0x24BDF65F, 0x816EAA94, + 0x395EAF89, 0x9C8DF342, 0x32FF67C4, 0x972C3B0F, + 0x429E6DFE, 0xE74D3135, 0x493FA5B3, 0xECECF978, + 0x54DCFC65, 0xF10FA0AE, 0x5F7D3428, 0xFAAE68E3, + 0x821B4416, 0x27C818DD, 0x89BA8C5B, 0x2C69D090, + 0x9459D58D, 0x318A8946, 0x9FF81DC0, 0x3A2B410B, + 0xEF9917FA, 0x4A4A4B31, 0xE438DFB7, 0x41EB837C, + 0xF9DB8661, 0x5C08DAAA, 0xF27A4E2C, 0x57A912E7, + 0x19199215, 0xBCCACEDE, 0x12B85A58, 0xB76B0693, + 0x0F5B038E, 0xAA885F45, 0x04FACBC3, 0xA1299708, + 0x749BC1F9, 0xD1489D32, 0x7F3A09B4, 0xDAE9557F, + 0x62D95062, 0xC70A0CA9, 0x6978982F, 0xCCABC4E4 + }, { + 0x00000000, 0xB40B77A6, 0x29119F97, 0x9D1AE831, + 0x13244FF4, 0xA72F3852, 0x3A35D063, 0x8E3EA7C5, + 0x674EEF33, 0xD3459895, 0x4E5F70A4, 0xFA540702, + 0x746AA0C7, 0xC061D761, 0x5D7B3F50, 0xE97048F6, + 0xCE9CDE67, 0x7A97A9C1, 0xE78D41F0, 0x53863656, + 0xDDB89193, 0x69B3E635, 0xF4A90E04, 0x40A279A2, + 0xA9D23154, 0x1DD946F2, 0x80C3AEC3, 0x34C8D965, + 0xBAF67EA0, 0x0EFD0906, 0x93E7E137, 0x27EC9691, + 0x9C39BDCF, 0x2832CA69, 0xB5282258, 0x012355FE, + 0x8F1DF23B, 0x3B16859D, 0xA60C6DAC, 0x12071A0A, + 0xFB7752FC, 0x4F7C255A, 0xD266CD6B, 0x666DBACD, + 0xE8531D08, 0x5C586AAE, 0xC142829F, 0x7549F539, + 0x52A563A8, 0xE6AE140E, 0x7BB4FC3F, 0xCFBF8B99, + 0x41812C5C, 0xF58A5BFA, 0x6890B3CB, 0xDC9BC46D, + 0x35EB8C9B, 0x81E0FB3D, 0x1CFA130C, 0xA8F164AA, + 0x26CFC36F, 0x92C4B4C9, 0x0FDE5CF8, 0xBBD52B5E, + 0x79750B44, 0xCD7E7CE2, 0x506494D3, 0xE46FE375, + 0x6A5144B0, 0xDE5A3316, 0x4340DB27, 0xF74BAC81, + 0x1E3BE477, 0xAA3093D1, 0x372A7BE0, 0x83210C46, + 0x0D1FAB83, 0xB914DC25, 0x240E3414, 0x900543B2, + 0xB7E9D523, 0x03E2A285, 0x9EF84AB4, 0x2AF33D12, + 0xA4CD9AD7, 0x10C6ED71, 0x8DDC0540, 0x39D772E6, + 0xD0A73A10, 0x64AC4DB6, 0xF9B6A587, 0x4DBDD221, + 0xC38375E4, 0x77880242, 0xEA92EA73, 0x5E999DD5, + 0xE54CB68B, 0x5147C12D, 0xCC5D291C, 0x78565EBA, + 0xF668F97F, 0x42638ED9, 0xDF7966E8, 0x6B72114E, + 0x820259B8, 0x36092E1E, 0xAB13C62F, 0x1F18B189, + 0x9126164C, 0x252D61EA, 0xB83789DB, 0x0C3CFE7D, + 0x2BD068EC, 0x9FDB1F4A, 0x02C1F77B, 0xB6CA80DD, + 0x38F42718, 0x8CFF50BE, 0x11E5B88F, 0xA5EECF29, + 0x4C9E87DF, 0xF895F079, 0x658F1848, 0xD1846FEE, + 0x5FBAC82B, 0xEBB1BF8D, 0x76AB57BC, 0xC2A0201A, + 0xF2EA1688, 0x46E1612E, 0xDBFB891F, 0x6FF0FEB9, + 0xE1CE597C, 0x55C52EDA, 0xC8DFC6EB, 0x7CD4B14D, + 0x95A4F9BB, 0x21AF8E1D, 0xBCB5662C, 0x08BE118A, + 0x8680B64F, 0x328BC1E9, 0xAF9129D8, 0x1B9A5E7E, + 0x3C76C8EF, 0x887DBF49, 0x15675778, 0xA16C20DE, + 0x2F52871B, 0x9B59F0BD, 0x0643188C, 0xB2486F2A, + 0x5B3827DC, 0xEF33507A, 0x7229B84B, 0xC622CFED, + 0x481C6828, 0xFC171F8E, 0x610DF7BF, 0xD5068019, + 0x6ED3AB47, 0xDAD8DCE1, 0x47C234D0, 0xF3C94376, + 0x7DF7E4B3, 0xC9FC9315, 0x54E67B24, 0xE0ED0C82, + 0x099D4474, 0xBD9633D2, 0x208CDBE3, 0x9487AC45, + 0x1AB90B80, 0xAEB27C26, 0x33A89417, 0x87A3E3B1, + 0xA04F7520, 0x14440286, 0x895EEAB7, 0x3D559D11, + 0xB36B3AD4, 0x07604D72, 0x9A7AA543, 0x2E71D2E5, + 0xC7019A13, 0x730AEDB5, 0xEE100584, 0x5A1B7222, + 0xD425D5E7, 0x602EA241, 0xFD344A70, 0x493F3DD6, + 0x8B9F1DCC, 0x3F946A6A, 0xA28E825B, 0x1685F5FD, + 0x98BB5238, 0x2CB0259E, 0xB1AACDAF, 0x05A1BA09, + 0xECD1F2FF, 0x58DA8559, 0xC5C06D68, 0x71CB1ACE, + 0xFFF5BD0B, 0x4BFECAAD, 0xD6E4229C, 0x62EF553A, + 0x4503C3AB, 0xF108B40D, 0x6C125C3C, 0xD8192B9A, + 0x56278C5F, 0xE22CFBF9, 0x7F3613C8, 0xCB3D646E, + 0x224D2C98, 0x96465B3E, 0x0B5CB30F, 0xBF57C4A9, + 0x3169636C, 0x856214CA, 0x1878FCFB, 0xAC738B5D, + 0x17A6A003, 0xA3ADD7A5, 0x3EB73F94, 0x8ABC4832, + 0x0482EFF7, 0xB0899851, 0x2D937060, 0x999807C6, + 0x70E84F30, 0xC4E33896, 0x59F9D0A7, 0xEDF2A701, + 0x63CC00C4, 0xD7C77762, 0x4ADD9F53, 0xFED6E8F5, + 0xD93A7E64, 0x6D3109C2, 0xF02BE1F3, 0x44209655, + 0xCA1E3190, 0x7E154636, 0xE30FAE07, 0x5704D9A1, + 0xBE749157, 0x0A7FE6F1, 0x97650EC0, 0x236E7966, + 0xAD50DEA3, 0x195BA905, 0x84414134, 0x304A3692 + }, { + 0x00000000, 0x9E00AACC, 0x7D072542, 0xE3078F8E, + 0xFA0E4A84, 0x640EE048, 0x87096FC6, 0x1909C50A, + 0xB51BE5D3, 0x2B1B4F1F, 0xC81CC091, 0x561C6A5D, + 0x4F15AF57, 0xD115059B, 0x32128A15, 0xAC1220D9, + 0x2B31BB7C, 0xB53111B0, 0x56369E3E, 0xC83634F2, + 0xD13FF1F8, 0x4F3F5B34, 0xAC38D4BA, 0x32387E76, + 0x9E2A5EAF, 0x002AF463, 0xE32D7BED, 0x7D2DD121, + 0x6424142B, 0xFA24BEE7, 0x19233169, 0x87239BA5, + 0x566276F9, 0xC862DC35, 0x2B6553BB, 0xB565F977, + 0xAC6C3C7D, 0x326C96B1, 0xD16B193F, 0x4F6BB3F3, + 0xE379932A, 0x7D7939E6, 0x9E7EB668, 0x007E1CA4, + 0x1977D9AE, 0x87777362, 0x6470FCEC, 0xFA705620, + 0x7D53CD85, 0xE3536749, 0x0054E8C7, 0x9E54420B, + 0x875D8701, 0x195D2DCD, 0xFA5AA243, 0x645A088F, + 0xC8482856, 0x5648829A, 0xB54F0D14, 0x2B4FA7D8, + 0x324662D2, 0xAC46C81E, 0x4F414790, 0xD141ED5C, + 0xEDC29D29, 0x73C237E5, 0x90C5B86B, 0x0EC512A7, + 0x17CCD7AD, 0x89CC7D61, 0x6ACBF2EF, 0xF4CB5823, + 0x58D978FA, 0xC6D9D236, 0x25DE5DB8, 0xBBDEF774, + 0xA2D7327E, 0x3CD798B2, 0xDFD0173C, 0x41D0BDF0, + 0xC6F32655, 0x58F38C99, 0xBBF40317, 0x25F4A9DB, + 0x3CFD6CD1, 0xA2FDC61D, 0x41FA4993, 0xDFFAE35F, + 0x73E8C386, 0xEDE8694A, 0x0EEFE6C4, 0x90EF4C08, + 0x89E68902, 0x17E623CE, 0xF4E1AC40, 0x6AE1068C, + 0xBBA0EBD0, 0x25A0411C, 0xC6A7CE92, 0x58A7645E, + 0x41AEA154, 0xDFAE0B98, 0x3CA98416, 0xA2A92EDA, + 0x0EBB0E03, 0x90BBA4CF, 0x73BC2B41, 0xEDBC818D, + 0xF4B54487, 0x6AB5EE4B, 0x89B261C5, 0x17B2CB09, + 0x909150AC, 0x0E91FA60, 0xED9675EE, 0x7396DF22, + 0x6A9F1A28, 0xF49FB0E4, 0x17983F6A, 0x899895A6, + 0x258AB57F, 0xBB8A1FB3, 0x588D903D, 0xC68D3AF1, + 0xDF84FFFB, 0x41845537, 0xA283DAB9, 0x3C837075, + 0xDA853B53, 0x4485919F, 0xA7821E11, 0x3982B4DD, + 0x208B71D7, 0xBE8BDB1B, 0x5D8C5495, 0xC38CFE59, + 0x6F9EDE80, 0xF19E744C, 0x1299FBC2, 0x8C99510E, + 0x95909404, 0x0B903EC8, 0xE897B146, 0x76971B8A, + 0xF1B4802F, 0x6FB42AE3, 0x8CB3A56D, 0x12B30FA1, + 0x0BBACAAB, 0x95BA6067, 0x76BDEFE9, 0xE8BD4525, + 0x44AF65FC, 0xDAAFCF30, 0x39A840BE, 0xA7A8EA72, + 0xBEA12F78, 0x20A185B4, 0xC3A60A3A, 0x5DA6A0F6, + 0x8CE74DAA, 0x12E7E766, 0xF1E068E8, 0x6FE0C224, + 0x76E9072E, 0xE8E9ADE2, 0x0BEE226C, 0x95EE88A0, + 0x39FCA879, 0xA7FC02B5, 0x44FB8D3B, 0xDAFB27F7, + 0xC3F2E2FD, 0x5DF24831, 0xBEF5C7BF, 0x20F56D73, + 0xA7D6F6D6, 0x39D65C1A, 0xDAD1D394, 0x44D17958, + 0x5DD8BC52, 0xC3D8169E, 0x20DF9910, 0xBEDF33DC, + 0x12CD1305, 0x8CCDB9C9, 0x6FCA3647, 0xF1CA9C8B, + 0xE8C35981, 0x76C3F34D, 0x95C47CC3, 0x0BC4D60F, + 0x3747A67A, 0xA9470CB6, 0x4A408338, 0xD44029F4, + 0xCD49ECFE, 0x53494632, 0xB04EC9BC, 0x2E4E6370, + 0x825C43A9, 0x1C5CE965, 0xFF5B66EB, 0x615BCC27, + 0x7852092D, 0xE652A3E1, 0x05552C6F, 0x9B5586A3, + 0x1C761D06, 0x8276B7CA, 0x61713844, 0xFF719288, + 0xE6785782, 0x7878FD4E, 0x9B7F72C0, 0x057FD80C, + 0xA96DF8D5, 0x376D5219, 0xD46ADD97, 0x4A6A775B, + 0x5363B251, 0xCD63189D, 0x2E649713, 0xB0643DDF, + 0x6125D083, 0xFF257A4F, 0x1C22F5C1, 0x82225F0D, + 0x9B2B9A07, 0x052B30CB, 0xE62CBF45, 0x782C1589, + 0xD43E3550, 0x4A3E9F9C, 0xA9391012, 0x3739BADE, + 0x2E307FD4, 0xB030D518, 0x53375A96, 0xCD37F05A, + 0x4A146BFF, 0xD414C133, 0x37134EBD, 0xA913E471, + 0xB01A217B, 0x2E1A8BB7, 0xCD1D0439, 0x531DAEF5, + 0xFF0F8E2C, 0x610F24E0, 0x8208AB6E, 0x1C0801A2, + 0x0501C4A8, 0x9B016E64, 0x7806E1EA, 0xE6064B26 + } +}; diff --git a/src/liblzma/check/crc32_table_le.h b/src/liblzma/check/crc32_table_le.h new file mode 100644 index 0000000..25f4fc4 --- /dev/null +++ b/src/liblzma/check/crc32_table_le.h @@ -0,0 +1,525 @@ +/* This file has been automatically generated by crc32_tablegen.c. */ + +const uint32_t lzma_crc32_table[8][256] = { + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }, { + 0x00000000, 0x191B3141, 0x32366282, 0x2B2D53C3, + 0x646CC504, 0x7D77F445, 0x565AA786, 0x4F4196C7, + 0xC8D98A08, 0xD1C2BB49, 0xFAEFE88A, 0xE3F4D9CB, + 0xACB54F0C, 0xB5AE7E4D, 0x9E832D8E, 0x87981CCF, + 0x4AC21251, 0x53D92310, 0x78F470D3, 0x61EF4192, + 0x2EAED755, 0x37B5E614, 0x1C98B5D7, 0x05838496, + 0x821B9859, 0x9B00A918, 0xB02DFADB, 0xA936CB9A, + 0xE6775D5D, 0xFF6C6C1C, 0xD4413FDF, 0xCD5A0E9E, + 0x958424A2, 0x8C9F15E3, 0xA7B24620, 0xBEA97761, + 0xF1E8E1A6, 0xE8F3D0E7, 0xC3DE8324, 0xDAC5B265, + 0x5D5DAEAA, 0x44469FEB, 0x6F6BCC28, 0x7670FD69, + 0x39316BAE, 0x202A5AEF, 0x0B07092C, 0x121C386D, + 0xDF4636F3, 0xC65D07B2, 0xED705471, 0xF46B6530, + 0xBB2AF3F7, 0xA231C2B6, 0x891C9175, 0x9007A034, + 0x179FBCFB, 0x0E848DBA, 0x25A9DE79, 0x3CB2EF38, + 0x73F379FF, 0x6AE848BE, 0x41C51B7D, 0x58DE2A3C, + 0xF0794F05, 0xE9627E44, 0xC24F2D87, 0xDB541CC6, + 0x94158A01, 0x8D0EBB40, 0xA623E883, 0xBF38D9C2, + 0x38A0C50D, 0x21BBF44C, 0x0A96A78F, 0x138D96CE, + 0x5CCC0009, 0x45D73148, 0x6EFA628B, 0x77E153CA, + 0xBABB5D54, 0xA3A06C15, 0x888D3FD6, 0x91960E97, + 0xDED79850, 0xC7CCA911, 0xECE1FAD2, 0xF5FACB93, + 0x7262D75C, 0x6B79E61D, 0x4054B5DE, 0x594F849F, + 0x160E1258, 0x0F152319, 0x243870DA, 0x3D23419B, + 0x65FD6BA7, 0x7CE65AE6, 0x57CB0925, 0x4ED03864, + 0x0191AEA3, 0x188A9FE2, 0x33A7CC21, 0x2ABCFD60, + 0xAD24E1AF, 0xB43FD0EE, 0x9F12832D, 0x8609B26C, + 0xC94824AB, 0xD05315EA, 0xFB7E4629, 0xE2657768, + 0x2F3F79F6, 0x362448B7, 0x1D091B74, 0x04122A35, + 0x4B53BCF2, 0x52488DB3, 0x7965DE70, 0x607EEF31, + 0xE7E6F3FE, 0xFEFDC2BF, 0xD5D0917C, 0xCCCBA03D, + 0x838A36FA, 0x9A9107BB, 0xB1BC5478, 0xA8A76539, + 0x3B83984B, 0x2298A90A, 0x09B5FAC9, 0x10AECB88, + 0x5FEF5D4F, 0x46F46C0E, 0x6DD93FCD, 0x74C20E8C, + 0xF35A1243, 0xEA412302, 0xC16C70C1, 0xD8774180, + 0x9736D747, 0x8E2DE606, 0xA500B5C5, 0xBC1B8484, + 0x71418A1A, 0x685ABB5B, 0x4377E898, 0x5A6CD9D9, + 0x152D4F1E, 0x0C367E5F, 0x271B2D9C, 0x3E001CDD, + 0xB9980012, 0xA0833153, 0x8BAE6290, 0x92B553D1, + 0xDDF4C516, 0xC4EFF457, 0xEFC2A794, 0xF6D996D5, + 0xAE07BCE9, 0xB71C8DA8, 0x9C31DE6B, 0x852AEF2A, + 0xCA6B79ED, 0xD37048AC, 0xF85D1B6F, 0xE1462A2E, + 0x66DE36E1, 0x7FC507A0, 0x54E85463, 0x4DF36522, + 0x02B2F3E5, 0x1BA9C2A4, 0x30849167, 0x299FA026, + 0xE4C5AEB8, 0xFDDE9FF9, 0xD6F3CC3A, 0xCFE8FD7B, + 0x80A96BBC, 0x99B25AFD, 0xB29F093E, 0xAB84387F, + 0x2C1C24B0, 0x350715F1, 0x1E2A4632, 0x07317773, + 0x4870E1B4, 0x516BD0F5, 0x7A468336, 0x635DB277, + 0xCBFAD74E, 0xD2E1E60F, 0xF9CCB5CC, 0xE0D7848D, + 0xAF96124A, 0xB68D230B, 0x9DA070C8, 0x84BB4189, + 0x03235D46, 0x1A386C07, 0x31153FC4, 0x280E0E85, + 0x674F9842, 0x7E54A903, 0x5579FAC0, 0x4C62CB81, + 0x8138C51F, 0x9823F45E, 0xB30EA79D, 0xAA1596DC, + 0xE554001B, 0xFC4F315A, 0xD7626299, 0xCE7953D8, + 0x49E14F17, 0x50FA7E56, 0x7BD72D95, 0x62CC1CD4, + 0x2D8D8A13, 0x3496BB52, 0x1FBBE891, 0x06A0D9D0, + 0x5E7EF3EC, 0x4765C2AD, 0x6C48916E, 0x7553A02F, + 0x3A1236E8, 0x230907A9, 0x0824546A, 0x113F652B, + 0x96A779E4, 0x8FBC48A5, 0xA4911B66, 0xBD8A2A27, + 0xF2CBBCE0, 0xEBD08DA1, 0xC0FDDE62, 0xD9E6EF23, + 0x14BCE1BD, 0x0DA7D0FC, 0x268A833F, 0x3F91B27E, + 0x70D024B9, 0x69CB15F8, 0x42E6463B, 0x5BFD777A, + 0xDC656BB5, 0xC57E5AF4, 0xEE530937, 0xF7483876, + 0xB809AEB1, 0xA1129FF0, 0x8A3FCC33, 0x9324FD72 + }, { + 0x00000000, 0x01C26A37, 0x0384D46E, 0x0246BE59, + 0x0709A8DC, 0x06CBC2EB, 0x048D7CB2, 0x054F1685, + 0x0E1351B8, 0x0FD13B8F, 0x0D9785D6, 0x0C55EFE1, + 0x091AF964, 0x08D89353, 0x0A9E2D0A, 0x0B5C473D, + 0x1C26A370, 0x1DE4C947, 0x1FA2771E, 0x1E601D29, + 0x1B2F0BAC, 0x1AED619B, 0x18ABDFC2, 0x1969B5F5, + 0x1235F2C8, 0x13F798FF, 0x11B126A6, 0x10734C91, + 0x153C5A14, 0x14FE3023, 0x16B88E7A, 0x177AE44D, + 0x384D46E0, 0x398F2CD7, 0x3BC9928E, 0x3A0BF8B9, + 0x3F44EE3C, 0x3E86840B, 0x3CC03A52, 0x3D025065, + 0x365E1758, 0x379C7D6F, 0x35DAC336, 0x3418A901, + 0x3157BF84, 0x3095D5B3, 0x32D36BEA, 0x331101DD, + 0x246BE590, 0x25A98FA7, 0x27EF31FE, 0x262D5BC9, + 0x23624D4C, 0x22A0277B, 0x20E69922, 0x2124F315, + 0x2A78B428, 0x2BBADE1F, 0x29FC6046, 0x283E0A71, + 0x2D711CF4, 0x2CB376C3, 0x2EF5C89A, 0x2F37A2AD, + 0x709A8DC0, 0x7158E7F7, 0x731E59AE, 0x72DC3399, + 0x7793251C, 0x76514F2B, 0x7417F172, 0x75D59B45, + 0x7E89DC78, 0x7F4BB64F, 0x7D0D0816, 0x7CCF6221, + 0x798074A4, 0x78421E93, 0x7A04A0CA, 0x7BC6CAFD, + 0x6CBC2EB0, 0x6D7E4487, 0x6F38FADE, 0x6EFA90E9, + 0x6BB5866C, 0x6A77EC5B, 0x68315202, 0x69F33835, + 0x62AF7F08, 0x636D153F, 0x612BAB66, 0x60E9C151, + 0x65A6D7D4, 0x6464BDE3, 0x662203BA, 0x67E0698D, + 0x48D7CB20, 0x4915A117, 0x4B531F4E, 0x4A917579, + 0x4FDE63FC, 0x4E1C09CB, 0x4C5AB792, 0x4D98DDA5, + 0x46C49A98, 0x4706F0AF, 0x45404EF6, 0x448224C1, + 0x41CD3244, 0x400F5873, 0x4249E62A, 0x438B8C1D, + 0x54F16850, 0x55330267, 0x5775BC3E, 0x56B7D609, + 0x53F8C08C, 0x523AAABB, 0x507C14E2, 0x51BE7ED5, + 0x5AE239E8, 0x5B2053DF, 0x5966ED86, 0x58A487B1, + 0x5DEB9134, 0x5C29FB03, 0x5E6F455A, 0x5FAD2F6D, + 0xE1351B80, 0xE0F771B7, 0xE2B1CFEE, 0xE373A5D9, + 0xE63CB35C, 0xE7FED96B, 0xE5B86732, 0xE47A0D05, + 0xEF264A38, 0xEEE4200F, 0xECA29E56, 0xED60F461, + 0xE82FE2E4, 0xE9ED88D3, 0xEBAB368A, 0xEA695CBD, + 0xFD13B8F0, 0xFCD1D2C7, 0xFE976C9E, 0xFF5506A9, + 0xFA1A102C, 0xFBD87A1B, 0xF99EC442, 0xF85CAE75, + 0xF300E948, 0xF2C2837F, 0xF0843D26, 0xF1465711, + 0xF4094194, 0xF5CB2BA3, 0xF78D95FA, 0xF64FFFCD, + 0xD9785D60, 0xD8BA3757, 0xDAFC890E, 0xDB3EE339, + 0xDE71F5BC, 0xDFB39F8B, 0xDDF521D2, 0xDC374BE5, + 0xD76B0CD8, 0xD6A966EF, 0xD4EFD8B6, 0xD52DB281, + 0xD062A404, 0xD1A0CE33, 0xD3E6706A, 0xD2241A5D, + 0xC55EFE10, 0xC49C9427, 0xC6DA2A7E, 0xC7184049, + 0xC25756CC, 0xC3953CFB, 0xC1D382A2, 0xC011E895, + 0xCB4DAFA8, 0xCA8FC59F, 0xC8C97BC6, 0xC90B11F1, + 0xCC440774, 0xCD866D43, 0xCFC0D31A, 0xCE02B92D, + 0x91AF9640, 0x906DFC77, 0x922B422E, 0x93E92819, + 0x96A63E9C, 0x976454AB, 0x9522EAF2, 0x94E080C5, + 0x9FBCC7F8, 0x9E7EADCF, 0x9C381396, 0x9DFA79A1, + 0x98B56F24, 0x99770513, 0x9B31BB4A, 0x9AF3D17D, + 0x8D893530, 0x8C4B5F07, 0x8E0DE15E, 0x8FCF8B69, + 0x8A809DEC, 0x8B42F7DB, 0x89044982, 0x88C623B5, + 0x839A6488, 0x82580EBF, 0x801EB0E6, 0x81DCDAD1, + 0x8493CC54, 0x8551A663, 0x8717183A, 0x86D5720D, + 0xA9E2D0A0, 0xA820BA97, 0xAA6604CE, 0xABA46EF9, + 0xAEEB787C, 0xAF29124B, 0xAD6FAC12, 0xACADC625, + 0xA7F18118, 0xA633EB2F, 0xA4755576, 0xA5B73F41, + 0xA0F829C4, 0xA13A43F3, 0xA37CFDAA, 0xA2BE979D, + 0xB5C473D0, 0xB40619E7, 0xB640A7BE, 0xB782CD89, + 0xB2CDDB0C, 0xB30FB13B, 0xB1490F62, 0xB08B6555, + 0xBBD72268, 0xBA15485F, 0xB853F606, 0xB9919C31, + 0xBCDE8AB4, 0xBD1CE083, 0xBF5A5EDA, 0xBE9834ED + }, { + 0x00000000, 0xB8BC6765, 0xAA09C88B, 0x12B5AFEE, + 0x8F629757, 0x37DEF032, 0x256B5FDC, 0x9DD738B9, + 0xC5B428EF, 0x7D084F8A, 0x6FBDE064, 0xD7018701, + 0x4AD6BFB8, 0xF26AD8DD, 0xE0DF7733, 0x58631056, + 0x5019579F, 0xE8A530FA, 0xFA109F14, 0x42ACF871, + 0xDF7BC0C8, 0x67C7A7AD, 0x75720843, 0xCDCE6F26, + 0x95AD7F70, 0x2D111815, 0x3FA4B7FB, 0x8718D09E, + 0x1ACFE827, 0xA2738F42, 0xB0C620AC, 0x087A47C9, + 0xA032AF3E, 0x188EC85B, 0x0A3B67B5, 0xB28700D0, + 0x2F503869, 0x97EC5F0C, 0x8559F0E2, 0x3DE59787, + 0x658687D1, 0xDD3AE0B4, 0xCF8F4F5A, 0x7733283F, + 0xEAE41086, 0x525877E3, 0x40EDD80D, 0xF851BF68, + 0xF02BF8A1, 0x48979FC4, 0x5A22302A, 0xE29E574F, + 0x7F496FF6, 0xC7F50893, 0xD540A77D, 0x6DFCC018, + 0x359FD04E, 0x8D23B72B, 0x9F9618C5, 0x272A7FA0, + 0xBAFD4719, 0x0241207C, 0x10F48F92, 0xA848E8F7, + 0x9B14583D, 0x23A83F58, 0x311D90B6, 0x89A1F7D3, + 0x1476CF6A, 0xACCAA80F, 0xBE7F07E1, 0x06C36084, + 0x5EA070D2, 0xE61C17B7, 0xF4A9B859, 0x4C15DF3C, + 0xD1C2E785, 0x697E80E0, 0x7BCB2F0E, 0xC377486B, + 0xCB0D0FA2, 0x73B168C7, 0x6104C729, 0xD9B8A04C, + 0x446F98F5, 0xFCD3FF90, 0xEE66507E, 0x56DA371B, + 0x0EB9274D, 0xB6054028, 0xA4B0EFC6, 0x1C0C88A3, + 0x81DBB01A, 0x3967D77F, 0x2BD27891, 0x936E1FF4, + 0x3B26F703, 0x839A9066, 0x912F3F88, 0x299358ED, + 0xB4446054, 0x0CF80731, 0x1E4DA8DF, 0xA6F1CFBA, + 0xFE92DFEC, 0x462EB889, 0x549B1767, 0xEC277002, + 0x71F048BB, 0xC94C2FDE, 0xDBF98030, 0x6345E755, + 0x6B3FA09C, 0xD383C7F9, 0xC1366817, 0x798A0F72, + 0xE45D37CB, 0x5CE150AE, 0x4E54FF40, 0xF6E89825, + 0xAE8B8873, 0x1637EF16, 0x048240F8, 0xBC3E279D, + 0x21E91F24, 0x99557841, 0x8BE0D7AF, 0x335CB0CA, + 0xED59B63B, 0x55E5D15E, 0x47507EB0, 0xFFEC19D5, + 0x623B216C, 0xDA874609, 0xC832E9E7, 0x708E8E82, + 0x28ED9ED4, 0x9051F9B1, 0x82E4565F, 0x3A58313A, + 0xA78F0983, 0x1F336EE6, 0x0D86C108, 0xB53AA66D, + 0xBD40E1A4, 0x05FC86C1, 0x1749292F, 0xAFF54E4A, + 0x322276F3, 0x8A9E1196, 0x982BBE78, 0x2097D91D, + 0x78F4C94B, 0xC048AE2E, 0xD2FD01C0, 0x6A4166A5, + 0xF7965E1C, 0x4F2A3979, 0x5D9F9697, 0xE523F1F2, + 0x4D6B1905, 0xF5D77E60, 0xE762D18E, 0x5FDEB6EB, + 0xC2098E52, 0x7AB5E937, 0x680046D9, 0xD0BC21BC, + 0x88DF31EA, 0x3063568F, 0x22D6F961, 0x9A6A9E04, + 0x07BDA6BD, 0xBF01C1D8, 0xADB46E36, 0x15080953, + 0x1D724E9A, 0xA5CE29FF, 0xB77B8611, 0x0FC7E174, + 0x9210D9CD, 0x2AACBEA8, 0x38191146, 0x80A57623, + 0xD8C66675, 0x607A0110, 0x72CFAEFE, 0xCA73C99B, + 0x57A4F122, 0xEF189647, 0xFDAD39A9, 0x45115ECC, + 0x764DEE06, 0xCEF18963, 0xDC44268D, 0x64F841E8, + 0xF92F7951, 0x41931E34, 0x5326B1DA, 0xEB9AD6BF, + 0xB3F9C6E9, 0x0B45A18C, 0x19F00E62, 0xA14C6907, + 0x3C9B51BE, 0x842736DB, 0x96929935, 0x2E2EFE50, + 0x2654B999, 0x9EE8DEFC, 0x8C5D7112, 0x34E11677, + 0xA9362ECE, 0x118A49AB, 0x033FE645, 0xBB838120, + 0xE3E09176, 0x5B5CF613, 0x49E959FD, 0xF1553E98, + 0x6C820621, 0xD43E6144, 0xC68BCEAA, 0x7E37A9CF, + 0xD67F4138, 0x6EC3265D, 0x7C7689B3, 0xC4CAEED6, + 0x591DD66F, 0xE1A1B10A, 0xF3141EE4, 0x4BA87981, + 0x13CB69D7, 0xAB770EB2, 0xB9C2A15C, 0x017EC639, + 0x9CA9FE80, 0x241599E5, 0x36A0360B, 0x8E1C516E, + 0x866616A7, 0x3EDA71C2, 0x2C6FDE2C, 0x94D3B949, + 0x090481F0, 0xB1B8E695, 0xA30D497B, 0x1BB12E1E, + 0x43D23E48, 0xFB6E592D, 0xE9DBF6C3, 0x516791A6, + 0xCCB0A91F, 0x740CCE7A, 0x66B96194, 0xDE0506F1 + }, { + 0x00000000, 0x3D6029B0, 0x7AC05360, 0x47A07AD0, + 0xF580A6C0, 0xC8E08F70, 0x8F40F5A0, 0xB220DC10, + 0x30704BC1, 0x0D106271, 0x4AB018A1, 0x77D03111, + 0xC5F0ED01, 0xF890C4B1, 0xBF30BE61, 0x825097D1, + 0x60E09782, 0x5D80BE32, 0x1A20C4E2, 0x2740ED52, + 0x95603142, 0xA80018F2, 0xEFA06222, 0xD2C04B92, + 0x5090DC43, 0x6DF0F5F3, 0x2A508F23, 0x1730A693, + 0xA5107A83, 0x98705333, 0xDFD029E3, 0xE2B00053, + 0xC1C12F04, 0xFCA106B4, 0xBB017C64, 0x866155D4, + 0x344189C4, 0x0921A074, 0x4E81DAA4, 0x73E1F314, + 0xF1B164C5, 0xCCD14D75, 0x8B7137A5, 0xB6111E15, + 0x0431C205, 0x3951EBB5, 0x7EF19165, 0x4391B8D5, + 0xA121B886, 0x9C419136, 0xDBE1EBE6, 0xE681C256, + 0x54A11E46, 0x69C137F6, 0x2E614D26, 0x13016496, + 0x9151F347, 0xAC31DAF7, 0xEB91A027, 0xD6F18997, + 0x64D15587, 0x59B17C37, 0x1E1106E7, 0x23712F57, + 0x58F35849, 0x659371F9, 0x22330B29, 0x1F532299, + 0xAD73FE89, 0x9013D739, 0xD7B3ADE9, 0xEAD38459, + 0x68831388, 0x55E33A38, 0x124340E8, 0x2F236958, + 0x9D03B548, 0xA0639CF8, 0xE7C3E628, 0xDAA3CF98, + 0x3813CFCB, 0x0573E67B, 0x42D39CAB, 0x7FB3B51B, + 0xCD93690B, 0xF0F340BB, 0xB7533A6B, 0x8A3313DB, + 0x0863840A, 0x3503ADBA, 0x72A3D76A, 0x4FC3FEDA, + 0xFDE322CA, 0xC0830B7A, 0x872371AA, 0xBA43581A, + 0x9932774D, 0xA4525EFD, 0xE3F2242D, 0xDE920D9D, + 0x6CB2D18D, 0x51D2F83D, 0x167282ED, 0x2B12AB5D, + 0xA9423C8C, 0x9422153C, 0xD3826FEC, 0xEEE2465C, + 0x5CC29A4C, 0x61A2B3FC, 0x2602C92C, 0x1B62E09C, + 0xF9D2E0CF, 0xC4B2C97F, 0x8312B3AF, 0xBE729A1F, + 0x0C52460F, 0x31326FBF, 0x7692156F, 0x4BF23CDF, + 0xC9A2AB0E, 0xF4C282BE, 0xB362F86E, 0x8E02D1DE, + 0x3C220DCE, 0x0142247E, 0x46E25EAE, 0x7B82771E, + 0xB1E6B092, 0x8C869922, 0xCB26E3F2, 0xF646CA42, + 0x44661652, 0x79063FE2, 0x3EA64532, 0x03C66C82, + 0x8196FB53, 0xBCF6D2E3, 0xFB56A833, 0xC6368183, + 0x74165D93, 0x49767423, 0x0ED60EF3, 0x33B62743, + 0xD1062710, 0xEC660EA0, 0xABC67470, 0x96A65DC0, + 0x248681D0, 0x19E6A860, 0x5E46D2B0, 0x6326FB00, + 0xE1766CD1, 0xDC164561, 0x9BB63FB1, 0xA6D61601, + 0x14F6CA11, 0x2996E3A1, 0x6E369971, 0x5356B0C1, + 0x70279F96, 0x4D47B626, 0x0AE7CCF6, 0x3787E546, + 0x85A73956, 0xB8C710E6, 0xFF676A36, 0xC2074386, + 0x4057D457, 0x7D37FDE7, 0x3A978737, 0x07F7AE87, + 0xB5D77297, 0x88B75B27, 0xCF1721F7, 0xF2770847, + 0x10C70814, 0x2DA721A4, 0x6A075B74, 0x576772C4, + 0xE547AED4, 0xD8278764, 0x9F87FDB4, 0xA2E7D404, + 0x20B743D5, 0x1DD76A65, 0x5A7710B5, 0x67173905, + 0xD537E515, 0xE857CCA5, 0xAFF7B675, 0x92979FC5, + 0xE915E8DB, 0xD475C16B, 0x93D5BBBB, 0xAEB5920B, + 0x1C954E1B, 0x21F567AB, 0x66551D7B, 0x5B3534CB, + 0xD965A31A, 0xE4058AAA, 0xA3A5F07A, 0x9EC5D9CA, + 0x2CE505DA, 0x11852C6A, 0x562556BA, 0x6B457F0A, + 0x89F57F59, 0xB49556E9, 0xF3352C39, 0xCE550589, + 0x7C75D999, 0x4115F029, 0x06B58AF9, 0x3BD5A349, + 0xB9853498, 0x84E51D28, 0xC34567F8, 0xFE254E48, + 0x4C059258, 0x7165BBE8, 0x36C5C138, 0x0BA5E888, + 0x28D4C7DF, 0x15B4EE6F, 0x521494BF, 0x6F74BD0F, + 0xDD54611F, 0xE03448AF, 0xA794327F, 0x9AF41BCF, + 0x18A48C1E, 0x25C4A5AE, 0x6264DF7E, 0x5F04F6CE, + 0xED242ADE, 0xD044036E, 0x97E479BE, 0xAA84500E, + 0x4834505D, 0x755479ED, 0x32F4033D, 0x0F942A8D, + 0xBDB4F69D, 0x80D4DF2D, 0xC774A5FD, 0xFA148C4D, + 0x78441B9C, 0x4524322C, 0x028448FC, 0x3FE4614C, + 0x8DC4BD5C, 0xB0A494EC, 0xF704EE3C, 0xCA64C78C + }, { + 0x00000000, 0xCB5CD3A5, 0x4DC8A10B, 0x869472AE, + 0x9B914216, 0x50CD91B3, 0xD659E31D, 0x1D0530B8, + 0xEC53826D, 0x270F51C8, 0xA19B2366, 0x6AC7F0C3, + 0x77C2C07B, 0xBC9E13DE, 0x3A0A6170, 0xF156B2D5, + 0x03D6029B, 0xC88AD13E, 0x4E1EA390, 0x85427035, + 0x9847408D, 0x531B9328, 0xD58FE186, 0x1ED33223, + 0xEF8580F6, 0x24D95353, 0xA24D21FD, 0x6911F258, + 0x7414C2E0, 0xBF481145, 0x39DC63EB, 0xF280B04E, + 0x07AC0536, 0xCCF0D693, 0x4A64A43D, 0x81387798, + 0x9C3D4720, 0x57619485, 0xD1F5E62B, 0x1AA9358E, + 0xEBFF875B, 0x20A354FE, 0xA6372650, 0x6D6BF5F5, + 0x706EC54D, 0xBB3216E8, 0x3DA66446, 0xF6FAB7E3, + 0x047A07AD, 0xCF26D408, 0x49B2A6A6, 0x82EE7503, + 0x9FEB45BB, 0x54B7961E, 0xD223E4B0, 0x197F3715, + 0xE82985C0, 0x23755665, 0xA5E124CB, 0x6EBDF76E, + 0x73B8C7D6, 0xB8E41473, 0x3E7066DD, 0xF52CB578, + 0x0F580A6C, 0xC404D9C9, 0x4290AB67, 0x89CC78C2, + 0x94C9487A, 0x5F959BDF, 0xD901E971, 0x125D3AD4, + 0xE30B8801, 0x28575BA4, 0xAEC3290A, 0x659FFAAF, + 0x789ACA17, 0xB3C619B2, 0x35526B1C, 0xFE0EB8B9, + 0x0C8E08F7, 0xC7D2DB52, 0x4146A9FC, 0x8A1A7A59, + 0x971F4AE1, 0x5C439944, 0xDAD7EBEA, 0x118B384F, + 0xE0DD8A9A, 0x2B81593F, 0xAD152B91, 0x6649F834, + 0x7B4CC88C, 0xB0101B29, 0x36846987, 0xFDD8BA22, + 0x08F40F5A, 0xC3A8DCFF, 0x453CAE51, 0x8E607DF4, + 0x93654D4C, 0x58399EE9, 0xDEADEC47, 0x15F13FE2, + 0xE4A78D37, 0x2FFB5E92, 0xA96F2C3C, 0x6233FF99, + 0x7F36CF21, 0xB46A1C84, 0x32FE6E2A, 0xF9A2BD8F, + 0x0B220DC1, 0xC07EDE64, 0x46EAACCA, 0x8DB67F6F, + 0x90B34FD7, 0x5BEF9C72, 0xDD7BEEDC, 0x16273D79, + 0xE7718FAC, 0x2C2D5C09, 0xAAB92EA7, 0x61E5FD02, + 0x7CE0CDBA, 0xB7BC1E1F, 0x31286CB1, 0xFA74BF14, + 0x1EB014D8, 0xD5ECC77D, 0x5378B5D3, 0x98246676, + 0x852156CE, 0x4E7D856B, 0xC8E9F7C5, 0x03B52460, + 0xF2E396B5, 0x39BF4510, 0xBF2B37BE, 0x7477E41B, + 0x6972D4A3, 0xA22E0706, 0x24BA75A8, 0xEFE6A60D, + 0x1D661643, 0xD63AC5E6, 0x50AEB748, 0x9BF264ED, + 0x86F75455, 0x4DAB87F0, 0xCB3FF55E, 0x006326FB, + 0xF135942E, 0x3A69478B, 0xBCFD3525, 0x77A1E680, + 0x6AA4D638, 0xA1F8059D, 0x276C7733, 0xEC30A496, + 0x191C11EE, 0xD240C24B, 0x54D4B0E5, 0x9F886340, + 0x828D53F8, 0x49D1805D, 0xCF45F2F3, 0x04192156, + 0xF54F9383, 0x3E134026, 0xB8873288, 0x73DBE12D, + 0x6EDED195, 0xA5820230, 0x2316709E, 0xE84AA33B, + 0x1ACA1375, 0xD196C0D0, 0x5702B27E, 0x9C5E61DB, + 0x815B5163, 0x4A0782C6, 0xCC93F068, 0x07CF23CD, + 0xF6999118, 0x3DC542BD, 0xBB513013, 0x700DE3B6, + 0x6D08D30E, 0xA65400AB, 0x20C07205, 0xEB9CA1A0, + 0x11E81EB4, 0xDAB4CD11, 0x5C20BFBF, 0x977C6C1A, + 0x8A795CA2, 0x41258F07, 0xC7B1FDA9, 0x0CED2E0C, + 0xFDBB9CD9, 0x36E74F7C, 0xB0733DD2, 0x7B2FEE77, + 0x662ADECF, 0xAD760D6A, 0x2BE27FC4, 0xE0BEAC61, + 0x123E1C2F, 0xD962CF8A, 0x5FF6BD24, 0x94AA6E81, + 0x89AF5E39, 0x42F38D9C, 0xC467FF32, 0x0F3B2C97, + 0xFE6D9E42, 0x35314DE7, 0xB3A53F49, 0x78F9ECEC, + 0x65FCDC54, 0xAEA00FF1, 0x28347D5F, 0xE368AEFA, + 0x16441B82, 0xDD18C827, 0x5B8CBA89, 0x90D0692C, + 0x8DD55994, 0x46898A31, 0xC01DF89F, 0x0B412B3A, + 0xFA1799EF, 0x314B4A4A, 0xB7DF38E4, 0x7C83EB41, + 0x6186DBF9, 0xAADA085C, 0x2C4E7AF2, 0xE712A957, + 0x15921919, 0xDECECABC, 0x585AB812, 0x93066BB7, + 0x8E035B0F, 0x455F88AA, 0xC3CBFA04, 0x089729A1, + 0xF9C19B74, 0x329D48D1, 0xB4093A7F, 0x7F55E9DA, + 0x6250D962, 0xA90C0AC7, 0x2F987869, 0xE4C4ABCC + }, { + 0x00000000, 0xA6770BB4, 0x979F1129, 0x31E81A9D, + 0xF44F2413, 0x52382FA7, 0x63D0353A, 0xC5A73E8E, + 0x33EF4E67, 0x959845D3, 0xA4705F4E, 0x020754FA, + 0xC7A06A74, 0x61D761C0, 0x503F7B5D, 0xF64870E9, + 0x67DE9CCE, 0xC1A9977A, 0xF0418DE7, 0x56368653, + 0x9391B8DD, 0x35E6B369, 0x040EA9F4, 0xA279A240, + 0x5431D2A9, 0xF246D91D, 0xC3AEC380, 0x65D9C834, + 0xA07EF6BA, 0x0609FD0E, 0x37E1E793, 0x9196EC27, + 0xCFBD399C, 0x69CA3228, 0x582228B5, 0xFE552301, + 0x3BF21D8F, 0x9D85163B, 0xAC6D0CA6, 0x0A1A0712, + 0xFC5277FB, 0x5A257C4F, 0x6BCD66D2, 0xCDBA6D66, + 0x081D53E8, 0xAE6A585C, 0x9F8242C1, 0x39F54975, + 0xA863A552, 0x0E14AEE6, 0x3FFCB47B, 0x998BBFCF, + 0x5C2C8141, 0xFA5B8AF5, 0xCBB39068, 0x6DC49BDC, + 0x9B8CEB35, 0x3DFBE081, 0x0C13FA1C, 0xAA64F1A8, + 0x6FC3CF26, 0xC9B4C492, 0xF85CDE0F, 0x5E2BD5BB, + 0x440B7579, 0xE27C7ECD, 0xD3946450, 0x75E36FE4, + 0xB044516A, 0x16335ADE, 0x27DB4043, 0x81AC4BF7, + 0x77E43B1E, 0xD19330AA, 0xE07B2A37, 0x460C2183, + 0x83AB1F0D, 0x25DC14B9, 0x14340E24, 0xB2430590, + 0x23D5E9B7, 0x85A2E203, 0xB44AF89E, 0x123DF32A, + 0xD79ACDA4, 0x71EDC610, 0x4005DC8D, 0xE672D739, + 0x103AA7D0, 0xB64DAC64, 0x87A5B6F9, 0x21D2BD4D, + 0xE47583C3, 0x42028877, 0x73EA92EA, 0xD59D995E, + 0x8BB64CE5, 0x2DC14751, 0x1C295DCC, 0xBA5E5678, + 0x7FF968F6, 0xD98E6342, 0xE86679DF, 0x4E11726B, + 0xB8590282, 0x1E2E0936, 0x2FC613AB, 0x89B1181F, + 0x4C162691, 0xEA612D25, 0xDB8937B8, 0x7DFE3C0C, + 0xEC68D02B, 0x4A1FDB9F, 0x7BF7C102, 0xDD80CAB6, + 0x1827F438, 0xBE50FF8C, 0x8FB8E511, 0x29CFEEA5, + 0xDF879E4C, 0x79F095F8, 0x48188F65, 0xEE6F84D1, + 0x2BC8BA5F, 0x8DBFB1EB, 0xBC57AB76, 0x1A20A0C2, + 0x8816EAF2, 0x2E61E146, 0x1F89FBDB, 0xB9FEF06F, + 0x7C59CEE1, 0xDA2EC555, 0xEBC6DFC8, 0x4DB1D47C, + 0xBBF9A495, 0x1D8EAF21, 0x2C66B5BC, 0x8A11BE08, + 0x4FB68086, 0xE9C18B32, 0xD82991AF, 0x7E5E9A1B, + 0xEFC8763C, 0x49BF7D88, 0x78576715, 0xDE206CA1, + 0x1B87522F, 0xBDF0599B, 0x8C184306, 0x2A6F48B2, + 0xDC27385B, 0x7A5033EF, 0x4BB82972, 0xEDCF22C6, + 0x28681C48, 0x8E1F17FC, 0xBFF70D61, 0x198006D5, + 0x47ABD36E, 0xE1DCD8DA, 0xD034C247, 0x7643C9F3, + 0xB3E4F77D, 0x1593FCC9, 0x247BE654, 0x820CEDE0, + 0x74449D09, 0xD23396BD, 0xE3DB8C20, 0x45AC8794, + 0x800BB91A, 0x267CB2AE, 0x1794A833, 0xB1E3A387, + 0x20754FA0, 0x86024414, 0xB7EA5E89, 0x119D553D, + 0xD43A6BB3, 0x724D6007, 0x43A57A9A, 0xE5D2712E, + 0x139A01C7, 0xB5ED0A73, 0x840510EE, 0x22721B5A, + 0xE7D525D4, 0x41A22E60, 0x704A34FD, 0xD63D3F49, + 0xCC1D9F8B, 0x6A6A943F, 0x5B828EA2, 0xFDF58516, + 0x3852BB98, 0x9E25B02C, 0xAFCDAAB1, 0x09BAA105, + 0xFFF2D1EC, 0x5985DA58, 0x686DC0C5, 0xCE1ACB71, + 0x0BBDF5FF, 0xADCAFE4B, 0x9C22E4D6, 0x3A55EF62, + 0xABC30345, 0x0DB408F1, 0x3C5C126C, 0x9A2B19D8, + 0x5F8C2756, 0xF9FB2CE2, 0xC813367F, 0x6E643DCB, + 0x982C4D22, 0x3E5B4696, 0x0FB35C0B, 0xA9C457BF, + 0x6C636931, 0xCA146285, 0xFBFC7818, 0x5D8B73AC, + 0x03A0A617, 0xA5D7ADA3, 0x943FB73E, 0x3248BC8A, + 0xF7EF8204, 0x519889B0, 0x6070932D, 0xC6079899, + 0x304FE870, 0x9638E3C4, 0xA7D0F959, 0x01A7F2ED, + 0xC400CC63, 0x6277C7D7, 0x539FDD4A, 0xF5E8D6FE, + 0x647E3AD9, 0xC209316D, 0xF3E12BF0, 0x55962044, + 0x90311ECA, 0x3646157E, 0x07AE0FE3, 0xA1D90457, + 0x579174BE, 0xF1E67F0A, 0xC00E6597, 0x66796E23, + 0xA3DE50AD, 0x05A95B19, 0x34414184, 0x92364A30 + }, { + 0x00000000, 0xCCAA009E, 0x4225077D, 0x8E8F07E3, + 0x844A0EFA, 0x48E00E64, 0xC66F0987, 0x0AC50919, + 0xD3E51BB5, 0x1F4F1B2B, 0x91C01CC8, 0x5D6A1C56, + 0x57AF154F, 0x9B0515D1, 0x158A1232, 0xD92012AC, + 0x7CBB312B, 0xB01131B5, 0x3E9E3656, 0xF23436C8, + 0xF8F13FD1, 0x345B3F4F, 0xBAD438AC, 0x767E3832, + 0xAF5E2A9E, 0x63F42A00, 0xED7B2DE3, 0x21D12D7D, + 0x2B142464, 0xE7BE24FA, 0x69312319, 0xA59B2387, + 0xF9766256, 0x35DC62C8, 0xBB53652B, 0x77F965B5, + 0x7D3C6CAC, 0xB1966C32, 0x3F196BD1, 0xF3B36B4F, + 0x2A9379E3, 0xE639797D, 0x68B67E9E, 0xA41C7E00, + 0xAED97719, 0x62737787, 0xECFC7064, 0x205670FA, + 0x85CD537D, 0x496753E3, 0xC7E85400, 0x0B42549E, + 0x01875D87, 0xCD2D5D19, 0x43A25AFA, 0x8F085A64, + 0x562848C8, 0x9A824856, 0x140D4FB5, 0xD8A74F2B, + 0xD2624632, 0x1EC846AC, 0x9047414F, 0x5CED41D1, + 0x299DC2ED, 0xE537C273, 0x6BB8C590, 0xA712C50E, + 0xADD7CC17, 0x617DCC89, 0xEFF2CB6A, 0x2358CBF4, + 0xFA78D958, 0x36D2D9C6, 0xB85DDE25, 0x74F7DEBB, + 0x7E32D7A2, 0xB298D73C, 0x3C17D0DF, 0xF0BDD041, + 0x5526F3C6, 0x998CF358, 0x1703F4BB, 0xDBA9F425, + 0xD16CFD3C, 0x1DC6FDA2, 0x9349FA41, 0x5FE3FADF, + 0x86C3E873, 0x4A69E8ED, 0xC4E6EF0E, 0x084CEF90, + 0x0289E689, 0xCE23E617, 0x40ACE1F4, 0x8C06E16A, + 0xD0EBA0BB, 0x1C41A025, 0x92CEA7C6, 0x5E64A758, + 0x54A1AE41, 0x980BAEDF, 0x1684A93C, 0xDA2EA9A2, + 0x030EBB0E, 0xCFA4BB90, 0x412BBC73, 0x8D81BCED, + 0x8744B5F4, 0x4BEEB56A, 0xC561B289, 0x09CBB217, + 0xAC509190, 0x60FA910E, 0xEE7596ED, 0x22DF9673, + 0x281A9F6A, 0xE4B09FF4, 0x6A3F9817, 0xA6959889, + 0x7FB58A25, 0xB31F8ABB, 0x3D908D58, 0xF13A8DC6, + 0xFBFF84DF, 0x37558441, 0xB9DA83A2, 0x7570833C, + 0x533B85DA, 0x9F918544, 0x111E82A7, 0xDDB48239, + 0xD7718B20, 0x1BDB8BBE, 0x95548C5D, 0x59FE8CC3, + 0x80DE9E6F, 0x4C749EF1, 0xC2FB9912, 0x0E51998C, + 0x04949095, 0xC83E900B, 0x46B197E8, 0x8A1B9776, + 0x2F80B4F1, 0xE32AB46F, 0x6DA5B38C, 0xA10FB312, + 0xABCABA0B, 0x6760BA95, 0xE9EFBD76, 0x2545BDE8, + 0xFC65AF44, 0x30CFAFDA, 0xBE40A839, 0x72EAA8A7, + 0x782FA1BE, 0xB485A120, 0x3A0AA6C3, 0xF6A0A65D, + 0xAA4DE78C, 0x66E7E712, 0xE868E0F1, 0x24C2E06F, + 0x2E07E976, 0xE2ADE9E8, 0x6C22EE0B, 0xA088EE95, + 0x79A8FC39, 0xB502FCA7, 0x3B8DFB44, 0xF727FBDA, + 0xFDE2F2C3, 0x3148F25D, 0xBFC7F5BE, 0x736DF520, + 0xD6F6D6A7, 0x1A5CD639, 0x94D3D1DA, 0x5879D144, + 0x52BCD85D, 0x9E16D8C3, 0x1099DF20, 0xDC33DFBE, + 0x0513CD12, 0xC9B9CD8C, 0x4736CA6F, 0x8B9CCAF1, + 0x8159C3E8, 0x4DF3C376, 0xC37CC495, 0x0FD6C40B, + 0x7AA64737, 0xB60C47A9, 0x3883404A, 0xF42940D4, + 0xFEEC49CD, 0x32464953, 0xBCC94EB0, 0x70634E2E, + 0xA9435C82, 0x65E95C1C, 0xEB665BFF, 0x27CC5B61, + 0x2D095278, 0xE1A352E6, 0x6F2C5505, 0xA386559B, + 0x061D761C, 0xCAB77682, 0x44387161, 0x889271FF, + 0x825778E6, 0x4EFD7878, 0xC0727F9B, 0x0CD87F05, + 0xD5F86DA9, 0x19526D37, 0x97DD6AD4, 0x5B776A4A, + 0x51B26353, 0x9D1863CD, 0x1397642E, 0xDF3D64B0, + 0x83D02561, 0x4F7A25FF, 0xC1F5221C, 0x0D5F2282, + 0x079A2B9B, 0xCB302B05, 0x45BF2CE6, 0x89152C78, + 0x50353ED4, 0x9C9F3E4A, 0x121039A9, 0xDEBA3937, + 0xD47F302E, 0x18D530B0, 0x965A3753, 0x5AF037CD, + 0xFF6B144A, 0x33C114D4, 0xBD4E1337, 0x71E413A9, + 0x7B211AB0, 0xB78B1A2E, 0x39041DCD, 0xF5AE1D53, + 0x2C8E0FFF, 0xE0240F61, 0x6EAB0882, 0xA201081C, + 0xA8C40105, 0x646E019B, 0xEAE10678, 0x264B06E6 + } +}; diff --git a/src/liblzma/check/crc32_tablegen.c b/src/liblzma/check/crc32_tablegen.c new file mode 100644 index 0000000..31a4d27 --- /dev/null +++ b/src/liblzma/check/crc32_tablegen.c @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc32_tablegen.c +/// \brief Generate crc32_table_le.h and crc32_table_be.h +/// +/// Compiling: gcc -std=c99 -o crc32_tablegen crc32_tablegen.c +/// Add -DWORDS_BIGENDIAN to generate big endian table. +/// Add -DLZ_HASH_TABLE to generate lz_encoder_hash_table.h (little endian). +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include "../../common/tuklib_integer.h" + + +static uint32_t crc32_table[8][256]; + + +static void +init_crc32_table(void) +{ + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint32_t r = s == 0 ? b : crc32_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + crc32_table[s][b] = r; + } + } + +#ifdef WORDS_BIGENDIAN + for (size_t s = 0; s < 8; ++s) + for (size_t b = 0; b < 256; ++b) + crc32_table[s][b] = bswap32(crc32_table[s][b]); +#endif + + return; +} + + +static void +print_crc32_table(void) +{ + printf("/* This file has been automatically generated by " + "crc32_tablegen.c. */\n\n" + "const uint32_t lzma_crc32_table[8][256] = {\n\t{"); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + if ((b % 4) == 0) + printf("\n\t\t"); + + printf("0x%08" PRIX32, crc32_table[s][b]); + + if (b != 255) + printf(",%s", (b+1) % 4 == 0 ? "" : " "); + } + + if (s == 7) + printf("\n\t}\n};\n"); + else + printf("\n\t}, {"); + } + + return; +} + + +static void +print_lz_table(void) +{ + printf("/* This file has been automatically generated by " + "crc32_tablegen.c. */\n\n" + "const uint32_t lzma_lz_hash_table[256] = {"); + + for (size_t b = 0; b < 256; ++b) { + if ((b % 4) == 0) + printf("\n\t"); + + printf("0x%08" PRIX32, crc32_table[0][b]); + + if (b != 255) + printf(",%s", (b+1) % 4 == 0 ? "" : " "); + } + + printf("\n};\n"); + + return; +} + + +int +main(void) +{ + init_crc32_table(); + +#ifdef LZ_HASH_TABLE + print_lz_table(); +#else + print_crc32_table(); +#endif + + return 0; +} diff --git a/src/liblzma/check/crc32_x86.S b/src/liblzma/check/crc32_x86.S new file mode 100644 index 0000000..4f395df --- /dev/null +++ b/src/liblzma/check/crc32_x86.S @@ -0,0 +1,313 @@ +/* + * Speed-optimized CRC32 using slicing-by-eight algorithm + * + * This uses only i386 instructions, but it is optimized for i686 and later + * (including e.g. Pentium II/III/IV, Athlon XP, and Core 2). For i586 + * (e.g. Pentium), slicing-by-four would be better, and even the C version + * of slicing-by-eight built with gcc -march=i586 tends to be a little bit + * better than this. Very few probably run this code on i586 or older x86 + * so this shouldn't be a problem in practice. + * + * Authors: Igor Pavlov (original version) + * Lasse Collin (AT&T syntax, PIC support, better portability) + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * This code needs lzma_crc32_table, which can be created using the + * following C code: + +uint32_t lzma_crc32_table[8][256]; + +void +init_table(void) +{ + // IEEE-802.3 + static const uint32_t poly32 = UINT32_C(0xEDB88320); + + // Castagnoli + // static const uint32_t poly32 = UINT32_C(0x82F63B78); + + // Koopman + // static const uint32_t poly32 = UINT32_C(0xEB31D82E); + + for (size_t s = 0; s < 8; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint32_t r = s == 0 ? b : lzma_crc32_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly32; + else + r >>= 1; + } + + lzma_crc32_table[s][b] = r; + } + } +} + + * The prototype of the CRC32 function: + * extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc); + */ + +/* When Intel CET is enabled, include in assembly code to mark + Intel CET support. */ +#ifdef __CET__ +# include +#else +# define _CET_ENDBR +#endif + +/* + * On some systems, the functions need to be prefixed. The prefix is + * usually an underscore. + */ +#ifndef __USER_LABEL_PREFIX__ +# define __USER_LABEL_PREFIX__ +#endif +#define MAKE_SYM_CAT(prefix, sym) prefix ## sym +#define MAKE_SYM(prefix, sym) MAKE_SYM_CAT(prefix, sym) +#define LZMA_CRC32 MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc32) +#define LZMA_CRC32_TABLE MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc32_table) + +/* + * Solaris assembler doesn't have .p2align, and Darwin uses .align + * differently than GNU/Linux and Solaris. + */ +#if defined(__APPLE__) || defined(__MSDOS__) +# define ALIGN(pow2, abs) .align pow2 +#else +# define ALIGN(pow2, abs) .align abs +#endif + + .text + .globl LZMA_CRC32 + +#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) \ + && !defined(__MSDOS__) + .type LZMA_CRC32, @function +#endif + + ALIGN(4, 16) +LZMA_CRC32: + _CET_ENDBR + /* + * Register usage: + * %eax crc + * %esi buf + * %edi size or buf + size + * %ebx lzma_crc32_table + * %ebp Table index + * %ecx Temporary + * %edx Temporary + */ + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl 0x14(%esp), %esi /* buf */ + movl 0x18(%esp), %edi /* size */ + movl 0x1C(%esp), %eax /* crc */ + + /* + * Store the address of lzma_crc32_table to %ebx. This is needed to + * get position-independent code (PIC). + * + * The PIC macro is defined by libtool, while __PIC__ is defined + * by GCC but only on some systems. Testing for both makes it simpler + * to test this code without libtool, and keeps the code working also + * when built with libtool but using something else than GCC. + * + * I understood that libtool may define PIC on Windows even though + * the code in Windows DLLs is not PIC in sense that it is in ELF + * binaries, so we need a separate check to always use the non-PIC + * code on Windows. + */ +#if (!defined(PIC) && !defined(__PIC__)) \ + || (defined(_WIN32) || defined(__CYGWIN__)) + /* Not PIC */ + movl $ LZMA_CRC32_TABLE, %ebx +#elif defined(__APPLE__) + /* Mach-O */ + call .L_get_pc +.L_pic: + leal .L_lzma_crc32_table$non_lazy_ptr-.L_pic(%ebx), %ebx + movl (%ebx), %ebx +#else + /* ELF */ + call .L_get_pc + addl $_GLOBAL_OFFSET_TABLE_, %ebx + movl LZMA_CRC32_TABLE@GOT(%ebx), %ebx +#endif + + /* Complement the initial value. */ + notl %eax + + ALIGN(4, 16) +.L_align: + /* + * Check if there is enough input to use slicing-by-eight. + * We need 16 bytes, because the loop pre-reads eight bytes. + */ + cmpl $16, %edi + jb .L_rest + + /* Check if we have reached alignment of eight bytes. */ + testl $7, %esi + jz .L_slice + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrl $8, %eax + xorl (%ebx, %ebp, 4), %eax + decl %edi + jmp .L_align + + ALIGN(2, 4) +.L_slice: + /* + * If we get here, there's at least 16 bytes of aligned input + * available. Make %edi multiple of eight bytes. Store the possible + * remainder over the "size" variable in the argument stack. + */ + movl %edi, 0x18(%esp) + andl $-8, %edi + subl %edi, 0x18(%esp) + + /* + * Let %edi be buf + size - 8 while running the main loop. This way + * we can compare for equality to determine when exit the loop. + */ + addl %esi, %edi + subl $8, %edi + + /* Read in the first eight aligned bytes. */ + xorl (%esi), %eax + movl 4(%esi), %ecx + movzbl %cl, %ebp + +.L_loop: + movl 0x0C00(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl 0x0800(%ebx, %ebp, 4), %edx + shrl $16, %ecx + xorl 8(%esi), %edx + movzbl %cl, %ebp + xorl 0x0400(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl (%ebx, %ebp, 4), %edx + movzbl %al, %ebp + + /* + * Read the next four bytes, for which the CRC is calculated + * on the next iteration of the loop. + */ + movl 12(%esi), %ecx + + xorl 0x1C00(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + shrl $16, %eax + xorl 0x1800(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + movzbl %al, %eax + movl 0x1400(%ebx, %eax, 4), %eax + addl $8, %esi + xorl %edx, %eax + xorl 0x1000(%ebx, %ebp, 4), %eax + + /* Check for end of aligned input. */ + cmpl %edi, %esi + movzbl %cl, %ebp + jne .L_loop + + /* + * Process the remaining eight bytes, which we have already + * copied to %ecx and %edx. + */ + movl 0x0C00(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl 0x0800(%ebx, %ebp, 4), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0400(%ebx, %ebp, 4), %edx + movzbl %ch, %ebp + xorl (%ebx, %ebp, 4), %edx + movzbl %al, %ebp + + xorl 0x1C00(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + shrl $16, %eax + xorl 0x1800(%ebx, %ebp, 4), %edx + movzbl %ah, %ebp + movzbl %al, %eax + movl 0x1400(%ebx, %eax, 4), %eax + addl $8, %esi + xorl %edx, %eax + xorl 0x1000(%ebx, %ebp, 4), %eax + + /* Copy the number of remaining bytes to %edi. */ + movl 0x18(%esp), %edi + +.L_rest: + /* Check for end of input. */ + testl %edi, %edi + jz .L_return + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrl $8, %eax + xorl (%ebx, %ebp, 4), %eax + decl %edi + jmp .L_rest + +.L_return: + /* Complement the final value. */ + notl %eax + + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + +#if defined(PIC) || defined(__PIC__) + ALIGN(4, 16) +.L_get_pc: + movl (%esp), %ebx + ret +#endif + +#if defined(__APPLE__) && (defined(PIC) || defined(__PIC__)) + /* Mach-O PIC */ + .section __IMPORT,__pointers,non_lazy_symbol_pointers +.L_lzma_crc32_table$non_lazy_ptr: + .indirect_symbol LZMA_CRC32_TABLE + .long 0 + +#elif defined(_WIN32) || defined(__CYGWIN__) +# ifdef DLL_EXPORT + /* This is equivalent of __declspec(dllexport). */ + .section .drectve + .ascii " -export:lzma_crc32" +# endif + +#elif !defined(__MSDOS__) + /* ELF */ + .size LZMA_CRC32, .-LZMA_CRC32 +#endif + +/* + * This is needed to support non-executable stack. It's ugly to + * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when + * we are using GNU assembler. + */ +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) + .section .note.GNU-stack,"",@progbits +#endif diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c new file mode 100644 index 0000000..db44633 --- /dev/null +++ b/src/liblzma/check/crc64_fast.c @@ -0,0 +1,530 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64.c +/// \brief CRC64 calculation +/// +/// There are two methods in this file. crc64_generic uses the +/// the slice-by-four algorithm. This is the same idea that is +/// used in crc32_fast.c, but for CRC64 we use only four tables +/// instead of eight to avoid increasing CPU cache usage. +/// +/// crc64_clmul uses 32/64-bit x86 SSSE3, SSE4.1, and CLMUL instructions. +/// It was derived from +/// https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf +/// and the public domain code from https://github.com/rawrunprotected/crc +/// (URLs were checked on 2022-11-07). +/// +/// FIXME: Builds for 32-bit x86 use crc64_x86.S by default instead +/// of this file and thus CLMUL version isn't available on 32-bit x86 +/// unless configured with --disable-assembler. Even then the lookup table +/// isn't omitted in crc64_table.c since it doesn't know that assembly +/// code has been disabled. +// +// Authors: Lasse Collin +// Ilya Kurdyukov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + +#undef CRC_GENERIC +#undef CRC_CLMUL +#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS + +// If CLMUL cannot be used then only the generic slice-by-four is built. +#if !defined(HAVE_USABLE_CLMUL) +# define CRC_GENERIC 1 + +// If CLMUL is allowed unconditionally in the compiler options then the +// generic version can be omitted. Note that this doesn't work with MSVC +// as I don't know how to detect the features here. +// +// NOTE: Keep this this in sync with crc64_table.c. +#elif (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \ + || (defined(__e2k__) && __iset__ >= 6) +# define CRC_CLMUL 1 + +// Otherwise build both and detect at runtime which version to use. +#else +# define CRC_GENERIC 1 +# define CRC_CLMUL 1 + +/* + // The generic code is much faster with 1-8-byte inputs and has + // similar performance up to 16 bytes at least in microbenchmarks + // (it depends on input buffer alignment too). If both versions are + // built, this #define will use the generic version for inputs up to + // 16 bytes and CLMUL for bigger inputs. It saves a little in code + // size since the special cases for 0-16-byte inputs will be omitted + // from the CLMUL code. +# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1 +*/ + +# if defined(_MSC_VER) +# include +# elif defined(HAVE_CPUID_H) +# include +# endif +#endif + + +///////////////////////////////// +// Generic slice-by-four CRC64 // +///////////////////////////////// + +#ifdef CRC_GENERIC + +#include "crc_macros.h" + + +#ifdef WORDS_BIGENDIAN +# define A1(x) ((x) >> 56) +#else +# define A1 A +#endif + + +// See the comments in crc32_fast.c. They aren't duplicated here. +static uint64_t +crc64_generic(const uint8_t *buf, size_t size, uint64_t crc) +{ + crc = ~crc; + +#ifdef WORDS_BIGENDIAN + crc = bswap64(crc); +#endif + + if (size > 4) { + while ((uintptr_t)(buf) & 3) { + crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); + --size; + } + + const uint8_t *const limit = buf + (size & ~(size_t)(3)); + size &= (size_t)(3); + + while (buf < limit) { +#ifdef WORDS_BIGENDIAN + const uint32_t tmp = (uint32_t)(crc >> 32) + ^ aligned_read32ne(buf); +#else + const uint32_t tmp = (uint32_t)crc + ^ aligned_read32ne(buf); +#endif + buf += 4; + + crc = lzma_crc64_table[3][A(tmp)] + ^ lzma_crc64_table[2][B(tmp)] + ^ S32(crc) + ^ lzma_crc64_table[1][C(tmp)] + ^ lzma_crc64_table[0][D(tmp)]; + } + } + + while (size-- != 0) + crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); + +#ifdef WORDS_BIGENDIAN + crc = bswap64(crc); +#endif + + return ~crc; +} +#endif + + +///////////////////// +// x86 CLMUL CRC64 // +///////////////////// + +#ifdef CRC_CLMUL + +#include + + +/* +// These functions were used to generate the constants +// at the top of crc64_clmul(). +static uint64_t +calc_lo(uint64_t poly) +{ + uint64_t a = poly; + uint64_t b = 0; + + for (unsigned i = 0; i < 64; ++i) { + b = (b >> 1) | (a << 63); + a = (a >> 1) ^ (a & 1 ? poly : 0); + } + + return b; +} + +static uint64_t +calc_hi(uint64_t poly, uint64_t a) +{ + for (unsigned i = 0; i < 64; ++i) + a = (a >> 1) ^ (a & 1 ? poly : 0); + + return a; +} +*/ + + +#define MASK_L(in, mask, r) \ + r = _mm_shuffle_epi8(in, mask) + +#define MASK_H(in, mask, r) \ + r = _mm_shuffle_epi8(in, _mm_xor_si128(mask, vsign)) + +#define MASK_LH(in, mask, low, high) \ + MASK_L(in, mask, low); \ + MASK_H(in, mask, high) + + +// MSVC (VS2015 - VS2022) produces bad 32-bit x86 code from the CLMUL CRC +// code when optimizations are enabled (release build). According to the bug +// report, the ebx register is corrupted and the calculated result is wrong. +// Trying to workaround the problem with "__asm mov ebx, ebx" didn't help. +// The following pragma works and performance is still good. x86-64 builds +// aren't affected by this problem. +// +// NOTE: Another pragma after the function restores the optimizations. +// If the #if condition here is updated, the other one must be updated too. +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \ + && defined(_M_IX86) +# pragma optimize("g", off) +#endif + +// EDG-based compilers (Intel's classic compiler and compiler for E2K) can +// define __GNUC__ but the attribute must not be used with them. +// The new Clang-based ICX needs the attribute. +// +// NOTE: Build systems check for this too, keep them in sync with this. +#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__) +__attribute__((__target__("ssse3,sse4.1,pclmul"))) +#endif +static uint64_t +crc64_clmul(const uint8_t *buf, size_t size, uint64_t crc) +{ + // The prototypes of the intrinsics use signed types while most of + // the values are treated as unsigned here. These warnings in this + // function have been checked and found to be harmless so silence them. +#if TUKLIB_GNUC_REQ(4, 6) || defined(__clang__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-conversion" +# pragma GCC diagnostic ignored "-Wconversion" +#endif + +#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS + // The code assumes that there is at least one byte of input. + if (size == 0) + return crc; +#endif + + // const uint64_t poly = 0xc96c5795d7870f42; // CRC polynomial + const uint64_t p = 0x92d8af2baf0e1e85; // (poly << 1) | 1 + const uint64_t mu = 0x9c3e466c172963d5; // (calc_lo(poly) << 1) | 1 + const uint64_t k2 = 0xdabe95afc7875f40; // calc_hi(poly, 1) + const uint64_t k1 = 0xe05dd497ca393ae4; // calc_hi(poly, k2) + const __m128i vfold0 = _mm_set_epi64x(p, mu); + const __m128i vfold1 = _mm_set_epi64x(k2, k1); + + // Create a vector with 8-bit values 0 to 15. This is used to + // construct control masks for _mm_blendv_epi8 and _mm_shuffle_epi8. + const __m128i vramp = _mm_setr_epi32( + 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c); + + // This is used to inverse the control mask of _mm_shuffle_epi8 + // so that bytes that wouldn't be picked with the original mask + // will be picked and vice versa. + const __m128i vsign = _mm_set1_epi8(0x80); + + // Memory addresses A to D and the distances between them: + // + // A B C D + // [skip_start][size][skip_end] + // [ size2 ] + // + // A and D are 16-byte aligned. B and C are 1-byte aligned. + // skip_start and skip_end are 0-15 bytes. size is at least 1 byte. + // + // A = aligned_buf will initially point to this address. + // B = The address pointed by the caller-supplied buf. + // C = buf + size == aligned_buf + size2 + // D = buf + size + skip_end == aligned_buf + size2 + skip_end + const size_t skip_start = (size_t)((uintptr_t)buf & 15); + const size_t skip_end = (size_t)(-(uintptr_t)(buf + size) & 15); + const __m128i *aligned_buf = (const __m128i *)( + (uintptr_t)buf & ~(uintptr_t)15); + + // If size2 <= 16 then the whole input fits into a single 16-byte + // vector. If size2 > 16 then at least two 16-byte vectors must + // be processed. If size2 > 16 && size <= 16 then there is only + // one 16-byte vector's worth of input but it is unaligned in memory. + // + // NOTE: There is no integer overflow here if the arguments are valid. + // If this overflowed, buf + size would too. + size_t size2 = skip_start + size; + + // Masks to be used with _mm_blendv_epi8 and _mm_shuffle_epi8: + // The first skip_start or skip_end bytes in the vectors will have + // the high bit (0x80) set. _mm_blendv_epi8 and _mm_shuffle_epi8 + // will produce zeros for these positions. (Bitwise-xor of these + // masks with vsign will produce the opposite behavior.) + const __m128i mask_start + = _mm_sub_epi8(vramp, _mm_set1_epi8(skip_start)); + const __m128i mask_end = _mm_sub_epi8(vramp, _mm_set1_epi8(skip_end)); + + // Get the first 1-16 bytes into data0. If loading less than 16 bytes, + // the bytes are loaded to the high bits of the vector and the least + // significant positions are filled with zeros. + const __m128i data0 = _mm_blendv_epi8(_mm_load_si128(aligned_buf), + _mm_setzero_si128(), mask_start); + ++aligned_buf; + +#if defined(__i386__) || defined(_M_IX86) + const __m128i initial_crc = _mm_set_epi64x(0, ~crc); +#else + // GCC and Clang would produce good code with _mm_set_epi64x + // but MSVC needs _mm_cvtsi64_si128 on x86-64. + const __m128i initial_crc = _mm_cvtsi64_si128(~crc); +#endif + + __m128i v0, v1, v2, v3; + +#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS + if (size <= 16) { + // Right-shift initial_crc by 1-16 bytes based on "size" + // and store the result in v1 (high bytes) and v0 (low bytes). + // + // NOTE: The highest 8 bytes of initial_crc are zeros so + // v1 will be filled with zeros if size >= 8. The highest 8 + // bytes of v1 will always become zeros. + // + // [ v1 ][ v0 ] + // [ initial_crc ] size == 1 + // [ initial_crc ] size == 2 + // [ initial_crc ] size == 15 + // [ initial_crc ] size == 16 (all in v0) + const __m128i mask_low = _mm_add_epi8( + vramp, _mm_set1_epi8(size - 16)); + MASK_LH(initial_crc, mask_low, v0, v1); + + if (size2 <= 16) { + // There are 1-16 bytes of input and it is all + // in data0. Copy the input bytes to v3. If there + // are fewer than 16 bytes, the low bytes in v3 + // will be filled with zeros. That is, the input + // bytes are stored to the same position as + // (part of) initial_crc is in v0. + MASK_L(data0, mask_end, v3); + } else { + // There are 2-16 bytes of input but not all bytes + // are in data0. + const __m128i data1 = _mm_load_si128(aligned_buf); + + // Collect the 2-16 input bytes from data0 and data1 + // to v2 and v3, and bitwise-xor them with the + // low bits of initial_crc in v0. Note that the + // the second xor is below this else-block as it + // is shared with the other branch. + MASK_H(data0, mask_end, v2); + MASK_L(data1, mask_end, v3); + v0 = _mm_xor_si128(v0, v2); + } + + v0 = _mm_xor_si128(v0, v3); + v1 = _mm_alignr_epi8(v1, v0, 8); + } else +#endif + { + const __m128i data1 = _mm_load_si128(aligned_buf); + MASK_LH(initial_crc, mask_start, v0, v1); + v0 = _mm_xor_si128(v0, data0); + v1 = _mm_xor_si128(v1, data1); + +#define FOLD \ + v1 = _mm_xor_si128(v1, _mm_clmulepi64_si128(v0, vfold1, 0x00)); \ + v0 = _mm_xor_si128(v1, _mm_clmulepi64_si128(v0, vfold1, 0x11)); + + while (size2 > 32) { + ++aligned_buf; + size2 -= 16; + FOLD + v1 = _mm_load_si128(aligned_buf); + } + + if (size2 < 32) { + MASK_H(v0, mask_end, v2); + MASK_L(v0, mask_end, v0); + MASK_L(v1, mask_end, v3); + v1 = _mm_or_si128(v2, v3); + } + + FOLD + v1 = _mm_srli_si128(v0, 8); +#undef FOLD + } + + v1 = _mm_xor_si128(_mm_clmulepi64_si128(v0, vfold1, 0x10), v1); + v0 = _mm_clmulepi64_si128(v1, vfold0, 0x00); + v2 = _mm_clmulepi64_si128(v0, vfold0, 0x10); + v0 = _mm_xor_si128(_mm_xor_si128(v2, _mm_slli_si128(v0, 8)), v1); + +#if defined(__i386__) || defined(_M_IX86) + return ~(((uint64_t)(uint32_t)_mm_extract_epi32(v0, 3) << 32) | + (uint64_t)(uint32_t)_mm_extract_epi32(v0, 2)); +#else + return ~(uint64_t)_mm_extract_epi64(v0, 1); +#endif + +#if TUKLIB_GNUC_REQ(4, 6) || defined(__clang__) +# pragma GCC diagnostic pop +#endif +} +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \ + && defined(_M_IX86) +# pragma optimize("", on) +#endif +#endif + + +//////////////////////// +// Detect CPU support // +//////////////////////// + +#if defined(CRC_GENERIC) && defined(CRC_CLMUL) +static inline bool +is_clmul_supported(void) +{ + int success = 1; + uint32_t r[4]; // eax, ebx, ecx, edx + +#if defined(_MSC_VER) + // This needs with MSVC. ICC has it as a built-in + // on all platforms. + __cpuid(r, 1); +#elif defined(HAVE_CPUID_H) + // Compared to just using __asm__ to run CPUID, this also checks + // that CPUID is supported and saves and restores ebx as that is + // needed with GCC < 5 with position-independent code (PIC). + success = __get_cpuid(1, &r[0], &r[1], &r[2], &r[3]); +#else + // Just a fallback that shouldn't be needed. + __asm__("cpuid\n\t" + : "=a"(r[0]), "=b"(r[1]), "=c"(r[2]), "=d"(r[3]) + : "a"(1), "c"(0)); +#endif + + // Returns true if these are supported: + // CLMUL (bit 1 in ecx) + // SSSE3 (bit 9 in ecx) + // SSE4.1 (bit 19 in ecx) + const uint32_t ecx_mask = (1 << 1) | (1 << 9) | (1 << 19); + return success && (r[2] & ecx_mask) == ecx_mask; + + // Alternative methods that weren't used: + // - ICC's _may_i_use_cpu_feature: the other methods should work too. + // - GCC >= 6 / Clang / ICX __builtin_cpu_supports("pclmul") + // + // CPUID decding is needed with MSVC anyway and older GCC. This keeps + // the feature checks in the build system simpler too. The nice thing + // about __builtin_cpu_supports would be that it generates very short + // code as is it only reads a variable set at startup but a few bytes + // doesn't matter here. +} + + +#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR +# define CRC64_FUNC_INIT +# define CRC64_SET_FUNC_ATTR __attribute__((__constructor__)) +#else +# define CRC64_FUNC_INIT = &crc64_dispatch +# define CRC64_SET_FUNC_ATTR +static uint64_t crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc); +#endif + + +// Pointer to the the selected CRC64 method. +static uint64_t (*crc64_func)(const uint8_t *buf, size_t size, uint64_t crc) + CRC64_FUNC_INIT; + + +CRC64_SET_FUNC_ATTR +static void +crc64_set_func(void) +{ + crc64_func = is_clmul_supported() ? &crc64_clmul : &crc64_generic; + return; +} + + +#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR +static uint64_t +crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc) +{ + // When __attribute__((__constructor__)) isn't supported, set the + // function pointer without any locking. If multiple threads run + // the detection code in parallel, they will all end up setting + // the pointer to the same value. This avoids the use of + // mythread_once() on every call to lzma_crc64() but this likely + // isn't strictly standards compliant. Let's change it if it breaks. + crc64_set_func(); + return crc64_func(buf, size, crc); +} +#endif +#endif + + +extern LZMA_API(uint64_t) +lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) +{ +#if defined(CRC_GENERIC) && defined(CRC_CLMUL) + // If CLMUL is available, it is the best for non-tiny inputs, + // being over twice as fast as the generic slice-by-four version. + // However, for size <= 16 it's different. In the extreme case + // of size == 1 the generic version can be five times faster. + // At size >= 8 the CLMUL starts to become reasonable. It + // varies depending on the alignment of buf too. + // + // The above doesn't include the overhead of mythread_once(). + // At least on x86-64 GNU/Linux, pthread_once() is very fast but + // it still makes lzma_crc64(buf, 1, crc) 50-100 % slower. When + // size reaches 12-16 bytes the overhead becomes negligible. + // + // So using the generic version for size <= 16 may give better + // performance with tiny inputs but if such inputs happen rarely + // it's not so obvious because then the lookup table of the + // generic version may not be in the processor cache. +#ifdef CRC_USE_GENERIC_FOR_SMALL_INPUTS + if (size <= 16) + return crc64_generic(buf, size, crc); +#endif + +/* +#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR + // See crc64_dispatch(). This would be the alternative which uses + // locking and doesn't use crc64_dispatch(). Note that on Windows + // this method needs Vista threads. + mythread_once(crc64_set_func); +#endif +*/ + + return crc64_func(buf, size, crc); + +#elif defined(CRC_CLMUL) + // If CLMUL is used unconditionally without runtime CPU detection + // then omitting the generic version and its 8 KiB lookup table + // makes the library smaller. + // + // FIXME: Lookup table isn't currently omitted on 32-bit x86, + // see crc64_table.c. + return crc64_clmul(buf, size, crc); + +#else + return crc64_generic(buf, size, crc); +#endif +} diff --git a/src/liblzma/check/crc64_small.c b/src/liblzma/check/crc64_small.c new file mode 100644 index 0000000..420f7cf --- /dev/null +++ b/src/liblzma/check/crc64_small.c @@ -0,0 +1,58 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_small.c +/// \brief CRC64 calculation (size-optimized) +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + + +static uint64_t crc64_table[256]; + + +#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR +__attribute__((__constructor__)) +#endif +static void +crc64_init(void) +{ + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t b = 0; b < 256; ++b) { + uint64_t r = b; + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + crc64_table[b] = r; + } + + return; +} + + +extern LZMA_API(uint64_t) +lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) +{ +#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR + mythread_once(crc64_init); +#endif + + crc = ~crc; + + while (size != 0) { + crc = crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} diff --git a/src/liblzma/check/crc64_table.c b/src/liblzma/check/crc64_table.c new file mode 100644 index 0000000..241adcd --- /dev/null +++ b/src/liblzma/check/crc64_table.c @@ -0,0 +1,35 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_table.c +/// \brief Precalculated CRC64 table with correct endianness +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +// FIXME: Compared to crc64_fast.c this has to check for __x86_64__ too +// so that in 32-bit builds crc64_x86.S won't break due to a missing table. +#if (defined(__x86_64__) && defined(__SSSE3__) \ + && defined(__SSE4_1__) && defined(__PCLMUL__)) \ + || (defined(__e2k__) && __iset__ >= 6) +// No table needed but something has to be exported to keep some toolchains +// happy. Also use a declaration to silence compiler warnings. +extern const char lzma_crc64_dummy; +const char lzma_crc64_dummy; + +#else +// Having the declaration here silences clang -Wmissing-variable-declarations. +extern const uint64_t lzma_crc64_table[4][256]; + +# if defined(WORDS_BIGENDIAN) +# include "crc64_table_be.h" +# else +# include "crc64_table_le.h" +# endif +#endif diff --git a/src/liblzma/check/crc64_table_be.h b/src/liblzma/check/crc64_table_be.h new file mode 100644 index 0000000..ea074f3 --- /dev/null +++ b/src/liblzma/check/crc64_table_be.h @@ -0,0 +1,521 @@ +/* This file has been automatically generated by crc64_tablegen.c. */ + +const uint64_t lzma_crc64_table[4][256] = { + { + UINT64_C(0x0000000000000000), UINT64_C(0x6F5FA703BE4C2EB3), + UINT64_C(0x5BA040A8573684F4), UINT64_C(0x34FFE7ABE97AAA47), + UINT64_C(0x335E8FFF84C3D07B), UINT64_C(0x5C0128FC3A8FFEC8), + UINT64_C(0x68FECF57D3F5548F), UINT64_C(0x07A168546DB97A3C), + UINT64_C(0x66BC1EFF0987A1F7), UINT64_C(0x09E3B9FCB7CB8F44), + UINT64_C(0x3D1C5E575EB12503), UINT64_C(0x5243F954E0FD0BB0), + UINT64_C(0x55E291008D44718C), UINT64_C(0x3ABD360333085F3F), + UINT64_C(0x0E42D1A8DA72F578), UINT64_C(0x611D76AB643EDBCB), + UINT64_C(0x4966335138A19B7D), UINT64_C(0x2639945286EDB5CE), + UINT64_C(0x12C673F96F971F89), UINT64_C(0x7D99D4FAD1DB313A), + UINT64_C(0x7A38BCAEBC624B06), UINT64_C(0x15671BAD022E65B5), + UINT64_C(0x2198FC06EB54CFF2), UINT64_C(0x4EC75B055518E141), + UINT64_C(0x2FDA2DAE31263A8A), UINT64_C(0x40858AAD8F6A1439), + UINT64_C(0x747A6D066610BE7E), UINT64_C(0x1B25CA05D85C90CD), + UINT64_C(0x1C84A251B5E5EAF1), UINT64_C(0x73DB05520BA9C442), + UINT64_C(0x4724E2F9E2D36E05), UINT64_C(0x287B45FA5C9F40B6), + UINT64_C(0x92CC66A2704237FB), UINT64_C(0xFD93C1A1CE0E1948), + UINT64_C(0xC96C260A2774B30F), UINT64_C(0xA633810999389DBC), + UINT64_C(0xA192E95DF481E780), UINT64_C(0xCECD4E5E4ACDC933), + UINT64_C(0xFA32A9F5A3B76374), UINT64_C(0x956D0EF61DFB4DC7), + UINT64_C(0xF470785D79C5960C), UINT64_C(0x9B2FDF5EC789B8BF), + UINT64_C(0xAFD038F52EF312F8), UINT64_C(0xC08F9FF690BF3C4B), + UINT64_C(0xC72EF7A2FD064677), UINT64_C(0xA87150A1434A68C4), + UINT64_C(0x9C8EB70AAA30C283), UINT64_C(0xF3D11009147CEC30), + UINT64_C(0xDBAA55F348E3AC86), UINT64_C(0xB4F5F2F0F6AF8235), + UINT64_C(0x800A155B1FD52872), UINT64_C(0xEF55B258A19906C1), + UINT64_C(0xE8F4DA0CCC207CFD), UINT64_C(0x87AB7D0F726C524E), + UINT64_C(0xB3549AA49B16F809), UINT64_C(0xDC0B3DA7255AD6BA), + UINT64_C(0xBD164B0C41640D71), UINT64_C(0xD249EC0FFF2823C2), + UINT64_C(0xE6B60BA416528985), UINT64_C(0x89E9ACA7A81EA736), + UINT64_C(0x8E48C4F3C5A7DD0A), UINT64_C(0xE11763F07BEBF3B9), + UINT64_C(0xD5E8845B929159FE), UINT64_C(0xBAB723582CDD774D), + UINT64_C(0xA187C3EBCA2BB664), UINT64_C(0xCED864E8746798D7), + UINT64_C(0xFA2783439D1D3290), UINT64_C(0x9578244023511C23), + UINT64_C(0x92D94C144EE8661F), UINT64_C(0xFD86EB17F0A448AC), + UINT64_C(0xC9790CBC19DEE2EB), UINT64_C(0xA626ABBFA792CC58), + UINT64_C(0xC73BDD14C3AC1793), UINT64_C(0xA8647A177DE03920), + UINT64_C(0x9C9B9DBC949A9367), UINT64_C(0xF3C43ABF2AD6BDD4), + UINT64_C(0xF46552EB476FC7E8), UINT64_C(0x9B3AF5E8F923E95B), + UINT64_C(0xAFC512431059431C), UINT64_C(0xC09AB540AE156DAF), + UINT64_C(0xE8E1F0BAF28A2D19), UINT64_C(0x87BE57B94CC603AA), + UINT64_C(0xB341B012A5BCA9ED), UINT64_C(0xDC1E17111BF0875E), + UINT64_C(0xDBBF7F457649FD62), UINT64_C(0xB4E0D846C805D3D1), + UINT64_C(0x801F3FED217F7996), UINT64_C(0xEF4098EE9F335725), + UINT64_C(0x8E5DEE45FB0D8CEE), UINT64_C(0xE10249464541A25D), + UINT64_C(0xD5FDAEEDAC3B081A), UINT64_C(0xBAA209EE127726A9), + UINT64_C(0xBD0361BA7FCE5C95), UINT64_C(0xD25CC6B9C1827226), + UINT64_C(0xE6A3211228F8D861), UINT64_C(0x89FC861196B4F6D2), + UINT64_C(0x334BA549BA69819F), UINT64_C(0x5C14024A0425AF2C), + UINT64_C(0x68EBE5E1ED5F056B), UINT64_C(0x07B442E253132BD8), + UINT64_C(0x00152AB63EAA51E4), UINT64_C(0x6F4A8DB580E67F57), + UINT64_C(0x5BB56A1E699CD510), UINT64_C(0x34EACD1DD7D0FBA3), + UINT64_C(0x55F7BBB6B3EE2068), UINT64_C(0x3AA81CB50DA20EDB), + UINT64_C(0x0E57FB1EE4D8A49C), UINT64_C(0x61085C1D5A948A2F), + UINT64_C(0x66A93449372DF013), UINT64_C(0x09F6934A8961DEA0), + UINT64_C(0x3D0974E1601B74E7), UINT64_C(0x5256D3E2DE575A54), + UINT64_C(0x7A2D961882C81AE2), UINT64_C(0x1572311B3C843451), + UINT64_C(0x218DD6B0D5FE9E16), UINT64_C(0x4ED271B36BB2B0A5), + UINT64_C(0x497319E7060BCA99), UINT64_C(0x262CBEE4B847E42A), + UINT64_C(0x12D3594F513D4E6D), UINT64_C(0x7D8CFE4CEF7160DE), + UINT64_C(0x1C9188E78B4FBB15), UINT64_C(0x73CE2FE4350395A6), + UINT64_C(0x4731C84FDC793FE1), UINT64_C(0x286E6F4C62351152), + UINT64_C(0x2FCF07180F8C6B6E), UINT64_C(0x4090A01BB1C045DD), + UINT64_C(0x746F47B058BAEF9A), UINT64_C(0x1B30E0B3E6F6C129), + UINT64_C(0x420F87D795576CC9), UINT64_C(0x2D5020D42B1B427A), + UINT64_C(0x19AFC77FC261E83D), UINT64_C(0x76F0607C7C2DC68E), + UINT64_C(0x715108281194BCB2), UINT64_C(0x1E0EAF2BAFD89201), + UINT64_C(0x2AF1488046A23846), UINT64_C(0x45AEEF83F8EE16F5), + UINT64_C(0x24B399289CD0CD3E), UINT64_C(0x4BEC3E2B229CE38D), + UINT64_C(0x7F13D980CBE649CA), UINT64_C(0x104C7E8375AA6779), + UINT64_C(0x17ED16D718131D45), UINT64_C(0x78B2B1D4A65F33F6), + UINT64_C(0x4C4D567F4F2599B1), UINT64_C(0x2312F17CF169B702), + UINT64_C(0x0B69B486ADF6F7B4), UINT64_C(0x6436138513BAD907), + UINT64_C(0x50C9F42EFAC07340), UINT64_C(0x3F96532D448C5DF3), + UINT64_C(0x38373B79293527CF), UINT64_C(0x57689C7A9779097C), + UINT64_C(0x63977BD17E03A33B), UINT64_C(0x0CC8DCD2C04F8D88), + UINT64_C(0x6DD5AA79A4715643), UINT64_C(0x028A0D7A1A3D78F0), + UINT64_C(0x3675EAD1F347D2B7), UINT64_C(0x592A4DD24D0BFC04), + UINT64_C(0x5E8B258620B28638), UINT64_C(0x31D482859EFEA88B), + UINT64_C(0x052B652E778402CC), UINT64_C(0x6A74C22DC9C82C7F), + UINT64_C(0xD0C3E175E5155B32), UINT64_C(0xBF9C46765B597581), + UINT64_C(0x8B63A1DDB223DFC6), UINT64_C(0xE43C06DE0C6FF175), + UINT64_C(0xE39D6E8A61D68B49), UINT64_C(0x8CC2C989DF9AA5FA), + UINT64_C(0xB83D2E2236E00FBD), UINT64_C(0xD762892188AC210E), + UINT64_C(0xB67FFF8AEC92FAC5), UINT64_C(0xD920588952DED476), + UINT64_C(0xEDDFBF22BBA47E31), UINT64_C(0x8280182105E85082), + UINT64_C(0x8521707568512ABE), UINT64_C(0xEA7ED776D61D040D), + UINT64_C(0xDE8130DD3F67AE4A), UINT64_C(0xB1DE97DE812B80F9), + UINT64_C(0x99A5D224DDB4C04F), UINT64_C(0xF6FA752763F8EEFC), + UINT64_C(0xC205928C8A8244BB), UINT64_C(0xAD5A358F34CE6A08), + UINT64_C(0xAAFB5DDB59771034), UINT64_C(0xC5A4FAD8E73B3E87), + UINT64_C(0xF15B1D730E4194C0), UINT64_C(0x9E04BA70B00DBA73), + UINT64_C(0xFF19CCDBD43361B8), UINT64_C(0x90466BD86A7F4F0B), + UINT64_C(0xA4B98C738305E54C), UINT64_C(0xCBE62B703D49CBFF), + UINT64_C(0xCC47432450F0B1C3), UINT64_C(0xA318E427EEBC9F70), + UINT64_C(0x97E7038C07C63537), UINT64_C(0xF8B8A48FB98A1B84), + UINT64_C(0xE388443C5F7CDAAD), UINT64_C(0x8CD7E33FE130F41E), + UINT64_C(0xB8280494084A5E59), UINT64_C(0xD777A397B60670EA), + UINT64_C(0xD0D6CBC3DBBF0AD6), UINT64_C(0xBF896CC065F32465), + UINT64_C(0x8B768B6B8C898E22), UINT64_C(0xE4292C6832C5A091), + UINT64_C(0x85345AC356FB7B5A), UINT64_C(0xEA6BFDC0E8B755E9), + UINT64_C(0xDE941A6B01CDFFAE), UINT64_C(0xB1CBBD68BF81D11D), + UINT64_C(0xB66AD53CD238AB21), UINT64_C(0xD935723F6C748592), + UINT64_C(0xEDCA9594850E2FD5), UINT64_C(0x829532973B420166), + UINT64_C(0xAAEE776D67DD41D0), UINT64_C(0xC5B1D06ED9916F63), + UINT64_C(0xF14E37C530EBC524), UINT64_C(0x9E1190C68EA7EB97), + UINT64_C(0x99B0F892E31E91AB), UINT64_C(0xF6EF5F915D52BF18), + UINT64_C(0xC210B83AB428155F), UINT64_C(0xAD4F1F390A643BEC), + UINT64_C(0xCC5269926E5AE027), UINT64_C(0xA30DCE91D016CE94), + UINT64_C(0x97F2293A396C64D3), UINT64_C(0xF8AD8E3987204A60), + UINT64_C(0xFF0CE66DEA99305C), UINT64_C(0x9053416E54D51EEF), + UINT64_C(0xA4ACA6C5BDAFB4A8), UINT64_C(0xCBF301C603E39A1B), + UINT64_C(0x7144229E2F3EED56), UINT64_C(0x1E1B859D9172C3E5), + UINT64_C(0x2AE46236780869A2), UINT64_C(0x45BBC535C6444711), + UINT64_C(0x421AAD61ABFD3D2D), UINT64_C(0x2D450A6215B1139E), + UINT64_C(0x19BAEDC9FCCBB9D9), UINT64_C(0x76E54ACA4287976A), + UINT64_C(0x17F83C6126B94CA1), UINT64_C(0x78A79B6298F56212), + UINT64_C(0x4C587CC9718FC855), UINT64_C(0x2307DBCACFC3E6E6), + UINT64_C(0x24A6B39EA27A9CDA), UINT64_C(0x4BF9149D1C36B269), + UINT64_C(0x7F06F336F54C182E), UINT64_C(0x105954354B00369D), + UINT64_C(0x382211CF179F762B), UINT64_C(0x577DB6CCA9D35898), + UINT64_C(0x6382516740A9F2DF), UINT64_C(0x0CDDF664FEE5DC6C), + UINT64_C(0x0B7C9E30935CA650), UINT64_C(0x642339332D1088E3), + UINT64_C(0x50DCDE98C46A22A4), UINT64_C(0x3F83799B7A260C17), + UINT64_C(0x5E9E0F301E18D7DC), UINT64_C(0x31C1A833A054F96F), + UINT64_C(0x053E4F98492E5328), UINT64_C(0x6A61E89BF7627D9B), + UINT64_C(0x6DC080CF9ADB07A7), UINT64_C(0x029F27CC24972914), + UINT64_C(0x3660C067CDED8353), UINT64_C(0x593F676473A1ADE0) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x0DF1D05C9279E954), + UINT64_C(0x1AE2A1B924F3D2A9), UINT64_C(0x171371E5B68A3BFD), + UINT64_C(0xB1DA4DDC62497DC1), UINT64_C(0xBC2B9D80F0309495), + UINT64_C(0xAB38EC6546BAAF68), UINT64_C(0xA6C93C39D4C3463C), + UINT64_C(0xE7AB9517EE3D2210), UINT64_C(0xEA5A454B7C44CB44), + UINT64_C(0xFD4934AECACEF0B9), UINT64_C(0xF0B8E4F258B719ED), + UINT64_C(0x5671D8CB8C745FD1), UINT64_C(0x5B8008971E0DB685), + UINT64_C(0x4C937972A8878D78), UINT64_C(0x4162A92E3AFE642C), + UINT64_C(0xCE572B2FDC7B4420), UINT64_C(0xC3A6FB734E02AD74), + UINT64_C(0xD4B58A96F8889689), UINT64_C(0xD9445ACA6AF17FDD), + UINT64_C(0x7F8D66F3BE3239E1), UINT64_C(0x727CB6AF2C4BD0B5), + UINT64_C(0x656FC74A9AC1EB48), UINT64_C(0x689E171608B8021C), + UINT64_C(0x29FCBE3832466630), UINT64_C(0x240D6E64A03F8F64), + UINT64_C(0x331E1F8116B5B499), UINT64_C(0x3EEFCFDD84CC5DCD), + UINT64_C(0x9826F3E4500F1BF1), UINT64_C(0x95D723B8C276F2A5), + UINT64_C(0x82C4525D74FCC958), UINT64_C(0x8F358201E685200C), + UINT64_C(0x9CAF565EB8F78840), UINT64_C(0x915E86022A8E6114), + UINT64_C(0x864DF7E79C045AE9), UINT64_C(0x8BBC27BB0E7DB3BD), + UINT64_C(0x2D751B82DABEF581), UINT64_C(0x2084CBDE48C71CD5), + UINT64_C(0x3797BA3BFE4D2728), UINT64_C(0x3A666A676C34CE7C), + UINT64_C(0x7B04C34956CAAA50), UINT64_C(0x76F51315C4B34304), + UINT64_C(0x61E662F0723978F9), UINT64_C(0x6C17B2ACE04091AD), + UINT64_C(0xCADE8E953483D791), UINT64_C(0xC72F5EC9A6FA3EC5), + UINT64_C(0xD03C2F2C10700538), UINT64_C(0xDDCDFF708209EC6C), + UINT64_C(0x52F87D71648CCC60), UINT64_C(0x5F09AD2DF6F52534), + UINT64_C(0x481ADCC8407F1EC9), UINT64_C(0x45EB0C94D206F79D), + UINT64_C(0xE32230AD06C5B1A1), UINT64_C(0xEED3E0F194BC58F5), + UINT64_C(0xF9C0911422366308), UINT64_C(0xF4314148B04F8A5C), + UINT64_C(0xB553E8668AB1EE70), UINT64_C(0xB8A2383A18C80724), + UINT64_C(0xAFB149DFAE423CD9), UINT64_C(0xA24099833C3BD58D), + UINT64_C(0x0489A5BAE8F893B1), UINT64_C(0x097875E67A817AE5), + UINT64_C(0x1E6B0403CC0B4118), UINT64_C(0x139AD45F5E72A84C), + UINT64_C(0x385FADBC70EF1181), UINT64_C(0x35AE7DE0E296F8D5), + UINT64_C(0x22BD0C05541CC328), UINT64_C(0x2F4CDC59C6652A7C), + UINT64_C(0x8985E06012A66C40), UINT64_C(0x8474303C80DF8514), + UINT64_C(0x936741D93655BEE9), UINT64_C(0x9E969185A42C57BD), + UINT64_C(0xDFF438AB9ED23391), UINT64_C(0xD205E8F70CABDAC5), + UINT64_C(0xC5169912BA21E138), UINT64_C(0xC8E7494E2858086C), + UINT64_C(0x6E2E7577FC9B4E50), UINT64_C(0x63DFA52B6EE2A704), + UINT64_C(0x74CCD4CED8689CF9), UINT64_C(0x793D04924A1175AD), + UINT64_C(0xF6088693AC9455A1), UINT64_C(0xFBF956CF3EEDBCF5), + UINT64_C(0xECEA272A88678708), UINT64_C(0xE11BF7761A1E6E5C), + UINT64_C(0x47D2CB4FCEDD2860), UINT64_C(0x4A231B135CA4C134), + UINT64_C(0x5D306AF6EA2EFAC9), UINT64_C(0x50C1BAAA7857139D), + UINT64_C(0x11A3138442A977B1), UINT64_C(0x1C52C3D8D0D09EE5), + UINT64_C(0x0B41B23D665AA518), UINT64_C(0x06B06261F4234C4C), + UINT64_C(0xA0795E5820E00A70), UINT64_C(0xAD888E04B299E324), + UINT64_C(0xBA9BFFE10413D8D9), UINT64_C(0xB76A2FBD966A318D), + UINT64_C(0xA4F0FBE2C81899C1), UINT64_C(0xA9012BBE5A617095), + UINT64_C(0xBE125A5BECEB4B68), UINT64_C(0xB3E38A077E92A23C), + UINT64_C(0x152AB63EAA51E400), UINT64_C(0x18DB666238280D54), + UINT64_C(0x0FC817878EA236A9), UINT64_C(0x0239C7DB1CDBDFFD), + UINT64_C(0x435B6EF52625BBD1), UINT64_C(0x4EAABEA9B45C5285), + UINT64_C(0x59B9CF4C02D66978), UINT64_C(0x54481F1090AF802C), + UINT64_C(0xF2812329446CC610), UINT64_C(0xFF70F375D6152F44), + UINT64_C(0xE8638290609F14B9), UINT64_C(0xE59252CCF2E6FDED), + UINT64_C(0x6AA7D0CD1463DDE1), UINT64_C(0x67560091861A34B5), + UINT64_C(0x7045717430900F48), UINT64_C(0x7DB4A128A2E9E61C), + UINT64_C(0xDB7D9D11762AA020), UINT64_C(0xD68C4D4DE4534974), + UINT64_C(0xC19F3CA852D97289), UINT64_C(0xCC6EECF4C0A09BDD), + UINT64_C(0x8D0C45DAFA5EFFF1), UINT64_C(0x80FD9586682716A5), + UINT64_C(0x97EEE463DEAD2D58), UINT64_C(0x9A1F343F4CD4C40C), + UINT64_C(0x3CD6080698178230), UINT64_C(0x3127D85A0A6E6B64), + UINT64_C(0x2634A9BFBCE45099), UINT64_C(0x2BC579E32E9DB9CD), + UINT64_C(0xF5A054D6CA71FB90), UINT64_C(0xF851848A580812C4), + UINT64_C(0xEF42F56FEE822939), UINT64_C(0xE2B325337CFBC06D), + UINT64_C(0x447A190AA8388651), UINT64_C(0x498BC9563A416F05), + UINT64_C(0x5E98B8B38CCB54F8), UINT64_C(0x536968EF1EB2BDAC), + UINT64_C(0x120BC1C1244CD980), UINT64_C(0x1FFA119DB63530D4), + UINT64_C(0x08E9607800BF0B29), UINT64_C(0x0518B02492C6E27D), + UINT64_C(0xA3D18C1D4605A441), UINT64_C(0xAE205C41D47C4D15), + UINT64_C(0xB9332DA462F676E8), UINT64_C(0xB4C2FDF8F08F9FBC), + UINT64_C(0x3BF77FF9160ABFB0), UINT64_C(0x3606AFA5847356E4), + UINT64_C(0x2115DE4032F96D19), UINT64_C(0x2CE40E1CA080844D), + UINT64_C(0x8A2D32257443C271), UINT64_C(0x87DCE279E63A2B25), + UINT64_C(0x90CF939C50B010D8), UINT64_C(0x9D3E43C0C2C9F98C), + UINT64_C(0xDC5CEAEEF8379DA0), UINT64_C(0xD1AD3AB26A4E74F4), + UINT64_C(0xC6BE4B57DCC44F09), UINT64_C(0xCB4F9B0B4EBDA65D), + UINT64_C(0x6D86A7329A7EE061), UINT64_C(0x6077776E08070935), + UINT64_C(0x7764068BBE8D32C8), UINT64_C(0x7A95D6D72CF4DB9C), + UINT64_C(0x690F0288728673D0), UINT64_C(0x64FED2D4E0FF9A84), + UINT64_C(0x73EDA3315675A179), UINT64_C(0x7E1C736DC40C482D), + UINT64_C(0xD8D54F5410CF0E11), UINT64_C(0xD5249F0882B6E745), + UINT64_C(0xC237EEED343CDCB8), UINT64_C(0xCFC63EB1A64535EC), + UINT64_C(0x8EA4979F9CBB51C0), UINT64_C(0x835547C30EC2B894), + UINT64_C(0x94463626B8488369), UINT64_C(0x99B7E67A2A316A3D), + UINT64_C(0x3F7EDA43FEF22C01), UINT64_C(0x328F0A1F6C8BC555), + UINT64_C(0x259C7BFADA01FEA8), UINT64_C(0x286DABA6487817FC), + UINT64_C(0xA75829A7AEFD37F0), UINT64_C(0xAAA9F9FB3C84DEA4), + UINT64_C(0xBDBA881E8A0EE559), UINT64_C(0xB04B584218770C0D), + UINT64_C(0x1682647BCCB44A31), UINT64_C(0x1B73B4275ECDA365), + UINT64_C(0x0C60C5C2E8479898), UINT64_C(0x0191159E7A3E71CC), + UINT64_C(0x40F3BCB040C015E0), UINT64_C(0x4D026CECD2B9FCB4), + UINT64_C(0x5A111D096433C749), UINT64_C(0x57E0CD55F64A2E1D), + UINT64_C(0xF129F16C22896821), UINT64_C(0xFCD82130B0F08175), + UINT64_C(0xEBCB50D5067ABA88), UINT64_C(0xE63A8089940353DC), + UINT64_C(0xCDFFF96ABA9EEA11), UINT64_C(0xC00E293628E70345), + UINT64_C(0xD71D58D39E6D38B8), UINT64_C(0xDAEC888F0C14D1EC), + UINT64_C(0x7C25B4B6D8D797D0), UINT64_C(0x71D464EA4AAE7E84), + UINT64_C(0x66C7150FFC244579), UINT64_C(0x6B36C5536E5DAC2D), + UINT64_C(0x2A546C7D54A3C801), UINT64_C(0x27A5BC21C6DA2155), + UINT64_C(0x30B6CDC470501AA8), UINT64_C(0x3D471D98E229F3FC), + UINT64_C(0x9B8E21A136EAB5C0), UINT64_C(0x967FF1FDA4935C94), + UINT64_C(0x816C801812196769), UINT64_C(0x8C9D504480608E3D), + UINT64_C(0x03A8D24566E5AE31), UINT64_C(0x0E590219F49C4765), + UINT64_C(0x194A73FC42167C98), UINT64_C(0x14BBA3A0D06F95CC), + UINT64_C(0xB2729F9904ACD3F0), UINT64_C(0xBF834FC596D53AA4), + UINT64_C(0xA8903E20205F0159), UINT64_C(0xA561EE7CB226E80D), + UINT64_C(0xE403475288D88C21), UINT64_C(0xE9F2970E1AA16575), + UINT64_C(0xFEE1E6EBAC2B5E88), UINT64_C(0xF31036B73E52B7DC), + UINT64_C(0x55D90A8EEA91F1E0), UINT64_C(0x5828DAD278E818B4), + UINT64_C(0x4F3BAB37CE622349), UINT64_C(0x42CA7B6B5C1BCA1D), + UINT64_C(0x5150AF3402696251), UINT64_C(0x5CA17F6890108B05), + UINT64_C(0x4BB20E8D269AB0F8), UINT64_C(0x4643DED1B4E359AC), + UINT64_C(0xE08AE2E860201F90), UINT64_C(0xED7B32B4F259F6C4), + UINT64_C(0xFA68435144D3CD39), UINT64_C(0xF799930DD6AA246D), + UINT64_C(0xB6FB3A23EC544041), UINT64_C(0xBB0AEA7F7E2DA915), + UINT64_C(0xAC199B9AC8A792E8), UINT64_C(0xA1E84BC65ADE7BBC), + UINT64_C(0x072177FF8E1D3D80), UINT64_C(0x0AD0A7A31C64D4D4), + UINT64_C(0x1DC3D646AAEEEF29), UINT64_C(0x1032061A3897067D), + UINT64_C(0x9F07841BDE122671), UINT64_C(0x92F654474C6BCF25), + UINT64_C(0x85E525A2FAE1F4D8), UINT64_C(0x8814F5FE68981D8C), + UINT64_C(0x2EDDC9C7BC5B5BB0), UINT64_C(0x232C199B2E22B2E4), + UINT64_C(0x343F687E98A88919), UINT64_C(0x39CEB8220AD1604D), + UINT64_C(0x78AC110C302F0461), UINT64_C(0x755DC150A256ED35), + UINT64_C(0x624EB0B514DCD6C8), UINT64_C(0x6FBF60E986A53F9C), + UINT64_C(0xC9765CD0526679A0), UINT64_C(0xC4878C8CC01F90F4), + UINT64_C(0xD394FD697695AB09), UINT64_C(0xDE652D35E4EC425D) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0xCB6D6A914AE10B3F), + UINT64_C(0x96DBD42295C2177E), UINT64_C(0x5DB6BEB3DF231C41), + UINT64_C(0x2CB7A9452A852FFC), UINT64_C(0xE7DAC3D4606424C3), + UINT64_C(0xBA6C7D67BF473882), UINT64_C(0x710117F6F5A633BD), + UINT64_C(0xDD705D247FA5876A), UINT64_C(0x161D37B535448C55), + UINT64_C(0x4BAB8906EA679014), UINT64_C(0x80C6E397A0869B2B), + UINT64_C(0xF1C7F4615520A896), UINT64_C(0x3AAA9EF01FC1A3A9), + UINT64_C(0x671C2043C0E2BFE8), UINT64_C(0xAC714AD28A03B4D7), + UINT64_C(0xBAE1BA48FE4A0FD5), UINT64_C(0x718CD0D9B4AB04EA), + UINT64_C(0x2C3A6E6A6B8818AB), UINT64_C(0xE75704FB21691394), + UINT64_C(0x9656130DD4CF2029), UINT64_C(0x5D3B799C9E2E2B16), + UINT64_C(0x008DC72F410D3757), UINT64_C(0xCBE0ADBE0BEC3C68), + UINT64_C(0x6791E76C81EF88BF), UINT64_C(0xACFC8DFDCB0E8380), + UINT64_C(0xF14A334E142D9FC1), UINT64_C(0x3A2759DF5ECC94FE), + UINT64_C(0x4B264E29AB6AA743), UINT64_C(0x804B24B8E18BAC7C), + UINT64_C(0xDDFD9A0B3EA8B03D), UINT64_C(0x1690F09A7449BB02), + UINT64_C(0xF1DD7B3ED73AC638), UINT64_C(0x3AB011AF9DDBCD07), + UINT64_C(0x6706AF1C42F8D146), UINT64_C(0xAC6BC58D0819DA79), + UINT64_C(0xDD6AD27BFDBFE9C4), UINT64_C(0x1607B8EAB75EE2FB), + UINT64_C(0x4BB10659687DFEBA), UINT64_C(0x80DC6CC8229CF585), + UINT64_C(0x2CAD261AA89F4152), UINT64_C(0xE7C04C8BE27E4A6D), + UINT64_C(0xBA76F2383D5D562C), UINT64_C(0x711B98A977BC5D13), + UINT64_C(0x001A8F5F821A6EAE), UINT64_C(0xCB77E5CEC8FB6591), + UINT64_C(0x96C15B7D17D879D0), UINT64_C(0x5DAC31EC5D3972EF), + UINT64_C(0x4B3CC1762970C9ED), UINT64_C(0x8051ABE76391C2D2), + UINT64_C(0xDDE71554BCB2DE93), UINT64_C(0x168A7FC5F653D5AC), + UINT64_C(0x678B683303F5E611), UINT64_C(0xACE602A24914ED2E), + UINT64_C(0xF150BC119637F16F), UINT64_C(0x3A3DD680DCD6FA50), + UINT64_C(0x964C9C5256D54E87), UINT64_C(0x5D21F6C31C3445B8), + UINT64_C(0x00974870C31759F9), UINT64_C(0xCBFA22E189F652C6), + UINT64_C(0xBAFB35177C50617B), UINT64_C(0x71965F8636B16A44), + UINT64_C(0x2C20E135E9927605), UINT64_C(0xE74D8BA4A3737D3A), + UINT64_C(0xE2BBF77CAE758C71), UINT64_C(0x29D69DEDE494874E), + UINT64_C(0x7460235E3BB79B0F), UINT64_C(0xBF0D49CF71569030), + UINT64_C(0xCE0C5E3984F0A38D), UINT64_C(0x056134A8CE11A8B2), + UINT64_C(0x58D78A1B1132B4F3), UINT64_C(0x93BAE08A5BD3BFCC), + UINT64_C(0x3FCBAA58D1D00B1B), UINT64_C(0xF4A6C0C99B310024), + UINT64_C(0xA9107E7A44121C65), UINT64_C(0x627D14EB0EF3175A), + UINT64_C(0x137C031DFB5524E7), UINT64_C(0xD811698CB1B42FD8), + UINT64_C(0x85A7D73F6E973399), UINT64_C(0x4ECABDAE247638A6), + UINT64_C(0x585A4D34503F83A4), UINT64_C(0x933727A51ADE889B), + UINT64_C(0xCE819916C5FD94DA), UINT64_C(0x05ECF3878F1C9FE5), + UINT64_C(0x74EDE4717ABAAC58), UINT64_C(0xBF808EE0305BA767), + UINT64_C(0xE2363053EF78BB26), UINT64_C(0x295B5AC2A599B019), + UINT64_C(0x852A10102F9A04CE), UINT64_C(0x4E477A81657B0FF1), + UINT64_C(0x13F1C432BA5813B0), UINT64_C(0xD89CAEA3F0B9188F), + UINT64_C(0xA99DB955051F2B32), UINT64_C(0x62F0D3C44FFE200D), + UINT64_C(0x3F466D7790DD3C4C), UINT64_C(0xF42B07E6DA3C3773), + UINT64_C(0x13668C42794F4A49), UINT64_C(0xD80BE6D333AE4176), + UINT64_C(0x85BD5860EC8D5D37), UINT64_C(0x4ED032F1A66C5608), + UINT64_C(0x3FD1250753CA65B5), UINT64_C(0xF4BC4F96192B6E8A), + UINT64_C(0xA90AF125C60872CB), UINT64_C(0x62679BB48CE979F4), + UINT64_C(0xCE16D16606EACD23), UINT64_C(0x057BBBF74C0BC61C), + UINT64_C(0x58CD05449328DA5D), UINT64_C(0x93A06FD5D9C9D162), + UINT64_C(0xE2A178232C6FE2DF), UINT64_C(0x29CC12B2668EE9E0), + UINT64_C(0x747AAC01B9ADF5A1), UINT64_C(0xBF17C690F34CFE9E), + UINT64_C(0xA987360A8705459C), UINT64_C(0x62EA5C9BCDE44EA3), + UINT64_C(0x3F5CE22812C752E2), UINT64_C(0xF43188B9582659DD), + UINT64_C(0x85309F4FAD806A60), UINT64_C(0x4E5DF5DEE761615F), + UINT64_C(0x13EB4B6D38427D1E), UINT64_C(0xD88621FC72A37621), + UINT64_C(0x74F76B2EF8A0C2F6), UINT64_C(0xBF9A01BFB241C9C9), + UINT64_C(0xE22CBF0C6D62D588), UINT64_C(0x2941D59D2783DEB7), + UINT64_C(0x5840C26BD225ED0A), UINT64_C(0x932DA8FA98C4E635), + UINT64_C(0xCE9B164947E7FA74), UINT64_C(0x05F67CD80D06F14B), + UINT64_C(0xC477EFF95CEB18E3), UINT64_C(0x0F1A8568160A13DC), + UINT64_C(0x52AC3BDBC9290F9D), UINT64_C(0x99C1514A83C804A2), + UINT64_C(0xE8C046BC766E371F), UINT64_C(0x23AD2C2D3C8F3C20), + UINT64_C(0x7E1B929EE3AC2061), UINT64_C(0xB576F80FA94D2B5E), + UINT64_C(0x1907B2DD234E9F89), UINT64_C(0xD26AD84C69AF94B6), + UINT64_C(0x8FDC66FFB68C88F7), UINT64_C(0x44B10C6EFC6D83C8), + UINT64_C(0x35B01B9809CBB075), UINT64_C(0xFEDD7109432ABB4A), + UINT64_C(0xA36BCFBA9C09A70B), UINT64_C(0x6806A52BD6E8AC34), + UINT64_C(0x7E9655B1A2A11736), UINT64_C(0xB5FB3F20E8401C09), + UINT64_C(0xE84D819337630048), UINT64_C(0x2320EB027D820B77), + UINT64_C(0x5221FCF4882438CA), UINT64_C(0x994C9665C2C533F5), + UINT64_C(0xC4FA28D61DE62FB4), UINT64_C(0x0F9742475707248B), + UINT64_C(0xA3E60895DD04905C), UINT64_C(0x688B620497E59B63), + UINT64_C(0x353DDCB748C68722), UINT64_C(0xFE50B62602278C1D), + UINT64_C(0x8F51A1D0F781BFA0), UINT64_C(0x443CCB41BD60B49F), + UINT64_C(0x198A75F26243A8DE), UINT64_C(0xD2E71F6328A2A3E1), + UINT64_C(0x35AA94C78BD1DEDB), UINT64_C(0xFEC7FE56C130D5E4), + UINT64_C(0xA37140E51E13C9A5), UINT64_C(0x681C2A7454F2C29A), + UINT64_C(0x191D3D82A154F127), UINT64_C(0xD2705713EBB5FA18), + UINT64_C(0x8FC6E9A03496E659), UINT64_C(0x44AB83317E77ED66), + UINT64_C(0xE8DAC9E3F47459B1), UINT64_C(0x23B7A372BE95528E), + UINT64_C(0x7E011DC161B64ECF), UINT64_C(0xB56C77502B5745F0), + UINT64_C(0xC46D60A6DEF1764D), UINT64_C(0x0F000A3794107D72), + UINT64_C(0x52B6B4844B336133), UINT64_C(0x99DBDE1501D26A0C), + UINT64_C(0x8F4B2E8F759BD10E), UINT64_C(0x4426441E3F7ADA31), + UINT64_C(0x1990FAADE059C670), UINT64_C(0xD2FD903CAAB8CD4F), + UINT64_C(0xA3FC87CA5F1EFEF2), UINT64_C(0x6891ED5B15FFF5CD), + UINT64_C(0x352753E8CADCE98C), UINT64_C(0xFE4A3979803DE2B3), + UINT64_C(0x523B73AB0A3E5664), UINT64_C(0x9956193A40DF5D5B), + UINT64_C(0xC4E0A7899FFC411A), UINT64_C(0x0F8DCD18D51D4A25), + UINT64_C(0x7E8CDAEE20BB7998), UINT64_C(0xB5E1B07F6A5A72A7), + UINT64_C(0xE8570ECCB5796EE6), UINT64_C(0x233A645DFF9865D9), + UINT64_C(0x26CC1885F29E9492), UINT64_C(0xEDA17214B87F9FAD), + UINT64_C(0xB017CCA7675C83EC), UINT64_C(0x7B7AA6362DBD88D3), + UINT64_C(0x0A7BB1C0D81BBB6E), UINT64_C(0xC116DB5192FAB051), + UINT64_C(0x9CA065E24DD9AC10), UINT64_C(0x57CD0F730738A72F), + UINT64_C(0xFBBC45A18D3B13F8), UINT64_C(0x30D12F30C7DA18C7), + UINT64_C(0x6D67918318F90486), UINT64_C(0xA60AFB1252180FB9), + UINT64_C(0xD70BECE4A7BE3C04), UINT64_C(0x1C668675ED5F373B), + UINT64_C(0x41D038C6327C2B7A), UINT64_C(0x8ABD5257789D2045), + UINT64_C(0x9C2DA2CD0CD49B47), UINT64_C(0x5740C85C46359078), + UINT64_C(0x0AF676EF99168C39), UINT64_C(0xC19B1C7ED3F78706), + UINT64_C(0xB09A0B882651B4BB), UINT64_C(0x7BF761196CB0BF84), + UINT64_C(0x2641DFAAB393A3C5), UINT64_C(0xED2CB53BF972A8FA), + UINT64_C(0x415DFFE973711C2D), UINT64_C(0x8A30957839901712), + UINT64_C(0xD7862BCBE6B30B53), UINT64_C(0x1CEB415AAC52006C), + UINT64_C(0x6DEA56AC59F433D1), UINT64_C(0xA6873C3D131538EE), + UINT64_C(0xFB31828ECC3624AF), UINT64_C(0x305CE81F86D72F90), + UINT64_C(0xD71163BB25A452AA), UINT64_C(0x1C7C092A6F455995), + UINT64_C(0x41CAB799B06645D4), UINT64_C(0x8AA7DD08FA874EEB), + UINT64_C(0xFBA6CAFE0F217D56), UINT64_C(0x30CBA06F45C07669), + UINT64_C(0x6D7D1EDC9AE36A28), UINT64_C(0xA610744DD0026117), + UINT64_C(0x0A613E9F5A01D5C0), UINT64_C(0xC10C540E10E0DEFF), + UINT64_C(0x9CBAEABDCFC3C2BE), UINT64_C(0x57D7802C8522C981), + UINT64_C(0x26D697DA7084FA3C), UINT64_C(0xEDBBFD4B3A65F103), + UINT64_C(0xB00D43F8E546ED42), UINT64_C(0x7B602969AFA7E67D), + UINT64_C(0x6DF0D9F3DBEE5D7F), UINT64_C(0xA69DB362910F5640), + UINT64_C(0xFB2B0DD14E2C4A01), UINT64_C(0x3046674004CD413E), + UINT64_C(0x414770B6F16B7283), UINT64_C(0x8A2A1A27BB8A79BC), + UINT64_C(0xD79CA49464A965FD), UINT64_C(0x1CF1CE052E486EC2), + UINT64_C(0xB08084D7A44BDA15), UINT64_C(0x7BEDEE46EEAAD12A), + UINT64_C(0x265B50F53189CD6B), UINT64_C(0xED363A647B68C654), + UINT64_C(0x9C372D928ECEF5E9), UINT64_C(0x575A4703C42FFED6), + UINT64_C(0x0AECF9B01B0CE297), UINT64_C(0xC181932151EDE9A8) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0xDCA12C225E8AEE1D), + UINT64_C(0xB8435944BC14DD3B), UINT64_C(0x64E27566E29E3326), + UINT64_C(0x7087B2887829BA77), UINT64_C(0xAC269EAA26A3546A), + UINT64_C(0xC8C4EBCCC43D674C), UINT64_C(0x1465C7EE9AB78951), + UINT64_C(0xE00E6511F15274EF), UINT64_C(0x3CAF4933AFD89AF2), + UINT64_C(0x584D3C554D46A9D4), UINT64_C(0x84EC107713CC47C9), + UINT64_C(0x9089D799897BCE98), UINT64_C(0x4C28FBBBD7F12085), + UINT64_C(0x28CA8EDD356F13A3), UINT64_C(0xF46BA2FF6BE5FDBE), + UINT64_C(0x4503C48DC90A304C), UINT64_C(0x99A2E8AF9780DE51), + UINT64_C(0xFD409DC9751EED77), UINT64_C(0x21E1B1EB2B94036A), + UINT64_C(0x35847605B1238A3B), UINT64_C(0xE9255A27EFA96426), + UINT64_C(0x8DC72F410D375700), UINT64_C(0x5166036353BDB91D), + UINT64_C(0xA50DA19C385844A3), UINT64_C(0x79AC8DBE66D2AABE), + UINT64_C(0x1D4EF8D8844C9998), UINT64_C(0xC1EFD4FADAC67785), + UINT64_C(0xD58A13144071FED4), UINT64_C(0x092B3F361EFB10C9), + UINT64_C(0x6DC94A50FC6523EF), UINT64_C(0xB1686672A2EFCDF2), + UINT64_C(0x8A06881B93156098), UINT64_C(0x56A7A439CD9F8E85), + UINT64_C(0x3245D15F2F01BDA3), UINT64_C(0xEEE4FD7D718B53BE), + UINT64_C(0xFA813A93EB3CDAEF), UINT64_C(0x262016B1B5B634F2), + UINT64_C(0x42C263D7572807D4), UINT64_C(0x9E634FF509A2E9C9), + UINT64_C(0x6A08ED0A62471477), UINT64_C(0xB6A9C1283CCDFA6A), + UINT64_C(0xD24BB44EDE53C94C), UINT64_C(0x0EEA986C80D92751), + UINT64_C(0x1A8F5F821A6EAE00), UINT64_C(0xC62E73A044E4401D), + UINT64_C(0xA2CC06C6A67A733B), UINT64_C(0x7E6D2AE4F8F09D26), + UINT64_C(0xCF054C965A1F50D4), UINT64_C(0x13A460B40495BEC9), + UINT64_C(0x774615D2E60B8DEF), UINT64_C(0xABE739F0B88163F2), + UINT64_C(0xBF82FE1E2236EAA3), UINT64_C(0x6323D23C7CBC04BE), + UINT64_C(0x07C1A75A9E223798), UINT64_C(0xDB608B78C0A8D985), + UINT64_C(0x2F0B2987AB4D243B), UINT64_C(0xF3AA05A5F5C7CA26), + UINT64_C(0x974870C31759F900), UINT64_C(0x4BE95CE149D3171D), + UINT64_C(0x5F8C9B0FD3649E4C), UINT64_C(0x832DB72D8DEE7051), + UINT64_C(0xE7CFC24B6F704377), UINT64_C(0x3B6EEE6931FAAD6A), + UINT64_C(0x91131E980D8418A2), UINT64_C(0x4DB232BA530EF6BF), + UINT64_C(0x295047DCB190C599), UINT64_C(0xF5F16BFEEF1A2B84), + UINT64_C(0xE194AC1075ADA2D5), UINT64_C(0x3D3580322B274CC8), + UINT64_C(0x59D7F554C9B97FEE), UINT64_C(0x8576D976973391F3), + UINT64_C(0x711D7B89FCD66C4D), UINT64_C(0xADBC57ABA25C8250), + UINT64_C(0xC95E22CD40C2B176), UINT64_C(0x15FF0EEF1E485F6B), + UINT64_C(0x019AC90184FFD63A), UINT64_C(0xDD3BE523DA753827), + UINT64_C(0xB9D9904538EB0B01), UINT64_C(0x6578BC676661E51C), + UINT64_C(0xD410DA15C48E28EE), UINT64_C(0x08B1F6379A04C6F3), + UINT64_C(0x6C538351789AF5D5), UINT64_C(0xB0F2AF7326101BC8), + UINT64_C(0xA497689DBCA79299), UINT64_C(0x783644BFE22D7C84), + UINT64_C(0x1CD431D900B34FA2), UINT64_C(0xC0751DFB5E39A1BF), + UINT64_C(0x341EBF0435DC5C01), UINT64_C(0xE8BF93266B56B21C), + UINT64_C(0x8C5DE64089C8813A), UINT64_C(0x50FCCA62D7426F27), + UINT64_C(0x44990D8C4DF5E676), UINT64_C(0x983821AE137F086B), + UINT64_C(0xFCDA54C8F1E13B4D), UINT64_C(0x207B78EAAF6BD550), + UINT64_C(0x1B1596839E91783A), UINT64_C(0xC7B4BAA1C01B9627), + UINT64_C(0xA356CFC72285A501), UINT64_C(0x7FF7E3E57C0F4B1C), + UINT64_C(0x6B92240BE6B8C24D), UINT64_C(0xB7330829B8322C50), + UINT64_C(0xD3D17D4F5AAC1F76), UINT64_C(0x0F70516D0426F16B), + UINT64_C(0xFB1BF3926FC30CD5), UINT64_C(0x27BADFB03149E2C8), + UINT64_C(0x4358AAD6D3D7D1EE), UINT64_C(0x9FF986F48D5D3FF3), + UINT64_C(0x8B9C411A17EAB6A2), UINT64_C(0x573D6D38496058BF), + UINT64_C(0x33DF185EABFE6B99), UINT64_C(0xEF7E347CF5748584), + UINT64_C(0x5E16520E579B4876), UINT64_C(0x82B77E2C0911A66B), + UINT64_C(0xE6550B4AEB8F954D), UINT64_C(0x3AF42768B5057B50), + UINT64_C(0x2E91E0862FB2F201), UINT64_C(0xF230CCA471381C1C), + UINT64_C(0x96D2B9C293A62F3A), UINT64_C(0x4A7395E0CD2CC127), + UINT64_C(0xBE18371FA6C93C99), UINT64_C(0x62B91B3DF843D284), + UINT64_C(0x065B6E5B1ADDE1A2), UINT64_C(0xDAFA427944570FBF), + UINT64_C(0xCE9F8597DEE086EE), UINT64_C(0x123EA9B5806A68F3), + UINT64_C(0x76DCDCD362F45BD5), UINT64_C(0xAA7DF0F13C7EB5C8), + UINT64_C(0xA739329F30A7E9D6), UINT64_C(0x7B981EBD6E2D07CB), + UINT64_C(0x1F7A6BDB8CB334ED), UINT64_C(0xC3DB47F9D239DAF0), + UINT64_C(0xD7BE8017488E53A1), UINT64_C(0x0B1FAC351604BDBC), + UINT64_C(0x6FFDD953F49A8E9A), UINT64_C(0xB35CF571AA106087), + UINT64_C(0x4737578EC1F59D39), UINT64_C(0x9B967BAC9F7F7324), + UINT64_C(0xFF740ECA7DE14002), UINT64_C(0x23D522E8236BAE1F), + UINT64_C(0x37B0E506B9DC274E), UINT64_C(0xEB11C924E756C953), + UINT64_C(0x8FF3BC4205C8FA75), UINT64_C(0x535290605B421468), + UINT64_C(0xE23AF612F9ADD99A), UINT64_C(0x3E9BDA30A7273787), + UINT64_C(0x5A79AF5645B904A1), UINT64_C(0x86D883741B33EABC), + UINT64_C(0x92BD449A818463ED), UINT64_C(0x4E1C68B8DF0E8DF0), + UINT64_C(0x2AFE1DDE3D90BED6), UINT64_C(0xF65F31FC631A50CB), + UINT64_C(0x0234930308FFAD75), UINT64_C(0xDE95BF2156754368), + UINT64_C(0xBA77CA47B4EB704E), UINT64_C(0x66D6E665EA619E53), + UINT64_C(0x72B3218B70D61702), UINT64_C(0xAE120DA92E5CF91F), + UINT64_C(0xCAF078CFCCC2CA39), UINT64_C(0x165154ED92482424), + UINT64_C(0x2D3FBA84A3B2894E), UINT64_C(0xF19E96A6FD386753), + UINT64_C(0x957CE3C01FA65475), UINT64_C(0x49DDCFE2412CBA68), + UINT64_C(0x5DB8080CDB9B3339), UINT64_C(0x8119242E8511DD24), + UINT64_C(0xE5FB5148678FEE02), UINT64_C(0x395A7D6A3905001F), + UINT64_C(0xCD31DF9552E0FDA1), UINT64_C(0x1190F3B70C6A13BC), + UINT64_C(0x757286D1EEF4209A), UINT64_C(0xA9D3AAF3B07ECE87), + UINT64_C(0xBDB66D1D2AC947D6), UINT64_C(0x6117413F7443A9CB), + UINT64_C(0x05F5345996DD9AED), UINT64_C(0xD954187BC85774F0), + UINT64_C(0x683C7E096AB8B902), UINT64_C(0xB49D522B3432571F), + UINT64_C(0xD07F274DD6AC6439), UINT64_C(0x0CDE0B6F88268A24), + UINT64_C(0x18BBCC8112910375), UINT64_C(0xC41AE0A34C1BED68), + UINT64_C(0xA0F895C5AE85DE4E), UINT64_C(0x7C59B9E7F00F3053), + UINT64_C(0x88321B189BEACDED), UINT64_C(0x5493373AC56023F0), + UINT64_C(0x3071425C27FE10D6), UINT64_C(0xECD06E7E7974FECB), + UINT64_C(0xF8B5A990E3C3779A), UINT64_C(0x241485B2BD499987), + UINT64_C(0x40F6F0D45FD7AAA1), UINT64_C(0x9C57DCF6015D44BC), + UINT64_C(0x362A2C073D23F174), UINT64_C(0xEA8B002563A91F69), + UINT64_C(0x8E69754381372C4F), UINT64_C(0x52C85961DFBDC252), + UINT64_C(0x46AD9E8F450A4B03), UINT64_C(0x9A0CB2AD1B80A51E), + UINT64_C(0xFEEEC7CBF91E9638), UINT64_C(0x224FEBE9A7947825), + UINT64_C(0xD6244916CC71859B), UINT64_C(0x0A85653492FB6B86), + UINT64_C(0x6E671052706558A0), UINT64_C(0xB2C63C702EEFB6BD), + UINT64_C(0xA6A3FB9EB4583FEC), UINT64_C(0x7A02D7BCEAD2D1F1), + UINT64_C(0x1EE0A2DA084CE2D7), UINT64_C(0xC2418EF856C60CCA), + UINT64_C(0x7329E88AF429C138), UINT64_C(0xAF88C4A8AAA32F25), + UINT64_C(0xCB6AB1CE483D1C03), UINT64_C(0x17CB9DEC16B7F21E), + UINT64_C(0x03AE5A028C007B4F), UINT64_C(0xDF0F7620D28A9552), + UINT64_C(0xBBED03463014A674), UINT64_C(0x674C2F646E9E4869), + UINT64_C(0x93278D9B057BB5D7), UINT64_C(0x4F86A1B95BF15BCA), + UINT64_C(0x2B64D4DFB96F68EC), UINT64_C(0xF7C5F8FDE7E586F1), + UINT64_C(0xE3A03F137D520FA0), UINT64_C(0x3F01133123D8E1BD), + UINT64_C(0x5BE36657C146D29B), UINT64_C(0x87424A759FCC3C86), + UINT64_C(0xBC2CA41CAE3691EC), UINT64_C(0x608D883EF0BC7FF1), + UINT64_C(0x046FFD5812224CD7), UINT64_C(0xD8CED17A4CA8A2CA), + UINT64_C(0xCCAB1694D61F2B9B), UINT64_C(0x100A3AB68895C586), + UINT64_C(0x74E84FD06A0BF6A0), UINT64_C(0xA84963F2348118BD), + UINT64_C(0x5C22C10D5F64E503), UINT64_C(0x8083ED2F01EE0B1E), + UINT64_C(0xE4619849E3703838), UINT64_C(0x38C0B46BBDFAD625), + UINT64_C(0x2CA57385274D5F74), UINT64_C(0xF0045FA779C7B169), + UINT64_C(0x94E62AC19B59824F), UINT64_C(0x484706E3C5D36C52), + UINT64_C(0xF92F6091673CA1A0), UINT64_C(0x258E4CB339B64FBD), + UINT64_C(0x416C39D5DB287C9B), UINT64_C(0x9DCD15F785A29286), + UINT64_C(0x89A8D2191F151BD7), UINT64_C(0x5509FE3B419FF5CA), + UINT64_C(0x31EB8B5DA301C6EC), UINT64_C(0xED4AA77FFD8B28F1), + UINT64_C(0x19210580966ED54F), UINT64_C(0xC58029A2C8E43B52), + UINT64_C(0xA1625CC42A7A0874), UINT64_C(0x7DC370E674F0E669), + UINT64_C(0x69A6B708EE476F38), UINT64_C(0xB5079B2AB0CD8125), + UINT64_C(0xD1E5EE4C5253B203), UINT64_C(0x0D44C26E0CD95C1E) + } +}; diff --git a/src/liblzma/check/crc64_table_le.h b/src/liblzma/check/crc64_table_le.h new file mode 100644 index 0000000..1196b31 --- /dev/null +++ b/src/liblzma/check/crc64_table_le.h @@ -0,0 +1,521 @@ +/* This file has been automatically generated by crc64_tablegen.c. */ + +const uint64_t lzma_crc64_table[4][256] = { + { + UINT64_C(0x0000000000000000), UINT64_C(0xB32E4CBE03A75F6F), + UINT64_C(0xF4843657A840A05B), UINT64_C(0x47AA7AE9ABE7FF34), + UINT64_C(0x7BD0C384FF8F5E33), UINT64_C(0xC8FE8F3AFC28015C), + UINT64_C(0x8F54F5D357CFFE68), UINT64_C(0x3C7AB96D5468A107), + UINT64_C(0xF7A18709FF1EBC66), UINT64_C(0x448FCBB7FCB9E309), + UINT64_C(0x0325B15E575E1C3D), UINT64_C(0xB00BFDE054F94352), + UINT64_C(0x8C71448D0091E255), UINT64_C(0x3F5F08330336BD3A), + UINT64_C(0x78F572DAA8D1420E), UINT64_C(0xCBDB3E64AB761D61), + UINT64_C(0x7D9BA13851336649), UINT64_C(0xCEB5ED8652943926), + UINT64_C(0x891F976FF973C612), UINT64_C(0x3A31DBD1FAD4997D), + UINT64_C(0x064B62BCAEBC387A), UINT64_C(0xB5652E02AD1B6715), + UINT64_C(0xF2CF54EB06FC9821), UINT64_C(0x41E11855055BC74E), + UINT64_C(0x8A3A2631AE2DDA2F), UINT64_C(0x39146A8FAD8A8540), + UINT64_C(0x7EBE1066066D7A74), UINT64_C(0xCD905CD805CA251B), + UINT64_C(0xF1EAE5B551A2841C), UINT64_C(0x42C4A90B5205DB73), + UINT64_C(0x056ED3E2F9E22447), UINT64_C(0xB6409F5CFA457B28), + UINT64_C(0xFB374270A266CC92), UINT64_C(0x48190ECEA1C193FD), + UINT64_C(0x0FB374270A266CC9), UINT64_C(0xBC9D3899098133A6), + UINT64_C(0x80E781F45DE992A1), UINT64_C(0x33C9CD4A5E4ECDCE), + UINT64_C(0x7463B7A3F5A932FA), UINT64_C(0xC74DFB1DF60E6D95), + UINT64_C(0x0C96C5795D7870F4), UINT64_C(0xBFB889C75EDF2F9B), + UINT64_C(0xF812F32EF538D0AF), UINT64_C(0x4B3CBF90F69F8FC0), + UINT64_C(0x774606FDA2F72EC7), UINT64_C(0xC4684A43A15071A8), + UINT64_C(0x83C230AA0AB78E9C), UINT64_C(0x30EC7C140910D1F3), + UINT64_C(0x86ACE348F355AADB), UINT64_C(0x3582AFF6F0F2F5B4), + UINT64_C(0x7228D51F5B150A80), UINT64_C(0xC10699A158B255EF), + UINT64_C(0xFD7C20CC0CDAF4E8), UINT64_C(0x4E526C720F7DAB87), + UINT64_C(0x09F8169BA49A54B3), UINT64_C(0xBAD65A25A73D0BDC), + UINT64_C(0x710D64410C4B16BD), UINT64_C(0xC22328FF0FEC49D2), + UINT64_C(0x85895216A40BB6E6), UINT64_C(0x36A71EA8A7ACE989), + UINT64_C(0x0ADDA7C5F3C4488E), UINT64_C(0xB9F3EB7BF06317E1), + UINT64_C(0xFE5991925B84E8D5), UINT64_C(0x4D77DD2C5823B7BA), + UINT64_C(0x64B62BCAEBC387A1), UINT64_C(0xD7986774E864D8CE), + UINT64_C(0x90321D9D438327FA), UINT64_C(0x231C512340247895), + UINT64_C(0x1F66E84E144CD992), UINT64_C(0xAC48A4F017EB86FD), + UINT64_C(0xEBE2DE19BC0C79C9), UINT64_C(0x58CC92A7BFAB26A6), + UINT64_C(0x9317ACC314DD3BC7), UINT64_C(0x2039E07D177A64A8), + UINT64_C(0x67939A94BC9D9B9C), UINT64_C(0xD4BDD62ABF3AC4F3), + UINT64_C(0xE8C76F47EB5265F4), UINT64_C(0x5BE923F9E8F53A9B), + UINT64_C(0x1C4359104312C5AF), UINT64_C(0xAF6D15AE40B59AC0), + UINT64_C(0x192D8AF2BAF0E1E8), UINT64_C(0xAA03C64CB957BE87), + UINT64_C(0xEDA9BCA512B041B3), UINT64_C(0x5E87F01B11171EDC), + UINT64_C(0x62FD4976457FBFDB), UINT64_C(0xD1D305C846D8E0B4), + UINT64_C(0x96797F21ED3F1F80), UINT64_C(0x2557339FEE9840EF), + UINT64_C(0xEE8C0DFB45EE5D8E), UINT64_C(0x5DA24145464902E1), + UINT64_C(0x1A083BACEDAEFDD5), UINT64_C(0xA9267712EE09A2BA), + UINT64_C(0x955CCE7FBA6103BD), UINT64_C(0x267282C1B9C65CD2), + UINT64_C(0x61D8F8281221A3E6), UINT64_C(0xD2F6B4961186FC89), + UINT64_C(0x9F8169BA49A54B33), UINT64_C(0x2CAF25044A02145C), + UINT64_C(0x6B055FEDE1E5EB68), UINT64_C(0xD82B1353E242B407), + UINT64_C(0xE451AA3EB62A1500), UINT64_C(0x577FE680B58D4A6F), + UINT64_C(0x10D59C691E6AB55B), UINT64_C(0xA3FBD0D71DCDEA34), + UINT64_C(0x6820EEB3B6BBF755), UINT64_C(0xDB0EA20DB51CA83A), + UINT64_C(0x9CA4D8E41EFB570E), UINT64_C(0x2F8A945A1D5C0861), + UINT64_C(0x13F02D374934A966), UINT64_C(0xA0DE61894A93F609), + UINT64_C(0xE7741B60E174093D), UINT64_C(0x545A57DEE2D35652), + UINT64_C(0xE21AC88218962D7A), UINT64_C(0x5134843C1B317215), + UINT64_C(0x169EFED5B0D68D21), UINT64_C(0xA5B0B26BB371D24E), + UINT64_C(0x99CA0B06E7197349), UINT64_C(0x2AE447B8E4BE2C26), + UINT64_C(0x6D4E3D514F59D312), UINT64_C(0xDE6071EF4CFE8C7D), + UINT64_C(0x15BB4F8BE788911C), UINT64_C(0xA6950335E42FCE73), + UINT64_C(0xE13F79DC4FC83147), UINT64_C(0x521135624C6F6E28), + UINT64_C(0x6E6B8C0F1807CF2F), UINT64_C(0xDD45C0B11BA09040), + UINT64_C(0x9AEFBA58B0476F74), UINT64_C(0x29C1F6E6B3E0301B), + UINT64_C(0xC96C5795D7870F42), UINT64_C(0x7A421B2BD420502D), + UINT64_C(0x3DE861C27FC7AF19), UINT64_C(0x8EC62D7C7C60F076), + UINT64_C(0xB2BC941128085171), UINT64_C(0x0192D8AF2BAF0E1E), + UINT64_C(0x4638A2468048F12A), UINT64_C(0xF516EEF883EFAE45), + UINT64_C(0x3ECDD09C2899B324), UINT64_C(0x8DE39C222B3EEC4B), + UINT64_C(0xCA49E6CB80D9137F), UINT64_C(0x7967AA75837E4C10), + UINT64_C(0x451D1318D716ED17), UINT64_C(0xF6335FA6D4B1B278), + UINT64_C(0xB199254F7F564D4C), UINT64_C(0x02B769F17CF11223), + UINT64_C(0xB4F7F6AD86B4690B), UINT64_C(0x07D9BA1385133664), + UINT64_C(0x4073C0FA2EF4C950), UINT64_C(0xF35D8C442D53963F), + UINT64_C(0xCF273529793B3738), UINT64_C(0x7C0979977A9C6857), + UINT64_C(0x3BA3037ED17B9763), UINT64_C(0x888D4FC0D2DCC80C), + UINT64_C(0x435671A479AAD56D), UINT64_C(0xF0783D1A7A0D8A02), + UINT64_C(0xB7D247F3D1EA7536), UINT64_C(0x04FC0B4DD24D2A59), + UINT64_C(0x3886B22086258B5E), UINT64_C(0x8BA8FE9E8582D431), + UINT64_C(0xCC0284772E652B05), UINT64_C(0x7F2CC8C92DC2746A), + UINT64_C(0x325B15E575E1C3D0), UINT64_C(0x8175595B76469CBF), + UINT64_C(0xC6DF23B2DDA1638B), UINT64_C(0x75F16F0CDE063CE4), + UINT64_C(0x498BD6618A6E9DE3), UINT64_C(0xFAA59ADF89C9C28C), + UINT64_C(0xBD0FE036222E3DB8), UINT64_C(0x0E21AC88218962D7), + UINT64_C(0xC5FA92EC8AFF7FB6), UINT64_C(0x76D4DE52895820D9), + UINT64_C(0x317EA4BB22BFDFED), UINT64_C(0x8250E80521188082), + UINT64_C(0xBE2A516875702185), UINT64_C(0x0D041DD676D77EEA), + UINT64_C(0x4AAE673FDD3081DE), UINT64_C(0xF9802B81DE97DEB1), + UINT64_C(0x4FC0B4DD24D2A599), UINT64_C(0xFCEEF8632775FAF6), + UINT64_C(0xBB44828A8C9205C2), UINT64_C(0x086ACE348F355AAD), + UINT64_C(0x34107759DB5DFBAA), UINT64_C(0x873E3BE7D8FAA4C5), + UINT64_C(0xC094410E731D5BF1), UINT64_C(0x73BA0DB070BA049E), + UINT64_C(0xB86133D4DBCC19FF), UINT64_C(0x0B4F7F6AD86B4690), + UINT64_C(0x4CE50583738CB9A4), UINT64_C(0xFFCB493D702BE6CB), + UINT64_C(0xC3B1F050244347CC), UINT64_C(0x709FBCEE27E418A3), + UINT64_C(0x3735C6078C03E797), UINT64_C(0x841B8AB98FA4B8F8), + UINT64_C(0xADDA7C5F3C4488E3), UINT64_C(0x1EF430E13FE3D78C), + UINT64_C(0x595E4A08940428B8), UINT64_C(0xEA7006B697A377D7), + UINT64_C(0xD60ABFDBC3CBD6D0), UINT64_C(0x6524F365C06C89BF), + UINT64_C(0x228E898C6B8B768B), UINT64_C(0x91A0C532682C29E4), + UINT64_C(0x5A7BFB56C35A3485), UINT64_C(0xE955B7E8C0FD6BEA), + UINT64_C(0xAEFFCD016B1A94DE), UINT64_C(0x1DD181BF68BDCBB1), + UINT64_C(0x21AB38D23CD56AB6), UINT64_C(0x9285746C3F7235D9), + UINT64_C(0xD52F0E859495CAED), UINT64_C(0x6601423B97329582), + UINT64_C(0xD041DD676D77EEAA), UINT64_C(0x636F91D96ED0B1C5), + UINT64_C(0x24C5EB30C5374EF1), UINT64_C(0x97EBA78EC690119E), + UINT64_C(0xAB911EE392F8B099), UINT64_C(0x18BF525D915FEFF6), + UINT64_C(0x5F1528B43AB810C2), UINT64_C(0xEC3B640A391F4FAD), + UINT64_C(0x27E05A6E926952CC), UINT64_C(0x94CE16D091CE0DA3), + UINT64_C(0xD3646C393A29F297), UINT64_C(0x604A2087398EADF8), + UINT64_C(0x5C3099EA6DE60CFF), UINT64_C(0xEF1ED5546E415390), + UINT64_C(0xA8B4AFBDC5A6ACA4), UINT64_C(0x1B9AE303C601F3CB), + UINT64_C(0x56ED3E2F9E224471), UINT64_C(0xE5C372919D851B1E), + UINT64_C(0xA26908783662E42A), UINT64_C(0x114744C635C5BB45), + UINT64_C(0x2D3DFDAB61AD1A42), UINT64_C(0x9E13B115620A452D), + UINT64_C(0xD9B9CBFCC9EDBA19), UINT64_C(0x6A978742CA4AE576), + UINT64_C(0xA14CB926613CF817), UINT64_C(0x1262F598629BA778), + UINT64_C(0x55C88F71C97C584C), UINT64_C(0xE6E6C3CFCADB0723), + UINT64_C(0xDA9C7AA29EB3A624), UINT64_C(0x69B2361C9D14F94B), + UINT64_C(0x2E184CF536F3067F), UINT64_C(0x9D36004B35545910), + UINT64_C(0x2B769F17CF112238), UINT64_C(0x9858D3A9CCB67D57), + UINT64_C(0xDFF2A94067518263), UINT64_C(0x6CDCE5FE64F6DD0C), + UINT64_C(0x50A65C93309E7C0B), UINT64_C(0xE388102D33392364), + UINT64_C(0xA4226AC498DEDC50), UINT64_C(0x170C267A9B79833F), + UINT64_C(0xDCD7181E300F9E5E), UINT64_C(0x6FF954A033A8C131), + UINT64_C(0x28532E49984F3E05), UINT64_C(0x9B7D62F79BE8616A), + UINT64_C(0xA707DB9ACF80C06D), UINT64_C(0x14299724CC279F02), + UINT64_C(0x5383EDCD67C06036), UINT64_C(0xE0ADA17364673F59) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x54E979925CD0F10D), + UINT64_C(0xA9D2F324B9A1E21A), UINT64_C(0xFD3B8AB6E5711317), + UINT64_C(0xC17D4962DC4DDAB1), UINT64_C(0x959430F0809D2BBC), + UINT64_C(0x68AFBA4665EC38AB), UINT64_C(0x3C46C3D4393CC9A6), + UINT64_C(0x10223DEE1795ABE7), UINT64_C(0x44CB447C4B455AEA), + UINT64_C(0xB9F0CECAAE3449FD), UINT64_C(0xED19B758F2E4B8F0), + UINT64_C(0xD15F748CCBD87156), UINT64_C(0x85B60D1E9708805B), + UINT64_C(0x788D87A87279934C), UINT64_C(0x2C64FE3A2EA96241), + UINT64_C(0x20447BDC2F2B57CE), UINT64_C(0x74AD024E73FBA6C3), + UINT64_C(0x899688F8968AB5D4), UINT64_C(0xDD7FF16ACA5A44D9), + UINT64_C(0xE13932BEF3668D7F), UINT64_C(0xB5D04B2CAFB67C72), + UINT64_C(0x48EBC19A4AC76F65), UINT64_C(0x1C02B80816179E68), + UINT64_C(0x3066463238BEFC29), UINT64_C(0x648F3FA0646E0D24), + UINT64_C(0x99B4B516811F1E33), UINT64_C(0xCD5DCC84DDCFEF3E), + UINT64_C(0xF11B0F50E4F32698), UINT64_C(0xA5F276C2B823D795), + UINT64_C(0x58C9FC745D52C482), UINT64_C(0x0C2085E60182358F), + UINT64_C(0x4088F7B85E56AF9C), UINT64_C(0x14618E2A02865E91), + UINT64_C(0xE95A049CE7F74D86), UINT64_C(0xBDB37D0EBB27BC8B), + UINT64_C(0x81F5BEDA821B752D), UINT64_C(0xD51CC748DECB8420), + UINT64_C(0x28274DFE3BBA9737), UINT64_C(0x7CCE346C676A663A), + UINT64_C(0x50AACA5649C3047B), UINT64_C(0x0443B3C41513F576), + UINT64_C(0xF9783972F062E661), UINT64_C(0xAD9140E0ACB2176C), + UINT64_C(0x91D78334958EDECA), UINT64_C(0xC53EFAA6C95E2FC7), + UINT64_C(0x380570102C2F3CD0), UINT64_C(0x6CEC098270FFCDDD), + UINT64_C(0x60CC8C64717DF852), UINT64_C(0x3425F5F62DAD095F), + UINT64_C(0xC91E7F40C8DC1A48), UINT64_C(0x9DF706D2940CEB45), + UINT64_C(0xA1B1C506AD3022E3), UINT64_C(0xF558BC94F1E0D3EE), + UINT64_C(0x086336221491C0F9), UINT64_C(0x5C8A4FB0484131F4), + UINT64_C(0x70EEB18A66E853B5), UINT64_C(0x2407C8183A38A2B8), + UINT64_C(0xD93C42AEDF49B1AF), UINT64_C(0x8DD53B3C839940A2), + UINT64_C(0xB193F8E8BAA58904), UINT64_C(0xE57A817AE6757809), + UINT64_C(0x18410BCC03046B1E), UINT64_C(0x4CA8725E5FD49A13), + UINT64_C(0x8111EF70BCAD5F38), UINT64_C(0xD5F896E2E07DAE35), + UINT64_C(0x28C31C54050CBD22), UINT64_C(0x7C2A65C659DC4C2F), + UINT64_C(0x406CA61260E08589), UINT64_C(0x1485DF803C307484), + UINT64_C(0xE9BE5536D9416793), UINT64_C(0xBD572CA48591969E), + UINT64_C(0x9133D29EAB38F4DF), UINT64_C(0xC5DAAB0CF7E805D2), + UINT64_C(0x38E121BA129916C5), UINT64_C(0x6C0858284E49E7C8), + UINT64_C(0x504E9BFC77752E6E), UINT64_C(0x04A7E26E2BA5DF63), + UINT64_C(0xF99C68D8CED4CC74), UINT64_C(0xAD75114A92043D79), + UINT64_C(0xA15594AC938608F6), UINT64_C(0xF5BCED3ECF56F9FB), + UINT64_C(0x088767882A27EAEC), UINT64_C(0x5C6E1E1A76F71BE1), + UINT64_C(0x6028DDCE4FCBD247), UINT64_C(0x34C1A45C131B234A), + UINT64_C(0xC9FA2EEAF66A305D), UINT64_C(0x9D135778AABAC150), + UINT64_C(0xB177A9428413A311), UINT64_C(0xE59ED0D0D8C3521C), + UINT64_C(0x18A55A663DB2410B), UINT64_C(0x4C4C23F46162B006), + UINT64_C(0x700AE020585E79A0), UINT64_C(0x24E399B2048E88AD), + UINT64_C(0xD9D81304E1FF9BBA), UINT64_C(0x8D316A96BD2F6AB7), + UINT64_C(0xC19918C8E2FBF0A4), UINT64_C(0x9570615ABE2B01A9), + UINT64_C(0x684BEBEC5B5A12BE), UINT64_C(0x3CA2927E078AE3B3), + UINT64_C(0x00E451AA3EB62A15), UINT64_C(0x540D28386266DB18), + UINT64_C(0xA936A28E8717C80F), UINT64_C(0xFDDFDB1CDBC73902), + UINT64_C(0xD1BB2526F56E5B43), UINT64_C(0x85525CB4A9BEAA4E), + UINT64_C(0x7869D6024CCFB959), UINT64_C(0x2C80AF90101F4854), + UINT64_C(0x10C66C44292381F2), UINT64_C(0x442F15D675F370FF), + UINT64_C(0xB9149F60908263E8), UINT64_C(0xEDFDE6F2CC5292E5), + UINT64_C(0xE1DD6314CDD0A76A), UINT64_C(0xB5341A8691005667), + UINT64_C(0x480F903074714570), UINT64_C(0x1CE6E9A228A1B47D), + UINT64_C(0x20A02A76119D7DDB), UINT64_C(0x744953E44D4D8CD6), + UINT64_C(0x8972D952A83C9FC1), UINT64_C(0xDD9BA0C0F4EC6ECC), + UINT64_C(0xF1FF5EFADA450C8D), UINT64_C(0xA51627688695FD80), + UINT64_C(0x582DADDE63E4EE97), UINT64_C(0x0CC4D44C3F341F9A), + UINT64_C(0x308217980608D63C), UINT64_C(0x646B6E0A5AD82731), + UINT64_C(0x9950E4BCBFA93426), UINT64_C(0xCDB99D2EE379C52B), + UINT64_C(0x90FB71CAD654A0F5), UINT64_C(0xC41208588A8451F8), + UINT64_C(0x392982EE6FF542EF), UINT64_C(0x6DC0FB7C3325B3E2), + UINT64_C(0x518638A80A197A44), UINT64_C(0x056F413A56C98B49), + UINT64_C(0xF854CB8CB3B8985E), UINT64_C(0xACBDB21EEF686953), + UINT64_C(0x80D94C24C1C10B12), UINT64_C(0xD43035B69D11FA1F), + UINT64_C(0x290BBF007860E908), UINT64_C(0x7DE2C69224B01805), + UINT64_C(0x41A405461D8CD1A3), UINT64_C(0x154D7CD4415C20AE), + UINT64_C(0xE876F662A42D33B9), UINT64_C(0xBC9F8FF0F8FDC2B4), + UINT64_C(0xB0BF0A16F97FF73B), UINT64_C(0xE4567384A5AF0636), + UINT64_C(0x196DF93240DE1521), UINT64_C(0x4D8480A01C0EE42C), + UINT64_C(0x71C2437425322D8A), UINT64_C(0x252B3AE679E2DC87), + UINT64_C(0xD810B0509C93CF90), UINT64_C(0x8CF9C9C2C0433E9D), + UINT64_C(0xA09D37F8EEEA5CDC), UINT64_C(0xF4744E6AB23AADD1), + UINT64_C(0x094FC4DC574BBEC6), UINT64_C(0x5DA6BD4E0B9B4FCB), + UINT64_C(0x61E07E9A32A7866D), UINT64_C(0x350907086E777760), + UINT64_C(0xC8328DBE8B066477), UINT64_C(0x9CDBF42CD7D6957A), + UINT64_C(0xD073867288020F69), UINT64_C(0x849AFFE0D4D2FE64), + UINT64_C(0x79A1755631A3ED73), UINT64_C(0x2D480CC46D731C7E), + UINT64_C(0x110ECF10544FD5D8), UINT64_C(0x45E7B682089F24D5), + UINT64_C(0xB8DC3C34EDEE37C2), UINT64_C(0xEC3545A6B13EC6CF), + UINT64_C(0xC051BB9C9F97A48E), UINT64_C(0x94B8C20EC3475583), + UINT64_C(0x698348B826364694), UINT64_C(0x3D6A312A7AE6B799), + UINT64_C(0x012CF2FE43DA7E3F), UINT64_C(0x55C58B6C1F0A8F32), + UINT64_C(0xA8FE01DAFA7B9C25), UINT64_C(0xFC177848A6AB6D28), + UINT64_C(0xF037FDAEA72958A7), UINT64_C(0xA4DE843CFBF9A9AA), + UINT64_C(0x59E50E8A1E88BABD), UINT64_C(0x0D0C771842584BB0), + UINT64_C(0x314AB4CC7B648216), UINT64_C(0x65A3CD5E27B4731B), + UINT64_C(0x989847E8C2C5600C), UINT64_C(0xCC713E7A9E159101), + UINT64_C(0xE015C040B0BCF340), UINT64_C(0xB4FCB9D2EC6C024D), + UINT64_C(0x49C73364091D115A), UINT64_C(0x1D2E4AF655CDE057), + UINT64_C(0x216889226CF129F1), UINT64_C(0x7581F0B03021D8FC), + UINT64_C(0x88BA7A06D550CBEB), UINT64_C(0xDC53039489803AE6), + UINT64_C(0x11EA9EBA6AF9FFCD), UINT64_C(0x4503E72836290EC0), + UINT64_C(0xB8386D9ED3581DD7), UINT64_C(0xECD1140C8F88ECDA), + UINT64_C(0xD097D7D8B6B4257C), UINT64_C(0x847EAE4AEA64D471), + UINT64_C(0x794524FC0F15C766), UINT64_C(0x2DAC5D6E53C5366B), + UINT64_C(0x01C8A3547D6C542A), UINT64_C(0x5521DAC621BCA527), + UINT64_C(0xA81A5070C4CDB630), UINT64_C(0xFCF329E2981D473D), + UINT64_C(0xC0B5EA36A1218E9B), UINT64_C(0x945C93A4FDF17F96), + UINT64_C(0x6967191218806C81), UINT64_C(0x3D8E608044509D8C), + UINT64_C(0x31AEE56645D2A803), UINT64_C(0x65479CF41902590E), + UINT64_C(0x987C1642FC734A19), UINT64_C(0xCC956FD0A0A3BB14), + UINT64_C(0xF0D3AC04999F72B2), UINT64_C(0xA43AD596C54F83BF), + UINT64_C(0x59015F20203E90A8), UINT64_C(0x0DE826B27CEE61A5), + UINT64_C(0x218CD888524703E4), UINT64_C(0x7565A11A0E97F2E9), + UINT64_C(0x885E2BACEBE6E1FE), UINT64_C(0xDCB7523EB73610F3), + UINT64_C(0xE0F191EA8E0AD955), UINT64_C(0xB418E878D2DA2858), + UINT64_C(0x492362CE37AB3B4F), UINT64_C(0x1DCA1B5C6B7BCA42), + UINT64_C(0x5162690234AF5051), UINT64_C(0x058B1090687FA15C), + UINT64_C(0xF8B09A268D0EB24B), UINT64_C(0xAC59E3B4D1DE4346), + UINT64_C(0x901F2060E8E28AE0), UINT64_C(0xC4F659F2B4327BED), + UINT64_C(0x39CDD344514368FA), UINT64_C(0x6D24AAD60D9399F7), + UINT64_C(0x414054EC233AFBB6), UINT64_C(0x15A92D7E7FEA0ABB), + UINT64_C(0xE892A7C89A9B19AC), UINT64_C(0xBC7BDE5AC64BE8A1), + UINT64_C(0x803D1D8EFF772107), UINT64_C(0xD4D4641CA3A7D00A), + UINT64_C(0x29EFEEAA46D6C31D), UINT64_C(0x7D0697381A063210), + UINT64_C(0x712612DE1B84079F), UINT64_C(0x25CF6B4C4754F692), + UINT64_C(0xD8F4E1FAA225E585), UINT64_C(0x8C1D9868FEF51488), + UINT64_C(0xB05B5BBCC7C9DD2E), UINT64_C(0xE4B2222E9B192C23), + UINT64_C(0x1989A8987E683F34), UINT64_C(0x4D60D10A22B8CE39), + UINT64_C(0x61042F300C11AC78), UINT64_C(0x35ED56A250C15D75), + UINT64_C(0xC8D6DC14B5B04E62), UINT64_C(0x9C3FA586E960BF6F), + UINT64_C(0xA0796652D05C76C9), UINT64_C(0xF4901FC08C8C87C4), + UINT64_C(0x09AB957669FD94D3), UINT64_C(0x5D42ECE4352D65DE) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x3F0BE14A916A6DCB), + UINT64_C(0x7E17C29522D4DB96), UINT64_C(0x411C23DFB3BEB65D), + UINT64_C(0xFC2F852A45A9B72C), UINT64_C(0xC3246460D4C3DAE7), + UINT64_C(0x823847BF677D6CBA), UINT64_C(0xBD33A6F5F6170171), + UINT64_C(0x6A87A57F245D70DD), UINT64_C(0x558C4435B5371D16), + UINT64_C(0x149067EA0689AB4B), UINT64_C(0x2B9B86A097E3C680), + UINT64_C(0x96A8205561F4C7F1), UINT64_C(0xA9A3C11FF09EAA3A), + UINT64_C(0xE8BFE2C043201C67), UINT64_C(0xD7B4038AD24A71AC), + UINT64_C(0xD50F4AFE48BAE1BA), UINT64_C(0xEA04ABB4D9D08C71), + UINT64_C(0xAB18886B6A6E3A2C), UINT64_C(0x94136921FB0457E7), + UINT64_C(0x2920CFD40D135696), UINT64_C(0x162B2E9E9C793B5D), + UINT64_C(0x57370D412FC78D00), UINT64_C(0x683CEC0BBEADE0CB), + UINT64_C(0xBF88EF816CE79167), UINT64_C(0x80830ECBFD8DFCAC), + UINT64_C(0xC19F2D144E334AF1), UINT64_C(0xFE94CC5EDF59273A), + UINT64_C(0x43A76AAB294E264B), UINT64_C(0x7CAC8BE1B8244B80), + UINT64_C(0x3DB0A83E0B9AFDDD), UINT64_C(0x02BB49749AF09016), + UINT64_C(0x38C63AD73E7BDDF1), UINT64_C(0x07CDDB9DAF11B03A), + UINT64_C(0x46D1F8421CAF0667), UINT64_C(0x79DA19088DC56BAC), + UINT64_C(0xC4E9BFFD7BD26ADD), UINT64_C(0xFBE25EB7EAB80716), + UINT64_C(0xBAFE7D685906B14B), UINT64_C(0x85F59C22C86CDC80), + UINT64_C(0x52419FA81A26AD2C), UINT64_C(0x6D4A7EE28B4CC0E7), + UINT64_C(0x2C565D3D38F276BA), UINT64_C(0x135DBC77A9981B71), + UINT64_C(0xAE6E1A825F8F1A00), UINT64_C(0x9165FBC8CEE577CB), + UINT64_C(0xD079D8177D5BC196), UINT64_C(0xEF72395DEC31AC5D), + UINT64_C(0xEDC9702976C13C4B), UINT64_C(0xD2C29163E7AB5180), + UINT64_C(0x93DEB2BC5415E7DD), UINT64_C(0xACD553F6C57F8A16), + UINT64_C(0x11E6F50333688B67), UINT64_C(0x2EED1449A202E6AC), + UINT64_C(0x6FF1379611BC50F1), UINT64_C(0x50FAD6DC80D63D3A), + UINT64_C(0x874ED556529C4C96), UINT64_C(0xB845341CC3F6215D), + UINT64_C(0xF95917C370489700), UINT64_C(0xC652F689E122FACB), + UINT64_C(0x7B61507C1735FBBA), UINT64_C(0x446AB136865F9671), + UINT64_C(0x057692E935E1202C), UINT64_C(0x3A7D73A3A48B4DE7), + UINT64_C(0x718C75AE7CF7BBE2), UINT64_C(0x4E8794E4ED9DD629), + UINT64_C(0x0F9BB73B5E236074), UINT64_C(0x30905671CF490DBF), + UINT64_C(0x8DA3F084395E0CCE), UINT64_C(0xB2A811CEA8346105), + UINT64_C(0xF3B432111B8AD758), UINT64_C(0xCCBFD35B8AE0BA93), + UINT64_C(0x1B0BD0D158AACB3F), UINT64_C(0x2400319BC9C0A6F4), + UINT64_C(0x651C12447A7E10A9), UINT64_C(0x5A17F30EEB147D62), + UINT64_C(0xE72455FB1D037C13), UINT64_C(0xD82FB4B18C6911D8), + UINT64_C(0x9933976E3FD7A785), UINT64_C(0xA6387624AEBDCA4E), + UINT64_C(0xA4833F50344D5A58), UINT64_C(0x9B88DE1AA5273793), + UINT64_C(0xDA94FDC5169981CE), UINT64_C(0xE59F1C8F87F3EC05), + UINT64_C(0x58ACBA7A71E4ED74), UINT64_C(0x67A75B30E08E80BF), + UINT64_C(0x26BB78EF533036E2), UINT64_C(0x19B099A5C25A5B29), + UINT64_C(0xCE049A2F10102A85), UINT64_C(0xF10F7B65817A474E), + UINT64_C(0xB01358BA32C4F113), UINT64_C(0x8F18B9F0A3AE9CD8), + UINT64_C(0x322B1F0555B99DA9), UINT64_C(0x0D20FE4FC4D3F062), + UINT64_C(0x4C3CDD90776D463F), UINT64_C(0x73373CDAE6072BF4), + UINT64_C(0x494A4F79428C6613), UINT64_C(0x7641AE33D3E60BD8), + UINT64_C(0x375D8DEC6058BD85), UINT64_C(0x08566CA6F132D04E), + UINT64_C(0xB565CA530725D13F), UINT64_C(0x8A6E2B19964FBCF4), + UINT64_C(0xCB7208C625F10AA9), UINT64_C(0xF479E98CB49B6762), + UINT64_C(0x23CDEA0666D116CE), UINT64_C(0x1CC60B4CF7BB7B05), + UINT64_C(0x5DDA28934405CD58), UINT64_C(0x62D1C9D9D56FA093), + UINT64_C(0xDFE26F2C2378A1E2), UINT64_C(0xE0E98E66B212CC29), + UINT64_C(0xA1F5ADB901AC7A74), UINT64_C(0x9EFE4CF390C617BF), + UINT64_C(0x9C4505870A3687A9), UINT64_C(0xA34EE4CD9B5CEA62), + UINT64_C(0xE252C71228E25C3F), UINT64_C(0xDD592658B98831F4), + UINT64_C(0x606A80AD4F9F3085), UINT64_C(0x5F6161E7DEF55D4E), + UINT64_C(0x1E7D42386D4BEB13), UINT64_C(0x2176A372FC2186D8), + UINT64_C(0xF6C2A0F82E6BF774), UINT64_C(0xC9C941B2BF019ABF), + UINT64_C(0x88D5626D0CBF2CE2), UINT64_C(0xB7DE83279DD54129), + UINT64_C(0x0AED25D26BC24058), UINT64_C(0x35E6C498FAA82D93), + UINT64_C(0x74FAE74749169BCE), UINT64_C(0x4BF1060DD87CF605), + UINT64_C(0xE318EB5CF9EF77C4), UINT64_C(0xDC130A1668851A0F), + UINT64_C(0x9D0F29C9DB3BAC52), UINT64_C(0xA204C8834A51C199), + UINT64_C(0x1F376E76BC46C0E8), UINT64_C(0x203C8F3C2D2CAD23), + UINT64_C(0x6120ACE39E921B7E), UINT64_C(0x5E2B4DA90FF876B5), + UINT64_C(0x899F4E23DDB20719), UINT64_C(0xB694AF694CD86AD2), + UINT64_C(0xF7888CB6FF66DC8F), UINT64_C(0xC8836DFC6E0CB144), + UINT64_C(0x75B0CB09981BB035), UINT64_C(0x4ABB2A430971DDFE), + UINT64_C(0x0BA7099CBACF6BA3), UINT64_C(0x34ACE8D62BA50668), + UINT64_C(0x3617A1A2B155967E), UINT64_C(0x091C40E8203FFBB5), + UINT64_C(0x4800633793814DE8), UINT64_C(0x770B827D02EB2023), + UINT64_C(0xCA382488F4FC2152), UINT64_C(0xF533C5C265964C99), + UINT64_C(0xB42FE61DD628FAC4), UINT64_C(0x8B2407574742970F), + UINT64_C(0x5C9004DD9508E6A3), UINT64_C(0x639BE59704628B68), + UINT64_C(0x2287C648B7DC3D35), UINT64_C(0x1D8C270226B650FE), + UINT64_C(0xA0BF81F7D0A1518F), UINT64_C(0x9FB460BD41CB3C44), + UINT64_C(0xDEA84362F2758A19), UINT64_C(0xE1A3A228631FE7D2), + UINT64_C(0xDBDED18BC794AA35), UINT64_C(0xE4D530C156FEC7FE), + UINT64_C(0xA5C9131EE54071A3), UINT64_C(0x9AC2F254742A1C68), + UINT64_C(0x27F154A1823D1D19), UINT64_C(0x18FAB5EB135770D2), + UINT64_C(0x59E69634A0E9C68F), UINT64_C(0x66ED777E3183AB44), + UINT64_C(0xB15974F4E3C9DAE8), UINT64_C(0x8E5295BE72A3B723), + UINT64_C(0xCF4EB661C11D017E), UINT64_C(0xF045572B50776CB5), + UINT64_C(0x4D76F1DEA6606DC4), UINT64_C(0x727D1094370A000F), + UINT64_C(0x3361334B84B4B652), UINT64_C(0x0C6AD20115DEDB99), + UINT64_C(0x0ED19B758F2E4B8F), UINT64_C(0x31DA7A3F1E442644), + UINT64_C(0x70C659E0ADFA9019), UINT64_C(0x4FCDB8AA3C90FDD2), + UINT64_C(0xF2FE1E5FCA87FCA3), UINT64_C(0xCDF5FF155BED9168), + UINT64_C(0x8CE9DCCAE8532735), UINT64_C(0xB3E23D8079394AFE), + UINT64_C(0x64563E0AAB733B52), UINT64_C(0x5B5DDF403A195699), + UINT64_C(0x1A41FC9F89A7E0C4), UINT64_C(0x254A1DD518CD8D0F), + UINT64_C(0x9879BB20EEDA8C7E), UINT64_C(0xA7725A6A7FB0E1B5), + UINT64_C(0xE66E79B5CC0E57E8), UINT64_C(0xD96598FF5D643A23), + UINT64_C(0x92949EF28518CC26), UINT64_C(0xAD9F7FB81472A1ED), + UINT64_C(0xEC835C67A7CC17B0), UINT64_C(0xD388BD2D36A67A7B), + UINT64_C(0x6EBB1BD8C0B17B0A), UINT64_C(0x51B0FA9251DB16C1), + UINT64_C(0x10ACD94DE265A09C), UINT64_C(0x2FA73807730FCD57), + UINT64_C(0xF8133B8DA145BCFB), UINT64_C(0xC718DAC7302FD130), + UINT64_C(0x8604F9188391676D), UINT64_C(0xB90F185212FB0AA6), + UINT64_C(0x043CBEA7E4EC0BD7), UINT64_C(0x3B375FED7586661C), + UINT64_C(0x7A2B7C32C638D041), UINT64_C(0x45209D785752BD8A), + UINT64_C(0x479BD40CCDA22D9C), UINT64_C(0x789035465CC84057), + UINT64_C(0x398C1699EF76F60A), UINT64_C(0x0687F7D37E1C9BC1), + UINT64_C(0xBBB45126880B9AB0), UINT64_C(0x84BFB06C1961F77B), + UINT64_C(0xC5A393B3AADF4126), UINT64_C(0xFAA872F93BB52CED), + UINT64_C(0x2D1C7173E9FF5D41), UINT64_C(0x121790397895308A), + UINT64_C(0x530BB3E6CB2B86D7), UINT64_C(0x6C0052AC5A41EB1C), + UINT64_C(0xD133F459AC56EA6D), UINT64_C(0xEE3815133D3C87A6), + UINT64_C(0xAF2436CC8E8231FB), UINT64_C(0x902FD7861FE85C30), + UINT64_C(0xAA52A425BB6311D7), UINT64_C(0x9559456F2A097C1C), + UINT64_C(0xD44566B099B7CA41), UINT64_C(0xEB4E87FA08DDA78A), + UINT64_C(0x567D210FFECAA6FB), UINT64_C(0x6976C0456FA0CB30), + UINT64_C(0x286AE39ADC1E7D6D), UINT64_C(0x176102D04D7410A6), + UINT64_C(0xC0D5015A9F3E610A), UINT64_C(0xFFDEE0100E540CC1), + UINT64_C(0xBEC2C3CFBDEABA9C), UINT64_C(0x81C922852C80D757), + UINT64_C(0x3CFA8470DA97D626), UINT64_C(0x03F1653A4BFDBBED), + UINT64_C(0x42ED46E5F8430DB0), UINT64_C(0x7DE6A7AF6929607B), + UINT64_C(0x7F5DEEDBF3D9F06D), UINT64_C(0x40560F9162B39DA6), + UINT64_C(0x014A2C4ED10D2BFB), UINT64_C(0x3E41CD0440674630), + UINT64_C(0x83726BF1B6704741), UINT64_C(0xBC798ABB271A2A8A), + UINT64_C(0xFD65A96494A49CD7), UINT64_C(0xC26E482E05CEF11C), + UINT64_C(0x15DA4BA4D78480B0), UINT64_C(0x2AD1AAEE46EEED7B), + UINT64_C(0x6BCD8931F5505B26), UINT64_C(0x54C6687B643A36ED), + UINT64_C(0xE9F5CE8E922D379C), UINT64_C(0xD6FE2FC403475A57), + UINT64_C(0x97E20C1BB0F9EC0A), UINT64_C(0xA8E9ED51219381C1) + }, { + UINT64_C(0x0000000000000000), UINT64_C(0x1DEE8A5E222CA1DC), + UINT64_C(0x3BDD14BC445943B8), UINT64_C(0x26339EE26675E264), + UINT64_C(0x77BA297888B28770), UINT64_C(0x6A54A326AA9E26AC), + UINT64_C(0x4C673DC4CCEBC4C8), UINT64_C(0x5189B79AEEC76514), + UINT64_C(0xEF7452F111650EE0), UINT64_C(0xF29AD8AF3349AF3C), + UINT64_C(0xD4A9464D553C4D58), UINT64_C(0xC947CC137710EC84), + UINT64_C(0x98CE7B8999D78990), UINT64_C(0x8520F1D7BBFB284C), + UINT64_C(0xA3136F35DD8ECA28), UINT64_C(0xBEFDE56BFFA26BF4), + UINT64_C(0x4C300AC98DC40345), UINT64_C(0x51DE8097AFE8A299), + UINT64_C(0x77ED1E75C99D40FD), UINT64_C(0x6A03942BEBB1E121), + UINT64_C(0x3B8A23B105768435), UINT64_C(0x2664A9EF275A25E9), + UINT64_C(0x0057370D412FC78D), UINT64_C(0x1DB9BD5363036651), + UINT64_C(0xA34458389CA10DA5), UINT64_C(0xBEAAD266BE8DAC79), + UINT64_C(0x98994C84D8F84E1D), UINT64_C(0x8577C6DAFAD4EFC1), + UINT64_C(0xD4FE714014138AD5), UINT64_C(0xC910FB1E363F2B09), + UINT64_C(0xEF2365FC504AC96D), UINT64_C(0xF2CDEFA2726668B1), + UINT64_C(0x986015931B88068A), UINT64_C(0x858E9FCD39A4A756), + UINT64_C(0xA3BD012F5FD14532), UINT64_C(0xBE538B717DFDE4EE), + UINT64_C(0xEFDA3CEB933A81FA), UINT64_C(0xF234B6B5B1162026), + UINT64_C(0xD4072857D763C242), UINT64_C(0xC9E9A209F54F639E), + UINT64_C(0x771447620AED086A), UINT64_C(0x6AFACD3C28C1A9B6), + UINT64_C(0x4CC953DE4EB44BD2), UINT64_C(0x5127D9806C98EA0E), + UINT64_C(0x00AE6E1A825F8F1A), UINT64_C(0x1D40E444A0732EC6), + UINT64_C(0x3B737AA6C606CCA2), UINT64_C(0x269DF0F8E42A6D7E), + UINT64_C(0xD4501F5A964C05CF), UINT64_C(0xC9BE9504B460A413), + UINT64_C(0xEF8D0BE6D2154677), UINT64_C(0xF26381B8F039E7AB), + UINT64_C(0xA3EA36221EFE82BF), UINT64_C(0xBE04BC7C3CD22363), + UINT64_C(0x9837229E5AA7C107), UINT64_C(0x85D9A8C0788B60DB), + UINT64_C(0x3B244DAB87290B2F), UINT64_C(0x26CAC7F5A505AAF3), + UINT64_C(0x00F95917C3704897), UINT64_C(0x1D17D349E15CE94B), + UINT64_C(0x4C9E64D30F9B8C5F), UINT64_C(0x5170EE8D2DB72D83), + UINT64_C(0x7743706F4BC2CFE7), UINT64_C(0x6AADFA3169EE6E3B), + UINT64_C(0xA218840D981E1391), UINT64_C(0xBFF60E53BA32B24D), + UINT64_C(0x99C590B1DC475029), UINT64_C(0x842B1AEFFE6BF1F5), + UINT64_C(0xD5A2AD7510AC94E1), UINT64_C(0xC84C272B3280353D), + UINT64_C(0xEE7FB9C954F5D759), UINT64_C(0xF391339776D97685), + UINT64_C(0x4D6CD6FC897B1D71), UINT64_C(0x50825CA2AB57BCAD), + UINT64_C(0x76B1C240CD225EC9), UINT64_C(0x6B5F481EEF0EFF15), + UINT64_C(0x3AD6FF8401C99A01), UINT64_C(0x273875DA23E53BDD), + UINT64_C(0x010BEB384590D9B9), UINT64_C(0x1CE5616667BC7865), + UINT64_C(0xEE288EC415DA10D4), UINT64_C(0xF3C6049A37F6B108), + UINT64_C(0xD5F59A785183536C), UINT64_C(0xC81B102673AFF2B0), + UINT64_C(0x9992A7BC9D6897A4), UINT64_C(0x847C2DE2BF443678), + UINT64_C(0xA24FB300D931D41C), UINT64_C(0xBFA1395EFB1D75C0), + UINT64_C(0x015CDC3504BF1E34), UINT64_C(0x1CB2566B2693BFE8), + UINT64_C(0x3A81C88940E65D8C), UINT64_C(0x276F42D762CAFC50), + UINT64_C(0x76E6F54D8C0D9944), UINT64_C(0x6B087F13AE213898), + UINT64_C(0x4D3BE1F1C854DAFC), UINT64_C(0x50D56BAFEA787B20), + UINT64_C(0x3A78919E8396151B), UINT64_C(0x27961BC0A1BAB4C7), + UINT64_C(0x01A58522C7CF56A3), UINT64_C(0x1C4B0F7CE5E3F77F), + UINT64_C(0x4DC2B8E60B24926B), UINT64_C(0x502C32B8290833B7), + UINT64_C(0x761FAC5A4F7DD1D3), UINT64_C(0x6BF126046D51700F), + UINT64_C(0xD50CC36F92F31BFB), UINT64_C(0xC8E24931B0DFBA27), + UINT64_C(0xEED1D7D3D6AA5843), UINT64_C(0xF33F5D8DF486F99F), + UINT64_C(0xA2B6EA171A419C8B), UINT64_C(0xBF586049386D3D57), + UINT64_C(0x996BFEAB5E18DF33), UINT64_C(0x848574F57C347EEF), + UINT64_C(0x76489B570E52165E), UINT64_C(0x6BA611092C7EB782), + UINT64_C(0x4D958FEB4A0B55E6), UINT64_C(0x507B05B56827F43A), + UINT64_C(0x01F2B22F86E0912E), UINT64_C(0x1C1C3871A4CC30F2), + UINT64_C(0x3A2FA693C2B9D296), UINT64_C(0x27C12CCDE095734A), + UINT64_C(0x993CC9A61F3718BE), UINT64_C(0x84D243F83D1BB962), + UINT64_C(0xA2E1DD1A5B6E5B06), UINT64_C(0xBF0F57447942FADA), + UINT64_C(0xEE86E0DE97859FCE), UINT64_C(0xF3686A80B5A93E12), + UINT64_C(0xD55BF462D3DCDC76), UINT64_C(0xC8B57E3CF1F07DAA), + UINT64_C(0xD6E9A7309F3239A7), UINT64_C(0xCB072D6EBD1E987B), + UINT64_C(0xED34B38CDB6B7A1F), UINT64_C(0xF0DA39D2F947DBC3), + UINT64_C(0xA1538E481780BED7), UINT64_C(0xBCBD041635AC1F0B), + UINT64_C(0x9A8E9AF453D9FD6F), UINT64_C(0x876010AA71F55CB3), + UINT64_C(0x399DF5C18E573747), UINT64_C(0x24737F9FAC7B969B), + UINT64_C(0x0240E17DCA0E74FF), UINT64_C(0x1FAE6B23E822D523), + UINT64_C(0x4E27DCB906E5B037), UINT64_C(0x53C956E724C911EB), + UINT64_C(0x75FAC80542BCF38F), UINT64_C(0x6814425B60905253), + UINT64_C(0x9AD9ADF912F63AE2), UINT64_C(0x873727A730DA9B3E), + UINT64_C(0xA104B94556AF795A), UINT64_C(0xBCEA331B7483D886), + UINT64_C(0xED6384819A44BD92), UINT64_C(0xF08D0EDFB8681C4E), + UINT64_C(0xD6BE903DDE1DFE2A), UINT64_C(0xCB501A63FC315FF6), + UINT64_C(0x75ADFF0803933402), UINT64_C(0x6843755621BF95DE), + UINT64_C(0x4E70EBB447CA77BA), UINT64_C(0x539E61EA65E6D666), + UINT64_C(0x0217D6708B21B372), UINT64_C(0x1FF95C2EA90D12AE), + UINT64_C(0x39CAC2CCCF78F0CA), UINT64_C(0x24244892ED545116), + UINT64_C(0x4E89B2A384BA3F2D), UINT64_C(0x536738FDA6969EF1), + UINT64_C(0x7554A61FC0E37C95), UINT64_C(0x68BA2C41E2CFDD49), + UINT64_C(0x39339BDB0C08B85D), UINT64_C(0x24DD11852E241981), + UINT64_C(0x02EE8F674851FBE5), UINT64_C(0x1F0005396A7D5A39), + UINT64_C(0xA1FDE05295DF31CD), UINT64_C(0xBC136A0CB7F39011), + UINT64_C(0x9A20F4EED1867275), UINT64_C(0x87CE7EB0F3AAD3A9), + UINT64_C(0xD647C92A1D6DB6BD), UINT64_C(0xCBA943743F411761), + UINT64_C(0xED9ADD965934F505), UINT64_C(0xF07457C87B1854D9), + UINT64_C(0x02B9B86A097E3C68), UINT64_C(0x1F5732342B529DB4), + UINT64_C(0x3964ACD64D277FD0), UINT64_C(0x248A26886F0BDE0C), + UINT64_C(0x7503911281CCBB18), UINT64_C(0x68ED1B4CA3E01AC4), + UINT64_C(0x4EDE85AEC595F8A0), UINT64_C(0x53300FF0E7B9597C), + UINT64_C(0xEDCDEA9B181B3288), UINT64_C(0xF02360C53A379354), + UINT64_C(0xD610FE275C427130), UINT64_C(0xCBFE74797E6ED0EC), + UINT64_C(0x9A77C3E390A9B5F8), UINT64_C(0x879949BDB2851424), + UINT64_C(0xA1AAD75FD4F0F640), UINT64_C(0xBC445D01F6DC579C), + UINT64_C(0x74F1233D072C2A36), UINT64_C(0x691FA96325008BEA), + UINT64_C(0x4F2C37814375698E), UINT64_C(0x52C2BDDF6159C852), + UINT64_C(0x034B0A458F9EAD46), UINT64_C(0x1EA5801BADB20C9A), + UINT64_C(0x38961EF9CBC7EEFE), UINT64_C(0x257894A7E9EB4F22), + UINT64_C(0x9B8571CC164924D6), UINT64_C(0x866BFB923465850A), + UINT64_C(0xA05865705210676E), UINT64_C(0xBDB6EF2E703CC6B2), + UINT64_C(0xEC3F58B49EFBA3A6), UINT64_C(0xF1D1D2EABCD7027A), + UINT64_C(0xD7E24C08DAA2E01E), UINT64_C(0xCA0CC656F88E41C2), + UINT64_C(0x38C129F48AE82973), UINT64_C(0x252FA3AAA8C488AF), + UINT64_C(0x031C3D48CEB16ACB), UINT64_C(0x1EF2B716EC9DCB17), + UINT64_C(0x4F7B008C025AAE03), UINT64_C(0x52958AD220760FDF), + UINT64_C(0x74A614304603EDBB), UINT64_C(0x69489E6E642F4C67), + UINT64_C(0xD7B57B059B8D2793), UINT64_C(0xCA5BF15BB9A1864F), + UINT64_C(0xEC686FB9DFD4642B), UINT64_C(0xF186E5E7FDF8C5F7), + UINT64_C(0xA00F527D133FA0E3), UINT64_C(0xBDE1D8233113013F), + UINT64_C(0x9BD246C15766E35B), UINT64_C(0x863CCC9F754A4287), + UINT64_C(0xEC9136AE1CA42CBC), UINT64_C(0xF17FBCF03E888D60), + UINT64_C(0xD74C221258FD6F04), UINT64_C(0xCAA2A84C7AD1CED8), + UINT64_C(0x9B2B1FD69416ABCC), UINT64_C(0x86C59588B63A0A10), + UINT64_C(0xA0F60B6AD04FE874), UINT64_C(0xBD188134F26349A8), + UINT64_C(0x03E5645F0DC1225C), UINT64_C(0x1E0BEE012FED8380), + UINT64_C(0x383870E3499861E4), UINT64_C(0x25D6FABD6BB4C038), + UINT64_C(0x745F4D278573A52C), UINT64_C(0x69B1C779A75F04F0), + UINT64_C(0x4F82599BC12AE694), UINT64_C(0x526CD3C5E3064748), + UINT64_C(0xA0A13C6791602FF9), UINT64_C(0xBD4FB639B34C8E25), + UINT64_C(0x9B7C28DBD5396C41), UINT64_C(0x8692A285F715CD9D), + UINT64_C(0xD71B151F19D2A889), UINT64_C(0xCAF59F413BFE0955), + UINT64_C(0xECC601A35D8BEB31), UINT64_C(0xF1288BFD7FA74AED), + UINT64_C(0x4FD56E9680052119), UINT64_C(0x523BE4C8A22980C5), + UINT64_C(0x74087A2AC45C62A1), UINT64_C(0x69E6F074E670C37D), + UINT64_C(0x386F47EE08B7A669), UINT64_C(0x2581CDB02A9B07B5), + UINT64_C(0x03B253524CEEE5D1), UINT64_C(0x1E5CD90C6EC2440D) + } +}; diff --git a/src/liblzma/check/crc64_tablegen.c b/src/liblzma/check/crc64_tablegen.c new file mode 100644 index 0000000..fddaa7e --- /dev/null +++ b/src/liblzma/check/crc64_tablegen.c @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc64_tablegen.c +/// \brief Generate crc64_table_le.h and crc64_table_be.h +/// +/// Compiling: gcc -std=c99 -o crc64_tablegen crc64_tablegen.c +/// Add -DWORDS_BIGENDIAN to generate big endian table. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include "../../common/tuklib_integer.h" + + +static uint64_t crc64_table[4][256]; + + +extern void +init_crc64_table(void) +{ + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint64_t r = s == 0 ? b : crc64_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + crc64_table[s][b] = r; + } + } + +#ifdef WORDS_BIGENDIAN + for (size_t s = 0; s < 4; ++s) + for (size_t b = 0; b < 256; ++b) + crc64_table[s][b] = bswap64(crc64_table[s][b]); +#endif + + return; +} + + +static void +print_crc64_table(void) +{ + printf("/* This file has been automatically generated by " + "crc64_tablegen.c. */\n\n" + "const uint64_t lzma_crc64_table[4][256] = {\n\t{"); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + if ((b % 2) == 0) + printf("\n\t\t"); + + printf("UINT64_C(0x%016" PRIX64 ")", + crc64_table[s][b]); + + if (b != 255) + printf(",%s", (b+1) % 2 == 0 ? "" : " "); + } + + if (s == 3) + printf("\n\t}\n};\n"); + else + printf("\n\t}, {"); + } + + return; +} + + +int +main(void) +{ + init_crc64_table(); + print_crc64_table(); + return 0; +} diff --git a/src/liblzma/check/crc64_x86.S b/src/liblzma/check/crc64_x86.S new file mode 100644 index 0000000..9aecf58 --- /dev/null +++ b/src/liblzma/check/crc64_x86.S @@ -0,0 +1,296 @@ +/* + * Speed-optimized CRC64 using slicing-by-four algorithm + * + * This uses only i386 instructions, but it is optimized for i686 and later + * (including e.g. Pentium II/III/IV, Athlon XP, and Core 2). + * + * Authors: Igor Pavlov (original CRC32 assembly code) + * Lasse Collin (CRC64 adaptation of the modified CRC32 code) + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + * + * This code needs lzma_crc64_table, which can be created using the + * following C code: + +uint64_t lzma_crc64_table[4][256]; + +void +init_table(void) +{ + // ECMA-182 + static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); + + for (size_t s = 0; s < 4; ++s) { + for (size_t b = 0; b < 256; ++b) { + uint64_t r = s == 0 ? b : lzma_crc64_table[s - 1][b]; + + for (size_t i = 0; i < 8; ++i) { + if (r & 1) + r = (r >> 1) ^ poly64; + else + r >>= 1; + } + + lzma_crc64_table[s][b] = r; + } + } +} + + * The prototype of the CRC64 function: + * extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc); + */ + +/* When Intel CET is enabled, include in assembly code to mark + Intel CET support. */ +#ifdef __CET__ +# include +#else +# define _CET_ENDBR +#endif + +/* + * On some systems, the functions need to be prefixed. The prefix is + * usually an underscore. + */ +#ifndef __USER_LABEL_PREFIX__ +# define __USER_LABEL_PREFIX__ +#endif +#define MAKE_SYM_CAT(prefix, sym) prefix ## sym +#define MAKE_SYM(prefix, sym) MAKE_SYM_CAT(prefix, sym) +#define LZMA_CRC64 MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc64) +#define LZMA_CRC64_TABLE MAKE_SYM(__USER_LABEL_PREFIX__, lzma_crc64_table) + +/* + * Solaris assembler doesn't have .p2align, and Darwin uses .align + * differently than GNU/Linux and Solaris. + */ +#if defined(__APPLE__) || defined(__MSDOS__) +# define ALIGN(pow2, abs) .align pow2 +#else +# define ALIGN(pow2, abs) .align abs +#endif + + .text + .globl LZMA_CRC64 + +#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) \ + && !defined(__MSDOS__) + .type LZMA_CRC64, @function +#endif + + ALIGN(4, 16) +LZMA_CRC64: + _CET_ENDBR + /* + * Register usage: + * %eax crc LSB + * %edx crc MSB + * %esi buf + * %edi size or buf + size + * %ebx lzma_crc64_table + * %ebp Table index + * %ecx Temporary + */ + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl 0x14(%esp), %esi /* buf */ + movl 0x18(%esp), %edi /* size */ + movl 0x1C(%esp), %eax /* crc LSB */ + movl 0x20(%esp), %edx /* crc MSB */ + + /* + * Store the address of lzma_crc64_table to %ebx. This is needed to + * get position-independent code (PIC). + * + * The PIC macro is defined by libtool, while __PIC__ is defined + * by GCC but only on some systems. Testing for both makes it simpler + * to test this code without libtool, and keeps the code working also + * when built with libtool but using something else than GCC. + * + * I understood that libtool may define PIC on Windows even though + * the code in Windows DLLs is not PIC in sense that it is in ELF + * binaries, so we need a separate check to always use the non-PIC + * code on Windows. + */ +#if (!defined(PIC) && !defined(__PIC__)) \ + || (defined(_WIN32) || defined(__CYGWIN__)) + /* Not PIC */ + movl $ LZMA_CRC64_TABLE, %ebx +#elif defined(__APPLE__) + /* Mach-O */ + call .L_get_pc +.L_pic: + leal .L_lzma_crc64_table$non_lazy_ptr-.L_pic(%ebx), %ebx + movl (%ebx), %ebx +#else + /* ELF */ + call .L_get_pc + addl $_GLOBAL_OFFSET_TABLE_, %ebx + movl LZMA_CRC64_TABLE@GOT(%ebx), %ebx +#endif + + /* Complement the initial value. */ + notl %eax + notl %edx + +.L_align: + /* + * Check if there is enough input to use slicing-by-four. + * We need eight bytes, because the loop pre-reads four bytes. + */ + cmpl $8, %edi + jb .L_rest + + /* Check if we have reached alignment of four bytes. */ + testl $3, %esi + jz .L_slice + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrdl $8, %edx, %eax + xorl (%ebx, %ebp, 8), %eax + shrl $8, %edx + xorl 4(%ebx, %ebp, 8), %edx + decl %edi + jmp .L_align + +.L_slice: + /* + * If we get here, there's at least eight bytes of aligned input + * available. Make %edi multiple of four bytes. Store the possible + * remainder over the "size" variable in the argument stack. + */ + movl %edi, 0x18(%esp) + andl $-4, %edi + subl %edi, 0x18(%esp) + + /* + * Let %edi be buf + size - 4 while running the main loop. This way + * we can compare for equality to determine when exit the loop. + */ + addl %esi, %edi + subl $4, %edi + + /* Read in the first four aligned bytes. */ + movl (%esi), %ecx + +.L_loop: + xorl %eax, %ecx + movzbl %cl, %ebp + movl 0x1800(%ebx, %ebp, 8), %eax + xorl %edx, %eax + movl 0x1804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + xorl 0x1000(%ebx, %ebp, 8), %eax + xorl 0x1004(%ebx, %ebp, 8), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0800(%ebx, %ebp, 8), %eax + xorl 0x0804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + addl $4, %esi + xorl (%ebx, %ebp, 8), %eax + xorl 4(%ebx, %ebp, 8), %edx + + /* Check for end of aligned input. */ + cmpl %edi, %esi + + /* + * Copy the next input byte to %ecx. It is slightly faster to + * read it here than at the top of the loop. + */ + movl (%esi), %ecx + jb .L_loop + + /* + * Process the remaining four bytes, which we have already + * copied to %ecx. + */ + xorl %eax, %ecx + movzbl %cl, %ebp + movl 0x1800(%ebx, %ebp, 8), %eax + xorl %edx, %eax + movl 0x1804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + xorl 0x1000(%ebx, %ebp, 8), %eax + xorl 0x1004(%ebx, %ebp, 8), %edx + shrl $16, %ecx + movzbl %cl, %ebp + xorl 0x0800(%ebx, %ebp, 8), %eax + xorl 0x0804(%ebx, %ebp, 8), %edx + movzbl %ch, %ebp + addl $4, %esi + xorl (%ebx, %ebp, 8), %eax + xorl 4(%ebx, %ebp, 8), %edx + + /* Copy the number of remaining bytes to %edi. */ + movl 0x18(%esp), %edi + +.L_rest: + /* Check for end of input. */ + testl %edi, %edi + jz .L_return + + /* Calculate CRC of the next input byte. */ + movzbl (%esi), %ebp + incl %esi + movzbl %al, %ecx + xorl %ecx, %ebp + shrdl $8, %edx, %eax + xorl (%ebx, %ebp, 8), %eax + shrl $8, %edx + xorl 4(%ebx, %ebp, 8), %edx + decl %edi + jmp .L_rest + +.L_return: + /* Complement the final value. */ + notl %eax + notl %edx + + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + +#if defined(PIC) || defined(__PIC__) + ALIGN(4, 16) +.L_get_pc: + movl (%esp), %ebx + ret +#endif + +#if defined(__APPLE__) && (defined(PIC) || defined(__PIC__)) + /* Mach-O PIC */ + .section __IMPORT,__pointers,non_lazy_symbol_pointers +.L_lzma_crc64_table$non_lazy_ptr: + .indirect_symbol LZMA_CRC64_TABLE + .long 0 + +#elif defined(_WIN32) || defined(__CYGWIN__) +# ifdef DLL_EXPORT + /* This is equivalent of __declspec(dllexport). */ + .section .drectve + .ascii " -export:lzma_crc64" +# endif + +#elif !defined(__MSDOS__) + /* ELF */ + .size LZMA_CRC64, .-LZMA_CRC64 +#endif + +/* + * This is needed to support non-executable stack. It's ugly to + * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when + * we are using GNU assembler. + */ +#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__)) + .section .note.GNU-stack,"",@progbits +#endif diff --git a/src/liblzma/check/crc_macros.h b/src/liblzma/check/crc_macros.h new file mode 100644 index 0000000..a7c21b7 --- /dev/null +++ b/src/liblzma/check/crc_macros.h @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file crc_macros.h +/// \brief Some endian-dependent macros for CRC32 and CRC64 +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifdef WORDS_BIGENDIAN +# define A(x) ((x) >> 24) +# define B(x) (((x) >> 16) & 0xFF) +# define C(x) (((x) >> 8) & 0xFF) +# define D(x) ((x) & 0xFF) + +# define S8(x) ((x) << 8) +# define S32(x) ((x) << 32) + +#else +# define A(x) ((x) & 0xFF) +# define B(x) (((x) >> 8) & 0xFF) +# define C(x) (((x) >> 16) & 0xFF) +# define D(x) ((x) >> 24) + +# define S8(x) ((x) >> 8) +# define S32(x) ((x) >> 32) +#endif diff --git a/src/liblzma/check/sha256.c b/src/liblzma/check/sha256.c new file mode 100644 index 0000000..5eede5c --- /dev/null +++ b/src/liblzma/check/sha256.c @@ -0,0 +1,196 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sha256.c +/// \brief SHA-256 +/// +/// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they +/// are imported to liblzma, SSE instructions need to be used +/// conditionally to keep the code working on older boxes. +// +// This code is based on the code found from 7-Zip, which has a modified +// version of the SHA-256 found from Crypto++ . +// The code was modified a little to fit into liblzma. +// +// Authors: Kevin Springle +// Wei Dai +// Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "check.h" + +// Rotate a uint32_t. GCC can optimize this to a rotate instruction +// at least on x86. +static inline uint32_t +rotr_32(uint32_t num, unsigned amount) +{ + return (num >> amount) | (num << (32 - amount)); +} + +#define blk0(i) (W[i] = conv32be(data[i])) +#define blk2(i) (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] \ + + s0(W[(i - 15) & 15])) + +#define Ch(x, y, z) (z ^ (x & (y ^ z))) +#define Maj(x, y, z) ((x & (y ^ z)) + (y & z)) + +#define a(i) T[(0 - i) & 7] +#define b(i) T[(1 - i) & 7] +#define c(i) T[(2 - i) & 7] +#define d(i) T[(3 - i) & 7] +#define e(i) T[(4 - i) & 7] +#define f(i) T[(5 - i) & 7] +#define g(i) T[(6 - i) & 7] +#define h(i) T[(7 - i) & 7] + +#define R(i, j, blk) \ + h(i) += S1(e(i)) + Ch(e(i), f(i), g(i)) + SHA256_K[i + j] + blk; \ + d(i) += h(i); \ + h(i) += S0(a(i)) + Maj(a(i), b(i), c(i)) +#define R0(i) R(i, 0, blk0(i)) +#define R2(i) R(i, j, blk2(i)) + +#define S0(x) rotr_32(x ^ rotr_32(x ^ rotr_32(x, 9), 11), 2) +#define S1(x) rotr_32(x ^ rotr_32(x ^ rotr_32(x, 14), 5), 6) +#define s0(x) (rotr_32(x ^ rotr_32(x, 11), 7) ^ (x >> 3)) +#define s1(x) (rotr_32(x ^ rotr_32(x, 2), 17) ^ (x >> 10)) + + +static const uint32_t SHA256_K[64] = { + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2, +}; + + +static void +transform(uint32_t state[8], const uint32_t data[16]) +{ + uint32_t W[16]; + uint32_t T[8]; + + // Copy state[] to working vars. + memcpy(T, state, sizeof(T)); + + // The first 16 operations unrolled + R0( 0); R0( 1); R0( 2); R0( 3); + R0( 4); R0( 5); R0( 6); R0( 7); + R0( 8); R0( 9); R0(10); R0(11); + R0(12); R0(13); R0(14); R0(15); + + // The remaining 48 operations partially unrolled + for (unsigned int j = 16; j < 64; j += 16) { + R2( 0); R2( 1); R2( 2); R2( 3); + R2( 4); R2( 5); R2( 6); R2( 7); + R2( 8); R2( 9); R2(10); R2(11); + R2(12); R2(13); R2(14); R2(15); + } + + // Add the working vars back into state[]. + state[0] += a(0); + state[1] += b(0); + state[2] += c(0); + state[3] += d(0); + state[4] += e(0); + state[5] += f(0); + state[6] += g(0); + state[7] += h(0); +} + + +static void +process(lzma_check_state *check) +{ + transform(check->state.sha256.state, check->buffer.u32); + return; +} + + +extern void +lzma_sha256_init(lzma_check_state *check) +{ + static const uint32_t s[8] = { + 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, + 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19, + }; + + memcpy(check->state.sha256.state, s, sizeof(s)); + check->state.sha256.size = 0; + + return; +} + + +extern void +lzma_sha256_update(const uint8_t *buf, size_t size, lzma_check_state *check) +{ + // Copy the input data into a properly aligned temporary buffer. + // This way we can be called with arbitrarily sized buffers + // (no need to be multiple of 64 bytes), and the code works also + // on architectures that don't allow unaligned memory access. + while (size > 0) { + const size_t copy_start = check->state.sha256.size & 0x3F; + size_t copy_size = 64 - copy_start; + if (copy_size > size) + copy_size = size; + + memcpy(check->buffer.u8 + copy_start, buf, copy_size); + + buf += copy_size; + size -= copy_size; + check->state.sha256.size += copy_size; + + if ((check->state.sha256.size & 0x3F) == 0) + process(check); + } + + return; +} + + +extern void +lzma_sha256_finish(lzma_check_state *check) +{ + // Add padding as described in RFC 3174 (it describes SHA-1 but + // the same padding style is used for SHA-256 too). + size_t pos = check->state.sha256.size & 0x3F; + check->buffer.u8[pos++] = 0x80; + + while (pos != 64 - 8) { + if (pos == 64) { + process(check); + pos = 0; + } + + check->buffer.u8[pos++] = 0x00; + } + + // Convert the message size from bytes to bits. + check->state.sha256.size *= 8; + + check->buffer.u64[(64 - 8) / 8] = conv64be(check->state.sha256.size); + + process(check); + + for (size_t i = 0; i < 8; ++i) + check->buffer.u32[i] = conv32be(check->state.sha256.state[i]); + + return; +} diff --git a/src/liblzma/common/alone_decoder.c b/src/liblzma/common/alone_decoder.c new file mode 100644 index 0000000..1dc85ba --- /dev/null +++ b/src/liblzma/common/alone_decoder.c @@ -0,0 +1,249 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file alone_decoder.c +/// \brief Decoder for LZMA_Alone files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "alone_decoder.h" +#include "lzma_decoder.h" +#include "lz_decoder.h" + + +typedef struct { + lzma_next_coder next; + + enum { + SEQ_PROPERTIES, + SEQ_DICTIONARY_SIZE, + SEQ_UNCOMPRESSED_SIZE, + SEQ_CODER_INIT, + SEQ_CODE, + } sequence; + + /// If true, reject files that are unlikely to be .lzma files. + /// If false, more non-.lzma files get accepted and will give + /// LZMA_DATA_ERROR either immediately or after a few output bytes. + bool picky; + + /// Position in the header fields + size_t pos; + + /// Uncompressed size decoded from the header + lzma_vli uncompressed_size; + + /// Memory usage limit + uint64_t memlimit; + + /// Amount of memory actually needed (only an estimate) + uint64_t memusage; + + /// Options decoded from the header needed to initialize + /// the LZMA decoder + lzma_options_lzma options; +} lzma_alone_coder; + + +static lzma_ret +alone_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action) +{ + lzma_alone_coder *coder = coder_ptr; + + while (*out_pos < out_size + && (coder->sequence == SEQ_CODE || *in_pos < in_size)) + switch (coder->sequence) { + case SEQ_PROPERTIES: + if (lzma_lzma_lclppb_decode(&coder->options, in[*in_pos])) + return LZMA_FORMAT_ERROR; + + coder->sequence = SEQ_DICTIONARY_SIZE; + ++*in_pos; + break; + + case SEQ_DICTIONARY_SIZE: + coder->options.dict_size + |= (size_t)(in[*in_pos]) << (coder->pos * 8); + + if (++coder->pos == 4) { + if (coder->picky && coder->options.dict_size + != UINT32_MAX) { + // A hack to ditch tons of false positives: + // We allow only dictionary sizes that are + // 2^n or 2^n + 2^(n-1). LZMA_Alone created + // only files with 2^n, but accepts any + // dictionary size. + uint32_t d = coder->options.dict_size - 1; + d |= d >> 2; + d |= d >> 3; + d |= d >> 4; + d |= d >> 8; + d |= d >> 16; + ++d; + + if (d != coder->options.dict_size) + return LZMA_FORMAT_ERROR; + } + + coder->pos = 0; + coder->sequence = SEQ_UNCOMPRESSED_SIZE; + } + + ++*in_pos; + break; + + case SEQ_UNCOMPRESSED_SIZE: + coder->uncompressed_size + |= (lzma_vli)(in[*in_pos]) << (coder->pos * 8); + ++*in_pos; + if (++coder->pos < 8) + break; + + // Another hack to ditch false positives: Assume that + // if the uncompressed size is known, it must be less + // than 256 GiB. + // + // FIXME? Without picky we allow > LZMA_VLI_MAX which doesn't + // really matter in this specific situation (> LZMA_VLI_MAX is + // safe in the LZMA decoder) but it's somewhat weird still. + if (coder->picky + && coder->uncompressed_size != LZMA_VLI_UNKNOWN + && coder->uncompressed_size + >= (LZMA_VLI_C(1) << 38)) + return LZMA_FORMAT_ERROR; + + // Use LZMA_FILTER_LZMA1EXT features to specify the + // uncompressed size and that the end marker is allowed + // even when the uncompressed size is known. Both .lzma + // header and LZMA1EXT use UINT64_MAX indicate that size + // is unknown. + coder->options.ext_flags = LZMA_LZMA1EXT_ALLOW_EOPM; + lzma_set_ext_size(coder->options, coder->uncompressed_size); + + // Calculate the memory usage so that it is ready + // for SEQ_CODER_INIT. + coder->memusage = lzma_lzma_decoder_memusage(&coder->options) + + LZMA_MEMUSAGE_BASE; + + coder->pos = 0; + coder->sequence = SEQ_CODER_INIT; + + // Fall through + + case SEQ_CODER_INIT: { + if (coder->memusage > coder->memlimit) + return LZMA_MEMLIMIT_ERROR; + + lzma_filter_info filters[2] = { + { + .id = LZMA_FILTER_LZMA1EXT, + .init = &lzma_lzma_decoder_init, + .options = &coder->options, + }, { + .init = NULL, + } + }; + + return_if_error(lzma_next_filter_init(&coder->next, + allocator, filters)); + + coder->sequence = SEQ_CODE; + break; + } + + case SEQ_CODE: { + return coder->next.code(coder->next.coder, + allocator, in, in_pos, in_size, + out, out_pos, out_size, action); + } + + default: + return LZMA_PROG_ERROR; + } + + return LZMA_OK; +} + + +static void +alone_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_alone_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +alone_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_alone_coder *coder = coder_ptr; + + *memusage = coder->memusage; + *old_memlimit = coder->memlimit; + + if (new_memlimit != 0) { + if (new_memlimit < coder->memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +extern lzma_ret +lzma_alone_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, bool picky) +{ + lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator); + + lzma_alone_coder *coder = next->coder; + + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_alone_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &alone_decode; + next->end = &alone_decoder_end; + next->memconfig = &alone_decoder_memconfig; + coder->next = LZMA_NEXT_CODER_INIT; + } + + coder->sequence = SEQ_PROPERTIES; + coder->picky = picky; + coder->pos = 0; + coder->options.dict_size = 0; + coder->options.preset_dict = NULL; + coder->options.preset_dict_size = 0; + coder->uncompressed_size = 0; + coder->memlimit = my_max(1, memlimit); + coder->memusage = LZMA_MEMUSAGE_BASE; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) +{ + lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/alone_decoder.h b/src/liblzma/common/alone_decoder.h new file mode 100644 index 0000000..dfa031a --- /dev/null +++ b/src/liblzma/common/alone_decoder.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file alone_decoder.h +/// \brief Decoder for LZMA_Alone files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_ALONE_DECODER_H +#define LZMA_ALONE_DECODER_H + +#include "common.h" + + +extern lzma_ret lzma_alone_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, bool picky); + +#endif diff --git a/src/liblzma/common/alone_encoder.c b/src/liblzma/common/alone_encoder.c new file mode 100644 index 0000000..c9392f3 --- /dev/null +++ b/src/liblzma/common/alone_encoder.c @@ -0,0 +1,163 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file alone_encoder.c +/// \brief Encoder for LZMA_Alone files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "lzma_encoder.h" + + +#define ALONE_HEADER_SIZE (1 + 4 + 8) + + +typedef struct { + lzma_next_coder next; + + enum { + SEQ_HEADER, + SEQ_CODE, + } sequence; + + size_t header_pos; + uint8_t header[ALONE_HEADER_SIZE]; +} lzma_alone_coder; + + +static lzma_ret +alone_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action) +{ + lzma_alone_coder *coder = coder_ptr; + + while (*out_pos < out_size) + switch (coder->sequence) { + case SEQ_HEADER: + lzma_bufcpy(coder->header, &coder->header_pos, + ALONE_HEADER_SIZE, + out, out_pos, out_size); + if (coder->header_pos < ALONE_HEADER_SIZE) + return LZMA_OK; + + coder->sequence = SEQ_CODE; + break; + + case SEQ_CODE: + return coder->next.code(coder->next.coder, + allocator, in, in_pos, in_size, + out, out_pos, out_size, action); + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + return LZMA_OK; +} + + +static void +alone_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_alone_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +// At least for now, this is not used by any internal function. +static lzma_ret +alone_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_options_lzma *options) +{ + lzma_next_coder_init(&alone_encoder_init, next, allocator); + + lzma_alone_coder *coder = next->coder; + + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_alone_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &alone_encode; + next->end = &alone_encoder_end; + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Basic initializations + coder->sequence = SEQ_HEADER; + coder->header_pos = 0; + + // Encode the header: + // - Properties (1 byte) + if (lzma_lzma_lclppb_encode(options, coder->header)) + return LZMA_OPTIONS_ERROR; + + // - Dictionary size (4 bytes) + if (options->dict_size < LZMA_DICT_SIZE_MIN) + return LZMA_OPTIONS_ERROR; + + // Round up to the next 2^n or 2^n + 2^(n - 1) depending on which + // one is the next unless it is UINT32_MAX. While the header would + // allow any 32-bit integer, we do this to keep the decoder of liblzma + // accepting the resulting files. + uint32_t d = options->dict_size - 1; + d |= d >> 2; + d |= d >> 3; + d |= d >> 4; + d |= d >> 8; + d |= d >> 16; + if (d != UINT32_MAX) + ++d; + + write32le(coder->header + 1, d); + + // - Uncompressed size (always unknown and using EOPM) + memset(coder->header + 1 + 4, 0xFF, 8); + + // Initialize the LZMA encoder. + const lzma_filter_info filters[2] = { + { + .id = LZMA_FILTER_LZMA1, + .init = &lzma_lzma_encoder_init, + .options = (void *)(options), + }, { + .init = NULL, + } + }; + + return lzma_next_filter_init(&coder->next, allocator, filters); +} + + +/* +extern lzma_ret +lzma_alone_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_options_alone *options) +{ + lzma_next_coder_init(&alone_encoder_init, next, allocator, options); +} +*/ + + +extern LZMA_API(lzma_ret) +lzma_alone_encoder(lzma_stream *strm, const lzma_options_lzma *options) +{ + lzma_next_strm_init(alone_encoder_init, strm, options); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/auto_decoder.c b/src/liblzma/common/auto_decoder.c new file mode 100644 index 0000000..2a5c089 --- /dev/null +++ b/src/liblzma/common/auto_decoder.c @@ -0,0 +1,206 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file auto_decoder.c +/// \brief Autodetect between .xz, .lzma (LZMA_Alone), and .lz (lzip) +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_decoder.h" +#include "alone_decoder.h" +#ifdef HAVE_LZIP_DECODER +# include "lzip_decoder.h" +#endif + + +typedef struct { + /// .xz Stream decoder, LZMA_Alone decoder, or lzip decoder + lzma_next_coder next; + + uint64_t memlimit; + uint32_t flags; + + enum { + SEQ_INIT, + SEQ_CODE, + SEQ_FINISH, + } sequence; +} lzma_auto_coder; + + +static lzma_ret +auto_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_auto_coder *coder = coder_ptr; + + switch (coder->sequence) { + case SEQ_INIT: + if (*in_pos >= in_size) + return LZMA_OK; + + // Update the sequence now, because we want to continue from + // SEQ_CODE even if we return some LZMA_*_CHECK. + coder->sequence = SEQ_CODE; + + // Detect the file format. .xz files start with 0xFD which + // cannot be the first byte of .lzma (LZMA_Alone) format. + // The .lz format starts with 0x4C which could be the + // first byte of a .lzma file but luckily it would mean + // lc/lp/pb being 4/3/1 which liblzma doesn't support because + // lc + lp > 4. So using just 0x4C to detect .lz is OK here. + if (in[*in_pos] == 0xFD) { + return_if_error(lzma_stream_decoder_init( + &coder->next, allocator, + coder->memlimit, coder->flags)); +#ifdef HAVE_LZIP_DECODER + } else if (in[*in_pos] == 0x4C) { + return_if_error(lzma_lzip_decoder_init( + &coder->next, allocator, + coder->memlimit, coder->flags)); +#endif + } else { + return_if_error(lzma_alone_decoder_init(&coder->next, + allocator, coder->memlimit, true)); + + // If the application wants to know about missing + // integrity check or about the check in general, we + // need to handle it here, because LZMA_Alone decoder + // doesn't accept any flags. + if (coder->flags & LZMA_TELL_NO_CHECK) + return LZMA_NO_CHECK; + + if (coder->flags & LZMA_TELL_ANY_CHECK) + return LZMA_GET_CHECK; + } + + // Fall through + + case SEQ_CODE: { + const lzma_ret ret = coder->next.code( + coder->next.coder, allocator, + in, in_pos, in_size, + out, out_pos, out_size, action); + if (ret != LZMA_STREAM_END + || (coder->flags & LZMA_CONCATENATED) == 0) + return ret; + + coder->sequence = SEQ_FINISH; + } + + // Fall through + + case SEQ_FINISH: + // When LZMA_CONCATENATED was used and we were decoding + // a LZMA_Alone file, we need to check that there is no + // trailing garbage and wait for LZMA_FINISH. + if (*in_pos < in_size) + return LZMA_DATA_ERROR; + + return action == LZMA_FINISH ? LZMA_STREAM_END : LZMA_OK; + + default: + assert(0); + return LZMA_PROG_ERROR; + } +} + + +static void +auto_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_auto_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_check +auto_decoder_get_check(const void *coder_ptr) +{ + const lzma_auto_coder *coder = coder_ptr; + + // It is LZMA_Alone if get_check is NULL. + return coder->next.get_check == NULL ? LZMA_CHECK_NONE + : coder->next.get_check(coder->next.coder); +} + + +static lzma_ret +auto_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_auto_coder *coder = coder_ptr; + + lzma_ret ret; + + if (coder->next.memconfig != NULL) { + ret = coder->next.memconfig(coder->next.coder, + memusage, old_memlimit, new_memlimit); + assert(*old_memlimit == coder->memlimit); + } else { + // No coder is configured yet. Use the base value as + // the current memory usage. + *memusage = LZMA_MEMUSAGE_BASE; + *old_memlimit = coder->memlimit; + + ret = LZMA_OK; + if (new_memlimit != 0 && new_memlimit < *memusage) + ret = LZMA_MEMLIMIT_ERROR; + } + + if (ret == LZMA_OK && new_memlimit != 0) + coder->memlimit = new_memlimit; + + return ret; +} + + +static lzma_ret +auto_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, uint32_t flags) +{ + lzma_next_coder_init(&auto_decoder_init, next, allocator); + + if (flags & ~LZMA_SUPPORTED_FLAGS) + return LZMA_OPTIONS_ERROR; + + lzma_auto_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_auto_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &auto_decode; + next->end = &auto_decoder_end; + next->get_check = &auto_decoder_get_check; + next->memconfig = &auto_decoder_memconfig; + coder->next = LZMA_NEXT_CODER_INIT; + } + + coder->memlimit = my_max(1, memlimit); + coder->flags = flags; + coder->sequence = SEQ_INIT; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_auto_decoder(lzma_stream *strm, uint64_t memlimit, uint32_t flags) +{ + lzma_next_strm_init(auto_decoder_init, strm, memlimit, flags); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/block_buffer_decoder.c b/src/liblzma/common/block_buffer_decoder.c new file mode 100644 index 0000000..b0ded90 --- /dev/null +++ b/src/liblzma/common/block_buffer_decoder.c @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_buffer_decoder.c +/// \brief Single-call .xz Block decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "block_decoder.h" + + +extern LZMA_API(lzma_ret) +lzma_block_buffer_decode(lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + if (in_pos == NULL || (in == NULL && *in_pos != in_size) + || *in_pos > in_size || out_pos == NULL + || (out == NULL && *out_pos != out_size) + || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // Initialize the Block decoder. + lzma_next_coder block_decoder = LZMA_NEXT_CODER_INIT; + lzma_ret ret = lzma_block_decoder_init( + &block_decoder, allocator, block); + + if (ret == LZMA_OK) { + // Save the positions so that we can restore them in case + // an error occurs. + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + // Do the actual decoding. + ret = block_decoder.code(block_decoder.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + LZMA_FINISH); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + if (ret == LZMA_OK) { + // Either the input was truncated or the + // output buffer was too small. + assert(*in_pos == in_size + || *out_pos == out_size); + + // If all the input was consumed, then the + // input is truncated, even if the output + // buffer is also full. This is because + // processing the last byte of the Block + // never produces output. + // + // NOTE: This assumption may break when new + // filters are added, if the end marker of + // the filter doesn't consume at least one + // complete byte. + if (*in_pos == in_size) + ret = LZMA_DATA_ERROR; + else + ret = LZMA_BUF_ERROR; + } + + // Restore the positions. + *in_pos = in_start; + *out_pos = out_start; + } + } + + // Free the decoder memory. This needs to be done even if + // initialization fails, because the internal API doesn't + // require the initialization function to free its memory on error. + lzma_next_end(&block_decoder, allocator); + + return ret; +} diff --git a/src/liblzma/common/block_buffer_encoder.c b/src/liblzma/common/block_buffer_encoder.c new file mode 100644 index 0000000..a47342e --- /dev/null +++ b/src/liblzma/common/block_buffer_encoder.c @@ -0,0 +1,355 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_buffer_encoder.c +/// \brief Single-call .xz Block encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "block_buffer_encoder.h" +#include "block_encoder.h" +#include "filter_encoder.h" +#include "lzma2_encoder.h" +#include "check.h" + + +/// Estimate the maximum size of the Block Header and Check fields for +/// a Block that uses LZMA2 uncompressed chunks. We could use +/// lzma_block_header_size() but this is simpler. +/// +/// Block Header Size + Block Flags + Compressed Size +/// + Uncompressed Size + Filter Flags for LZMA2 + CRC32 + Check +/// and round up to the next multiple of four to take Header Padding +/// into account. +#define HEADERS_BOUND ((1 + 1 + 2 * LZMA_VLI_BYTES_MAX + 3 + 4 \ + + LZMA_CHECK_SIZE_MAX + 3) & ~3) + + +static uint64_t +lzma2_bound(uint64_t uncompressed_size) +{ + // Prevent integer overflow in overhead calculation. + if (uncompressed_size > COMPRESSED_SIZE_MAX) + return 0; + + // Calculate the exact overhead of the LZMA2 headers: Round + // uncompressed_size up to the next multiple of LZMA2_CHUNK_MAX, + // multiply by the size of per-chunk header, and add one byte for + // the end marker. + const uint64_t overhead = ((uncompressed_size + LZMA2_CHUNK_MAX - 1) + / LZMA2_CHUNK_MAX) + * LZMA2_HEADER_UNCOMPRESSED + 1; + + // Catch the possible integer overflow. + if (COMPRESSED_SIZE_MAX - overhead < uncompressed_size) + return 0; + + return uncompressed_size + overhead; +} + + +extern uint64_t +lzma_block_buffer_bound64(uint64_t uncompressed_size) +{ + // If the data doesn't compress, we always use uncompressed + // LZMA2 chunks. + uint64_t lzma2_size = lzma2_bound(uncompressed_size); + if (lzma2_size == 0) + return 0; + + // Take Block Padding into account. + lzma2_size = (lzma2_size + 3) & ~UINT64_C(3); + + // No risk of integer overflow because lzma2_bound() already takes + // into account the size of the headers in the Block. + return HEADERS_BOUND + lzma2_size; +} + + +extern LZMA_API(size_t) +lzma_block_buffer_bound(size_t uncompressed_size) +{ + uint64_t ret = lzma_block_buffer_bound64(uncompressed_size); + +#if SIZE_MAX < UINT64_MAX + // Catch the possible integer overflow on 32-bit systems. + if (ret > SIZE_MAX) + return 0; +#endif + + return ret; +} + + +static lzma_ret +block_encode_uncompressed(lzma_block *block, const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Use LZMA2 uncompressed chunks. We wouldn't need a dictionary at + // all, but LZMA2 always requires a dictionary, so use the minimum + // value to minimize memory usage of the decoder. + lzma_options_lzma lzma2 = { + .dict_size = LZMA_DICT_SIZE_MIN, + }; + + lzma_filter filters[2]; + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = &lzma2; + filters[1].id = LZMA_VLI_UNKNOWN; + + // Set the above filter options to *block temporarily so that we can + // encode the Block Header. + lzma_filter *filters_orig = block->filters; + block->filters = filters; + + if (lzma_block_header_size(block) != LZMA_OK) { + block->filters = filters_orig; + return LZMA_PROG_ERROR; + } + + // Check that there's enough output space. The caller has already + // set block->compressed_size to what lzma2_bound() has returned, + // so we can reuse that value. We know that compressed_size is a + // known valid VLI and header_size is a small value so their sum + // will never overflow. + assert(block->compressed_size == lzma2_bound(in_size)); + if (out_size - *out_pos + < block->header_size + block->compressed_size) { + block->filters = filters_orig; + return LZMA_BUF_ERROR; + } + + if (lzma_block_header_encode(block, out + *out_pos) != LZMA_OK) { + block->filters = filters_orig; + return LZMA_PROG_ERROR; + } + + block->filters = filters_orig; + *out_pos += block->header_size; + + // Encode the data using LZMA2 uncompressed chunks. + size_t in_pos = 0; + uint8_t control = 0x01; // Dictionary reset + + while (in_pos < in_size) { + // Control byte: Indicate uncompressed chunk, of which + // the first resets the dictionary. + out[(*out_pos)++] = control; + control = 0x02; // No dictionary reset + + // Size of the uncompressed chunk + const size_t copy_size + = my_min(in_size - in_pos, LZMA2_CHUNK_MAX); + out[(*out_pos)++] = (copy_size - 1) >> 8; + out[(*out_pos)++] = (copy_size - 1) & 0xFF; + + // The actual data + assert(*out_pos + copy_size <= out_size); + memcpy(out + *out_pos, in + in_pos, copy_size); + + in_pos += copy_size; + *out_pos += copy_size; + } + + // End marker + out[(*out_pos)++] = 0x00; + assert(*out_pos <= out_size); + + return LZMA_OK; +} + + +static lzma_ret +block_encode_normal(lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Find out the size of the Block Header. + return_if_error(lzma_block_header_size(block)); + + // Reserve space for the Block Header and skip it for now. + if (out_size - *out_pos <= block->header_size) + return LZMA_BUF_ERROR; + + const size_t out_start = *out_pos; + *out_pos += block->header_size; + + // Limit out_size so that we stop encoding if the output would grow + // bigger than what uncompressed Block would be. + if (out_size - *out_pos > block->compressed_size) + out_size = *out_pos + block->compressed_size; + + // TODO: In many common cases this could be optimized to use + // significantly less memory. + lzma_next_coder raw_encoder = LZMA_NEXT_CODER_INIT; + lzma_ret ret = lzma_raw_encoder_init( + &raw_encoder, allocator, block->filters); + + if (ret == LZMA_OK) { + size_t in_pos = 0; + ret = raw_encoder.code(raw_encoder.coder, allocator, + in, &in_pos, in_size, out, out_pos, out_size, + LZMA_FINISH); + } + + // NOTE: This needs to be run even if lzma_raw_encoder_init() failed. + lzma_next_end(&raw_encoder, allocator); + + if (ret == LZMA_STREAM_END) { + // Compression was successful. Write the Block Header. + block->compressed_size + = *out_pos - (out_start + block->header_size); + ret = lzma_block_header_encode(block, out + out_start); + if (ret != LZMA_OK) + ret = LZMA_PROG_ERROR; + + } else if (ret == LZMA_OK) { + // Output buffer became full. + ret = LZMA_BUF_ERROR; + } + + // Reset *out_pos if something went wrong. + if (ret != LZMA_OK) + *out_pos = out_start; + + return ret; +} + + +static lzma_ret +block_buffer_encode(lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size, + bool try_to_compress) +{ + // Validate the arguments. + if (block == NULL || (in == NULL && in_size != 0) || out == NULL + || out_pos == NULL || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // The contents of the structure may depend on the version so + // check the version before validating the contents of *block. + if (block->version > 1) + return LZMA_OPTIONS_ERROR; + + if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX + || (try_to_compress && block->filters == NULL)) + return LZMA_PROG_ERROR; + + if (!lzma_check_is_supported(block->check)) + return LZMA_UNSUPPORTED_CHECK; + + // Size of a Block has to be a multiple of four, so limit the size + // here already. This way we don't need to check it again when adding + // Block Padding. + out_size -= (out_size - *out_pos) & 3; + + // Get the size of the Check field. + const size_t check_size = lzma_check_size(block->check); + assert(check_size != UINT32_MAX); + + // Reserve space for the Check field. + if (out_size - *out_pos <= check_size) + return LZMA_BUF_ERROR; + + out_size -= check_size; + + // Initialize block->uncompressed_size and calculate the worst-case + // value for block->compressed_size. + block->uncompressed_size = in_size; + block->compressed_size = lzma2_bound(in_size); + if (block->compressed_size == 0) + return LZMA_DATA_ERROR; + + // Do the actual compression. + lzma_ret ret = LZMA_BUF_ERROR; + if (try_to_compress) + ret = block_encode_normal(block, allocator, + in, in_size, out, out_pos, out_size); + + if (ret != LZMA_OK) { + // If the error was something else than output buffer + // becoming full, return the error now. + if (ret != LZMA_BUF_ERROR) + return ret; + + // The data was uncompressible (at least with the options + // given to us) or the output buffer was too small. Use the + // uncompressed chunks of LZMA2 to wrap the data into a valid + // Block. If we haven't been given enough output space, even + // this may fail. + return_if_error(block_encode_uncompressed(block, in, in_size, + out, out_pos, out_size)); + } + + assert(*out_pos <= out_size); + + // Block Padding. No buffer overflow here, because we already adjusted + // out_size so that (out_size - out_start) is a multiple of four. + // Thus, if the buffer is full, the loop body can never run. + for (size_t i = (size_t)(block->compressed_size); i & 3; ++i) { + assert(*out_pos < out_size); + out[(*out_pos)++] = 0x00; + } + + // If there's no Check field, we are done now. + if (check_size > 0) { + // Calculate the integrity check. We reserved space for + // the Check field earlier so we don't need to check for + // available output space here. + lzma_check_state check; + lzma_check_init(&check, block->check); + lzma_check_update(&check, block->check, in, in_size); + lzma_check_finish(&check, block->check); + + memcpy(block->raw_check, check.buffer.u8, check_size); + memcpy(out + *out_pos, check.buffer.u8, check_size); + *out_pos += check_size; + } + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_block_buffer_encode(lzma_block *block, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + return block_buffer_encode(block, allocator, + in, in_size, out, out_pos, out_size, true); +} + + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +// This is for compatibility with binaries linked against liblzma that +// has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7. +LZMA_SYMVER_API("lzma_block_uncomp_encode@XZ_5.2.2", + lzma_ret, lzma_block_uncomp_encode_522)(lzma_block *block, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result + __attribute__((__alias__("lzma_block_uncomp_encode_52"))); + +LZMA_SYMVER_API("lzma_block_uncomp_encode@@XZ_5.2", + lzma_ret, lzma_block_uncomp_encode_52)(lzma_block *block, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + +#define lzma_block_uncomp_encode lzma_block_uncomp_encode_52 +#endif +extern LZMA_API(lzma_ret) +lzma_block_uncomp_encode(lzma_block *block, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // It won't allocate any memory from heap so no need + // for lzma_allocator. + return block_buffer_encode(block, NULL, + in, in_size, out, out_pos, out_size, false); +} diff --git a/src/liblzma/common/block_buffer_encoder.h b/src/liblzma/common/block_buffer_encoder.h new file mode 100644 index 0000000..653207f --- /dev/null +++ b/src/liblzma/common/block_buffer_encoder.h @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_buffer_encoder.h +/// \brief Single-call .xz Block encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_BLOCK_BUFFER_ENCODER_H +#define LZMA_BLOCK_BUFFER_ENCODER_H + +#include "common.h" + + +/// uint64_t version of lzma_block_buffer_bound(). It is used by +/// stream_encoder_mt.c. Probably the original lzma_block_buffer_bound() +/// should have been 64-bit, but fixing it would break the ABI. +extern uint64_t lzma_block_buffer_bound64(uint64_t uncompressed_size); + +#endif diff --git a/src/liblzma/common/block_decoder.c b/src/liblzma/common/block_decoder.c new file mode 100644 index 0000000..4827e0f --- /dev/null +++ b/src/liblzma/common/block_decoder.c @@ -0,0 +1,286 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_decoder.c +/// \brief Decodes .xz Blocks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "block_decoder.h" +#include "filter_decoder.h" +#include "check.h" + + +typedef struct { + enum { + SEQ_CODE, + SEQ_PADDING, + SEQ_CHECK, + } sequence; + + /// The filters in the chain; initialized with lzma_raw_decoder_init(). + lzma_next_coder next; + + /// Decoding options; we also write Compressed Size and Uncompressed + /// Size back to this structure when the decoding has been finished. + lzma_block *block; + + /// Compressed Size calculated while decoding + lzma_vli compressed_size; + + /// Uncompressed Size calculated while decoding + lzma_vli uncompressed_size; + + /// Maximum allowed Compressed Size; this takes into account the + /// size of the Block Header and Check fields when Compressed Size + /// is unknown. + lzma_vli compressed_limit; + + /// Maximum allowed Uncompressed Size. + lzma_vli uncompressed_limit; + + /// Position when reading the Check field + size_t check_pos; + + /// Check of the uncompressed data + lzma_check_state check; + + /// True if the integrity check won't be calculated and verified. + bool ignore_check; +} lzma_block_coder; + + +static inline bool +is_size_valid(lzma_vli size, lzma_vli reference) +{ + return reference == LZMA_VLI_UNKNOWN || reference == size; +} + + +static lzma_ret +block_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_block_coder *coder = coder_ptr; + + switch (coder->sequence) { + case SEQ_CODE: { + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + // Limit the amount of input and output space that we give + // to the raw decoder based on the information we have + // (or don't have) from Block Header. + const size_t in_stop = *in_pos + (size_t)my_min( + in_size - *in_pos, + coder->compressed_limit - coder->compressed_size); + const size_t out_stop = *out_pos + (size_t)my_min( + out_size - *out_pos, + coder->uncompressed_limit - coder->uncompressed_size); + + const lzma_ret ret = coder->next.code(coder->next.coder, + allocator, in, in_pos, in_stop, + out, out_pos, out_stop, action); + + const size_t in_used = *in_pos - in_start; + const size_t out_used = *out_pos - out_start; + + // Because we have limited the input and output sizes, + // we know that these cannot grow too big or overflow. + coder->compressed_size += in_used; + coder->uncompressed_size += out_used; + + if (ret == LZMA_OK) { + const bool comp_done = coder->compressed_size + == coder->block->compressed_size; + const bool uncomp_done = coder->uncompressed_size + == coder->block->uncompressed_size; + + // If both input and output amounts match the sizes + // in Block Header but we still got LZMA_OK instead + // of LZMA_STREAM_END, the file is broken. + if (comp_done && uncomp_done) + return LZMA_DATA_ERROR; + + // If the decoder has consumed all the input that it + // needs but it still couldn't fill the output buffer + // or return LZMA_STREAM_END, the file is broken. + if (comp_done && *out_pos < out_size) + return LZMA_DATA_ERROR; + + // If the decoder has produced all the output but + // it still didn't return LZMA_STREAM_END or consume + // more input (for example, detecting an end of + // payload marker may need more input but produce + // no output) the file is broken. + if (uncomp_done && *in_pos < in_size) + return LZMA_DATA_ERROR; + } + + if (!coder->ignore_check) + lzma_check_update(&coder->check, coder->block->check, + out + out_start, out_used); + + if (ret != LZMA_STREAM_END) + return ret; + + // Compressed and Uncompressed Sizes are now at their final + // values. Verify that they match the values given to us. + if (!is_size_valid(coder->compressed_size, + coder->block->compressed_size) + || !is_size_valid(coder->uncompressed_size, + coder->block->uncompressed_size)) + return LZMA_DATA_ERROR; + + // Copy the values into coder->block. The caller + // may use this information to construct Index. + coder->block->compressed_size = coder->compressed_size; + coder->block->uncompressed_size = coder->uncompressed_size; + + coder->sequence = SEQ_PADDING; + } + + // Fall through + + case SEQ_PADDING: + // Compressed Data is padded to a multiple of four bytes. + while (coder->compressed_size & 3) { + if (*in_pos >= in_size) + return LZMA_OK; + + // We use compressed_size here just get the Padding + // right. The actual Compressed Size was stored to + // coder->block already, and won't be modified by + // us anymore. + ++coder->compressed_size; + + if (in[(*in_pos)++] != 0x00) + return LZMA_DATA_ERROR; + } + + if (coder->block->check == LZMA_CHECK_NONE) + return LZMA_STREAM_END; + + if (!coder->ignore_check) + lzma_check_finish(&coder->check, coder->block->check); + + coder->sequence = SEQ_CHECK; + + // Fall through + + case SEQ_CHECK: { + const size_t check_size = lzma_check_size(coder->block->check); + lzma_bufcpy(in, in_pos, in_size, coder->block->raw_check, + &coder->check_pos, check_size); + if (coder->check_pos < check_size) + return LZMA_OK; + + // Validate the Check only if we support it. + // coder->check.buffer may be uninitialized + // when the Check ID is not supported. + if (!coder->ignore_check + && lzma_check_is_supported(coder->block->check) + && memcmp(coder->block->raw_check, + coder->check.buffer.u8, + check_size) != 0) + return LZMA_DATA_ERROR; + + return LZMA_STREAM_END; + } + } + + return LZMA_PROG_ERROR; +} + + +static void +block_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_block_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +extern lzma_ret +lzma_block_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + lzma_block *block) +{ + lzma_next_coder_init(&lzma_block_decoder_init, next, allocator); + + // Validate the options. lzma_block_unpadded_size() does that for us + // except for Uncompressed Size and filters. Filters are validated + // by the raw decoder. + if (lzma_block_unpadded_size(block) == 0 + || !lzma_vli_is_valid(block->uncompressed_size)) + return LZMA_PROG_ERROR; + + // Allocate *next->coder if needed. + lzma_block_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_block_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &block_decode; + next->end = &block_decoder_end; + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Basic initializations + coder->sequence = SEQ_CODE; + coder->block = block; + coder->compressed_size = 0; + coder->uncompressed_size = 0; + + // If Compressed Size is not known, we calculate the maximum allowed + // value so that encoded size of the Block (including Block Padding) + // is still a valid VLI and a multiple of four. + coder->compressed_limit + = block->compressed_size == LZMA_VLI_UNKNOWN + ? (LZMA_VLI_MAX & ~LZMA_VLI_C(3)) + - block->header_size + - lzma_check_size(block->check) + : block->compressed_size; + + // With Uncompressed Size this is simpler. If Block Header lacks + // the size info, then LZMA_VLI_MAX is the maximum possible + // Uncompressed Size. + coder->uncompressed_limit + = block->uncompressed_size == LZMA_VLI_UNKNOWN + ? LZMA_VLI_MAX + : block->uncompressed_size; + + // Initialize the check. It's caller's problem if the Check ID is not + // supported, and the Block decoder cannot verify the Check field. + // Caller can test lzma_check_is_supported(block->check). + coder->check_pos = 0; + lzma_check_init(&coder->check, block->check); + + coder->ignore_check = block->version >= 1 + ? block->ignore_check : false; + + // Initialize the filter chain. + return lzma_raw_decoder_init(&coder->next, allocator, + block->filters); +} + + +extern LZMA_API(lzma_ret) +lzma_block_decoder(lzma_stream *strm, lzma_block *block) +{ + lzma_next_strm_init(lzma_block_decoder_init, strm, block); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/block_decoder.h b/src/liblzma/common/block_decoder.h new file mode 100644 index 0000000..718c5ce --- /dev/null +++ b/src/liblzma/common/block_decoder.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_decoder.h +/// \brief Decodes .xz Blocks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_BLOCK_DECODER_H +#define LZMA_BLOCK_DECODER_H + +#include "common.h" + + +extern lzma_ret lzma_block_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, lzma_block *block); + +#endif diff --git a/src/liblzma/common/block_encoder.c b/src/liblzma/common/block_encoder.c new file mode 100644 index 0000000..520ecc5 --- /dev/null +++ b/src/liblzma/common/block_encoder.c @@ -0,0 +1,224 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_encoder.c +/// \brief Encodes .xz Blocks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "block_encoder.h" +#include "filter_encoder.h" +#include "check.h" + + +typedef struct { + /// The filters in the chain; initialized with lzma_raw_decoder_init(). + lzma_next_coder next; + + /// Encoding options; we also write Unpadded Size, Compressed Size, + /// and Uncompressed Size back to this structure when the encoding + /// has been finished. + lzma_block *block; + + enum { + SEQ_CODE, + SEQ_PADDING, + SEQ_CHECK, + } sequence; + + /// Compressed Size calculated while encoding + lzma_vli compressed_size; + + /// Uncompressed Size calculated while encoding + lzma_vli uncompressed_size; + + /// Position in the Check field + size_t pos; + + /// Check of the uncompressed data + lzma_check_state check; +} lzma_block_coder; + + +static lzma_ret +block_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_block_coder *coder = coder_ptr; + + // Check that our amount of input stays in proper limits. + if (LZMA_VLI_MAX - coder->uncompressed_size < in_size - *in_pos) + return LZMA_DATA_ERROR; + + switch (coder->sequence) { + case SEQ_CODE: { + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + const lzma_ret ret = coder->next.code(coder->next.coder, + allocator, in, in_pos, in_size, + out, out_pos, out_size, action); + + const size_t in_used = *in_pos - in_start; + const size_t out_used = *out_pos - out_start; + + if (COMPRESSED_SIZE_MAX - coder->compressed_size < out_used) + return LZMA_DATA_ERROR; + + coder->compressed_size += out_used; + + // No need to check for overflow because we have already + // checked it at the beginning of this function. + coder->uncompressed_size += in_used; + + lzma_check_update(&coder->check, coder->block->check, + in + in_start, in_used); + + if (ret != LZMA_STREAM_END || action == LZMA_SYNC_FLUSH) + return ret; + + assert(*in_pos == in_size); + assert(action == LZMA_FINISH); + + // Copy the values into coder->block. The caller + // may use this information to construct Index. + coder->block->compressed_size = coder->compressed_size; + coder->block->uncompressed_size = coder->uncompressed_size; + + coder->sequence = SEQ_PADDING; + } + + // Fall through + + case SEQ_PADDING: + // Pad Compressed Data to a multiple of four bytes. We can + // use coder->compressed_size for this since we don't need + // it for anything else anymore. + while (coder->compressed_size & 3) { + if (*out_pos >= out_size) + return LZMA_OK; + + out[*out_pos] = 0x00; + ++*out_pos; + ++coder->compressed_size; + } + + if (coder->block->check == LZMA_CHECK_NONE) + return LZMA_STREAM_END; + + lzma_check_finish(&coder->check, coder->block->check); + + coder->sequence = SEQ_CHECK; + + // Fall through + + case SEQ_CHECK: { + const size_t check_size = lzma_check_size(coder->block->check); + lzma_bufcpy(coder->check.buffer.u8, &coder->pos, check_size, + out, out_pos, out_size); + if (coder->pos < check_size) + return LZMA_OK; + + memcpy(coder->block->raw_check, coder->check.buffer.u8, + check_size); + return LZMA_STREAM_END; + } + } + + return LZMA_PROG_ERROR; +} + + +static void +block_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_block_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +block_encoder_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters lzma_attribute((__unused__)), + const lzma_filter *reversed_filters) +{ + lzma_block_coder *coder = coder_ptr; + + if (coder->sequence != SEQ_CODE) + return LZMA_PROG_ERROR; + + return lzma_next_filter_update( + &coder->next, allocator, reversed_filters); +} + + +extern lzma_ret +lzma_block_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + lzma_block *block) +{ + lzma_next_coder_init(&lzma_block_encoder_init, next, allocator); + + if (block == NULL) + return LZMA_PROG_ERROR; + + // The contents of the structure may depend on the version so + // check the version first. + if (block->version > 1) + return LZMA_OPTIONS_ERROR; + + // If the Check ID is not supported, we cannot calculate the check and + // thus not create a proper Block. + if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX) + return LZMA_PROG_ERROR; + + if (!lzma_check_is_supported(block->check)) + return LZMA_UNSUPPORTED_CHECK; + + // Allocate and initialize *next->coder if needed. + lzma_block_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_block_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &block_encode; + next->end = &block_encoder_end; + next->update = &block_encoder_update; + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Basic initializations + coder->sequence = SEQ_CODE; + coder->block = block; + coder->compressed_size = 0; + coder->uncompressed_size = 0; + coder->pos = 0; + + // Initialize the check + lzma_check_init(&coder->check, block->check); + + // Initialize the requested filters. + return lzma_raw_encoder_init(&coder->next, allocator, block->filters); +} + + +extern LZMA_API(lzma_ret) +lzma_block_encoder(lzma_stream *strm, lzma_block *block) +{ + lzma_next_strm_init(lzma_block_encoder_init, strm, block); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/block_encoder.h b/src/liblzma/common/block_encoder.h new file mode 100644 index 0000000..bd97c18 --- /dev/null +++ b/src/liblzma/common/block_encoder.h @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_encoder.h +/// \brief Encodes .xz Blocks +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_BLOCK_ENCODER_H +#define LZMA_BLOCK_ENCODER_H + +#include "common.h" + + +/// \brief Biggest Compressed Size value that the Block encoder supports +/// +/// The maximum size of a single Block is limited by the maximum size of +/// a Stream, which in theory is 2^63 - 3 bytes (i.e. LZMA_VLI_MAX - 3). +/// While the size is really big and no one should hit it in practice, we +/// take it into account in some places anyway to catch some errors e.g. if +/// application passes insanely big value to some function. +/// +/// We could take into account the headers etc. to determine the exact +/// maximum size of the Compressed Data field, but the complexity would give +/// us nothing useful. Instead, limit the size of Compressed Data so that +/// even with biggest possible Block Header and Check fields the total +/// encoded size of the Block stays as a valid VLI. This doesn't guarantee +/// that the size of the Stream doesn't grow too big, but that problem is +/// taken care outside the Block handling code. +/// +/// ~LZMA_VLI_C(3) is to guarantee that if we need padding at the end of +/// the Compressed Data field, it will still stay in the proper limit. +/// +/// This constant is in this file because it is needed in both +/// block_encoder.c and block_buffer_encoder.c. +#define COMPRESSED_SIZE_MAX ((LZMA_VLI_MAX - LZMA_BLOCK_HEADER_SIZE_MAX \ + - LZMA_CHECK_SIZE_MAX) & ~LZMA_VLI_C(3)) + + +extern lzma_ret lzma_block_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, lzma_block *block); + +#endif diff --git a/src/liblzma/common/block_header_decoder.c b/src/liblzma/common/block_header_decoder.c new file mode 100644 index 0000000..c4935dc --- /dev/null +++ b/src/liblzma/common/block_header_decoder.c @@ -0,0 +1,115 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_header_decoder.c +/// \brief Decodes Block Header from .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "check.h" + + +extern LZMA_API(lzma_ret) +lzma_block_header_decode(lzma_block *block, + const lzma_allocator *allocator, const uint8_t *in) +{ + // NOTE: We consider the header to be corrupt not only when the + // CRC32 doesn't match, but also when variable-length integers + // are invalid or over 63 bits, or if the header is too small + // to contain the claimed information. + + // Catch unexpected NULL pointers. + if (block == NULL || block->filters == NULL || in == NULL) + return LZMA_PROG_ERROR; + + // Initialize the filter options array. This way the caller can + // safely free() the options even if an error occurs in this function. + for (size_t i = 0; i <= LZMA_FILTERS_MAX; ++i) { + block->filters[i].id = LZMA_VLI_UNKNOWN; + block->filters[i].options = NULL; + } + + // Versions 0 and 1 are supported. If a newer version was specified, + // we need to downgrade it. + if (block->version > 1) + block->version = 1; + + // This isn't a Block Header option, but since the decompressor will + // read it if version >= 1, it's better to initialize it here than + // to expect the caller to do it since in almost all cases this + // should be false. + block->ignore_check = false; + + // Validate Block Header Size and Check type. The caller must have + // already set these, so it is a programming error if this test fails. + if (lzma_block_header_size_decode(in[0]) != block->header_size + || (unsigned int)(block->check) > LZMA_CHECK_ID_MAX) + return LZMA_PROG_ERROR; + + // Exclude the CRC32 field. + const size_t in_size = block->header_size - 4; + + // Verify CRC32 + if (lzma_crc32(in, in_size, 0) != read32le(in + in_size)) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + return LZMA_DATA_ERROR; +#endif + } + + // Check for unsupported flags. + if (in[1] & 0x3C) + return LZMA_OPTIONS_ERROR; + + // Start after the Block Header Size and Block Flags fields. + size_t in_pos = 2; + + // Compressed Size + if (in[1] & 0x40) { + return_if_error(lzma_vli_decode(&block->compressed_size, + NULL, in, &in_pos, in_size)); + + // Validate Compressed Size. This checks that it isn't zero + // and that the total size of the Block is a valid VLI. + if (lzma_block_unpadded_size(block) == 0) + return LZMA_DATA_ERROR; + } else { + block->compressed_size = LZMA_VLI_UNKNOWN; + } + + // Uncompressed Size + if (in[1] & 0x80) + return_if_error(lzma_vli_decode(&block->uncompressed_size, + NULL, in, &in_pos, in_size)); + else + block->uncompressed_size = LZMA_VLI_UNKNOWN; + + // Filter Flags + const size_t filter_count = (in[1] & 3U) + 1; + for (size_t i = 0; i < filter_count; ++i) { + const lzma_ret ret = lzma_filter_flags_decode( + &block->filters[i], allocator, + in, &in_pos, in_size); + if (ret != LZMA_OK) { + lzma_filters_free(block->filters, allocator); + return ret; + } + } + + // Padding + while (in_pos < in_size) { + if (in[in_pos++] != 0x00) { + lzma_filters_free(block->filters, allocator); + + // Possibly some new field present so use + // LZMA_OPTIONS_ERROR instead of LZMA_DATA_ERROR. + return LZMA_OPTIONS_ERROR; + } + } + + return LZMA_OK; +} diff --git a/src/liblzma/common/block_header_encoder.c b/src/liblzma/common/block_header_encoder.c new file mode 100644 index 0000000..160425d --- /dev/null +++ b/src/liblzma/common/block_header_encoder.c @@ -0,0 +1,132 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_header_encoder.c +/// \brief Encodes Block Header for .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "check.h" + + +extern LZMA_API(lzma_ret) +lzma_block_header_size(lzma_block *block) +{ + if (block->version > 1) + return LZMA_OPTIONS_ERROR; + + // Block Header Size + Block Flags + CRC32. + uint32_t size = 1 + 1 + 4; + + // Compressed Size + if (block->compressed_size != LZMA_VLI_UNKNOWN) { + const uint32_t add = lzma_vli_size(block->compressed_size); + if (add == 0 || block->compressed_size == 0) + return LZMA_PROG_ERROR; + + size += add; + } + + // Uncompressed Size + if (block->uncompressed_size != LZMA_VLI_UNKNOWN) { + const uint32_t add = lzma_vli_size(block->uncompressed_size); + if (add == 0) + return LZMA_PROG_ERROR; + + size += add; + } + + // List of Filter Flags + if (block->filters == NULL || block->filters[0].id == LZMA_VLI_UNKNOWN) + return LZMA_PROG_ERROR; + + for (size_t i = 0; block->filters[i].id != LZMA_VLI_UNKNOWN; ++i) { + // Don't allow too many filters. + if (i == LZMA_FILTERS_MAX) + return LZMA_PROG_ERROR; + + uint32_t add; + return_if_error(lzma_filter_flags_size(&add, + block->filters + i)); + + size += add; + } + + // Pad to a multiple of four bytes. + block->header_size = (size + 3) & ~UINT32_C(3); + + // NOTE: We don't verify that the encoded size of the Block stays + // within limits. This is because it is possible that we are called + // with exaggerated Compressed Size (e.g. LZMA_VLI_MAX) to reserve + // space for Block Header, and later called again with lower, + // real values. + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_block_header_encode(const lzma_block *block, uint8_t *out) +{ + // Validate everything but filters. + if (lzma_block_unpadded_size(block) == 0 + || !lzma_vli_is_valid(block->uncompressed_size)) + return LZMA_PROG_ERROR; + + // Indicate the size of the buffer _excluding_ the CRC32 field. + const size_t out_size = block->header_size - 4; + + // Store the Block Header Size. + out[0] = out_size / 4; + + // We write Block Flags in pieces. + out[1] = 0x00; + size_t out_pos = 2; + + // Compressed Size + if (block->compressed_size != LZMA_VLI_UNKNOWN) { + return_if_error(lzma_vli_encode(block->compressed_size, NULL, + out, &out_pos, out_size)); + + out[1] |= 0x40; + } + + // Uncompressed Size + if (block->uncompressed_size != LZMA_VLI_UNKNOWN) { + return_if_error(lzma_vli_encode(block->uncompressed_size, NULL, + out, &out_pos, out_size)); + + out[1] |= 0x80; + } + + // Filter Flags + if (block->filters == NULL || block->filters[0].id == LZMA_VLI_UNKNOWN) + return LZMA_PROG_ERROR; + + size_t filter_count = 0; + do { + // There can be a maximum of four filters. + if (filter_count == LZMA_FILTERS_MAX) + return LZMA_PROG_ERROR; + + return_if_error(lzma_filter_flags_encode( + block->filters + filter_count, + out, &out_pos, out_size)); + + } while (block->filters[++filter_count].id != LZMA_VLI_UNKNOWN); + + out[1] |= filter_count - 1; + + // Padding + memzero(out + out_pos, out_size - out_pos); + + // CRC32 + write32le(out + out_size, lzma_crc32(out, out_size, 0)); + + return LZMA_OK; +} diff --git a/src/liblzma/common/block_util.c b/src/liblzma/common/block_util.c new file mode 100644 index 0000000..acb3111 --- /dev/null +++ b/src/liblzma/common/block_util.c @@ -0,0 +1,90 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file block_util.c +/// \brief Utility functions to handle lzma_block +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "index.h" + + +extern LZMA_API(lzma_ret) +lzma_block_compressed_size(lzma_block *block, lzma_vli unpadded_size) +{ + // Validate everything but Uncompressed Size and filters. + if (lzma_block_unpadded_size(block) == 0) + return LZMA_PROG_ERROR; + + const uint32_t container_size = block->header_size + + lzma_check_size(block->check); + + // Validate that Compressed Size will be greater than zero. + if (unpadded_size <= container_size) + return LZMA_DATA_ERROR; + + // Calculate what Compressed Size is supposed to be. + // If Compressed Size was present in Block Header, + // compare that the new value matches it. + const lzma_vli compressed_size = unpadded_size - container_size; + if (block->compressed_size != LZMA_VLI_UNKNOWN + && block->compressed_size != compressed_size) + return LZMA_DATA_ERROR; + + block->compressed_size = compressed_size; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_vli) +lzma_block_unpadded_size(const lzma_block *block) +{ + // Validate the values that we are interested in i.e. all but + // Uncompressed Size and the filters. + // + // NOTE: This function is used for validation too, so it is + // essential that these checks are always done even if + // Compressed Size is unknown. + if (block == NULL || block->version > 1 + || block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN + || block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX + || (block->header_size & 3) + || !lzma_vli_is_valid(block->compressed_size) + || block->compressed_size == 0 + || (unsigned int)(block->check) > LZMA_CHECK_ID_MAX) + return 0; + + // If Compressed Size is unknown, return that we cannot know + // size of the Block either. + if (block->compressed_size == LZMA_VLI_UNKNOWN) + return LZMA_VLI_UNKNOWN; + + // Calculate Unpadded Size and validate it. + const lzma_vli unpadded_size = block->compressed_size + + block->header_size + + lzma_check_size(block->check); + + assert(unpadded_size >= UNPADDED_SIZE_MIN); + if (unpadded_size > UNPADDED_SIZE_MAX) + return 0; + + return unpadded_size; +} + + +extern LZMA_API(lzma_vli) +lzma_block_total_size(const lzma_block *block) +{ + lzma_vli unpadded_size = lzma_block_unpadded_size(block); + + if (unpadded_size != LZMA_VLI_UNKNOWN) + unpadded_size = vli_ceil4(unpadded_size); + + return unpadded_size; +} diff --git a/src/liblzma/common/common.c b/src/liblzma/common/common.c new file mode 100644 index 0000000..a708fdf --- /dev/null +++ b/src/liblzma/common/common.c @@ -0,0 +1,471 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file common.c +/// \brief Common functions needed in many places in liblzma +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +///////////// +// Version // +///////////// + +extern LZMA_API(uint32_t) +lzma_version_number(void) +{ + return LZMA_VERSION; +} + + +extern LZMA_API(const char *) +lzma_version_string(void) +{ + return LZMA_VERSION_STRING; +} + + +/////////////////////// +// Memory allocation // +/////////////////////// + +extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1) +lzma_alloc(size_t size, const lzma_allocator *allocator) +{ + // Some malloc() variants return NULL if called with size == 0. + if (size == 0) + size = 1; + + void *ptr; + + if (allocator != NULL && allocator->alloc != NULL) + ptr = allocator->alloc(allocator->opaque, 1, size); + else + ptr = malloc(size); + + return ptr; +} + + +extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1) +lzma_alloc_zero(size_t size, const lzma_allocator *allocator) +{ + // Some calloc() variants return NULL if called with size == 0. + if (size == 0) + size = 1; + + void *ptr; + + if (allocator != NULL && allocator->alloc != NULL) { + ptr = allocator->alloc(allocator->opaque, 1, size); + if (ptr != NULL) + memzero(ptr, size); + } else { + ptr = calloc(1, size); + } + + return ptr; +} + + +extern void +lzma_free(void *ptr, const lzma_allocator *allocator) +{ + if (allocator != NULL && allocator->free != NULL) + allocator->free(allocator->opaque, ptr); + else + free(ptr); + + return; +} + + +////////// +// Misc // +////////// + +extern size_t +lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size) +{ + const size_t in_avail = in_size - *in_pos; + const size_t out_avail = out_size - *out_pos; + const size_t copy_size = my_min(in_avail, out_avail); + + // Call memcpy() only if there is something to copy. If there is + // nothing to copy, in or out might be NULL and then the memcpy() + // call would trigger undefined behavior. + if (copy_size > 0) + memcpy(out + *out_pos, in + *in_pos, copy_size); + + *in_pos += copy_size; + *out_pos += copy_size; + + return copy_size; +} + + +extern lzma_ret +lzma_next_filter_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + lzma_next_coder_init(filters[0].init, next, allocator); + next->id = filters[0].id; + return filters[0].init == NULL + ? LZMA_OK : filters[0].init(next, allocator, filters); +} + + +extern lzma_ret +lzma_next_filter_update(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *reversed_filters) +{ + // Check that the application isn't trying to change the Filter ID. + // End of filters is indicated with LZMA_VLI_UNKNOWN in both + // reversed_filters[0].id and next->id. + if (reversed_filters[0].id != next->id) + return LZMA_PROG_ERROR; + + if (reversed_filters[0].id == LZMA_VLI_UNKNOWN) + return LZMA_OK; + + assert(next->update != NULL); + return next->update(next->coder, allocator, NULL, reversed_filters); +} + + +extern void +lzma_next_end(lzma_next_coder *next, const lzma_allocator *allocator) +{ + if (next->init != (uintptr_t)(NULL)) { + // To avoid tiny end functions that simply call + // lzma_free(coder, allocator), we allow leaving next->end + // NULL and call lzma_free() here. + if (next->end != NULL) + next->end(next->coder, allocator); + else + lzma_free(next->coder, allocator); + + // Reset the variables so the we don't accidentally think + // that it is an already initialized coder. + *next = LZMA_NEXT_CODER_INIT; + } + + return; +} + + +////////////////////////////////////// +// External to internal API wrapper // +////////////////////////////////////// + +extern lzma_ret +lzma_strm_init(lzma_stream *strm) +{ + if (strm == NULL) + return LZMA_PROG_ERROR; + + if (strm->internal == NULL) { + strm->internal = lzma_alloc(sizeof(lzma_internal), + strm->allocator); + if (strm->internal == NULL) + return LZMA_MEM_ERROR; + + strm->internal->next = LZMA_NEXT_CODER_INIT; + } + + memzero(strm->internal->supported_actions, + sizeof(strm->internal->supported_actions)); + strm->internal->sequence = ISEQ_RUN; + strm->internal->allow_buf_error = false; + + strm->total_in = 0; + strm->total_out = 0; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_code(lzma_stream *strm, lzma_action action) +{ + // Sanity checks + if ((strm->next_in == NULL && strm->avail_in != 0) + || (strm->next_out == NULL && strm->avail_out != 0) + || strm->internal == NULL + || strm->internal->next.code == NULL + || (unsigned int)(action) > LZMA_ACTION_MAX + || !strm->internal->supported_actions[action]) + return LZMA_PROG_ERROR; + + // Check if unsupported members have been set to non-zero or non-NULL, + // which would indicate that some new feature is wanted. + if (strm->reserved_ptr1 != NULL + || strm->reserved_ptr2 != NULL + || strm->reserved_ptr3 != NULL + || strm->reserved_ptr4 != NULL + || strm->reserved_int2 != 0 + || strm->reserved_int3 != 0 + || strm->reserved_int4 != 0 + || strm->reserved_enum1 != LZMA_RESERVED_ENUM + || strm->reserved_enum2 != LZMA_RESERVED_ENUM) + return LZMA_OPTIONS_ERROR; + + switch (strm->internal->sequence) { + case ISEQ_RUN: + switch (action) { + case LZMA_RUN: + break; + + case LZMA_SYNC_FLUSH: + strm->internal->sequence = ISEQ_SYNC_FLUSH; + break; + + case LZMA_FULL_FLUSH: + strm->internal->sequence = ISEQ_FULL_FLUSH; + break; + + case LZMA_FINISH: + strm->internal->sequence = ISEQ_FINISH; + break; + + case LZMA_FULL_BARRIER: + strm->internal->sequence = ISEQ_FULL_BARRIER; + break; + } + + break; + + case ISEQ_SYNC_FLUSH: + // The same action must be used until we return + // LZMA_STREAM_END, and the amount of input must not change. + if (action != LZMA_SYNC_FLUSH + || strm->internal->avail_in != strm->avail_in) + return LZMA_PROG_ERROR; + + break; + + case ISEQ_FULL_FLUSH: + if (action != LZMA_FULL_FLUSH + || strm->internal->avail_in != strm->avail_in) + return LZMA_PROG_ERROR; + + break; + + case ISEQ_FINISH: + if (action != LZMA_FINISH + || strm->internal->avail_in != strm->avail_in) + return LZMA_PROG_ERROR; + + break; + + case ISEQ_FULL_BARRIER: + if (action != LZMA_FULL_BARRIER + || strm->internal->avail_in != strm->avail_in) + return LZMA_PROG_ERROR; + + break; + + case ISEQ_END: + return LZMA_STREAM_END; + + case ISEQ_ERROR: + default: + return LZMA_PROG_ERROR; + } + + size_t in_pos = 0; + size_t out_pos = 0; + lzma_ret ret = strm->internal->next.code( + strm->internal->next.coder, strm->allocator, + strm->next_in, &in_pos, strm->avail_in, + strm->next_out, &out_pos, strm->avail_out, action); + + strm->next_in += in_pos; + strm->avail_in -= in_pos; + strm->total_in += in_pos; + + strm->next_out += out_pos; + strm->avail_out -= out_pos; + strm->total_out += out_pos; + + strm->internal->avail_in = strm->avail_in; + + switch (ret) { + case LZMA_OK: + // Don't return LZMA_BUF_ERROR when it happens the first time. + // This is to avoid returning LZMA_BUF_ERROR when avail_out + // was zero but still there was no more data left to written + // to next_out. + if (out_pos == 0 && in_pos == 0) { + if (strm->internal->allow_buf_error) + ret = LZMA_BUF_ERROR; + else + strm->internal->allow_buf_error = true; + } else { + strm->internal->allow_buf_error = false; + } + break; + + case LZMA_TIMED_OUT: + strm->internal->allow_buf_error = false; + ret = LZMA_OK; + break; + + case LZMA_SEEK_NEEDED: + strm->internal->allow_buf_error = false; + + // If LZMA_FINISH was used, reset it back to the + // LZMA_RUN-based state so that new input can be supplied + // by the application. + if (strm->internal->sequence == ISEQ_FINISH) + strm->internal->sequence = ISEQ_RUN; + + break; + + case LZMA_STREAM_END: + if (strm->internal->sequence == ISEQ_SYNC_FLUSH + || strm->internal->sequence == ISEQ_FULL_FLUSH + || strm->internal->sequence + == ISEQ_FULL_BARRIER) + strm->internal->sequence = ISEQ_RUN; + else + strm->internal->sequence = ISEQ_END; + + // Fall through + + case LZMA_NO_CHECK: + case LZMA_UNSUPPORTED_CHECK: + case LZMA_GET_CHECK: + case LZMA_MEMLIMIT_ERROR: + // Something else than LZMA_OK, but not a fatal error, + // that is, coding may be continued (except if ISEQ_END). + strm->internal->allow_buf_error = false; + break; + + default: + // All the other errors are fatal; coding cannot be continued. + assert(ret != LZMA_BUF_ERROR); + strm->internal->sequence = ISEQ_ERROR; + break; + } + + return ret; +} + + +extern LZMA_API(void) +lzma_end(lzma_stream *strm) +{ + if (strm != NULL && strm->internal != NULL) { + lzma_next_end(&strm->internal->next, strm->allocator); + lzma_free(strm->internal, strm->allocator); + strm->internal = NULL; + } + + return; +} + + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +// This is for compatibility with binaries linked against liblzma that +// has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7. +LZMA_SYMVER_API("lzma_get_progress@XZ_5.2.2", + void, lzma_get_progress_522)(lzma_stream *strm, + uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow + __attribute__((__alias__("lzma_get_progress_52"))); + +LZMA_SYMVER_API("lzma_get_progress@@XZ_5.2", + void, lzma_get_progress_52)(lzma_stream *strm, + uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow; + +#define lzma_get_progress lzma_get_progress_52 +#endif +extern LZMA_API(void) +lzma_get_progress(lzma_stream *strm, + uint64_t *progress_in, uint64_t *progress_out) +{ + if (strm->internal->next.get_progress != NULL) { + strm->internal->next.get_progress(strm->internal->next.coder, + progress_in, progress_out); + } else { + *progress_in = strm->total_in; + *progress_out = strm->total_out; + } + + return; +} + + +extern LZMA_API(lzma_check) +lzma_get_check(const lzma_stream *strm) +{ + // Return LZMA_CHECK_NONE if we cannot know the check type. + // It's a bug in the application if this happens. + if (strm->internal->next.get_check == NULL) + return LZMA_CHECK_NONE; + + return strm->internal->next.get_check(strm->internal->next.coder); +} + + +extern LZMA_API(uint64_t) +lzma_memusage(const lzma_stream *strm) +{ + uint64_t memusage; + uint64_t old_memlimit; + + if (strm == NULL || strm->internal == NULL + || strm->internal->next.memconfig == NULL + || strm->internal->next.memconfig( + strm->internal->next.coder, + &memusage, &old_memlimit, 0) != LZMA_OK) + return 0; + + return memusage; +} + + +extern LZMA_API(uint64_t) +lzma_memlimit_get(const lzma_stream *strm) +{ + uint64_t old_memlimit; + uint64_t memusage; + + if (strm == NULL || strm->internal == NULL + || strm->internal->next.memconfig == NULL + || strm->internal->next.memconfig( + strm->internal->next.coder, + &memusage, &old_memlimit, 0) != LZMA_OK) + return 0; + + return old_memlimit; +} + + +extern LZMA_API(lzma_ret) +lzma_memlimit_set(lzma_stream *strm, uint64_t new_memlimit) +{ + // Dummy variables to simplify memconfig functions + uint64_t old_memlimit; + uint64_t memusage; + + if (strm == NULL || strm->internal == NULL + || strm->internal->next.memconfig == NULL) + return LZMA_PROG_ERROR; + + // Zero is a special value that cannot be used as an actual limit. + // If 0 was specified, use 1 instead. + if (new_memlimit == 0) + new_memlimit = 1; + + return strm->internal->next.memconfig(strm->internal->next.coder, + &memusage, &old_memlimit, new_memlimit); +} diff --git a/src/liblzma/common/common.h b/src/liblzma/common/common.h new file mode 100644 index 0000000..11fec52 --- /dev/null +++ b/src/liblzma/common/common.h @@ -0,0 +1,385 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file common.h +/// \brief Definitions common to the whole liblzma library +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_COMMON_H +#define LZMA_COMMON_H + +#include "sysdefs.h" +#include "mythread.h" +#include "tuklib_integer.h" + +#if defined(_WIN32) || defined(__CYGWIN__) +# ifdef DLL_EXPORT +# define LZMA_API_EXPORT __declspec(dllexport) +# else +# define LZMA_API_EXPORT +# endif +// Don't use ifdef or defined() below. +#elif HAVE_VISIBILITY +# define LZMA_API_EXPORT __attribute__((__visibility__("default"))) +#else +# define LZMA_API_EXPORT +#endif + +#define LZMA_API(type) LZMA_API_EXPORT type LZMA_API_CALL + +#include "lzma.h" + +// This is for detecting modern GCC and Clang attributes +// like __symver__ in GCC >= 10. +#ifdef __has_attribute +# define lzma_has_attribute(attr) __has_attribute(attr) +#else +# define lzma_has_attribute(attr) 0 +#endif + +// The extra symbol versioning in the C files may only be used when +// building a shared library. If HAVE_SYMBOL_VERSIONS_LINUX is defined +// to 2 then symbol versioning is done only if also PIC is defined. +// By default Libtool defines PIC when building a shared library and +// doesn't define it when building a static library but it can be +// overriden with --with-pic and --without-pic. configure let's rely +// on PIC if neither --with-pic or --without-pic was used. +#if defined(HAVE_SYMBOL_VERSIONS_LINUX) \ + && (HAVE_SYMBOL_VERSIONS_LINUX == 2 && !defined(PIC)) +# undef HAVE_SYMBOL_VERSIONS_LINUX +#endif + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +// To keep link-time optimization (LTO, -flto) working with GCC, +// the __symver__ attribute must be used instead of __asm__(".symver ..."). +// Otherwise the symbol versions may be lost, resulting in broken liblzma +// that has wrong default versions in the exported symbol list! +// The attribute was added in GCC 10; LTO with older GCC is not supported. +// +// To keep -Wmissing-prototypes happy, use LZMA_SYMVER_API only with function +// declarations (including those with __alias__ attribute) and LZMA_API with +// the function definitions. This means a little bit of silly copy-and-paste +// between declarations and definitions though. +// +// As of GCC 12.2, the __symver__ attribute supports only @ and @@ but the +// very convenient @@@ isn't supported (it's supported by GNU assembler +// since 2000). When using @@ instead of @@@, the internal name must not be +// the same as the external name to avoid problems in some situations. This +// is why "#define foo_52 foo" is needed for the default symbol versions. +// +// __has_attribute is supported before GCC 10 and it is supported in Clang 14 +// too (which doesn't support __symver__) so use it to detect if __symver__ +// is available. This should be far more reliable than looking at compiler +// version macros as nowadays especially __GNUC__ is defined by many compilers. +# if lzma_has_attribute(__symver__) +# define LZMA_SYMVER_API(extnamever, type, intname) \ + extern __attribute__((__symver__(extnamever))) \ + LZMA_API(type) intname +# else +# define LZMA_SYMVER_API(extnamever, type, intname) \ + __asm__(".symver " #intname "," extnamever); \ + extern LZMA_API(type) intname +# endif +#endif + +// These allow helping the compiler in some often-executed branches, whose +// result is almost always the same. +#ifdef __GNUC__ +# define likely(expr) __builtin_expect(expr, true) +# define unlikely(expr) __builtin_expect(expr, false) +#else +# define likely(expr) (expr) +# define unlikely(expr) (expr) +#endif + + +/// Size of temporary buffers needed in some filters +#define LZMA_BUFFER_SIZE 4096 + + +/// Maximum number of worker threads within one multithreaded component. +/// The limit exists solely to make it simpler to prevent integer overflows +/// when allocating structures etc. This should be big enough for now... +/// the code won't scale anywhere close to this number anyway. +#define LZMA_THREADS_MAX 16384 + + +/// Starting value for memory usage estimates. Instead of calculating size +/// of _every_ structure and taking into account malloc() overhead etc., we +/// add a base size to all memory usage estimates. It's not very accurate +/// but should be easily good enough. +#define LZMA_MEMUSAGE_BASE (UINT64_C(1) << 15) + +/// Start of internal Filter ID space. These IDs must never be used +/// in Streams. +#define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62) + + +/// Supported flags that can be passed to lzma_stream_decoder(), +/// lzma_auto_decoder(), or lzma_stream_decoder_mt(). +#define LZMA_SUPPORTED_FLAGS \ + ( LZMA_TELL_NO_CHECK \ + | LZMA_TELL_UNSUPPORTED_CHECK \ + | LZMA_TELL_ANY_CHECK \ + | LZMA_IGNORE_CHECK \ + | LZMA_CONCATENATED \ + | LZMA_FAIL_FAST ) + + +/// Largest valid lzma_action value as unsigned integer. +#define LZMA_ACTION_MAX ((unsigned int)(LZMA_FULL_BARRIER)) + + +/// Special return value (lzma_ret) to indicate that a timeout was reached +/// and lzma_code() must not return LZMA_BUF_ERROR. This is converted to +/// LZMA_OK in lzma_code(). +#define LZMA_TIMED_OUT LZMA_RET_INTERNAL1 + +/// Special return value (lzma_ret) for use in stream_decoder_mt.c to +/// indicate Index was detected instead of a Block Header. +#define LZMA_INDEX_DETECTED LZMA_RET_INTERNAL2 + + +typedef struct lzma_next_coder_s lzma_next_coder; + +typedef struct lzma_filter_info_s lzma_filter_info; + + +/// Type of a function used to initialize a filter encoder or decoder +typedef lzma_ret (*lzma_init_function)( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters); + +/// Type of a function to do some kind of coding work (filters, Stream, +/// Block encoders/decoders etc.). Some special coders use don't use both +/// input and output buffers, but for simplicity they still use this same +/// function prototype. +typedef lzma_ret (*lzma_code_function)( + void *coder, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action); + +/// Type of a function to free the memory allocated for the coder +typedef void (*lzma_end_function)( + void *coder, const lzma_allocator *allocator); + + +/// Raw coder validates and converts an array of lzma_filter structures to +/// an array of lzma_filter_info structures. This array is used with +/// lzma_next_filter_init to initialize the filter chain. +struct lzma_filter_info_s { + /// Filter ID. This can be used to share the same initiazation + /// function *and* data structures with different Filter IDs + /// (LZMA_FILTER_LZMA1EXT does it), and also by the encoder + /// with lzma_filters_update() if filter chain is updated + /// in the middle of a raw stream or Block (LZMA_SYNC_FLUSH). + lzma_vli id; + + /// Pointer to function used to initialize the filter. + /// This is NULL to indicate end of array. + lzma_init_function init; + + /// Pointer to filter's options structure + void *options; +}; + + +/// Hold data and function pointers of the next filter in the chain. +struct lzma_next_coder_s { + /// Pointer to coder-specific data + void *coder; + + /// Filter ID. This is LZMA_VLI_UNKNOWN when this structure doesn't + /// point to a filter coder. + lzma_vli id; + + /// "Pointer" to init function. This is never called here. + /// We need only to detect if we are initializing a coder + /// that was allocated earlier. See lzma_next_coder_init and + /// lzma_next_strm_init macros in this file. + uintptr_t init; + + /// Pointer to function to do the actual coding + lzma_code_function code; + + /// Pointer to function to free lzma_next_coder.coder. This can + /// be NULL; in that case, lzma_free is called to free + /// lzma_next_coder.coder. + lzma_end_function end; + + /// Pointer to a function to get progress information. If this is NULL, + /// lzma_stream.total_in and .total_out are used instead. + void (*get_progress)(void *coder, + uint64_t *progress_in, uint64_t *progress_out); + + /// Pointer to function to return the type of the integrity check. + /// Most coders won't support this. + lzma_check (*get_check)(const void *coder); + + /// Pointer to function to get and/or change the memory usage limit. + /// If new_memlimit == 0, the limit is not changed. + lzma_ret (*memconfig)(void *coder, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit); + + /// Update the filter-specific options or the whole filter chain + /// in the encoder. + lzma_ret (*update)(void *coder, const lzma_allocator *allocator, + const lzma_filter *filters, + const lzma_filter *reversed_filters); + + /// Set how many bytes of output this coder may produce at maximum. + /// On success LZMA_OK must be returned. + /// If the filter chain as a whole cannot support this feature, + /// this must return LZMA_OPTIONS_ERROR. + /// If no input has been given to the coder and the requested limit + /// is too small, this must return LZMA_BUF_ERROR. If input has been + /// seen, LZMA_OK is allowed too. + lzma_ret (*set_out_limit)(void *coder, uint64_t *uncomp_size, + uint64_t out_limit); +}; + + +/// Macro to initialize lzma_next_coder structure +#define LZMA_NEXT_CODER_INIT \ + (lzma_next_coder){ \ + .coder = NULL, \ + .init = (uintptr_t)(NULL), \ + .id = LZMA_VLI_UNKNOWN, \ + .code = NULL, \ + .end = NULL, \ + .get_progress = NULL, \ + .get_check = NULL, \ + .memconfig = NULL, \ + .update = NULL, \ + .set_out_limit = NULL, \ + } + + +/// Internal data for lzma_strm_init, lzma_code, and lzma_end. A pointer to +/// this is stored in lzma_stream. +struct lzma_internal_s { + /// The actual coder that should do something useful + lzma_next_coder next; + + /// Track the state of the coder. This is used to validate arguments + /// so that the actual coders can rely on e.g. that LZMA_SYNC_FLUSH + /// is used on every call to lzma_code until next.code has returned + /// LZMA_STREAM_END. + enum { + ISEQ_RUN, + ISEQ_SYNC_FLUSH, + ISEQ_FULL_FLUSH, + ISEQ_FINISH, + ISEQ_FULL_BARRIER, + ISEQ_END, + ISEQ_ERROR, + } sequence; + + /// A copy of lzma_stream avail_in. This is used to verify that the + /// amount of input doesn't change once e.g. LZMA_FINISH has been + /// used. + size_t avail_in; + + /// Indicates which lzma_action values are allowed by next.code. + bool supported_actions[LZMA_ACTION_MAX + 1]; + + /// If true, lzma_code will return LZMA_BUF_ERROR if no progress was + /// made (no input consumed and no output produced by next.code). + bool allow_buf_error; +}; + + +/// Allocates memory +extern void *lzma_alloc(size_t size, const lzma_allocator *allocator) + lzma_attribute((__malloc__)) lzma_attr_alloc_size(1); + +/// Allocates memory and zeroes it (like calloc()). This can be faster +/// than lzma_alloc() + memzero() while being backward compatible with +/// custom allocators. +extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1) + lzma_alloc_zero(size_t size, const lzma_allocator *allocator); + +/// Frees memory +extern void lzma_free(void *ptr, const lzma_allocator *allocator); + + +/// Allocates strm->internal if it is NULL, and initializes *strm and +/// strm->internal. This function is only called via lzma_next_strm_init macro. +extern lzma_ret lzma_strm_init(lzma_stream *strm); + +/// Initializes the next filter in the chain, if any. This takes care of +/// freeing the memory of previously initialized filter if it is different +/// than the filter being initialized now. This way the actual filter +/// initialization functions don't need to use lzma_next_coder_init macro. +extern lzma_ret lzma_next_filter_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +/// Update the next filter in the chain, if any. This checks that +/// the application is not trying to change the Filter IDs. +extern lzma_ret lzma_next_filter_update( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *reversed_filters); + +/// Frees the memory allocated for next->coder either using next->end or, +/// if next->end is NULL, using lzma_free. +extern void lzma_next_end(lzma_next_coder *next, + const lzma_allocator *allocator); + + +/// Copy as much data as possible from in[] to out[] and update *in_pos +/// and *out_pos accordingly. Returns the number of bytes copied. +extern size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size); + + +/// \brief Return if expression doesn't evaluate to LZMA_OK +/// +/// There are several situations where we want to return immediately +/// with the value of expr if it isn't LZMA_OK. This macro shortens +/// the code a little. +#define return_if_error(expr) \ +do { \ + const lzma_ret ret_ = (expr); \ + if (ret_ != LZMA_OK) \ + return ret_; \ +} while (0) + + +/// If next isn't already initialized, free the previous coder. Then mark +/// that next is _possibly_ initialized for the coder using this macro. +/// "Possibly" means that if e.g. allocation of next->coder fails, the +/// structure isn't actually initialized for this coder, but leaving +/// next->init to func is still OK. +#define lzma_next_coder_init(func, next, allocator) \ +do { \ + if ((uintptr_t)(func) != (next)->init) \ + lzma_next_end(next, allocator); \ + (next)->init = (uintptr_t)(func); \ +} while (0) + + +/// Initializes lzma_strm and calls func() to initialize strm->internal->next. +/// (The function being called will use lzma_next_coder_init()). If +/// initialization fails, memory that wasn't freed by func() is freed +/// along strm->internal. +#define lzma_next_strm_init(func, strm, ...) \ +do { \ + return_if_error(lzma_strm_init(strm)); \ + const lzma_ret ret_ = func(&(strm)->internal->next, \ + (strm)->allocator, __VA_ARGS__); \ + if (ret_ != LZMA_OK) { \ + lzma_end(strm); \ + return ret_; \ + } \ +} while (0) + +#endif diff --git a/src/liblzma/common/easy_buffer_encoder.c b/src/liblzma/common/easy_buffer_encoder.c new file mode 100644 index 0000000..48eb56f --- /dev/null +++ b/src/liblzma/common/easy_buffer_encoder.c @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_buffer_encoder.c +/// \brief Easy single-call .xz Stream encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "easy_preset.h" + + +extern LZMA_API(lzma_ret) +lzma_easy_buffer_encode(uint32_t preset, lzma_check check, + const lzma_allocator *allocator, const uint8_t *in, + size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) +{ + lzma_options_easy opt_easy; + if (lzma_easy_preset(&opt_easy, preset)) + return LZMA_OPTIONS_ERROR; + + return lzma_stream_buffer_encode(opt_easy.filters, check, + allocator, in, in_size, out, out_pos, out_size); +} diff --git a/src/liblzma/common/easy_decoder_memusage.c b/src/liblzma/common/easy_decoder_memusage.c new file mode 100644 index 0000000..20bcd5b --- /dev/null +++ b/src/liblzma/common/easy_decoder_memusage.c @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_decoder_memusage.c +/// \brief Decoder memory usage calculation to match easy encoder presets +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "easy_preset.h" + + +extern LZMA_API(uint64_t) +lzma_easy_decoder_memusage(uint32_t preset) +{ + lzma_options_easy opt_easy; + if (lzma_easy_preset(&opt_easy, preset)) + return UINT32_MAX; + + return lzma_raw_decoder_memusage(opt_easy.filters); +} diff --git a/src/liblzma/common/easy_encoder.c b/src/liblzma/common/easy_encoder.c new file mode 100644 index 0000000..5cb492d --- /dev/null +++ b/src/liblzma/common/easy_encoder.c @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_encoder.c +/// \brief Easy .xz Stream encoder initialization +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "easy_preset.h" + + +extern LZMA_API(lzma_ret) +lzma_easy_encoder(lzma_stream *strm, uint32_t preset, lzma_check check) +{ + lzma_options_easy opt_easy; + if (lzma_easy_preset(&opt_easy, preset)) + return LZMA_OPTIONS_ERROR; + + return lzma_stream_encoder(strm, opt_easy.filters, check); +} diff --git a/src/liblzma/common/easy_encoder_memusage.c b/src/liblzma/common/easy_encoder_memusage.c new file mode 100644 index 0000000..e910575 --- /dev/null +++ b/src/liblzma/common/easy_encoder_memusage.c @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_encoder_memusage.c +/// \brief Easy .xz Stream encoder memory usage calculation +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "easy_preset.h" + + +extern LZMA_API(uint64_t) +lzma_easy_encoder_memusage(uint32_t preset) +{ + lzma_options_easy opt_easy; + if (lzma_easy_preset(&opt_easy, preset)) + return UINT32_MAX; + + return lzma_raw_encoder_memusage(opt_easy.filters); +} diff --git a/src/liblzma/common/easy_preset.c b/src/liblzma/common/easy_preset.c new file mode 100644 index 0000000..2f98598 --- /dev/null +++ b/src/liblzma/common/easy_preset.c @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_preset.c +/// \brief Preset handling for easy encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "easy_preset.h" + + +extern bool +lzma_easy_preset(lzma_options_easy *opt_easy, uint32_t preset) +{ + if (lzma_lzma_preset(&opt_easy->opt_lzma, preset)) + return true; + + opt_easy->filters[0].id = LZMA_FILTER_LZMA2; + opt_easy->filters[0].options = &opt_easy->opt_lzma; + opt_easy->filters[1].id = LZMA_VLI_UNKNOWN; + + return false; +} diff --git a/src/liblzma/common/easy_preset.h b/src/liblzma/common/easy_preset.h new file mode 100644 index 0000000..382ade8 --- /dev/null +++ b/src/liblzma/common/easy_preset.h @@ -0,0 +1,32 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file easy_preset.h +/// \brief Preset handling for easy encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +typedef struct { + /// We need to keep the filters array available in case + /// LZMA_FULL_FLUSH is used. + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + + /// Options for LZMA2 + lzma_options_lzma opt_lzma; + + // Options for more filters can be added later, so this struct + // is not ready to be put into the public API. + +} lzma_options_easy; + + +/// Set *easy to the settings given by the preset. Returns true on error, +/// false on success. +extern bool lzma_easy_preset(lzma_options_easy *easy, uint32_t preset); diff --git a/src/liblzma/common/file_info.c b/src/liblzma/common/file_info.c new file mode 100644 index 0000000..a6b7e14 --- /dev/null +++ b/src/liblzma/common/file_info.c @@ -0,0 +1,855 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file file_info.c +/// \brief Decode .xz file information into a lzma_index structure +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "index_decoder.h" + + +typedef struct { + enum { + SEQ_MAGIC_BYTES, + SEQ_PADDING_SEEK, + SEQ_PADDING_DECODE, + SEQ_FOOTER, + SEQ_INDEX_INIT, + SEQ_INDEX_DECODE, + SEQ_HEADER_DECODE, + SEQ_HEADER_COMPARE, + } sequence; + + /// Absolute position of in[*in_pos] in the file. All code that + /// modifies *in_pos also updates this. seek_to_pos() needs this + /// to determine if we need to request the application to seek for + /// us or if we can do the seeking internally by adjusting *in_pos. + uint64_t file_cur_pos; + + /// This refers to absolute positions of interesting parts of the + /// input file. Sometimes it points to the *beginning* of a specific + /// field and sometimes to the *end* of a field. The current target + /// position at each moment is explained in the comments. + uint64_t file_target_pos; + + /// Size of the .xz file (from the application). + uint64_t file_size; + + /// Index decoder + lzma_next_coder index_decoder; + + /// Number of bytes remaining in the Index field that is currently + /// being decoded. + lzma_vli index_remaining; + + /// The Index decoder will store the decoded Index in this pointer. + lzma_index *this_index; + + /// Amount of Stream Padding in the current Stream. + lzma_vli stream_padding; + + /// The final combined index is collected here. + lzma_index *combined_index; + + /// Pointer from the application where to store the index information + /// after successful decoding. + lzma_index **dest_index; + + /// Pointer to lzma_stream.seek_pos to be used when returning + /// LZMA_SEEK_NEEDED. This is set by seek_to_pos() when needed. + uint64_t *external_seek_pos; + + /// Memory usage limit + uint64_t memlimit; + + /// Stream Flags from the very beginning of the file. + lzma_stream_flags first_header_flags; + + /// Stream Flags from Stream Header of the current Stream. + lzma_stream_flags header_flags; + + /// Stream Flags from Stream Footer of the current Stream. + lzma_stream_flags footer_flags; + + size_t temp_pos; + size_t temp_size; + uint8_t temp[8192]; + +} lzma_file_info_coder; + + +/// Copies data from in[*in_pos] into coder->temp until +/// coder->temp_pos == coder->temp_size. This also keeps coder->file_cur_pos +/// in sync with *in_pos. Returns true if more input is needed. +static bool +fill_temp(lzma_file_info_coder *coder, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size) +{ + coder->file_cur_pos += lzma_bufcpy(in, in_pos, in_size, + coder->temp, &coder->temp_pos, coder->temp_size); + return coder->temp_pos < coder->temp_size; +} + + +/// Seeks to the absolute file position specified by target_pos. +/// This tries to do the seeking by only modifying *in_pos, if possible. +/// The main benefit of this is that if one passes the whole file at once +/// to lzma_code(), the decoder will never need to return LZMA_SEEK_NEEDED +/// as all the seeking can be done by adjusting *in_pos in this function. +/// +/// Returns true if an external seek is needed and the caller must return +/// LZMA_SEEK_NEEDED. +static bool +seek_to_pos(lzma_file_info_coder *coder, uint64_t target_pos, + size_t in_start, size_t *in_pos, size_t in_size) +{ + // The input buffer doesn't extend beyond the end of the file. + // This has been checked by file_info_decode() already. + assert(coder->file_size - coder->file_cur_pos >= in_size - *in_pos); + + const uint64_t pos_min = coder->file_cur_pos - (*in_pos - in_start); + const uint64_t pos_max = coder->file_cur_pos + (in_size - *in_pos); + + bool external_seek_needed; + + if (target_pos >= pos_min && target_pos <= pos_max) { + // The requested position is available in the current input + // buffer or right after it. That is, in a corner case we + // end up setting *in_pos == in_size and thus will immediately + // need new input bytes from the application. + *in_pos += (size_t)(target_pos - coder->file_cur_pos); + external_seek_needed = false; + } else { + // Ask the application to seek the input file. + *coder->external_seek_pos = target_pos; + external_seek_needed = true; + + // Mark the whole input buffer as used. This way + // lzma_stream.total_in will have a better estimate + // of the amount of data read. It still won't be perfect + // as the value will depend on the input buffer size that + // the application uses, but it should be good enough for + // those few who want an estimate. + *in_pos = in_size; + } + + // After seeking (internal or external) the current position + // will match the requested target position. + coder->file_cur_pos = target_pos; + + return external_seek_needed; +} + + +/// The caller sets coder->file_target_pos so that it points to the *end* +/// of the desired file position. This function then determines how far +/// backwards from that position we can seek. After seeking fill_temp() +/// can be used to read data into coder->temp. When fill_temp() has finished, +/// coder->temp[coder->temp_size] will match coder->file_target_pos. +/// +/// This also validates that coder->target_file_pos is sane in sense that +/// we aren't trying to seek too far backwards (too close or beyond the +/// beginning of the file). +static lzma_ret +reverse_seek(lzma_file_info_coder *coder, + size_t in_start, size_t *in_pos, size_t in_size) +{ + // Check that there is enough data before the target position + // to contain at least Stream Header and Stream Footer. If there + // isn't, the file cannot be valid. + if (coder->file_target_pos < 2 * LZMA_STREAM_HEADER_SIZE) + return LZMA_DATA_ERROR; + + coder->temp_pos = 0; + + // The Stream Header at the very beginning of the file gets handled + // specially in SEQ_MAGIC_BYTES and thus we will never need to seek + // there. By not seeking to the first LZMA_STREAM_HEADER_SIZE bytes + // we avoid a useless external seek after SEQ_MAGIC_BYTES if the + // application uses an extremely small input buffer and the input + // file is very small. + if (coder->file_target_pos - LZMA_STREAM_HEADER_SIZE + < sizeof(coder->temp)) + coder->temp_size = (size_t)(coder->file_target_pos + - LZMA_STREAM_HEADER_SIZE); + else + coder->temp_size = sizeof(coder->temp); + + // The above if-statements guarantee this. This is important because + // the Stream Header/Footer decoders assume that there's at least + // LZMA_STREAM_HEADER_SIZE bytes in coder->temp. + assert(coder->temp_size >= LZMA_STREAM_HEADER_SIZE); + + if (seek_to_pos(coder, coder->file_target_pos - coder->temp_size, + in_start, in_pos, in_size)) + return LZMA_SEEK_NEEDED; + + return LZMA_OK; +} + + +/// Gets the number of zero-bytes at the end of the buffer. +static size_t +get_padding_size(const uint8_t *buf, size_t buf_size) +{ + size_t padding = 0; + while (buf_size > 0 && buf[--buf_size] == 0x00) + ++padding; + + return padding; +} + + +/// With the Stream Header at the very beginning of the file, LZMA_FORMAT_ERROR +/// is used to tell the application that Magic Bytes didn't match. In other +/// Stream Header/Footer fields (in the middle/end of the file) it could be +/// a bit confusing to return LZMA_FORMAT_ERROR as we already know that there +/// is a valid Stream Header at the beginning of the file. For those cases +/// this function is used to convert LZMA_FORMAT_ERROR to LZMA_DATA_ERROR. +static lzma_ret +hide_format_error(lzma_ret ret) +{ + if (ret == LZMA_FORMAT_ERROR) + ret = LZMA_DATA_ERROR; + + return ret; +} + + +/// Calls the Index decoder and updates coder->index_remaining. +/// This is a separate function because the input can be either directly +/// from the application or from coder->temp. +static lzma_ret +decode_index(lzma_file_info_coder *coder, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, bool update_file_cur_pos) +{ + const size_t in_start = *in_pos; + + const lzma_ret ret = coder->index_decoder.code( + coder->index_decoder.coder, + allocator, in, in_pos, in_size, + NULL, NULL, 0, LZMA_RUN); + + coder->index_remaining -= *in_pos - in_start; + + if (update_file_cur_pos) + coder->file_cur_pos += *in_pos - in_start; + + return ret; +} + + +static lzma_ret +file_info_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, + uint8_t *restrict out lzma_attribute((__unused__)), + size_t *restrict out_pos lzma_attribute((__unused__)), + size_t out_size lzma_attribute((__unused__)), + lzma_action action lzma_attribute((__unused__))) +{ + lzma_file_info_coder *coder = coder_ptr; + const size_t in_start = *in_pos; + + // If the caller provides input past the end of the file, trim + // the extra bytes from the buffer so that we won't read too far. + assert(coder->file_size >= coder->file_cur_pos); + if (coder->file_size - coder->file_cur_pos < in_size - in_start) + in_size = in_start + + (size_t)(coder->file_size - coder->file_cur_pos); + + while (true) + switch (coder->sequence) { + case SEQ_MAGIC_BYTES: + // Decode the Stream Header at the beginning of the file + // first to check if the Magic Bytes match. The flags + // are stored in coder->first_header_flags so that we + // don't need to seek to it again. + // + // Check that the file is big enough to contain at least + // Stream Header. + if (coder->file_size < LZMA_STREAM_HEADER_SIZE) + return LZMA_FORMAT_ERROR; + + // Read the Stream Header field into coder->temp. + if (fill_temp(coder, in, in_pos, in_size)) + return LZMA_OK; + + // This is the only Stream Header/Footer decoding where we + // want to return LZMA_FORMAT_ERROR if the Magic Bytes don't + // match. Elsewhere it will be converted to LZMA_DATA_ERROR. + return_if_error(lzma_stream_header_decode( + &coder->first_header_flags, coder->temp)); + + // Now that we know that the Magic Bytes match, check the + // file size. It's better to do this here after checking the + // Magic Bytes since this way we can give LZMA_FORMAT_ERROR + // instead of LZMA_DATA_ERROR when the Magic Bytes don't + // match in a file that is too big or isn't a multiple of + // four bytes. + if (coder->file_size > LZMA_VLI_MAX || (coder->file_size & 3)) + return LZMA_DATA_ERROR; + + // Start looking for Stream Padding and Stream Footer + // at the end of the file. + coder->file_target_pos = coder->file_size; + + // Fall through + + case SEQ_PADDING_SEEK: + coder->sequence = SEQ_PADDING_DECODE; + return_if_error(reverse_seek( + coder, in_start, in_pos, in_size)); + + // Fall through + + case SEQ_PADDING_DECODE: { + // Copy to coder->temp first. This keeps the code simpler if + // the application only provides input a few bytes at a time. + if (fill_temp(coder, in, in_pos, in_size)) + return LZMA_OK; + + // Scan the buffer backwards to get the size of the + // Stream Padding field (if any). + const size_t new_padding = get_padding_size( + coder->temp, coder->temp_size); + coder->stream_padding += new_padding; + + // Set the target position to the beginning of Stream Padding + // that has been observed so far. If all Stream Padding has + // been seen, then the target position will be at the end + // of the Stream Footer field. + coder->file_target_pos -= new_padding; + + if (new_padding == coder->temp_size) { + // The whole buffer was padding. Seek backwards in + // the file to get more input. + coder->sequence = SEQ_PADDING_SEEK; + break; + } + + // Size of Stream Padding must be a multiple of 4 bytes. + if (coder->stream_padding & 3) + return LZMA_DATA_ERROR; + + coder->sequence = SEQ_FOOTER; + + // Calculate the amount of non-padding data in coder->temp. + coder->temp_size -= new_padding; + coder->temp_pos = coder->temp_size; + + // We can avoid an external seek if the whole Stream Footer + // is already in coder->temp. In that case SEQ_FOOTER won't + // read more input and will find the Stream Footer from + // coder->temp[coder->temp_size - LZMA_STREAM_HEADER_SIZE]. + // + // Otherwise we will need to seek. The seeking is done so + // that Stream Footer wil be at the end of coder->temp. + // This way it's likely that we also get a complete Index + // field into coder->temp without needing a separate seek + // for that (unless the Index field is big). + if (coder->temp_size < LZMA_STREAM_HEADER_SIZE) + return_if_error(reverse_seek( + coder, in_start, in_pos, in_size)); + } + + // Fall through + + case SEQ_FOOTER: + // Copy the Stream Footer field into coder->temp. + // If Stream Footer was already available in coder->temp + // in SEQ_PADDING_DECODE, then this does nothing. + if (fill_temp(coder, in, in_pos, in_size)) + return LZMA_OK; + + // Make coder->file_target_pos and coder->temp_size point + // to the beginning of Stream Footer and thus to the end + // of the Index field. coder->temp_pos will be updated + // a bit later. + coder->file_target_pos -= LZMA_STREAM_HEADER_SIZE; + coder->temp_size -= LZMA_STREAM_HEADER_SIZE; + + // Decode Stream Footer. + return_if_error(hide_format_error(lzma_stream_footer_decode( + &coder->footer_flags, + coder->temp + coder->temp_size))); + + // Check that we won't seek past the beginning of the file. + // + // LZMA_STREAM_HEADER_SIZE is added because there must be + // space for Stream Header too even though we won't seek + // there before decoding the Index field. + // + // There's no risk of integer overflow here because + // Backward Size cannot be greater than 2^34. + if (coder->file_target_pos < coder->footer_flags.backward_size + + LZMA_STREAM_HEADER_SIZE) + return LZMA_DATA_ERROR; + + // Set the target position to the beginning of the Index field. + coder->file_target_pos -= coder->footer_flags.backward_size; + coder->sequence = SEQ_INDEX_INIT; + + // We can avoid an external seek if the whole Index field is + // already available in coder->temp. + if (coder->temp_size >= coder->footer_flags.backward_size) { + // Set coder->temp_pos to point to the beginning + // of the Index. + coder->temp_pos = coder->temp_size + - coder->footer_flags.backward_size; + } else { + // These are set to zero to indicate that there's no + // useful data (Index or anything else) in coder->temp. + coder->temp_pos = 0; + coder->temp_size = 0; + + // Seek to the beginning of the Index field. + if (seek_to_pos(coder, coder->file_target_pos, + in_start, in_pos, in_size)) + return LZMA_SEEK_NEEDED; + } + + // Fall through + + case SEQ_INDEX_INIT: { + // Calculate the amount of memory already used by the earlier + // Indexes so that we know how big memory limit to pass to + // the Index decoder. + // + // NOTE: When there are multiple Streams, the separate + // lzma_index structures can use more RAM (as measured by + // lzma_index_memused()) than the final combined lzma_index. + // Thus memlimit may need to be slightly higher than the final + // calculated memory usage will be. This is perhaps a bit + // confusing to the application, but I think it shouldn't + // cause problems in practice. + uint64_t memused = 0; + if (coder->combined_index != NULL) { + memused = lzma_index_memused(coder->combined_index); + assert(memused <= coder->memlimit); + if (memused > coder->memlimit) // Extra sanity check + return LZMA_PROG_ERROR; + } + + // Initialize the Index decoder. + return_if_error(lzma_index_decoder_init( + &coder->index_decoder, allocator, + &coder->this_index, + coder->memlimit - memused)); + + coder->index_remaining = coder->footer_flags.backward_size; + coder->sequence = SEQ_INDEX_DECODE; + } + + // Fall through + + case SEQ_INDEX_DECODE: { + // Decode (a part of) the Index. If the whole Index is already + // in coder->temp, read it from there. Otherwise read from + // in[*in_pos] onwards. Note that index_decode() updates + // coder->index_remaining and optionally coder->file_cur_pos. + lzma_ret ret; + if (coder->temp_size != 0) { + assert(coder->temp_size - coder->temp_pos + == coder->index_remaining); + ret = decode_index(coder, allocator, coder->temp, + &coder->temp_pos, coder->temp_size, + false); + } else { + // Don't give the decoder more input than the known + // remaining size of the Index field. + size_t in_stop = in_size; + if (in_size - *in_pos > coder->index_remaining) + in_stop = *in_pos + + (size_t)(coder->index_remaining); + + ret = decode_index(coder, allocator, + in, in_pos, in_stop, true); + } + + switch (ret) { + case LZMA_OK: + // If the Index docoder asks for more input when we + // have already given it as much input as Backward Size + // indicated, the file is invalid. + if (coder->index_remaining == 0) + return LZMA_DATA_ERROR; + + // We cannot get here if we were reading Index from + // coder->temp because when reading from coder->temp + // we give the Index decoder exactly + // coder->index_remaining bytes of input. + assert(coder->temp_size == 0); + + return LZMA_OK; + + case LZMA_STREAM_END: + // If the decoding seems to be successful, check also + // that the Index decoder consumed as much input as + // indicated by the Backward Size field. + if (coder->index_remaining != 0) + return LZMA_DATA_ERROR; + + break; + + default: + return ret; + } + + // Calculate how much the Index tells us to seek backwards + // (relative to the beginning of the Index): Total size of + // all Blocks plus the size of the Stream Header field. + // No integer overflow here because lzma_index_total_size() + // cannot return a value greater than LZMA_VLI_MAX. + const uint64_t seek_amount + = lzma_index_total_size(coder->this_index) + + LZMA_STREAM_HEADER_SIZE; + + // Check that Index is sane in sense that seek_amount won't + // make us seek past the beginning of the file when locating + // the Stream Header. + // + // coder->file_target_pos still points to the beginning of + // the Index field. + if (coder->file_target_pos < seek_amount) + return LZMA_DATA_ERROR; + + // Set the target to the beginning of Stream Header. + coder->file_target_pos -= seek_amount; + + if (coder->file_target_pos == 0) { + // We would seek to the beginning of the file, but + // since we already decoded that Stream Header in + // SEQ_MAGIC_BYTES, we can use the cached value from + // coder->first_header_flags to avoid the seek. + coder->header_flags = coder->first_header_flags; + coder->sequence = SEQ_HEADER_COMPARE; + break; + } + + coder->sequence = SEQ_HEADER_DECODE; + + // Make coder->file_target_pos point to the end of + // the Stream Header field. + coder->file_target_pos += LZMA_STREAM_HEADER_SIZE; + + // If coder->temp_size is non-zero, it points to the end + // of the Index field. Then the beginning of the Index + // field is at coder->temp[coder->temp_size + // - coder->footer_flags.backward_size]. + assert(coder->temp_size == 0 || coder->temp_size + >= coder->footer_flags.backward_size); + + // If coder->temp contained the whole Index, see if it has + // enough data to contain also the Stream Header. If so, + // we avoid an external seek. + // + // NOTE: This can happen only with small .xz files and only + // for the non-first Stream as the Stream Flags of the first + // Stream are cached and already handled a few lines above. + // So this isn't as useful as the other seek-avoidance cases. + if (coder->temp_size != 0 && coder->temp_size + - coder->footer_flags.backward_size + >= seek_amount) { + // Make temp_pos and temp_size point to the *end* of + // Stream Header so that SEQ_HEADER_DECODE will find + // the start of Stream Header from coder->temp[ + // coder->temp_size - LZMA_STREAM_HEADER_SIZE]. + coder->temp_pos = coder->temp_size + - coder->footer_flags.backward_size + - seek_amount + + LZMA_STREAM_HEADER_SIZE; + coder->temp_size = coder->temp_pos; + } else { + // Seek so that Stream Header will be at the end of + // coder->temp. With typical multi-Stream files we + // will usually also get the Stream Footer and Index + // of the *previous* Stream in coder->temp and thus + // won't need a separate seek for them. + return_if_error(reverse_seek(coder, + in_start, in_pos, in_size)); + } + } + + // Fall through + + case SEQ_HEADER_DECODE: + // Copy the Stream Header field into coder->temp. + // If Stream Header was already available in coder->temp + // in SEQ_INDEX_DECODE, then this does nothing. + if (fill_temp(coder, in, in_pos, in_size)) + return LZMA_OK; + + // Make all these point to the beginning of Stream Header. + coder->file_target_pos -= LZMA_STREAM_HEADER_SIZE; + coder->temp_size -= LZMA_STREAM_HEADER_SIZE; + coder->temp_pos = coder->temp_size; + + // Decode the Stream Header. + return_if_error(hide_format_error(lzma_stream_header_decode( + &coder->header_flags, + coder->temp + coder->temp_size))); + + coder->sequence = SEQ_HEADER_COMPARE; + + // Fall through + + case SEQ_HEADER_COMPARE: + // Compare Stream Header against Stream Footer. They must + // match. + return_if_error(lzma_stream_flags_compare( + &coder->header_flags, &coder->footer_flags)); + + // Store the decoded Stream Flags into the Index. Use the + // Footer Flags because it contains Backward Size, although + // it shouldn't matter in practice. + if (lzma_index_stream_flags(coder->this_index, + &coder->footer_flags) != LZMA_OK) + return LZMA_PROG_ERROR; + + // Store also the size of the Stream Padding field. It is + // needed to calculate the offsets of the Streams correctly. + if (lzma_index_stream_padding(coder->this_index, + coder->stream_padding) != LZMA_OK) + return LZMA_PROG_ERROR; + + // Reset it so that it's ready for the next Stream. + coder->stream_padding = 0; + + // Append the earlier decoded Indexes after this_index. + if (coder->combined_index != NULL) + return_if_error(lzma_index_cat(coder->this_index, + coder->combined_index, allocator)); + + coder->combined_index = coder->this_index; + coder->this_index = NULL; + + // If the whole file was decoded, tell the caller that we + // are finished. + if (coder->file_target_pos == 0) { + // The combined index must indicate the same file + // size as was told to us at initialization. + assert(lzma_index_file_size(coder->combined_index) + == coder->file_size); + + // Make the combined index available to + // the application. + *coder->dest_index = coder->combined_index; + coder->combined_index = NULL; + + // Mark the input buffer as used since we may have + // done internal seeking and thus don't know how + // many input bytes were actually used. This way + // lzma_stream.total_in gets a slightly better + // estimate of the amount of input used. + *in_pos = in_size; + return LZMA_STREAM_END; + } + + // We didn't hit the beginning of the file yet, so continue + // reading backwards in the file. If we have unprocessed + // data in coder->temp, use it before requesting more data + // from the application. + // + // coder->file_target_pos, coder->temp_size, and + // coder->temp_pos all point to the beginning of Stream Header + // and thus the end of the previous Stream in the file. + coder->sequence = coder->temp_size > 0 + ? SEQ_PADDING_DECODE : SEQ_PADDING_SEEK; + break; + + default: + assert(0); + return LZMA_PROG_ERROR; + } +} + + +static lzma_ret +file_info_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_file_info_coder *coder = coder_ptr; + + // The memory usage calculation comes from three things: + // + // (1) The Indexes that have already been decoded and processed into + // coder->combined_index. + // + // (2) The latest Index in coder->this_index that has been decoded but + // not yet put into coder->combined_index. + // + // (3) The latest Index that we have started decoding but haven't + // finished and thus isn't available in coder->this_index yet. + // Memory usage and limit information needs to be communicated + // from/to coder->index_decoder. + // + // Care has to be taken to not do both (2) and (3) when calculating + // the memory usage. + uint64_t combined_index_memusage = 0; + uint64_t this_index_memusage = 0; + + // (1) If we have already successfully decoded one or more Indexes, + // get their memory usage. + if (coder->combined_index != NULL) + combined_index_memusage = lzma_index_memused( + coder->combined_index); + + // Choose between (2), (3), or neither. + if (coder->this_index != NULL) { + // (2) The latest Index is available. Use its memory usage. + this_index_memusage = lzma_index_memused(coder->this_index); + + } else if (coder->sequence == SEQ_INDEX_DECODE) { + // (3) The Index decoder is activate and hasn't yet stored + // the new index in coder->this_index. Get the memory usage + // information from the Index decoder. + // + // NOTE: If the Index decoder doesn't yet know how much memory + // it will eventually need, it will return a tiny value here. + uint64_t dummy; + if (coder->index_decoder.memconfig(coder->index_decoder.coder, + &this_index_memusage, &dummy, 0) + != LZMA_OK) { + assert(0); + return LZMA_PROG_ERROR; + } + } + + // Now we know the total memory usage/requirement. If we had neither + // old Indexes nor a new Index, this will be zero which isn't + // acceptable as lzma_memusage() has to return non-zero on success + // and even with an empty .xz file we will end up with a lzma_index + // that takes some memory. + *memusage = combined_index_memusage + this_index_memusage; + if (*memusage == 0) + *memusage = lzma_index_memusage(1, 0); + + *old_memlimit = coder->memlimit; + + // If requested, set a new memory usage limit. + if (new_memlimit != 0) { + if (new_memlimit < *memusage) + return LZMA_MEMLIMIT_ERROR; + + // In the condition (3) we need to tell the Index decoder + // its new memory usage limit. + if (coder->this_index == NULL + && coder->sequence == SEQ_INDEX_DECODE) { + const uint64_t idec_new_memlimit = new_memlimit + - combined_index_memusage; + + assert(this_index_memusage > 0); + assert(idec_new_memlimit > 0); + + uint64_t dummy1; + uint64_t dummy2; + + if (coder->index_decoder.memconfig( + coder->index_decoder.coder, + &dummy1, &dummy2, idec_new_memlimit) + != LZMA_OK) { + assert(0); + return LZMA_PROG_ERROR; + } + } + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +static void +file_info_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_file_info_coder *coder = coder_ptr; + + lzma_next_end(&coder->index_decoder, allocator); + lzma_index_end(coder->this_index, allocator); + lzma_index_end(coder->combined_index, allocator); + + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +lzma_file_info_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, uint64_t *seek_pos, + lzma_index **dest_index, + uint64_t memlimit, uint64_t file_size) +{ + lzma_next_coder_init(&lzma_file_info_decoder_init, next, allocator); + + if (dest_index == NULL) + return LZMA_PROG_ERROR; + + lzma_file_info_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_file_info_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &file_info_decode; + next->end = &file_info_decoder_end; + next->memconfig = &file_info_decoder_memconfig; + + coder->index_decoder = LZMA_NEXT_CODER_INIT; + coder->this_index = NULL; + coder->combined_index = NULL; + } + + coder->sequence = SEQ_MAGIC_BYTES; + coder->file_cur_pos = 0; + coder->file_target_pos = 0; + coder->file_size = file_size; + + lzma_index_end(coder->this_index, allocator); + coder->this_index = NULL; + + lzma_index_end(coder->combined_index, allocator); + coder->combined_index = NULL; + + coder->stream_padding = 0; + + coder->dest_index = dest_index; + coder->external_seek_pos = seek_pos; + + // If memlimit is 0, make it 1 to ensure that lzma_memlimit_get() + // won't return 0 (which would indicate an error). + coder->memlimit = my_max(1, memlimit); + + // Prepare these for reading the first Stream Header into coder->temp. + coder->temp_pos = 0; + coder->temp_size = LZMA_STREAM_HEADER_SIZE; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_file_info_decoder(lzma_stream *strm, lzma_index **dest_index, + uint64_t memlimit, uint64_t file_size) +{ + lzma_next_strm_init(lzma_file_info_decoder_init, strm, &strm->seek_pos, + dest_index, memlimit, file_size); + + // We allow LZMA_FINISH in addition to LZMA_RUN for convenience. + // lzma_code() is able to handle the LZMA_FINISH + LZMA_SEEK_NEEDED + // combination in a sane way. Applications still need to be careful + // if they use LZMA_FINISH so that they remember to reset it back + // to LZMA_RUN after seeking if needed. + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/filter_buffer_decoder.c b/src/liblzma/common/filter_buffer_decoder.c new file mode 100644 index 0000000..6620986 --- /dev/null +++ b/src/liblzma/common/filter_buffer_decoder.c @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_buffer_decoder.c +/// \brief Single-call raw decoding +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_decoder.h" + + +extern LZMA_API(lzma_ret) +lzma_raw_buffer_decode( + const lzma_filter *filters, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Validate what isn't validated later in filter_common.c. + if (in == NULL || in_pos == NULL || *in_pos > in_size || out == NULL + || out_pos == NULL || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // Initialize the decoer. + lzma_next_coder next = LZMA_NEXT_CODER_INIT; + return_if_error(lzma_raw_decoder_init(&next, allocator, filters)); + + // Store the positions so that we can restore them if something + // goes wrong. + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + // Do the actual decoding and free decoder's memory. + lzma_ret ret = next.code(next.coder, allocator, in, in_pos, in_size, + out, out_pos, out_size, LZMA_FINISH); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + if (ret == LZMA_OK) { + // Either the input was truncated or the + // output buffer was too small. + assert(*in_pos == in_size || *out_pos == out_size); + + if (*in_pos != in_size) { + // Since input wasn't consumed completely, + // the output buffer became full and is + // too small. + ret = LZMA_BUF_ERROR; + + } else if (*out_pos != out_size) { + // Since output didn't became full, the input + // has to be truncated. + ret = LZMA_DATA_ERROR; + + } else { + // All the input was consumed and output + // buffer is full. Now we don't immediately + // know the reason for the error. Try + // decoding one more byte. If it succeeds, + // then the output buffer was too small. If + // we cannot get a new output byte, the input + // is truncated. + uint8_t tmp[1]; + size_t tmp_pos = 0; + (void)next.code(next.coder, allocator, + in, in_pos, in_size, + tmp, &tmp_pos, 1, LZMA_FINISH); + + if (tmp_pos == 1) + ret = LZMA_BUF_ERROR; + else + ret = LZMA_DATA_ERROR; + } + } + + // Restore the positions. + *in_pos = in_start; + *out_pos = out_start; + } + + lzma_next_end(&next, allocator); + + return ret; +} diff --git a/src/liblzma/common/filter_buffer_encoder.c b/src/liblzma/common/filter_buffer_encoder.c new file mode 100644 index 0000000..dda18e3 --- /dev/null +++ b/src/liblzma/common/filter_buffer_encoder.c @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_buffer_encoder.c +/// \brief Single-call raw encoding +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_encoder.h" + + +extern LZMA_API(lzma_ret) +lzma_raw_buffer_encode( + const lzma_filter *filters, const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Validate what isn't validated later in filter_common.c. + if ((in == NULL && in_size != 0) || out == NULL + || out_pos == NULL || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // Initialize the encoder + lzma_next_coder next = LZMA_NEXT_CODER_INIT; + return_if_error(lzma_raw_encoder_init(&next, allocator, filters)); + + // Store the output position so that we can restore it if + // something goes wrong. + const size_t out_start = *out_pos; + + // Do the actual encoding and free coder's memory. + size_t in_pos = 0; + lzma_ret ret = next.code(next.coder, allocator, in, &in_pos, in_size, + out, out_pos, out_size, LZMA_FINISH); + lzma_next_end(&next, allocator); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + if (ret == LZMA_OK) { + // Output buffer was too small. + assert(*out_pos == out_size); + ret = LZMA_BUF_ERROR; + } + + // Restore the output position. + *out_pos = out_start; + } + + return ret; +} diff --git a/src/liblzma/common/filter_common.c b/src/liblzma/common/filter_common.c new file mode 100644 index 0000000..fa0927c --- /dev/null +++ b/src/liblzma/common/filter_common.c @@ -0,0 +1,385 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_common.c +/// \brief Filter-specific stuff common for both encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_common.h" + + +static const struct { + /// Filter ID + lzma_vli id; + + /// Size of the filter-specific options structure + size_t options_size; + + /// True if it is OK to use this filter as non-last filter in + /// the chain. + bool non_last_ok; + + /// True if it is OK to use this filter as the last filter in + /// the chain. + bool last_ok; + + /// True if the filter may change the size of the data (that is, the + /// amount of encoded output can be different than the amount of + /// uncompressed input). + bool changes_size; + +} features[] = { +#if defined (HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) + { + .id = LZMA_FILTER_LZMA1, + .options_size = sizeof(lzma_options_lzma), + .non_last_ok = false, + .last_ok = true, + .changes_size = true, + }, + { + .id = LZMA_FILTER_LZMA1EXT, + .options_size = sizeof(lzma_options_lzma), + .non_last_ok = false, + .last_ok = true, + .changes_size = true, + }, +#endif +#if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2) + { + .id = LZMA_FILTER_LZMA2, + .options_size = sizeof(lzma_options_lzma), + .non_last_ok = false, + .last_ok = true, + .changes_size = true, + }, +#endif +#if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86) + { + .id = LZMA_FILTER_X86, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC) + { + .id = LZMA_FILTER_POWERPC, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64) + { + .id = LZMA_FILTER_IA64, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_ARM) || defined(HAVE_DECODER_ARM) + { + .id = LZMA_FILTER_ARM, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_ARMTHUMB) || defined(HAVE_DECODER_ARMTHUMB) + { + .id = LZMA_FILTER_ARMTHUMB, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_ARM64) || defined(HAVE_DECODER_ARM64) + { + .id = LZMA_FILTER_ARM64, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_SPARC) || defined(HAVE_DECODER_SPARC) + { + .id = LZMA_FILTER_SPARC, + .options_size = sizeof(lzma_options_bcj), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif +#if defined(HAVE_ENCODER_DELTA) || defined(HAVE_DECODER_DELTA) + { + .id = LZMA_FILTER_DELTA, + .options_size = sizeof(lzma_options_delta), + .non_last_ok = true, + .last_ok = false, + .changes_size = false, + }, +#endif + { + .id = LZMA_VLI_UNKNOWN + } +}; + + +extern LZMA_API(lzma_ret) +lzma_filters_copy(const lzma_filter *src, lzma_filter *real_dest, + const lzma_allocator *allocator) +{ + if (src == NULL || real_dest == NULL) + return LZMA_PROG_ERROR; + + // Use a temporary destination so that the real destination + // will never be modied if an error occurs. + lzma_filter dest[LZMA_FILTERS_MAX + 1]; + + lzma_ret ret; + size_t i; + for (i = 0; src[i].id != LZMA_VLI_UNKNOWN; ++i) { + // There must be a maximum of four filters plus + // the array terminator. + if (i == LZMA_FILTERS_MAX) { + ret = LZMA_OPTIONS_ERROR; + goto error; + } + + dest[i].id = src[i].id; + + if (src[i].options == NULL) { + dest[i].options = NULL; + } else { + // See if the filter is supported only when the + // options is not NULL. This might be convenient + // sometimes if the app is actually copying only + // a partial filter chain with a place holder ID. + // + // When options is not NULL, the Filter ID must be + // supported by us, because otherwise we don't know + // how big the options are. + size_t j; + for (j = 0; src[i].id != features[j].id; ++j) { + if (features[j].id == LZMA_VLI_UNKNOWN) { + ret = LZMA_OPTIONS_ERROR; + goto error; + } + } + + // Allocate and copy the options. + dest[i].options = lzma_alloc(features[j].options_size, + allocator); + if (dest[i].options == NULL) { + ret = LZMA_MEM_ERROR; + goto error; + } + + memcpy(dest[i].options, src[i].options, + features[j].options_size); + } + } + + // Terminate the filter array. + assert(i < LZMA_FILTERS_MAX + 1); + dest[i].id = LZMA_VLI_UNKNOWN; + dest[i].options = NULL; + + // Copy it to the caller-supplied array now that we know that + // no errors occurred. + memcpy(real_dest, dest, (i + 1) * sizeof(lzma_filter)); + + return LZMA_OK; + +error: + // Free the options which we have already allocated. + while (i-- > 0) + lzma_free(dest[i].options, allocator); + + return ret; +} + + +extern LZMA_API(void) +lzma_filters_free(lzma_filter *filters, const lzma_allocator *allocator) +{ + if (filters == NULL) + return; + + for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) { + if (i == LZMA_FILTERS_MAX) { + // The API says that LZMA_FILTERS_MAX + 1 is the + // maximum allowed size including the terminating + // element. Thus, we should never get here but in + // case there is a bug and we do anyway, don't go + // past the (probable) end of the array. + assert(0); + break; + } + + lzma_free(filters[i].options, allocator); + filters[i].options = NULL; + filters[i].id = LZMA_VLI_UNKNOWN; + } + + return; +} + + +extern lzma_ret +lzma_validate_chain(const lzma_filter *filters, size_t *count) +{ + // There must be at least one filter. + if (filters == NULL || filters[0].id == LZMA_VLI_UNKNOWN) + return LZMA_PROG_ERROR; + + // Number of non-last filters that may change the size of the data + // significantly (that is, more than 1-2 % or so). + size_t changes_size_count = 0; + + // True if it is OK to add a new filter after the current filter. + bool non_last_ok = true; + + // True if the last filter in the given chain is actually usable as + // the last filter. Only filters that support embedding End of Payload + // Marker can be used as the last filter in the chain. + bool last_ok = false; + + size_t i = 0; + do { + size_t j; + for (j = 0; filters[i].id != features[j].id; ++j) + if (features[j].id == LZMA_VLI_UNKNOWN) + return LZMA_OPTIONS_ERROR; + + // If the previous filter in the chain cannot be a non-last + // filter, the chain is invalid. + if (!non_last_ok) + return LZMA_OPTIONS_ERROR; + + non_last_ok = features[j].non_last_ok; + last_ok = features[j].last_ok; + changes_size_count += features[j].changes_size; + + } while (filters[++i].id != LZMA_VLI_UNKNOWN); + + // There must be 1-4 filters. The last filter must be usable as + // the last filter in the chain. A maximum of three filters are + // allowed to change the size of the data. + if (i > LZMA_FILTERS_MAX || !last_ok || changes_size_count > 3) + return LZMA_OPTIONS_ERROR; + + *count = i; + return LZMA_OK; +} + + +extern lzma_ret +lzma_raw_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *options, + lzma_filter_find coder_find, bool is_encoder) +{ + // Do some basic validation and get the number of filters. + size_t count; + return_if_error(lzma_validate_chain(options, &count)); + + // Set the filter functions and copy the options pointer. + lzma_filter_info filters[LZMA_FILTERS_MAX + 1]; + if (is_encoder) { + for (size_t i = 0; i < count; ++i) { + // The order of the filters is reversed in the + // encoder. It allows more efficient handling + // of the uncompressed data. + const size_t j = count - i - 1; + + const lzma_filter_coder *const fc + = coder_find(options[i].id); + if (fc == NULL || fc->init == NULL) + return LZMA_OPTIONS_ERROR; + + filters[j].id = options[i].id; + filters[j].init = fc->init; + filters[j].options = options[i].options; + } + } else { + for (size_t i = 0; i < count; ++i) { + const lzma_filter_coder *const fc + = coder_find(options[i].id); + if (fc == NULL || fc->init == NULL) + return LZMA_OPTIONS_ERROR; + + filters[i].id = options[i].id; + filters[i].init = fc->init; + filters[i].options = options[i].options; + } + } + + // Terminate the array. + filters[count].id = LZMA_VLI_UNKNOWN; + filters[count].init = NULL; + + // Initialize the filters. + const lzma_ret ret = lzma_next_filter_init(next, allocator, filters); + if (ret != LZMA_OK) + lzma_next_end(next, allocator); + + return ret; +} + + +extern uint64_t +lzma_raw_coder_memusage(lzma_filter_find coder_find, + const lzma_filter *filters) +{ + // The chain has to have at least one filter. + { + size_t tmp; + if (lzma_validate_chain(filters, &tmp) != LZMA_OK) + return UINT64_MAX; + } + + uint64_t total = 0; + size_t i = 0; + + do { + const lzma_filter_coder *const fc + = coder_find(filters[i].id); + if (fc == NULL) + return UINT64_MAX; // Unsupported Filter ID + + if (fc->memusage == NULL) { + // This filter doesn't have a function to calculate + // the memory usage and validate the options. Such + // filters need only little memory, so we use 1 KiB + // as a good estimate. They also accept all possible + // options, so there's no need to worry about lack + // of validation. + total += 1024; + } else { + // Call the filter-specific memory usage calculation + // function. + const uint64_t usage + = fc->memusage(filters[i].options); + if (usage == UINT64_MAX) + return UINT64_MAX; // Invalid options + + total += usage; + } + } while (filters[++i].id != LZMA_VLI_UNKNOWN); + + // Add some fixed amount of extra. It's to compensate memory usage + // of Stream, Block etc. coders, malloc() overhead, stack etc. + return total + LZMA_MEMUSAGE_BASE; +} diff --git a/src/liblzma/common/filter_common.h b/src/liblzma/common/filter_common.h new file mode 100644 index 0000000..2e47bb6 --- /dev/null +++ b/src/liblzma/common/filter_common.h @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_common.h +/// \brief Filter-specific stuff common for both encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_FILTER_COMMON_H +#define LZMA_FILTER_COMMON_H + +#include "common.h" + + +/// Both lzma_filter_encoder and lzma_filter_decoder begin with these members. +typedef struct { + /// Filter ID + lzma_vli id; + + /// Initializes the filter encoder and calls lzma_next_filter_init() + /// for filters + 1. + lzma_init_function init; + + /// Calculates memory usage of the encoder. If the options are + /// invalid, UINT64_MAX is returned. + uint64_t (*memusage)(const void *options); + +} lzma_filter_coder; + + +typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id); + + +extern lzma_ret lzma_validate_chain(const lzma_filter *filters, size_t *count); + + +extern lzma_ret lzma_raw_coder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *filters, + lzma_filter_find coder_find, bool is_encoder); + + +extern uint64_t lzma_raw_coder_memusage(lzma_filter_find coder_find, + const lzma_filter *filters); + + +#endif diff --git a/src/liblzma/common/filter_decoder.c b/src/liblzma/common/filter_decoder.c new file mode 100644 index 0000000..fa53f5b --- /dev/null +++ b/src/liblzma/common/filter_decoder.c @@ -0,0 +1,198 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_decoder.c +/// \brief Filter ID mapping to filter-specific functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_decoder.h" +#include "filter_common.h" +#include "lzma_decoder.h" +#include "lzma2_decoder.h" +#include "simple_decoder.h" +#include "delta_decoder.h" + + +typedef struct { + /// Filter ID + lzma_vli id; + + /// Initializes the filter encoder and calls lzma_next_filter_init() + /// for filters + 1. + lzma_init_function init; + + /// Calculates memory usage of the encoder. If the options are + /// invalid, UINT64_MAX is returned. + uint64_t (*memusage)(const void *options); + + /// Decodes Filter Properties. + /// + /// \return - LZMA_OK: Properties decoded successfully. + /// - LZMA_OPTIONS_ERROR: Unsupported properties + /// - LZMA_MEM_ERROR: Memory allocation failed. + lzma_ret (*props_decode)( + void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size); + +} lzma_filter_decoder; + + +static const lzma_filter_decoder decoders[] = { +#ifdef HAVE_DECODER_LZMA1 + { + .id = LZMA_FILTER_LZMA1, + .init = &lzma_lzma_decoder_init, + .memusage = &lzma_lzma_decoder_memusage, + .props_decode = &lzma_lzma_props_decode, + }, + { + .id = LZMA_FILTER_LZMA1EXT, + .init = &lzma_lzma_decoder_init, + .memusage = &lzma_lzma_decoder_memusage, + .props_decode = &lzma_lzma_props_decode, + }, +#endif +#ifdef HAVE_DECODER_LZMA2 + { + .id = LZMA_FILTER_LZMA2, + .init = &lzma_lzma2_decoder_init, + .memusage = &lzma_lzma2_decoder_memusage, + .props_decode = &lzma_lzma2_props_decode, + }, +#endif +#ifdef HAVE_DECODER_X86 + { + .id = LZMA_FILTER_X86, + .init = &lzma_simple_x86_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_POWERPC + { + .id = LZMA_FILTER_POWERPC, + .init = &lzma_simple_powerpc_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_IA64 + { + .id = LZMA_FILTER_IA64, + .init = &lzma_simple_ia64_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_ARM + { + .id = LZMA_FILTER_ARM, + .init = &lzma_simple_arm_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_ARMTHUMB + { + .id = LZMA_FILTER_ARMTHUMB, + .init = &lzma_simple_armthumb_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_ARM64 + { + .id = LZMA_FILTER_ARM64, + .init = &lzma_simple_arm64_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_SPARC + { + .id = LZMA_FILTER_SPARC, + .init = &lzma_simple_sparc_decoder_init, + .memusage = NULL, + .props_decode = &lzma_simple_props_decode, + }, +#endif +#ifdef HAVE_DECODER_DELTA + { + .id = LZMA_FILTER_DELTA, + .init = &lzma_delta_decoder_init, + .memusage = &lzma_delta_coder_memusage, + .props_decode = &lzma_delta_props_decode, + }, +#endif +}; + + +static const lzma_filter_decoder * +decoder_find(lzma_vli id) +{ + for (size_t i = 0; i < ARRAY_SIZE(decoders); ++i) + if (decoders[i].id == id) + return decoders + i; + + return NULL; +} + + +extern LZMA_API(lzma_bool) +lzma_filter_decoder_is_supported(lzma_vli id) +{ + return decoder_find(id) != NULL; +} + + +extern lzma_ret +lzma_raw_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *options) +{ + return lzma_raw_coder_init(next, allocator, + options, (lzma_filter_find)(&decoder_find), false); +} + + +extern LZMA_API(lzma_ret) +lzma_raw_decoder(lzma_stream *strm, const lzma_filter *options) +{ + lzma_next_strm_init(lzma_raw_decoder_init, strm, options); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} + + +extern LZMA_API(uint64_t) +lzma_raw_decoder_memusage(const lzma_filter *filters) +{ + return lzma_raw_coder_memusage( + (lzma_filter_find)(&decoder_find), filters); +} + + +extern LZMA_API(lzma_ret) +lzma_properties_decode(lzma_filter *filter, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) +{ + // Make it always NULL so that the caller can always safely free() it. + filter->options = NULL; + + const lzma_filter_decoder *const fd = decoder_find(filter->id); + if (fd == NULL) + return LZMA_OPTIONS_ERROR; + + if (fd->props_decode == NULL) + return props_size == 0 ? LZMA_OK : LZMA_OPTIONS_ERROR; + + return fd->props_decode( + &filter->options, allocator, props, props_size); +} diff --git a/src/liblzma/common/filter_decoder.h b/src/liblzma/common/filter_decoder.h new file mode 100644 index 0000000..2dac602 --- /dev/null +++ b/src/liblzma/common/filter_decoder.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_decoder.h +/// \brief Filter ID mapping to filter-specific functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_FILTER_DECODER_H +#define LZMA_FILTER_DECODER_H + +#include "common.h" + + +extern lzma_ret lzma_raw_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *options); + +#endif diff --git a/src/liblzma/common/filter_encoder.c b/src/liblzma/common/filter_encoder.c new file mode 100644 index 0000000..46fe8af --- /dev/null +++ b/src/liblzma/common/filter_encoder.c @@ -0,0 +1,308 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_decoder.c +/// \brief Filter ID mapping to filter-specific functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_encoder.h" +#include "filter_common.h" +#include "lzma_encoder.h" +#include "lzma2_encoder.h" +#include "simple_encoder.h" +#include "delta_encoder.h" + + +typedef struct { + /// Filter ID + lzma_vli id; + + /// Initializes the filter encoder and calls lzma_next_filter_init() + /// for filters + 1. + lzma_init_function init; + + /// Calculates memory usage of the encoder. If the options are + /// invalid, UINT64_MAX is returned. + uint64_t (*memusage)(const void *options); + + /// Calculates the recommended Uncompressed Size for .xz Blocks to + /// which the input data can be split to make multithreaded + /// encoding possible. If this is NULL, it is assumed that + /// the encoder is fast enough with single thread. + uint64_t (*block_size)(const void *options); + + /// Tells the size of the Filter Properties field. If options are + /// invalid, LZMA_OPTIONS_ERROR is returned and size is set to + /// UINT32_MAX. + lzma_ret (*props_size_get)(uint32_t *size, const void *options); + + /// Some filters will always have the same size Filter Properties + /// field. If props_size_get is NULL, this value is used. + uint32_t props_size_fixed; + + /// Encodes Filter Properties. + /// + /// \return - LZMA_OK: Properties encoded successfully. + /// - LZMA_OPTIONS_ERROR: Unsupported options + /// - LZMA_PROG_ERROR: Invalid options or not enough + /// output space + lzma_ret (*props_encode)(const void *options, uint8_t *out); + +} lzma_filter_encoder; + + +static const lzma_filter_encoder encoders[] = { +#ifdef HAVE_ENCODER_LZMA1 + { + .id = LZMA_FILTER_LZMA1, + .init = &lzma_lzma_encoder_init, + .memusage = &lzma_lzma_encoder_memusage, + .block_size = NULL, // Not needed for LZMA1 + .props_size_get = NULL, + .props_size_fixed = 5, + .props_encode = &lzma_lzma_props_encode, + }, + { + .id = LZMA_FILTER_LZMA1EXT, + .init = &lzma_lzma_encoder_init, + .memusage = &lzma_lzma_encoder_memusage, + .block_size = NULL, // Not needed for LZMA1 + .props_size_get = NULL, + .props_size_fixed = 5, + .props_encode = &lzma_lzma_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_LZMA2 + { + .id = LZMA_FILTER_LZMA2, + .init = &lzma_lzma2_encoder_init, + .memusage = &lzma_lzma2_encoder_memusage, + .block_size = &lzma_lzma2_block_size, + .props_size_get = NULL, + .props_size_fixed = 1, + .props_encode = &lzma_lzma2_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_X86 + { + .id = LZMA_FILTER_X86, + .init = &lzma_simple_x86_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_POWERPC + { + .id = LZMA_FILTER_POWERPC, + .init = &lzma_simple_powerpc_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_IA64 + { + .id = LZMA_FILTER_IA64, + .init = &lzma_simple_ia64_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_ARM + { + .id = LZMA_FILTER_ARM, + .init = &lzma_simple_arm_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_ARMTHUMB + { + .id = LZMA_FILTER_ARMTHUMB, + .init = &lzma_simple_armthumb_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_ARM64 + { + .id = LZMA_FILTER_ARM64, + .init = &lzma_simple_arm64_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_SPARC + { + .id = LZMA_FILTER_SPARC, + .init = &lzma_simple_sparc_encoder_init, + .memusage = NULL, + .block_size = NULL, + .props_size_get = &lzma_simple_props_size, + .props_encode = &lzma_simple_props_encode, + }, +#endif +#ifdef HAVE_ENCODER_DELTA + { + .id = LZMA_FILTER_DELTA, + .init = &lzma_delta_encoder_init, + .memusage = &lzma_delta_coder_memusage, + .block_size = NULL, + .props_size_get = NULL, + .props_size_fixed = 1, + .props_encode = &lzma_delta_props_encode, + }, +#endif +}; + + +static const lzma_filter_encoder * +encoder_find(lzma_vli id) +{ + for (size_t i = 0; i < ARRAY_SIZE(encoders); ++i) + if (encoders[i].id == id) + return encoders + i; + + return NULL; +} + + +extern LZMA_API(lzma_bool) +lzma_filter_encoder_is_supported(lzma_vli id) +{ + return encoder_find(id) != NULL; +} + + +extern LZMA_API(lzma_ret) +lzma_filters_update(lzma_stream *strm, const lzma_filter *filters) +{ + if (strm->internal->next.update == NULL) + return LZMA_PROG_ERROR; + + // Validate the filter chain. + if (lzma_raw_encoder_memusage(filters) == UINT64_MAX) + return LZMA_OPTIONS_ERROR; + + // The actual filter chain in the encoder is reversed. Some things + // still want the normal order chain, so we provide both. + size_t count = 1; + while (filters[count].id != LZMA_VLI_UNKNOWN) + ++count; + + lzma_filter reversed_filters[LZMA_FILTERS_MAX + 1]; + for (size_t i = 0; i < count; ++i) + reversed_filters[count - i - 1] = filters[i]; + + reversed_filters[count].id = LZMA_VLI_UNKNOWN; + + return strm->internal->next.update(strm->internal->next.coder, + strm->allocator, filters, reversed_filters); +} + + +extern lzma_ret +lzma_raw_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *options) +{ + return lzma_raw_coder_init(next, allocator, + options, (lzma_filter_find)(&encoder_find), true); +} + + +extern LZMA_API(lzma_ret) +lzma_raw_encoder(lzma_stream *strm, const lzma_filter *options) +{ + lzma_next_strm_init(lzma_raw_coder_init, strm, options, + (lzma_filter_find)(&encoder_find), true); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} + + +extern LZMA_API(uint64_t) +lzma_raw_encoder_memusage(const lzma_filter *filters) +{ + return lzma_raw_coder_memusage( + (lzma_filter_find)(&encoder_find), filters); +} + + +extern uint64_t +lzma_mt_block_size(const lzma_filter *filters) +{ + uint64_t max = 0; + + for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) { + const lzma_filter_encoder *const fe + = encoder_find(filters[i].id); + if (fe->block_size != NULL) { + const uint64_t size + = fe->block_size(filters[i].options); + if (size == 0) + return 0; + + if (size > max) + max = size; + } + } + + return max; +} + + +extern LZMA_API(lzma_ret) +lzma_properties_size(uint32_t *size, const lzma_filter *filter) +{ + const lzma_filter_encoder *const fe = encoder_find(filter->id); + if (fe == NULL) { + // Unknown filter - if the Filter ID is a proper VLI, + // return LZMA_OPTIONS_ERROR instead of LZMA_PROG_ERROR, + // because it's possible that we just don't have support + // compiled in for the requested filter. + return filter->id <= LZMA_VLI_MAX + ? LZMA_OPTIONS_ERROR : LZMA_PROG_ERROR; + } + + if (fe->props_size_get == NULL) { + // No props_size_get() function, use props_size_fixed. + *size = fe->props_size_fixed; + return LZMA_OK; + } + + return fe->props_size_get(size, filter->options); +} + + +extern LZMA_API(lzma_ret) +lzma_properties_encode(const lzma_filter *filter, uint8_t *props) +{ + const lzma_filter_encoder *const fe = encoder_find(filter->id); + if (fe == NULL) + return LZMA_PROG_ERROR; + + if (fe->props_encode == NULL) + return LZMA_OK; + + return fe->props_encode(filter->options, props); +} diff --git a/src/liblzma/common/filter_encoder.h b/src/liblzma/common/filter_encoder.h new file mode 100644 index 0000000..f1d5683 --- /dev/null +++ b/src/liblzma/common/filter_encoder.h @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_encoder.c +/// \brief Filter ID mapping to filter-specific functions +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_FILTER_ENCODER_H +#define LZMA_FILTER_ENCODER_H + +#include "common.h" + + +// FIXME: Might become a part of the public API. +extern uint64_t lzma_mt_block_size(const lzma_filter *filters); + + +extern lzma_ret lzma_raw_encoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *filters); + +#endif diff --git a/src/liblzma/common/filter_flags_decoder.c b/src/liblzma/common/filter_flags_decoder.c new file mode 100644 index 0000000..ddfb085 --- /dev/null +++ b/src/liblzma/common/filter_flags_decoder.c @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_flags_decoder.c +/// \brief Decodes a Filter Flags field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_decoder.h" + + +extern LZMA_API(lzma_ret) +lzma_filter_flags_decode( + lzma_filter *filter, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) +{ + // Set the pointer to NULL so the caller can always safely free it. + filter->options = NULL; + + // Filter ID + return_if_error(lzma_vli_decode(&filter->id, NULL, + in, in_pos, in_size)); + + if (filter->id >= LZMA_FILTER_RESERVED_START) + return LZMA_DATA_ERROR; + + // Size of Properties + lzma_vli props_size; + return_if_error(lzma_vli_decode(&props_size, NULL, + in, in_pos, in_size)); + + // Filter Properties + if (in_size - *in_pos < props_size) + return LZMA_DATA_ERROR; + + const lzma_ret ret = lzma_properties_decode( + filter, allocator, in + *in_pos, props_size); + + *in_pos += props_size; + + return ret; +} diff --git a/src/liblzma/common/filter_flags_encoder.c b/src/liblzma/common/filter_flags_encoder.c new file mode 100644 index 0000000..b57b9fd --- /dev/null +++ b/src/liblzma/common/filter_flags_encoder.c @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file filter_flags_encoder.c +/// \brief Encodes a Filter Flags field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_encoder.h" + + +extern LZMA_API(lzma_ret) +lzma_filter_flags_size(uint32_t *size, const lzma_filter *filter) +{ + if (filter->id >= LZMA_FILTER_RESERVED_START) + return LZMA_PROG_ERROR; + + return_if_error(lzma_properties_size(size, filter)); + + *size += lzma_vli_size(filter->id) + lzma_vli_size(*size); + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_filter_flags_encode(const lzma_filter *filter, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Filter ID + if (filter->id >= LZMA_FILTER_RESERVED_START) + return LZMA_PROG_ERROR; + + return_if_error(lzma_vli_encode(filter->id, NULL, + out, out_pos, out_size)); + + // Size of Properties + uint32_t props_size; + return_if_error(lzma_properties_size(&props_size, filter)); + return_if_error(lzma_vli_encode(props_size, NULL, + out, out_pos, out_size)); + + // Filter Properties + if (out_size - *out_pos < props_size) + return LZMA_PROG_ERROR; + + return_if_error(lzma_properties_encode(filter, out + *out_pos)); + + *out_pos += props_size; + + return LZMA_OK; +} diff --git a/src/liblzma/common/hardware_cputhreads.c b/src/liblzma/common/hardware_cputhreads.c new file mode 100644 index 0000000..5d246d2 --- /dev/null +++ b/src/liblzma/common/hardware_cputhreads.c @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file hardware_cputhreads.c +/// \brief Get the number of CPU threads or cores +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + +#include "tuklib_cpucores.h" + + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +// This is for compatibility with binaries linked against liblzma that +// has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7. +LZMA_SYMVER_API("lzma_cputhreads@XZ_5.2.2", + uint32_t, lzma_cputhreads_522)(void) lzma_nothrow + __attribute__((__alias__("lzma_cputhreads_52"))); + +LZMA_SYMVER_API("lzma_cputhreads@@XZ_5.2", + uint32_t, lzma_cputhreads_52)(void) lzma_nothrow; + +#define lzma_cputhreads lzma_cputhreads_52 +#endif +extern LZMA_API(uint32_t) +lzma_cputhreads(void) +{ + return tuklib_cpucores(); +} diff --git a/src/liblzma/common/hardware_physmem.c b/src/liblzma/common/hardware_physmem.c new file mode 100644 index 0000000..a2bbbe2 --- /dev/null +++ b/src/liblzma/common/hardware_physmem.c @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file hardware_physmem.c +/// \brief Get the total amount of physical memory (RAM) +// +// Author: Jonathan Nieder +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + +#include "tuklib_physmem.h" + + +extern LZMA_API(uint64_t) +lzma_physmem(void) +{ + // It is simpler to make lzma_physmem() a wrapper for + // tuklib_physmem() than to hack appropriate symbol visibility + // support for the tuklib modules. + return tuklib_physmem(); +} diff --git a/src/liblzma/common/index.c b/src/liblzma/common/index.c new file mode 100644 index 0000000..97cc9f9 --- /dev/null +++ b/src/liblzma/common/index.c @@ -0,0 +1,1263 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index.c +/// \brief Handling of .xz Indexes and some other Stream information +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "index.h" +#include "stream_flags_common.h" + + +/// \brief How many Records to allocate at once +/// +/// This should be big enough to avoid making lots of tiny allocations +/// but small enough to avoid too much unused memory at once. +#define INDEX_GROUP_SIZE 512 + + +/// \brief How many Records can be allocated at once at maximum +#define PREALLOC_MAX ((SIZE_MAX - sizeof(index_group)) / sizeof(index_record)) + + +/// \brief Base structure for index_stream and index_group structures +typedef struct index_tree_node_s index_tree_node; +struct index_tree_node_s { + /// Uncompressed start offset of this Stream (relative to the + /// beginning of the file) or Block (relative to the beginning + /// of the Stream) + lzma_vli uncompressed_base; + + /// Compressed start offset of this Stream or Block + lzma_vli compressed_base; + + index_tree_node *parent; + index_tree_node *left; + index_tree_node *right; +}; + + +/// \brief AVL tree to hold index_stream or index_group structures +typedef struct { + /// Root node + index_tree_node *root; + + /// Leftmost node. Since the tree will be filled sequentially, + /// this won't change after the first node has been added to + /// the tree. + index_tree_node *leftmost; + + /// The rightmost node in the tree. Since the tree is filled + /// sequentially, this is always the node where to add the new data. + index_tree_node *rightmost; + + /// Number of nodes in the tree + uint32_t count; + +} index_tree; + + +typedef struct { + lzma_vli uncompressed_sum; + lzma_vli unpadded_sum; +} index_record; + + +typedef struct { + /// Every Record group is part of index_stream.groups tree. + index_tree_node node; + + /// Number of Blocks in this Stream before this group. + lzma_vli number_base; + + /// Number of Records that can be put in records[]. + size_t allocated; + + /// Index of the last Record in use. + size_t last; + + /// The sizes in this array are stored as cumulative sums relative + /// to the beginning of the Stream. This makes it possible to + /// use binary search in lzma_index_locate(). + /// + /// Note that the cumulative summing is done specially for + /// unpadded_sum: The previous value is rounded up to the next + /// multiple of four before adding the Unpadded Size of the new + /// Block. The total encoded size of the Blocks in the Stream + /// is records[last].unpadded_sum in the last Record group of + /// the Stream. + /// + /// For example, if the Unpadded Sizes are 39, 57, and 81, the + /// stored values are 39, 97 (40 + 57), and 181 (100 + 181). + /// The total encoded size of these Blocks is 184. + /// + /// This is a flexible array, because it makes easy to optimize + /// memory usage in case someone concatenates many Streams that + /// have only one or few Blocks. + index_record records[]; + +} index_group; + + +typedef struct { + /// Every index_stream is a node in the tree of Streams. + index_tree_node node; + + /// Number of this Stream (first one is 1) + uint32_t number; + + /// Total number of Blocks before this Stream + lzma_vli block_number_base; + + /// Record groups of this Stream are stored in a tree. + /// It's a T-tree with AVL-tree balancing. There are + /// INDEX_GROUP_SIZE Records per node by default. + /// This keeps the number of memory allocations reasonable + /// and finding a Record is fast. + index_tree groups; + + /// Number of Records in this Stream + lzma_vli record_count; + + /// Size of the List of Records field in this Stream. This is used + /// together with record_count to calculate the size of the Index + /// field and thus the total size of the Stream. + lzma_vli index_list_size; + + /// Stream Flags of this Stream. This is meaningful only if + /// the Stream Flags have been told us with lzma_index_stream_flags(). + /// Initially stream_flags.version is set to UINT32_MAX to indicate + /// that the Stream Flags are unknown. + lzma_stream_flags stream_flags; + + /// Amount of Stream Padding after this Stream. This defaults to + /// zero and can be set with lzma_index_stream_padding(). + lzma_vli stream_padding; + +} index_stream; + + +struct lzma_index_s { + /// AVL-tree containing the Stream(s). Often there is just one + /// Stream, but using a tree keeps lookups fast even when there + /// are many concatenated Streams. + index_tree streams; + + /// Uncompressed size of all the Blocks in the Stream(s) + lzma_vli uncompressed_size; + + /// Total size of all the Blocks in the Stream(s) + lzma_vli total_size; + + /// Total number of Records in all Streams in this lzma_index + lzma_vli record_count; + + /// Size of the List of Records field if all the Streams in this + /// lzma_index were packed into a single Stream (makes it simpler to + /// take many .xz files and combine them into a single Stream). + /// + /// This value together with record_count is needed to calculate + /// Backward Size that is stored into Stream Footer. + lzma_vli index_list_size; + + /// How many Records to allocate at once in lzma_index_append(). + /// This defaults to INDEX_GROUP_SIZE but can be overridden with + /// lzma_index_prealloc(). + size_t prealloc; + + /// Bitmask indicating what integrity check types have been used + /// as set by lzma_index_stream_flags(). The bit of the last Stream + /// is not included here, since it is possible to change it by + /// calling lzma_index_stream_flags() again. + uint32_t checks; +}; + + +static void +index_tree_init(index_tree *tree) +{ + tree->root = NULL; + tree->leftmost = NULL; + tree->rightmost = NULL; + tree->count = 0; + return; +} + + +/// Helper for index_tree_end() +static void +index_tree_node_end(index_tree_node *node, const lzma_allocator *allocator, + void (*free_func)(void *node, const lzma_allocator *allocator)) +{ + // The tree won't ever be very huge, so recursion should be fine. + // 20 levels in the tree is likely quite a lot already in practice. + if (node->left != NULL) + index_tree_node_end(node->left, allocator, free_func); + + if (node->right != NULL) + index_tree_node_end(node->right, allocator, free_func); + + free_func(node, allocator); + return; +} + + +/// Free the memory allocated for a tree. Each node is freed using the +/// given free_func which is either &lzma_free or &index_stream_end. +/// The latter is used to free the Record groups from each index_stream +/// before freeing the index_stream itself. +static void +index_tree_end(index_tree *tree, const lzma_allocator *allocator, + void (*free_func)(void *node, const lzma_allocator *allocator)) +{ + assert(free_func != NULL); + + if (tree->root != NULL) + index_tree_node_end(tree->root, allocator, free_func); + + return; +} + + +/// Add a new node to the tree. node->uncompressed_base and +/// node->compressed_base must have been set by the caller already. +static void +index_tree_append(index_tree *tree, index_tree_node *node) +{ + node->parent = tree->rightmost; + node->left = NULL; + node->right = NULL; + + ++tree->count; + + // Handle the special case of adding the first node. + if (tree->root == NULL) { + tree->root = node; + tree->leftmost = node; + tree->rightmost = node; + return; + } + + // The tree is always filled sequentially. + assert(tree->rightmost->uncompressed_base <= node->uncompressed_base); + assert(tree->rightmost->compressed_base < node->compressed_base); + + // Add the new node after the rightmost node. It's the correct + // place due to the reason above. + tree->rightmost->right = node; + tree->rightmost = node; + + // Balance the AVL-tree if needed. We don't need to keep the balance + // factors in nodes, because we always fill the tree sequentially, + // and thus know the state of the tree just by looking at the node + // count. From the node count we can calculate how many steps to go + // up in the tree to find the rotation root. + uint32_t up = tree->count ^ (UINT32_C(1) << bsr32(tree->count)); + if (up != 0) { + // Locate the root node for the rotation. + up = ctz32(tree->count) + 2; + do { + node = node->parent; + } while (--up > 0); + + // Rotate left using node as the rotation root. + index_tree_node *pivot = node->right; + + if (node->parent == NULL) { + tree->root = pivot; + } else { + assert(node->parent->right == node); + node->parent->right = pivot; + } + + pivot->parent = node->parent; + + node->right = pivot->left; + if (node->right != NULL) + node->right->parent = node; + + pivot->left = node; + node->parent = pivot; + } + + return; +} + + +/// Get the next node in the tree. Return NULL if there are no more nodes. +static void * +index_tree_next(const index_tree_node *node) +{ + if (node->right != NULL) { + node = node->right; + while (node->left != NULL) + node = node->left; + + return (void *)(node); + } + + while (node->parent != NULL && node->parent->right == node) + node = node->parent; + + return (void *)(node->parent); +} + + +/// Locate a node that contains the given uncompressed offset. It is +/// caller's job to check that target is not bigger than the uncompressed +/// size of the tree (the last node would be returned in that case still). +static void * +index_tree_locate(const index_tree *tree, lzma_vli target) +{ + const index_tree_node *result = NULL; + const index_tree_node *node = tree->root; + + assert(tree->leftmost == NULL + || tree->leftmost->uncompressed_base == 0); + + // Consecutive nodes may have the same uncompressed_base. + // We must pick the rightmost one. + while (node != NULL) { + if (node->uncompressed_base > target) { + node = node->left; + } else { + result = node; + node = node->right; + } + } + + return (void *)(result); +} + + +/// Allocate and initialize a new Stream using the given base offsets. +static index_stream * +index_stream_init(lzma_vli compressed_base, lzma_vli uncompressed_base, + uint32_t stream_number, lzma_vli block_number_base, + const lzma_allocator *allocator) +{ + index_stream *s = lzma_alloc(sizeof(index_stream), allocator); + if (s == NULL) + return NULL; + + s->node.uncompressed_base = uncompressed_base; + s->node.compressed_base = compressed_base; + s->node.parent = NULL; + s->node.left = NULL; + s->node.right = NULL; + + s->number = stream_number; + s->block_number_base = block_number_base; + + index_tree_init(&s->groups); + + s->record_count = 0; + s->index_list_size = 0; + s->stream_flags.version = UINT32_MAX; + s->stream_padding = 0; + + return s; +} + + +/// Free the memory allocated for a Stream and its Record groups. +static void +index_stream_end(void *node, const lzma_allocator *allocator) +{ + index_stream *s = node; + index_tree_end(&s->groups, allocator, &lzma_free); + lzma_free(s, allocator); + return; +} + + +static lzma_index * +index_init_plain(const lzma_allocator *allocator) +{ + lzma_index *i = lzma_alloc(sizeof(lzma_index), allocator); + if (i != NULL) { + index_tree_init(&i->streams); + i->uncompressed_size = 0; + i->total_size = 0; + i->record_count = 0; + i->index_list_size = 0; + i->prealloc = INDEX_GROUP_SIZE; + i->checks = 0; + } + + return i; +} + + +extern LZMA_API(lzma_index *) +lzma_index_init(const lzma_allocator *allocator) +{ + lzma_index *i = index_init_plain(allocator); + if (i == NULL) + return NULL; + + index_stream *s = index_stream_init(0, 0, 1, 0, allocator); + if (s == NULL) { + lzma_free(i, allocator); + return NULL; + } + + index_tree_append(&i->streams, &s->node); + + return i; +} + + +extern LZMA_API(void) +lzma_index_end(lzma_index *i, const lzma_allocator *allocator) +{ + // NOTE: If you modify this function, check also the bottom + // of lzma_index_cat(). + if (i != NULL) { + index_tree_end(&i->streams, allocator, &index_stream_end); + lzma_free(i, allocator); + } + + return; +} + + +extern void +lzma_index_prealloc(lzma_index *i, lzma_vli records) +{ + if (records > PREALLOC_MAX) + records = PREALLOC_MAX; + + i->prealloc = (size_t)(records); + return; +} + + +extern LZMA_API(uint64_t) +lzma_index_memusage(lzma_vli streams, lzma_vli blocks) +{ + // This calculates an upper bound that is only a little bit + // bigger than the exact maximum memory usage with the given + // parameters. + + // Typical malloc() overhead is 2 * sizeof(void *) but we take + // a little bit extra just in case. Using LZMA_MEMUSAGE_BASE + // instead would give too inaccurate estimate. + const size_t alloc_overhead = 4 * sizeof(void *); + + // Amount of memory needed for each Stream base structures. + // We assume that every Stream has at least one Block and + // thus at least one group. + const size_t stream_base = sizeof(index_stream) + + sizeof(index_group) + 2 * alloc_overhead; + + // Amount of memory needed per group. + const size_t group_base = sizeof(index_group) + + INDEX_GROUP_SIZE * sizeof(index_record) + + alloc_overhead; + + // Number of groups. There may actually be more, but that overhead + // has been taken into account in stream_base already. + const lzma_vli groups + = (blocks + INDEX_GROUP_SIZE - 1) / INDEX_GROUP_SIZE; + + // Memory used by index_stream and index_group structures. + const uint64_t streams_mem = streams * stream_base; + const uint64_t groups_mem = groups * group_base; + + // Memory used by the base structure. + const uint64_t index_base = sizeof(lzma_index) + alloc_overhead; + + // Validate the arguments and catch integer overflows. + // Maximum number of Streams is "only" UINT32_MAX, because + // that limit is used by the tree containing the Streams. + const uint64_t limit = UINT64_MAX - index_base; + if (streams == 0 || streams > UINT32_MAX || blocks > LZMA_VLI_MAX + || streams > limit / stream_base + || groups > limit / group_base + || limit - streams_mem < groups_mem) + return UINT64_MAX; + + return index_base + streams_mem + groups_mem; +} + + +extern LZMA_API(uint64_t) +lzma_index_memused(const lzma_index *i) +{ + return lzma_index_memusage(i->streams.count, i->record_count); +} + + +extern LZMA_API(lzma_vli) +lzma_index_block_count(const lzma_index *i) +{ + return i->record_count; +} + + +extern LZMA_API(lzma_vli) +lzma_index_stream_count(const lzma_index *i) +{ + return i->streams.count; +} + + +extern LZMA_API(lzma_vli) +lzma_index_size(const lzma_index *i) +{ + return index_size(i->record_count, i->index_list_size); +} + + +extern LZMA_API(lzma_vli) +lzma_index_total_size(const lzma_index *i) +{ + return i->total_size; +} + + +extern LZMA_API(lzma_vli) +lzma_index_stream_size(const lzma_index *i) +{ + // Stream Header + Blocks + Index + Stream Footer + return LZMA_STREAM_HEADER_SIZE + i->total_size + + index_size(i->record_count, i->index_list_size) + + LZMA_STREAM_HEADER_SIZE; +} + + +static lzma_vli +index_file_size(lzma_vli compressed_base, lzma_vli unpadded_sum, + lzma_vli record_count, lzma_vli index_list_size, + lzma_vli stream_padding) +{ + // Earlier Streams and Stream Paddings + Stream Header + // + Blocks + Index + Stream Footer + Stream Padding + // + // This might go over LZMA_VLI_MAX due to too big unpadded_sum + // when this function is used in lzma_index_append(). + lzma_vli file_size = compressed_base + 2 * LZMA_STREAM_HEADER_SIZE + + stream_padding + vli_ceil4(unpadded_sum); + if (file_size > LZMA_VLI_MAX) + return LZMA_VLI_UNKNOWN; + + // The same applies here. + file_size += index_size(record_count, index_list_size); + if (file_size > LZMA_VLI_MAX) + return LZMA_VLI_UNKNOWN; + + return file_size; +} + + +extern LZMA_API(lzma_vli) +lzma_index_file_size(const lzma_index *i) +{ + const index_stream *s = (const index_stream *)(i->streams.rightmost); + const index_group *g = (const index_group *)(s->groups.rightmost); + return index_file_size(s->node.compressed_base, + g == NULL ? 0 : g->records[g->last].unpadded_sum, + s->record_count, s->index_list_size, + s->stream_padding); +} + + +extern LZMA_API(lzma_vli) +lzma_index_uncompressed_size(const lzma_index *i) +{ + return i->uncompressed_size; +} + + +extern LZMA_API(uint32_t) +lzma_index_checks(const lzma_index *i) +{ + uint32_t checks = i->checks; + + // Get the type of the Check of the last Stream too. + const index_stream *s = (const index_stream *)(i->streams.rightmost); + if (s->stream_flags.version != UINT32_MAX) + checks |= UINT32_C(1) << s->stream_flags.check; + + return checks; +} + + +extern uint32_t +lzma_index_padding_size(const lzma_index *i) +{ + return (LZMA_VLI_C(4) - index_size_unpadded( + i->record_count, i->index_list_size)) & 3; +} + + +extern LZMA_API(lzma_ret) +lzma_index_stream_flags(lzma_index *i, const lzma_stream_flags *stream_flags) +{ + if (i == NULL || stream_flags == NULL) + return LZMA_PROG_ERROR; + + // Validate the Stream Flags. + return_if_error(lzma_stream_flags_compare( + stream_flags, stream_flags)); + + index_stream *s = (index_stream *)(i->streams.rightmost); + s->stream_flags = *stream_flags; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_stream_padding(lzma_index *i, lzma_vli stream_padding) +{ + if (i == NULL || stream_padding > LZMA_VLI_MAX + || (stream_padding & 3) != 0) + return LZMA_PROG_ERROR; + + index_stream *s = (index_stream *)(i->streams.rightmost); + + // Check that the new value won't make the file grow too big. + const lzma_vli old_stream_padding = s->stream_padding; + s->stream_padding = 0; + if (lzma_index_file_size(i) + stream_padding > LZMA_VLI_MAX) { + s->stream_padding = old_stream_padding; + return LZMA_DATA_ERROR; + } + + s->stream_padding = stream_padding; + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_append(lzma_index *i, const lzma_allocator *allocator, + lzma_vli unpadded_size, lzma_vli uncompressed_size) +{ + // Validate. + if (i == NULL || unpadded_size < UNPADDED_SIZE_MIN + || unpadded_size > UNPADDED_SIZE_MAX + || uncompressed_size > LZMA_VLI_MAX) + return LZMA_PROG_ERROR; + + index_stream *s = (index_stream *)(i->streams.rightmost); + index_group *g = (index_group *)(s->groups.rightmost); + + const lzma_vli compressed_base = g == NULL ? 0 + : vli_ceil4(g->records[g->last].unpadded_sum); + const lzma_vli uncompressed_base = g == NULL ? 0 + : g->records[g->last].uncompressed_sum; + const uint32_t index_list_size_add = lzma_vli_size(unpadded_size) + + lzma_vli_size(uncompressed_size); + + // Check that uncompressed size will not overflow. + if (uncompressed_base + uncompressed_size > LZMA_VLI_MAX) + return LZMA_DATA_ERROR; + + // Check that the file size will stay within limits. + if (index_file_size(s->node.compressed_base, + compressed_base + unpadded_size, s->record_count + 1, + s->index_list_size + index_list_size_add, + s->stream_padding) == LZMA_VLI_UNKNOWN) + return LZMA_DATA_ERROR; + + // The size of the Index field must not exceed the maximum value + // that can be stored in the Backward Size field. + if (index_size(i->record_count + 1, + i->index_list_size + index_list_size_add) + > LZMA_BACKWARD_SIZE_MAX) + return LZMA_DATA_ERROR; + + if (g != NULL && g->last + 1 < g->allocated) { + // There is space in the last group at least for one Record. + ++g->last; + } else { + // We need to allocate a new group. + g = lzma_alloc(sizeof(index_group) + + i->prealloc * sizeof(index_record), + allocator); + if (g == NULL) + return LZMA_MEM_ERROR; + + g->last = 0; + g->allocated = i->prealloc; + + // Reset prealloc so that if the application happens to + // add new Records, the allocation size will be sane. + i->prealloc = INDEX_GROUP_SIZE; + + // Set the start offsets of this group. + g->node.uncompressed_base = uncompressed_base; + g->node.compressed_base = compressed_base; + g->number_base = s->record_count + 1; + + // Add the new group to the Stream. + index_tree_append(&s->groups, &g->node); + } + + // Add the new Record to the group. + g->records[g->last].uncompressed_sum + = uncompressed_base + uncompressed_size; + g->records[g->last].unpadded_sum + = compressed_base + unpadded_size; + + // Update the totals. + ++s->record_count; + s->index_list_size += index_list_size_add; + + i->total_size += vli_ceil4(unpadded_size); + i->uncompressed_size += uncompressed_size; + ++i->record_count; + i->index_list_size += index_list_size_add; + + return LZMA_OK; +} + + +/// Structure to pass info to index_cat_helper() +typedef struct { + /// Uncompressed size of the destination + lzma_vli uncompressed_size; + + /// Compressed file size of the destination + lzma_vli file_size; + + /// Same as above but for Block numbers + lzma_vli block_number_add; + + /// Number of Streams that were in the destination index before we + /// started appending new Streams from the source index. This is + /// used to fix the Stream numbering. + uint32_t stream_number_add; + + /// Destination index' Stream tree + index_tree *streams; + +} index_cat_info; + + +/// Add the Stream nodes from the source index to dest using recursion. +/// Simplest iterative traversal of the source tree wouldn't work, because +/// we update the pointers in nodes when moving them to the destination tree. +static void +index_cat_helper(const index_cat_info *info, index_stream *this) +{ + index_stream *left = (index_stream *)(this->node.left); + index_stream *right = (index_stream *)(this->node.right); + + if (left != NULL) + index_cat_helper(info, left); + + this->node.uncompressed_base += info->uncompressed_size; + this->node.compressed_base += info->file_size; + this->number += info->stream_number_add; + this->block_number_base += info->block_number_add; + index_tree_append(info->streams, &this->node); + + if (right != NULL) + index_cat_helper(info, right); + + return; +} + + +extern LZMA_API(lzma_ret) +lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src, + const lzma_allocator *allocator) +{ + if (dest == NULL || src == NULL) + return LZMA_PROG_ERROR; + + const lzma_vli dest_file_size = lzma_index_file_size(dest); + + // Check that we don't exceed the file size limits. + if (dest_file_size + lzma_index_file_size(src) > LZMA_VLI_MAX + || dest->uncompressed_size + src->uncompressed_size + > LZMA_VLI_MAX) + return LZMA_DATA_ERROR; + + // Check that the encoded size of the combined lzma_indexes stays + // within limits. In theory, this should be done only if we know + // that the user plans to actually combine the Streams and thus + // construct a single Index (probably rare). However, exceeding + // this limit is quite theoretical, so we do this check always + // to simplify things elsewhere. + { + const lzma_vli dest_size = index_size_unpadded( + dest->record_count, dest->index_list_size); + const lzma_vli src_size = index_size_unpadded( + src->record_count, src->index_list_size); + if (vli_ceil4(dest_size + src_size) > LZMA_BACKWARD_SIZE_MAX) + return LZMA_DATA_ERROR; + } + + // Optimize the last group to minimize memory usage. Allocation has + // to be done before modifying dest or src. + { + index_stream *s = (index_stream *)(dest->streams.rightmost); + index_group *g = (index_group *)(s->groups.rightmost); + if (g != NULL && g->last + 1 < g->allocated) { + assert(g->node.left == NULL); + assert(g->node.right == NULL); + + index_group *newg = lzma_alloc(sizeof(index_group) + + (g->last + 1) + * sizeof(index_record), + allocator); + if (newg == NULL) + return LZMA_MEM_ERROR; + + newg->node = g->node; + newg->allocated = g->last + 1; + newg->last = g->last; + newg->number_base = g->number_base; + + memcpy(newg->records, g->records, newg->allocated + * sizeof(index_record)); + + if (g->node.parent != NULL) { + assert(g->node.parent->right == &g->node); + g->node.parent->right = &newg->node; + } + + if (s->groups.leftmost == &g->node) { + assert(s->groups.root == &g->node); + s->groups.leftmost = &newg->node; + s->groups.root = &newg->node; + } + + assert(s->groups.rightmost == &g->node); + s->groups.rightmost = &newg->node; + + lzma_free(g, allocator); + + // NOTE: newg isn't leaked here because + // newg == (void *)&newg->node. + } + } + + // dest->checks includes the check types of all except the last Stream + // in dest. Set the bit for the check type of the last Stream now so + // that it won't get lost when Stream(s) from src are appended to dest. + dest->checks = lzma_index_checks(dest); + + // Add all the Streams from src to dest. Update the base offsets + // of each Stream from src. + const index_cat_info info = { + .uncompressed_size = dest->uncompressed_size, + .file_size = dest_file_size, + .stream_number_add = dest->streams.count, + .block_number_add = dest->record_count, + .streams = &dest->streams, + }; + index_cat_helper(&info, (index_stream *)(src->streams.root)); + + // Update info about all the combined Streams. + dest->uncompressed_size += src->uncompressed_size; + dest->total_size += src->total_size; + dest->record_count += src->record_count; + dest->index_list_size += src->index_list_size; + dest->checks |= src->checks; + + // There's nothing else left in src than the base structure. + lzma_free(src, allocator); + + return LZMA_OK; +} + + +/// Duplicate an index_stream. +static index_stream * +index_dup_stream(const index_stream *src, const lzma_allocator *allocator) +{ + // Catch a somewhat theoretical integer overflow. + if (src->record_count > PREALLOC_MAX) + return NULL; + + // Allocate and initialize a new Stream. + index_stream *dest = index_stream_init(src->node.compressed_base, + src->node.uncompressed_base, src->number, + src->block_number_base, allocator); + if (dest == NULL) + return NULL; + + // Copy the overall information. + dest->record_count = src->record_count; + dest->index_list_size = src->index_list_size; + dest->stream_flags = src->stream_flags; + dest->stream_padding = src->stream_padding; + + // Return if there are no groups to duplicate. + if (src->groups.leftmost == NULL) + return dest; + + // Allocate memory for the Records. We put all the Records into + // a single group. It's simplest and also tends to make + // lzma_index_locate() a little bit faster with very big Indexes. + index_group *destg = lzma_alloc(sizeof(index_group) + + src->record_count * sizeof(index_record), + allocator); + if (destg == NULL) { + index_stream_end(dest, allocator); + return NULL; + } + + // Initialize destg. + destg->node.uncompressed_base = 0; + destg->node.compressed_base = 0; + destg->number_base = 1; + destg->allocated = src->record_count; + destg->last = src->record_count - 1; + + // Go through all the groups in src and copy the Records into destg. + const index_group *srcg = (const index_group *)(src->groups.leftmost); + size_t i = 0; + do { + memcpy(destg->records + i, srcg->records, + (srcg->last + 1) * sizeof(index_record)); + i += srcg->last + 1; + srcg = index_tree_next(&srcg->node); + } while (srcg != NULL); + + assert(i == destg->allocated); + + // Add the group to the new Stream. + index_tree_append(&dest->groups, &destg->node); + + return dest; +} + + +extern LZMA_API(lzma_index *) +lzma_index_dup(const lzma_index *src, const lzma_allocator *allocator) +{ + // Allocate the base structure (no initial Stream). + lzma_index *dest = index_init_plain(allocator); + if (dest == NULL) + return NULL; + + // Copy the totals. + dest->uncompressed_size = src->uncompressed_size; + dest->total_size = src->total_size; + dest->record_count = src->record_count; + dest->index_list_size = src->index_list_size; + + // Copy the Streams and the groups in them. + const index_stream *srcstream + = (const index_stream *)(src->streams.leftmost); + do { + index_stream *deststream = index_dup_stream( + srcstream, allocator); + if (deststream == NULL) { + lzma_index_end(dest, allocator); + return NULL; + } + + index_tree_append(&dest->streams, &deststream->node); + + srcstream = index_tree_next(&srcstream->node); + } while (srcstream != NULL); + + return dest; +} + + +/// Indexing for lzma_index_iter.internal[] +enum { + ITER_INDEX, + ITER_STREAM, + ITER_GROUP, + ITER_RECORD, + ITER_METHOD, +}; + + +/// Values for lzma_index_iter.internal[ITER_METHOD].s +enum { + ITER_METHOD_NORMAL, + ITER_METHOD_NEXT, + ITER_METHOD_LEFTMOST, +}; + + +static void +iter_set_info(lzma_index_iter *iter) +{ + const lzma_index *i = iter->internal[ITER_INDEX].p; + const index_stream *stream = iter->internal[ITER_STREAM].p; + const index_group *group = iter->internal[ITER_GROUP].p; + const size_t record = iter->internal[ITER_RECORD].s; + + // lzma_index_iter.internal must not contain a pointer to the last + // group in the index, because that may be reallocated by + // lzma_index_cat(). + if (group == NULL) { + // There are no groups. + assert(stream->groups.root == NULL); + iter->internal[ITER_METHOD].s = ITER_METHOD_LEFTMOST; + + } else if (i->streams.rightmost != &stream->node + || stream->groups.rightmost != &group->node) { + // The group is not not the last group in the index. + iter->internal[ITER_METHOD].s = ITER_METHOD_NORMAL; + + } else if (stream->groups.leftmost != &group->node) { + // The group isn't the only group in the Stream, thus we + // know that it must have a parent group i.e. it's not + // the root node. + assert(stream->groups.root != &group->node); + assert(group->node.parent->right == &group->node); + iter->internal[ITER_METHOD].s = ITER_METHOD_NEXT; + iter->internal[ITER_GROUP].p = group->node.parent; + + } else { + // The Stream has only one group. + assert(stream->groups.root == &group->node); + assert(group->node.parent == NULL); + iter->internal[ITER_METHOD].s = ITER_METHOD_LEFTMOST; + iter->internal[ITER_GROUP].p = NULL; + } + + // NOTE: lzma_index_iter.stream.number is lzma_vli but we use uint32_t + // internally. + iter->stream.number = stream->number; + iter->stream.block_count = stream->record_count; + iter->stream.compressed_offset = stream->node.compressed_base; + iter->stream.uncompressed_offset = stream->node.uncompressed_base; + + // iter->stream.flags will be NULL if the Stream Flags haven't been + // set with lzma_index_stream_flags(). + iter->stream.flags = stream->stream_flags.version == UINT32_MAX + ? NULL : &stream->stream_flags; + iter->stream.padding = stream->stream_padding; + + if (stream->groups.rightmost == NULL) { + // Stream has no Blocks. + iter->stream.compressed_size = index_size(0, 0) + + 2 * LZMA_STREAM_HEADER_SIZE; + iter->stream.uncompressed_size = 0; + } else { + const index_group *g = (const index_group *)( + stream->groups.rightmost); + + // Stream Header + Stream Footer + Index + Blocks + iter->stream.compressed_size = 2 * LZMA_STREAM_HEADER_SIZE + + index_size(stream->record_count, + stream->index_list_size) + + vli_ceil4(g->records[g->last].unpadded_sum); + iter->stream.uncompressed_size + = g->records[g->last].uncompressed_sum; + } + + if (group != NULL) { + iter->block.number_in_stream = group->number_base + record; + iter->block.number_in_file = iter->block.number_in_stream + + stream->block_number_base; + + iter->block.compressed_stream_offset + = record == 0 ? group->node.compressed_base + : vli_ceil4(group->records[ + record - 1].unpadded_sum); + iter->block.uncompressed_stream_offset + = record == 0 ? group->node.uncompressed_base + : group->records[record - 1].uncompressed_sum; + + iter->block.uncompressed_size + = group->records[record].uncompressed_sum + - iter->block.uncompressed_stream_offset; + iter->block.unpadded_size + = group->records[record].unpadded_sum + - iter->block.compressed_stream_offset; + iter->block.total_size = vli_ceil4(iter->block.unpadded_size); + + iter->block.compressed_stream_offset + += LZMA_STREAM_HEADER_SIZE; + + iter->block.compressed_file_offset + = iter->block.compressed_stream_offset + + iter->stream.compressed_offset; + iter->block.uncompressed_file_offset + = iter->block.uncompressed_stream_offset + + iter->stream.uncompressed_offset; + } + + return; +} + + +extern LZMA_API(void) +lzma_index_iter_init(lzma_index_iter *iter, const lzma_index *i) +{ + iter->internal[ITER_INDEX].p = i; + lzma_index_iter_rewind(iter); + return; +} + + +extern LZMA_API(void) +lzma_index_iter_rewind(lzma_index_iter *iter) +{ + iter->internal[ITER_STREAM].p = NULL; + iter->internal[ITER_GROUP].p = NULL; + iter->internal[ITER_RECORD].s = 0; + iter->internal[ITER_METHOD].s = ITER_METHOD_NORMAL; + return; +} + + +extern LZMA_API(lzma_bool) +lzma_index_iter_next(lzma_index_iter *iter, lzma_index_iter_mode mode) +{ + // Catch unsupported mode values. + if ((unsigned int)(mode) > LZMA_INDEX_ITER_NONEMPTY_BLOCK) + return true; + + const lzma_index *i = iter->internal[ITER_INDEX].p; + const index_stream *stream = iter->internal[ITER_STREAM].p; + const index_group *group = NULL; + size_t record = iter->internal[ITER_RECORD].s; + + // If we are being asked for the next Stream, leave group to NULL + // so that the rest of the this function thinks that this Stream + // has no groups and will thus go to the next Stream. + if (mode != LZMA_INDEX_ITER_STREAM) { + // Get the pointer to the current group. See iter_set_inf() + // for explanation. + switch (iter->internal[ITER_METHOD].s) { + case ITER_METHOD_NORMAL: + group = iter->internal[ITER_GROUP].p; + break; + + case ITER_METHOD_NEXT: + group = index_tree_next(iter->internal[ITER_GROUP].p); + break; + + case ITER_METHOD_LEFTMOST: + group = (const index_group *)( + stream->groups.leftmost); + break; + } + } + +again: + if (stream == NULL) { + // We at the beginning of the lzma_index. + // Locate the first Stream. + stream = (const index_stream *)(i->streams.leftmost); + if (mode >= LZMA_INDEX_ITER_BLOCK) { + // Since we are being asked to return information + // about the first a Block, skip Streams that have + // no Blocks. + while (stream->groups.leftmost == NULL) { + stream = index_tree_next(&stream->node); + if (stream == NULL) + return true; + } + } + + // Start from the first Record in the Stream. + group = (const index_group *)(stream->groups.leftmost); + record = 0; + + } else if (group != NULL && record < group->last) { + // The next Record is in the same group. + ++record; + + } else { + // This group has no more Records or this Stream has + // no Blocks at all. + record = 0; + + // If group is not NULL, this Stream has at least one Block + // and thus at least one group. Find the next group. + if (group != NULL) + group = index_tree_next(&group->node); + + if (group == NULL) { + // This Stream has no more Records. Find the next + // Stream. If we are being asked to return information + // about a Block, we skip empty Streams. + do { + stream = index_tree_next(&stream->node); + if (stream == NULL) + return true; + } while (mode >= LZMA_INDEX_ITER_BLOCK + && stream->groups.leftmost == NULL); + + group = (const index_group *)( + stream->groups.leftmost); + } + } + + if (mode == LZMA_INDEX_ITER_NONEMPTY_BLOCK) { + // We need to look for the next Block again if this Block + // is empty. + if (record == 0) { + if (group->node.uncompressed_base + == group->records[0].uncompressed_sum) + goto again; + } else if (group->records[record - 1].uncompressed_sum + == group->records[record].uncompressed_sum) { + goto again; + } + } + + iter->internal[ITER_STREAM].p = stream; + iter->internal[ITER_GROUP].p = group; + iter->internal[ITER_RECORD].s = record; + + iter_set_info(iter); + + return false; +} + + +extern LZMA_API(lzma_bool) +lzma_index_iter_locate(lzma_index_iter *iter, lzma_vli target) +{ + const lzma_index *i = iter->internal[ITER_INDEX].p; + + // If the target is past the end of the file, return immediately. + if (i->uncompressed_size <= target) + return true; + + // Locate the Stream containing the target offset. + const index_stream *stream = index_tree_locate(&i->streams, target); + assert(stream != NULL); + target -= stream->node.uncompressed_base; + + // Locate the group containing the target offset. + const index_group *group = index_tree_locate(&stream->groups, target); + assert(group != NULL); + + // Use binary search to locate the exact Record. It is the first + // Record whose uncompressed_sum is greater than target. + // This is because we want the rightmost Record that fulfills the + // search criterion. It is possible that there are empty Blocks; + // we don't want to return them. + size_t left = 0; + size_t right = group->last; + + while (left < right) { + const size_t pos = left + (right - left) / 2; + if (group->records[pos].uncompressed_sum <= target) + left = pos + 1; + else + right = pos; + } + + iter->internal[ITER_STREAM].p = stream; + iter->internal[ITER_GROUP].p = group; + iter->internal[ITER_RECORD].s = left; + + iter_set_info(iter); + + return false; +} diff --git a/src/liblzma/common/index.h b/src/liblzma/common/index.h new file mode 100644 index 0000000..031efcc --- /dev/null +++ b/src/liblzma/common/index.h @@ -0,0 +1,81 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index.h +/// \brief Handling of Index +/// \note This header file does not include common.h or lzma.h because +/// this file is needed by both liblzma internally and by the +/// tests. Including common.h will include and define many things +/// the tests do not need and prevents issues with header file +/// include order. This way, if lzma.h or common.h are not +/// included before this file it will break on every OS instead +/// of causing more subtle errors. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_INDEX_H +#define LZMA_INDEX_H + + +/// Minimum Unpadded Size +#define UNPADDED_SIZE_MIN LZMA_VLI_C(5) + +/// Maximum Unpadded Size +#define UNPADDED_SIZE_MAX (LZMA_VLI_MAX & ~LZMA_VLI_C(3)) + +/// Index Indicator based on xz specification +#define INDEX_INDICATOR 0 + + +/// Get the size of the Index Padding field. This is needed by Index encoder +/// and decoder, but applications should have no use for this. +extern uint32_t lzma_index_padding_size(const lzma_index *i); + + +/// Set for how many Records to allocate memory the next time +/// lzma_index_append() needs to allocate space for a new Record. +/// This is used only by the Index decoder. +extern void lzma_index_prealloc(lzma_index *i, lzma_vli records); + + +/// Round the variable-length integer to the next multiple of four. +static inline lzma_vli +vli_ceil4(lzma_vli vli) +{ + assert(vli <= LZMA_VLI_MAX); + return (vli + 3) & ~LZMA_VLI_C(3); +} + + +/// Calculate the size of the Index field excluding Index Padding +static inline lzma_vli +index_size_unpadded(lzma_vli count, lzma_vli index_list_size) +{ + // Index Indicator + Number of Records + List of Records + CRC32 + return 1 + lzma_vli_size(count) + index_list_size + 4; +} + + +/// Calculate the size of the Index field including Index Padding +static inline lzma_vli +index_size(lzma_vli count, lzma_vli index_list_size) +{ + return vli_ceil4(index_size_unpadded(count, index_list_size)); +} + + +/// Calculate the total size of the Stream +static inline lzma_vli +index_stream_size(lzma_vli blocks_size, + lzma_vli count, lzma_vli index_list_size) +{ + return LZMA_STREAM_HEADER_SIZE + blocks_size + + index_size(count, index_list_size) + + LZMA_STREAM_HEADER_SIZE; +} + +#endif diff --git a/src/liblzma/common/index_decoder.c b/src/liblzma/common/index_decoder.c new file mode 100644 index 0000000..8622b2f --- /dev/null +++ b/src/liblzma/common/index_decoder.c @@ -0,0 +1,355 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index_decoder.c +/// \brief Decodes the Index field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "index_decoder.h" +#include "check.h" + + +typedef struct { + enum { + SEQ_INDICATOR, + SEQ_COUNT, + SEQ_MEMUSAGE, + SEQ_UNPADDED, + SEQ_UNCOMPRESSED, + SEQ_PADDING_INIT, + SEQ_PADDING, + SEQ_CRC32, + } sequence; + + /// Memory usage limit + uint64_t memlimit; + + /// Target Index + lzma_index *index; + + /// Pointer give by the application, which is set after + /// successful decoding. + lzma_index **index_ptr; + + /// Number of Records left to decode. + lzma_vli count; + + /// The most recent Unpadded Size field + lzma_vli unpadded_size; + + /// The most recent Uncompressed Size field + lzma_vli uncompressed_size; + + /// Position in integers + size_t pos; + + /// CRC32 of the List of Records field + uint32_t crc32; +} lzma_index_coder; + + +static lzma_ret +index_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, + uint8_t *restrict out lzma_attribute((__unused__)), + size_t *restrict out_pos lzma_attribute((__unused__)), + size_t out_size lzma_attribute((__unused__)), + lzma_action action lzma_attribute((__unused__))) +{ + lzma_index_coder *coder = coder_ptr; + + // Similar optimization as in index_encoder.c + const size_t in_start = *in_pos; + lzma_ret ret = LZMA_OK; + + while (*in_pos < in_size) + switch (coder->sequence) { + case SEQ_INDICATOR: + // Return LZMA_DATA_ERROR instead of e.g. LZMA_PROG_ERROR or + // LZMA_FORMAT_ERROR, because a typical usage case for Index + // decoder is when parsing the Stream backwards. If seeking + // backward from the Stream Footer gives us something that + // doesn't begin with Index Indicator, the file is considered + // corrupt, not "programming error" or "unrecognized file + // format". One could argue that the application should + // verify the Index Indicator before trying to decode the + // Index, but well, I suppose it is simpler this way. + if (in[(*in_pos)++] != INDEX_INDICATOR) + return LZMA_DATA_ERROR; + + coder->sequence = SEQ_COUNT; + break; + + case SEQ_COUNT: + ret = lzma_vli_decode(&coder->count, &coder->pos, + in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + goto out; + + coder->pos = 0; + coder->sequence = SEQ_MEMUSAGE; + + // Fall through + + case SEQ_MEMUSAGE: + if (lzma_index_memusage(1, coder->count) > coder->memlimit) { + ret = LZMA_MEMLIMIT_ERROR; + goto out; + } + + // Tell the Index handling code how many Records this + // Index has to allow it to allocate memory more efficiently. + lzma_index_prealloc(coder->index, coder->count); + + ret = LZMA_OK; + coder->sequence = coder->count == 0 + ? SEQ_PADDING_INIT : SEQ_UNPADDED; + break; + + case SEQ_UNPADDED: + case SEQ_UNCOMPRESSED: { + lzma_vli *size = coder->sequence == SEQ_UNPADDED + ? &coder->unpadded_size + : &coder->uncompressed_size; + + ret = lzma_vli_decode(size, &coder->pos, + in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + goto out; + + ret = LZMA_OK; + coder->pos = 0; + + if (coder->sequence == SEQ_UNPADDED) { + // Validate that encoded Unpadded Size isn't too small + // or too big. + if (coder->unpadded_size < UNPADDED_SIZE_MIN + || coder->unpadded_size + > UNPADDED_SIZE_MAX) + return LZMA_DATA_ERROR; + + coder->sequence = SEQ_UNCOMPRESSED; + } else { + // Add the decoded Record to the Index. + return_if_error(lzma_index_append( + coder->index, allocator, + coder->unpadded_size, + coder->uncompressed_size)); + + // Check if this was the last Record. + coder->sequence = --coder->count == 0 + ? SEQ_PADDING_INIT + : SEQ_UNPADDED; + } + + break; + } + + case SEQ_PADDING_INIT: + coder->pos = lzma_index_padding_size(coder->index); + coder->sequence = SEQ_PADDING; + + // Fall through + + case SEQ_PADDING: + if (coder->pos > 0) { + --coder->pos; + if (in[(*in_pos)++] != 0x00) + return LZMA_DATA_ERROR; + + break; + } + + // Finish the CRC32 calculation. + coder->crc32 = lzma_crc32(in + in_start, + *in_pos - in_start, coder->crc32); + + coder->sequence = SEQ_CRC32; + + // Fall through + + case SEQ_CRC32: + do { + if (*in_pos == in_size) + return LZMA_OK; + + if (((coder->crc32 >> (coder->pos * 8)) & 0xFF) + != in[(*in_pos)++]) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + return LZMA_DATA_ERROR; +#endif + } + + } while (++coder->pos < 4); + + // Decoding was successful, now we can let the application + // see the decoded Index. + *coder->index_ptr = coder->index; + + // Make index NULL so we don't free it unintentionally. + coder->index = NULL; + + return LZMA_STREAM_END; + + default: + assert(0); + return LZMA_PROG_ERROR; + } + +out: + // Update the CRC32, + coder->crc32 = lzma_crc32(in + in_start, + *in_pos - in_start, coder->crc32); + + return ret; +} + + +static void +index_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_index_coder *coder = coder_ptr; + lzma_index_end(coder->index, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +index_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_index_coder *coder = coder_ptr; + + *memusage = lzma_index_memusage(1, coder->count); + *old_memlimit = coder->memlimit; + + if (new_memlimit != 0) { + if (new_memlimit < *memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +static lzma_ret +index_decoder_reset(lzma_index_coder *coder, const lzma_allocator *allocator, + lzma_index **i, uint64_t memlimit) +{ + // Remember the pointer given by the application. We will set it + // to point to the decoded Index only if decoding is successful. + // Before that, keep it NULL so that applications can always safely + // pass it to lzma_index_end() no matter did decoding succeed or not. + coder->index_ptr = i; + *i = NULL; + + // We always allocate a new lzma_index. + coder->index = lzma_index_init(allocator); + if (coder->index == NULL) + return LZMA_MEM_ERROR; + + // Initialize the rest. + coder->sequence = SEQ_INDICATOR; + coder->memlimit = my_max(1, memlimit); + coder->count = 0; // Needs to be initialized due to _memconfig(). + coder->pos = 0; + coder->crc32 = 0; + + return LZMA_OK; +} + + +extern lzma_ret +lzma_index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + lzma_index **i, uint64_t memlimit) +{ + lzma_next_coder_init(&lzma_index_decoder_init, next, allocator); + + if (i == NULL) + return LZMA_PROG_ERROR; + + lzma_index_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_index_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &index_decode; + next->end = &index_decoder_end; + next->memconfig = &index_decoder_memconfig; + coder->index = NULL; + } else { + lzma_index_end(coder->index, allocator); + } + + return index_decoder_reset(coder, allocator, i, memlimit); +} + + +extern LZMA_API(lzma_ret) +lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit) +{ + lzma_next_strm_init(lzma_index_decoder_init, strm, i, memlimit); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_buffer_decode(lzma_index **i, uint64_t *memlimit, + const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size) +{ + // Sanity checks + if (i == NULL || memlimit == NULL + || in == NULL || in_pos == NULL || *in_pos > in_size) + return LZMA_PROG_ERROR; + + // Initialize the decoder. + lzma_index_coder coder; + return_if_error(index_decoder_reset(&coder, allocator, i, *memlimit)); + + // Store the input start position so that we can restore it in case + // of an error. + const size_t in_start = *in_pos; + + // Do the actual decoding. + lzma_ret ret = index_decode(&coder, allocator, in, in_pos, in_size, + NULL, NULL, 0, LZMA_RUN); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + // Something went wrong, free the Index structure and restore + // the input position. + lzma_index_end(coder.index, allocator); + *in_pos = in_start; + + if (ret == LZMA_OK) { + // The input is truncated or otherwise corrupt. + // Use LZMA_DATA_ERROR instead of LZMA_BUF_ERROR + // like lzma_vli_decode() does in single-call mode. + ret = LZMA_DATA_ERROR; + + } else if (ret == LZMA_MEMLIMIT_ERROR) { + // Tell the caller how much memory would have + // been needed. + *memlimit = lzma_index_memusage(1, coder.count); + } + } + + return ret; +} diff --git a/src/liblzma/common/index_decoder.h b/src/liblzma/common/index_decoder.h new file mode 100644 index 0000000..3fec483 --- /dev/null +++ b/src/liblzma/common/index_decoder.h @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index_decoder.h +/// \brief Decodes the Index field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_INDEX_DECODER_H +#define LZMA_INDEX_DECODER_H + +#include "common.h" +#include "index.h" + + +extern lzma_ret lzma_index_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + lzma_index **i, uint64_t memlimit); + + +#endif diff --git a/src/liblzma/common/index_encoder.c b/src/liblzma/common/index_encoder.c new file mode 100644 index 0000000..c7cafb7 --- /dev/null +++ b/src/liblzma/common/index_encoder.c @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index_encoder.c +/// \brief Encodes the Index field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "index_encoder.h" +#include "index.h" +#include "check.h" + + +typedef struct { + enum { + SEQ_INDICATOR, + SEQ_COUNT, + SEQ_UNPADDED, + SEQ_UNCOMPRESSED, + SEQ_NEXT, + SEQ_PADDING, + SEQ_CRC32, + } sequence; + + /// Index being encoded + const lzma_index *index; + + /// Iterator for the Index being encoded + lzma_index_iter iter; + + /// Position in integers + size_t pos; + + /// CRC32 of the List of Records field + uint32_t crc32; +} lzma_index_coder; + + +static lzma_ret +index_encode(void *coder_ptr, + const lzma_allocator *allocator lzma_attribute((__unused__)), + const uint8_t *restrict in lzma_attribute((__unused__)), + size_t *restrict in_pos lzma_attribute((__unused__)), + size_t in_size lzma_attribute((__unused__)), + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, + lzma_action action lzma_attribute((__unused__))) +{ + lzma_index_coder *coder = coder_ptr; + + // Position where to start calculating CRC32. The idea is that we + // need to call lzma_crc32() only once per call to index_encode(). + const size_t out_start = *out_pos; + + // Return value to use if we return at the end of this function. + // We use "goto out" to jump out of the while-switch construct + // instead of returning directly, because that way we don't need + // to copypaste the lzma_crc32() call to many places. + lzma_ret ret = LZMA_OK; + + while (*out_pos < out_size) + switch (coder->sequence) { + case SEQ_INDICATOR: + out[*out_pos] = INDEX_INDICATOR; + ++*out_pos; + coder->sequence = SEQ_COUNT; + break; + + case SEQ_COUNT: { + const lzma_vli count = lzma_index_block_count(coder->index); + ret = lzma_vli_encode(count, &coder->pos, + out, out_pos, out_size); + if (ret != LZMA_STREAM_END) + goto out; + + ret = LZMA_OK; + coder->pos = 0; + coder->sequence = SEQ_NEXT; + break; + } + + case SEQ_NEXT: + if (lzma_index_iter_next( + &coder->iter, LZMA_INDEX_ITER_BLOCK)) { + // Get the size of the Index Padding field. + coder->pos = lzma_index_padding_size(coder->index); + assert(coder->pos <= 3); + coder->sequence = SEQ_PADDING; + break; + } + + coder->sequence = SEQ_UNPADDED; + + // Fall through + + case SEQ_UNPADDED: + case SEQ_UNCOMPRESSED: { + const lzma_vli size = coder->sequence == SEQ_UNPADDED + ? coder->iter.block.unpadded_size + : coder->iter.block.uncompressed_size; + + ret = lzma_vli_encode(size, &coder->pos, + out, out_pos, out_size); + if (ret != LZMA_STREAM_END) + goto out; + + ret = LZMA_OK; + coder->pos = 0; + + // Advance to SEQ_UNCOMPRESSED or SEQ_NEXT. + ++coder->sequence; + break; + } + + case SEQ_PADDING: + if (coder->pos > 0) { + --coder->pos; + out[(*out_pos)++] = 0x00; + break; + } + + // Finish the CRC32 calculation. + coder->crc32 = lzma_crc32(out + out_start, + *out_pos - out_start, coder->crc32); + + coder->sequence = SEQ_CRC32; + + // Fall through + + case SEQ_CRC32: + // We don't use the main loop, because we don't want + // coder->crc32 to be touched anymore. + do { + if (*out_pos == out_size) + return LZMA_OK; + + out[*out_pos] = (coder->crc32 >> (coder->pos * 8)) + & 0xFF; + ++*out_pos; + + } while (++coder->pos < 4); + + return LZMA_STREAM_END; + + default: + assert(0); + return LZMA_PROG_ERROR; + } + +out: + // Update the CRC32. + coder->crc32 = lzma_crc32(out + out_start, + *out_pos - out_start, coder->crc32); + + return ret; +} + + +static void +index_encoder_end(void *coder, const lzma_allocator *allocator) +{ + lzma_free(coder, allocator); + return; +} + + +static void +index_encoder_reset(lzma_index_coder *coder, const lzma_index *i) +{ + lzma_index_iter_init(&coder->iter, i); + + coder->sequence = SEQ_INDICATOR; + coder->index = i; + coder->pos = 0; + coder->crc32 = 0; + + return; +} + + +extern lzma_ret +lzma_index_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_index *i) +{ + lzma_next_coder_init(&lzma_index_encoder_init, next, allocator); + + if (i == NULL) + return LZMA_PROG_ERROR; + + if (next->coder == NULL) { + next->coder = lzma_alloc(sizeof(lzma_index_coder), allocator); + if (next->coder == NULL) + return LZMA_MEM_ERROR; + + next->code = &index_encode; + next->end = &index_encoder_end; + } + + index_encoder_reset(next->coder, i); + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_encoder(lzma_stream *strm, const lzma_index *i) +{ + lzma_next_strm_init(lzma_index_encoder_init, strm, i); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_buffer_encode(const lzma_index *i, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Validate the arguments. + if (i == NULL || out == NULL || out_pos == NULL || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // Don't try to encode if there's not enough output space. + if (out_size - *out_pos < lzma_index_size(i)) + return LZMA_BUF_ERROR; + + // The Index encoder needs just one small data structure so we can + // allocate it on stack. + lzma_index_coder coder; + index_encoder_reset(&coder, i); + + // Do the actual encoding. This should never fail, but store + // the original *out_pos just in case. + const size_t out_start = *out_pos; + lzma_ret ret = index_encode(&coder, NULL, NULL, NULL, 0, + out, out_pos, out_size, LZMA_RUN); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + // We should never get here, but just in case, restore the + // output position and set the error accordingly if something + // goes wrong and debugging isn't enabled. + assert(0); + *out_pos = out_start; + ret = LZMA_PROG_ERROR; + } + + return ret; +} diff --git a/src/liblzma/common/index_encoder.h b/src/liblzma/common/index_encoder.h new file mode 100644 index 0000000..4d55cd1 --- /dev/null +++ b/src/liblzma/common/index_encoder.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index_encoder.h +/// \brief Encodes the Index field +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_INDEX_ENCODER_H +#define LZMA_INDEX_ENCODER_H + +#include "common.h" + + +extern lzma_ret lzma_index_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, const lzma_index *i); + + +#endif diff --git a/src/liblzma/common/index_hash.c b/src/liblzma/common/index_hash.c new file mode 100644 index 0000000..f55f7bc --- /dev/null +++ b/src/liblzma/common/index_hash.c @@ -0,0 +1,336 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file index_hash.c +/// \brief Validates Index by using a hash function +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "index.h" +#include "check.h" + + +typedef struct { + /// Sum of the Block sizes (including Block Padding) + lzma_vli blocks_size; + + /// Sum of the Uncompressed Size fields + lzma_vli uncompressed_size; + + /// Number of Records + lzma_vli count; + + /// Size of the List of Index Records as bytes + lzma_vli index_list_size; + + /// Check calculated from Unpadded Sizes and Uncompressed Sizes. + lzma_check_state check; + +} lzma_index_hash_info; + + +struct lzma_index_hash_s { + enum { + SEQ_BLOCK, + SEQ_COUNT, + SEQ_UNPADDED, + SEQ_UNCOMPRESSED, + SEQ_PADDING_INIT, + SEQ_PADDING, + SEQ_CRC32, + } sequence; + + /// Information collected while decoding the actual Blocks. + lzma_index_hash_info blocks; + + /// Information collected from the Index field. + lzma_index_hash_info records; + + /// Number of Records not fully decoded + lzma_vli remaining; + + /// Unpadded Size currently being read from an Index Record. + lzma_vli unpadded_size; + + /// Uncompressed Size currently being read from an Index Record. + lzma_vli uncompressed_size; + + /// Position in variable-length integers when decoding them from + /// the List of Records. + size_t pos; + + /// CRC32 of the Index + uint32_t crc32; +}; + + +extern LZMA_API(lzma_index_hash *) +lzma_index_hash_init(lzma_index_hash *index_hash, + const lzma_allocator *allocator) +{ + if (index_hash == NULL) { + index_hash = lzma_alloc(sizeof(lzma_index_hash), allocator); + if (index_hash == NULL) + return NULL; + } + + index_hash->sequence = SEQ_BLOCK; + index_hash->blocks.blocks_size = 0; + index_hash->blocks.uncompressed_size = 0; + index_hash->blocks.count = 0; + index_hash->blocks.index_list_size = 0; + index_hash->records.blocks_size = 0; + index_hash->records.uncompressed_size = 0; + index_hash->records.count = 0; + index_hash->records.index_list_size = 0; + index_hash->unpadded_size = 0; + index_hash->uncompressed_size = 0; + index_hash->pos = 0; + index_hash->crc32 = 0; + + // These cannot fail because LZMA_CHECK_BEST is known to be supported. + (void)lzma_check_init(&index_hash->blocks.check, LZMA_CHECK_BEST); + (void)lzma_check_init(&index_hash->records.check, LZMA_CHECK_BEST); + + return index_hash; +} + + +extern LZMA_API(void) +lzma_index_hash_end(lzma_index_hash *index_hash, + const lzma_allocator *allocator) +{ + lzma_free(index_hash, allocator); + return; +} + + +extern LZMA_API(lzma_vli) +lzma_index_hash_size(const lzma_index_hash *index_hash) +{ + // Get the size of the Index from ->blocks instead of ->records for + // cases where application wants to know the Index Size before + // decoding the Index. + return index_size(index_hash->blocks.count, + index_hash->blocks.index_list_size); +} + + +/// Updates the sizes and the hash without any validation. +static void +hash_append(lzma_index_hash_info *info, lzma_vli unpadded_size, + lzma_vli uncompressed_size) +{ + info->blocks_size += vli_ceil4(unpadded_size); + info->uncompressed_size += uncompressed_size; + info->index_list_size += lzma_vli_size(unpadded_size) + + lzma_vli_size(uncompressed_size); + ++info->count; + + const lzma_vli sizes[2] = { unpadded_size, uncompressed_size }; + lzma_check_update(&info->check, LZMA_CHECK_BEST, + (const uint8_t *)(sizes), sizeof(sizes)); + + return; +} + + +extern LZMA_API(lzma_ret) +lzma_index_hash_append(lzma_index_hash *index_hash, lzma_vli unpadded_size, + lzma_vli uncompressed_size) +{ + // Validate the arguments. + if (index_hash == NULL || index_hash->sequence != SEQ_BLOCK + || unpadded_size < UNPADDED_SIZE_MIN + || unpadded_size > UNPADDED_SIZE_MAX + || uncompressed_size > LZMA_VLI_MAX) + return LZMA_PROG_ERROR; + + // Update the hash. + hash_append(&index_hash->blocks, unpadded_size, uncompressed_size); + + // Validate the properties of *info are still in allowed limits. + if (index_hash->blocks.blocks_size > LZMA_VLI_MAX + || index_hash->blocks.uncompressed_size > LZMA_VLI_MAX + || index_size(index_hash->blocks.count, + index_hash->blocks.index_list_size) + > LZMA_BACKWARD_SIZE_MAX + || index_stream_size(index_hash->blocks.blocks_size, + index_hash->blocks.count, + index_hash->blocks.index_list_size) + > LZMA_VLI_MAX) + return LZMA_DATA_ERROR; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_index_hash_decode(lzma_index_hash *index_hash, const uint8_t *in, + size_t *in_pos, size_t in_size) +{ + // Catch zero input buffer here, because in contrast to Index encoder + // and decoder functions, applications call this function directly + // instead of via lzma_code(), which does the buffer checking. + if (*in_pos >= in_size) + return LZMA_BUF_ERROR; + + // NOTE: This function has many similarities to index_encode() and + // index_decode() functions found from index_encoder.c and + // index_decoder.c. See the comments especially in index_encoder.c. + const size_t in_start = *in_pos; + lzma_ret ret = LZMA_OK; + + while (*in_pos < in_size) + switch (index_hash->sequence) { + case SEQ_BLOCK: + // Check the Index Indicator is present. + if (in[(*in_pos)++] != INDEX_INDICATOR) + return LZMA_DATA_ERROR; + + index_hash->sequence = SEQ_COUNT; + break; + + case SEQ_COUNT: { + ret = lzma_vli_decode(&index_hash->remaining, + &index_hash->pos, in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + goto out; + + // The count must match the count of the Blocks decoded. + if (index_hash->remaining != index_hash->blocks.count) + return LZMA_DATA_ERROR; + + ret = LZMA_OK; + index_hash->pos = 0; + + // Handle the special case when there are no Blocks. + index_hash->sequence = index_hash->remaining == 0 + ? SEQ_PADDING_INIT : SEQ_UNPADDED; + break; + } + + case SEQ_UNPADDED: + case SEQ_UNCOMPRESSED: { + lzma_vli *size = index_hash->sequence == SEQ_UNPADDED + ? &index_hash->unpadded_size + : &index_hash->uncompressed_size; + + ret = lzma_vli_decode(size, &index_hash->pos, + in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + goto out; + + ret = LZMA_OK; + index_hash->pos = 0; + + if (index_hash->sequence == SEQ_UNPADDED) { + if (index_hash->unpadded_size < UNPADDED_SIZE_MIN + || index_hash->unpadded_size + > UNPADDED_SIZE_MAX) + return LZMA_DATA_ERROR; + + index_hash->sequence = SEQ_UNCOMPRESSED; + } else { + // Update the hash. + hash_append(&index_hash->records, + index_hash->unpadded_size, + index_hash->uncompressed_size); + + // Verify that we don't go over the known sizes. Note + // that this validation is simpler than the one used + // in lzma_index_hash_append(), because here we know + // that values in index_hash->blocks are already + // validated and we are fine as long as we don't + // exceed them in index_hash->records. + if (index_hash->blocks.blocks_size + < index_hash->records.blocks_size + || index_hash->blocks.uncompressed_size + < index_hash->records.uncompressed_size + || index_hash->blocks.index_list_size + < index_hash->records.index_list_size) + return LZMA_DATA_ERROR; + + // Check if this was the last Record. + index_hash->sequence = --index_hash->remaining == 0 + ? SEQ_PADDING_INIT : SEQ_UNPADDED; + } + + break; + } + + case SEQ_PADDING_INIT: + index_hash->pos = (LZMA_VLI_C(4) - index_size_unpadded( + index_hash->records.count, + index_hash->records.index_list_size)) & 3; + index_hash->sequence = SEQ_PADDING; + + // Fall through + + case SEQ_PADDING: + if (index_hash->pos > 0) { + --index_hash->pos; + if (in[(*in_pos)++] != 0x00) + return LZMA_DATA_ERROR; + + break; + } + + // Compare the sizes. + if (index_hash->blocks.blocks_size + != index_hash->records.blocks_size + || index_hash->blocks.uncompressed_size + != index_hash->records.uncompressed_size + || index_hash->blocks.index_list_size + != index_hash->records.index_list_size) + return LZMA_DATA_ERROR; + + // Finish the hashes and compare them. + lzma_check_finish(&index_hash->blocks.check, LZMA_CHECK_BEST); + lzma_check_finish(&index_hash->records.check, LZMA_CHECK_BEST); + if (memcmp(index_hash->blocks.check.buffer.u8, + index_hash->records.check.buffer.u8, + lzma_check_size(LZMA_CHECK_BEST)) != 0) + return LZMA_DATA_ERROR; + + // Finish the CRC32 calculation. + index_hash->crc32 = lzma_crc32(in + in_start, + *in_pos - in_start, index_hash->crc32); + + index_hash->sequence = SEQ_CRC32; + + // Fall through + + case SEQ_CRC32: + do { + if (*in_pos == in_size) + return LZMA_OK; + + if (((index_hash->crc32 >> (index_hash->pos * 8)) + & 0xFF) != in[(*in_pos)++]) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + return LZMA_DATA_ERROR; +#endif + } + + } while (++index_hash->pos < 4); + + return LZMA_STREAM_END; + + default: + assert(0); + return LZMA_PROG_ERROR; + } + +out: + // Update the CRC32, + index_hash->crc32 = lzma_crc32(in + in_start, + *in_pos - in_start, index_hash->crc32); + + return ret; +} diff --git a/src/liblzma/common/lzip_decoder.c b/src/liblzma/common/lzip_decoder.c new file mode 100644 index 0000000..20794f9 --- /dev/null +++ b/src/liblzma/common/lzip_decoder.c @@ -0,0 +1,414 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzip_decoder.c +/// \brief Decodes .lz (lzip) files +// +// Author: Michał Górny +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzip_decoder.h" +#include "lzma_decoder.h" +#include "check.h" + + +// .lz format version 0 lacks the 64-bit Member size field in the footer. +#define LZIP_V0_FOOTER_SIZE 12 +#define LZIP_V1_FOOTER_SIZE 20 +#define LZIP_FOOTER_SIZE_MAX LZIP_V1_FOOTER_SIZE + +// lc/lp/pb are hardcoded in the .lz format. +#define LZIP_LC 3 +#define LZIP_LP 0 +#define LZIP_PB 2 + + +typedef struct { + enum { + SEQ_ID_STRING, + SEQ_VERSION, + SEQ_DICT_SIZE, + SEQ_CODER_INIT, + SEQ_LZMA_STREAM, + SEQ_MEMBER_FOOTER, + } sequence; + + /// .lz member format version + uint32_t version; + + /// CRC32 of the uncompressed data in the .lz member + uint32_t crc32; + + /// Uncompressed size of the .lz member + uint64_t uncompressed_size; + + /// Compressed size of the .lz member + uint64_t member_size; + + /// Memory usage limit + uint64_t memlimit; + + /// Amount of memory actually needed + uint64_t memusage; + + /// If true, LZMA_GET_CHECK is returned after decoding the header + /// fields. As all files use CRC32 this is redundant but it's + /// implemented anyway since the initialization functions supports + /// all other flags in addition to LZMA_TELL_ANY_CHECK. + bool tell_any_check; + + /// If true, we won't calculate or verify the CRC32 of + /// the uncompressed data. + bool ignore_check; + + /// If true, we will decode concatenated .lz members and stop if + /// non-.lz data is seen after at least one member has been + /// successfully decoded. + bool concatenated; + + /// When decoding concatenated .lz members, this is true as long as + /// we are decoding the first .lz member. This is needed to avoid + /// incorrect LZMA_FORMAT_ERROR in case there is non-.lz data at + /// the end of the file. + bool first_member; + + /// Reading position in the header and footer fields + size_t pos; + + /// Buffer to hold the .lz footer fields + uint8_t buffer[LZIP_FOOTER_SIZE_MAX]; + + /// Options decoded from the .lz header that needed to initialize + /// the LZMA1 decoder. + lzma_options_lzma options; + + /// LZMA1 decoder + lzma_next_coder lzma_decoder; + +} lzma_lzip_coder; + + +static lzma_ret +lzip_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_lzip_coder *coder = coder_ptr; + + while (true) + switch (coder->sequence) { + case SEQ_ID_STRING: { + // The "ID string" or magic bytes are "LZIP" in US-ASCII. + const uint8_t lzip_id_string[4] = { 0x4C, 0x5A, 0x49, 0x50 }; + + while (coder->pos < sizeof(lzip_id_string)) { + if (*in_pos >= in_size) { + // If we are on the 2nd+ concatenated member + // and the input ends before we can read + // the magic bytes, we discard the bytes that + // were already read (up to 3) and finish. + // See the reasoning below. + return !coder->first_member + && action == LZMA_FINISH + ? LZMA_STREAM_END : LZMA_OK; + } + + if (in[*in_pos] != lzip_id_string[coder->pos]) { + // The .lz format allows putting non-.lz data + // at the end of the file. If we have seen + // at least one valid .lz member already, + // then we won't consume the byte at *in_pos + // and will return LZMA_STREAM_END. This way + // apps can easily locate and read the non-.lz + // data after the .lz member(s). + // + // NOTE: If the first 1-3 bytes of the non-.lz + // data match the .lz ID string then the first + // 1-3 bytes of the junk will get ignored by + // us. If apps want to properly locate the + // trailing data they must ensure that the + // first byte of their custom data isn't the + // same as the first byte of .lz ID string. + // With the liblzma API we cannot rewind the + // input position across calls to lzma_code(). + return !coder->first_member + ? LZMA_STREAM_END : LZMA_FORMAT_ERROR; + } + + ++*in_pos; + ++coder->pos; + } + + coder->pos = 0; + + coder->crc32 = 0; + coder->uncompressed_size = 0; + coder->member_size = sizeof(lzip_id_string); + + coder->sequence = SEQ_VERSION; + } + + // Fall through + + case SEQ_VERSION: + if (*in_pos >= in_size) + return LZMA_OK; + + coder->version = in[(*in_pos)++]; + + // We support version 0 and unextended version 1. + if (coder->version > 1) + return LZMA_OPTIONS_ERROR; + + ++coder->member_size; + coder->sequence = SEQ_DICT_SIZE; + + // .lz versions 0 and 1 use CRC32 as the integrity check + // so if the application wanted to know that + // (LZMA_TELL_ANY_CHECK) we can tell it now. + if (coder->tell_any_check) + return LZMA_GET_CHECK; + + // Fall through + + case SEQ_DICT_SIZE: { + if (*in_pos >= in_size) + return LZMA_OK; + + const uint32_t ds = in[(*in_pos)++]; + ++coder->member_size; + + // The five lowest bits are for the base-2 logarithm of + // the dictionary size and the highest three bits are + // the fractional part (0/16 to 7/16) that will be + // substracted to get the final value. + // + // For example, with 0xB5: + // b2log = 21 + // fracnum = 5 + // dict_size = 2^21 - 2^21 * 5 / 16 = 1408 KiB + const uint32_t b2log = ds & 0x1F; + const uint32_t fracnum = ds >> 5; + + // The format versions 0 and 1 allow dictionary size in the + // range [4 KiB, 512 MiB]. + if (b2log < 12 || b2log > 29 || (b2log == 12 && fracnum > 0)) + return LZMA_DATA_ERROR; + + // 2^[b2log] - 2^[b2log] * [fracnum] / 16 + // = 2^[b2log] - [fracnum] * 2^([b2log] - 4) + coder->options.dict_size = (UINT32_C(1) << b2log) + - (fracnum << (b2log - 4)); + + assert(coder->options.dict_size >= 4096); + assert(coder->options.dict_size <= (UINT32_C(512) << 20)); + + coder->options.preset_dict = NULL; + coder->options.lc = LZIP_LC; + coder->options.lp = LZIP_LP; + coder->options.pb = LZIP_PB; + + // Calculate the memory usage. + coder->memusage = lzma_lzma_decoder_memusage(&coder->options) + + LZMA_MEMUSAGE_BASE; + + // Initialization is a separate step because if we return + // LZMA_MEMLIMIT_ERROR we need to be able to restart after + // the memlimit has been increased. + coder->sequence = SEQ_CODER_INIT; + } + + // Fall through + + case SEQ_CODER_INIT: { + if (coder->memusage > coder->memlimit) + return LZMA_MEMLIMIT_ERROR; + + const lzma_filter_info filters[2] = { + { + .id = LZMA_FILTER_LZMA1, + .init = &lzma_lzma_decoder_init, + .options = &coder->options, + }, { + .init = NULL, + } + }; + + return_if_error(lzma_next_filter_init(&coder->lzma_decoder, + allocator, filters)); + + coder->crc32 = 0; + coder->sequence = SEQ_LZMA_STREAM; + } + + // Fall through + + case SEQ_LZMA_STREAM: { + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + const lzma_ret ret = coder->lzma_decoder.code( + coder->lzma_decoder.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + action); + + const size_t out_used = *out_pos - out_start; + + coder->member_size += *in_pos - in_start; + coder->uncompressed_size += out_used; + + if (!coder->ignore_check) + coder->crc32 = lzma_crc32(out + out_start, out_used, + coder->crc32); + + if (ret != LZMA_STREAM_END) + return ret; + + coder->sequence = SEQ_MEMBER_FOOTER; + } + + // Fall through + + case SEQ_MEMBER_FOOTER: { + // The footer of .lz version 0 lacks the Member size field. + // This is the only difference between version 0 and + // unextended version 1 formats. + const size_t footer_size = coder->version == 0 + ? LZIP_V0_FOOTER_SIZE + : LZIP_V1_FOOTER_SIZE; + + // Copy the CRC32, Data size, and Member size fields to + // the internal buffer. + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + footer_size); + + // Return if we didn't get the whole footer yet. + if (coder->pos < footer_size) + return LZMA_OK; + + coder->pos = 0; + coder->member_size += footer_size; + + // Check that the footer fields match the observed data. + if (!coder->ignore_check + && coder->crc32 != read32le(&coder->buffer[0])) + return LZMA_DATA_ERROR; + + if (coder->uncompressed_size != read64le(&coder->buffer[4])) + return LZMA_DATA_ERROR; + + if (coder->version > 0) { + // .lz version 0 has no Member size field. + if (coder->member_size != read64le(&coder->buffer[12])) + return LZMA_DATA_ERROR; + } + + // Decoding is finished if we weren't requested to decode + // more than one .lz member. + if (!coder->concatenated) + return LZMA_STREAM_END; + + coder->first_member = false; + coder->sequence = SEQ_ID_STRING; + break; + } + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + // Never reached +} + + +static void +lzip_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_lzip_coder *coder = coder_ptr; + lzma_next_end(&coder->lzma_decoder, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_check +lzip_decoder_get_check(const void *coder_ptr lzma_attribute((__unused__))) +{ + return LZMA_CHECK_CRC32; +} + + +static lzma_ret +lzip_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_lzip_coder *coder = coder_ptr; + + *memusage = coder->memusage; + *old_memlimit = coder->memlimit; + + if (new_memlimit != 0) { + if (new_memlimit < coder->memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +extern lzma_ret +lzma_lzip_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, uint32_t flags) +{ + lzma_next_coder_init(&lzma_lzip_decoder_init, next, allocator); + + if (flags & ~LZMA_SUPPORTED_FLAGS) + return LZMA_OPTIONS_ERROR; + + lzma_lzip_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_lzip_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &lzip_decode; + next->end = &lzip_decoder_end; + next->get_check = &lzip_decoder_get_check; + next->memconfig = &lzip_decoder_memconfig; + + coder->lzma_decoder = LZMA_NEXT_CODER_INIT; + } + + coder->sequence = SEQ_ID_STRING; + coder->memlimit = my_max(1, memlimit); + coder->memusage = LZMA_MEMUSAGE_BASE; + coder->tell_any_check = (flags & LZMA_TELL_ANY_CHECK) != 0; + coder->ignore_check = (flags & LZMA_IGNORE_CHECK) != 0; + coder->concatenated = (flags & LZMA_CONCATENATED) != 0; + coder->first_member = true; + coder->pos = 0; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_lzip_decoder(lzma_stream *strm, uint64_t memlimit, uint32_t flags) +{ + lzma_next_strm_init(lzma_lzip_decoder_init, strm, memlimit, flags); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/lzip_decoder.h b/src/liblzma/common/lzip_decoder.h new file mode 100644 index 0000000..33a01c3 --- /dev/null +++ b/src/liblzma/common/lzip_decoder.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzip_decoder.h +/// \brief Decodes .lz (lzip) files +// +// Author: Michał Górny +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZIP_DECODER_H +#define LZMA_LZIP_DECODER_H + +#include "common.h" + +extern lzma_ret lzma_lzip_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, uint32_t flags); + +#endif diff --git a/src/liblzma/common/memcmplen.h b/src/liblzma/common/memcmplen.h new file mode 100644 index 0000000..5a481a0 --- /dev/null +++ b/src/liblzma/common/memcmplen.h @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file memcmplen.h +/// \brief Optimized comparison of two buffers +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_MEMCMPLEN_H +#define LZMA_MEMCMPLEN_H + +#include "common.h" + +#ifdef HAVE_IMMINTRIN_H +# include +#endif + + +/// Find out how many equal bytes the two buffers have. +/// +/// \param buf1 First buffer +/// \param buf2 Second buffer +/// \param len How many bytes have already been compared and will +/// be assumed to match +/// \param limit How many bytes to compare at most, including the +/// already-compared bytes. This must be significantly +/// smaller than UINT32_MAX to avoid integer overflows. +/// Up to LZMA_MEMCMPLEN_EXTRA bytes may be read past +/// the specified limit from both buf1 and buf2. +/// +/// \return Number of equal bytes in the buffers is returned. +/// This is always at least len and at most limit. +/// +/// \note LZMA_MEMCMPLEN_EXTRA defines how many extra bytes may be read. +/// It's rounded up to 2^n. This extra amount needs to be +/// allocated in the buffers being used. It needs to be +/// initialized too to keep Valgrind quiet. +static inline uint32_t lzma_attribute((__always_inline__)) +lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2, + uint32_t len, uint32_t limit) +{ + assert(len <= limit); + assert(limit <= UINT32_MAX / 2); + +#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && ((TUKLIB_GNUC_REQ(3, 4) && defined(__x86_64__)) \ + || (defined(__INTEL_COMPILER) && defined(__x86_64__)) \ + || (defined(__INTEL_COMPILER) && defined(_M_X64)) \ + || (defined(_MSC_VER) && defined(_M_X64))) + // I keep this x86-64 only for now since that's where I know this + // to be a good method. This may be fine on other 64-bit CPUs too. + // On big endian one should use xor instead of subtraction and switch + // to __builtin_clzll(). +#define LZMA_MEMCMPLEN_EXTRA 8 + while (len < limit) { + const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len); + if (x != 0) { +# if defined(_M_X64) // MSVC or Intel C compiler on Windows + unsigned long tmp; + _BitScanForward64(&tmp, x); + len += (uint32_t)tmp >> 3; +# else // GCC, clang, or Intel C compiler + len += (uint32_t)__builtin_ctzll(x) >> 3; +# endif + return my_min(len, limit); + } + + len += 8; + } + + return limit; + +#elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) \ + && defined(HAVE__MM_MOVEMASK_EPI8) \ + && (defined(__SSE2__) \ + || (defined(_MSC_VER) && defined(_M_IX86_FP) \ + && _M_IX86_FP >= 2)) + // NOTE: This will use 128-bit unaligned access which + // TUKLIB_FAST_UNALIGNED_ACCESS wasn't meant to permit, + // but it's convenient here since this is x86-only. + // + // SSE2 version for 32-bit and 64-bit x86. On x86-64 the above + // version is sometimes significantly faster and sometimes + // slightly slower than this SSE2 version, so this SSE2 + // version isn't used on x86-64. +# define LZMA_MEMCMPLEN_EXTRA 16 + while (len < limit) { + const uint32_t x = 0xFFFF ^ _mm_movemask_epi8(_mm_cmpeq_epi8( + _mm_loadu_si128((const __m128i *)(buf1 + len)), + _mm_loadu_si128((const __m128i *)(buf2 + len)))); + + if (x != 0) { + len += ctz32(x); + return my_min(len, limit); + } + + len += 16; + } + + return limit; + +#elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) && !defined(WORDS_BIGENDIAN) + // Generic 32-bit little endian method +# define LZMA_MEMCMPLEN_EXTRA 4 + while (len < limit) { + uint32_t x = read32ne(buf1 + len) - read32ne(buf2 + len); + if (x != 0) { + if ((x & 0xFFFF) == 0) { + len += 2; + x >>= 16; + } + + if ((x & 0xFF) == 0) + ++len; + + return my_min(len, limit); + } + + len += 4; + } + + return limit; + +#elif defined(TUKLIB_FAST_UNALIGNED_ACCESS) && defined(WORDS_BIGENDIAN) + // Generic 32-bit big endian method +# define LZMA_MEMCMPLEN_EXTRA 4 + while (len < limit) { + uint32_t x = read32ne(buf1 + len) ^ read32ne(buf2 + len); + if (x != 0) { + if ((x & 0xFFFF0000) == 0) { + len += 2; + x <<= 16; + } + + if ((x & 0xFF000000) == 0) + ++len; + + return my_min(len, limit); + } + + len += 4; + } + + return limit; + +#else + // Simple portable version that doesn't use unaligned access. +# define LZMA_MEMCMPLEN_EXTRA 0 + while (len < limit && buf1[len] == buf2[len]) + ++len; + + return len; +#endif +} + +#endif diff --git a/src/liblzma/common/microlzma_decoder.c b/src/liblzma/common/microlzma_decoder.c new file mode 100644 index 0000000..e473373 --- /dev/null +++ b/src/liblzma/common/microlzma_decoder.c @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file microlzma_decoder.c +/// \brief Decode MicroLZMA format +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma_decoder.h" +#include "lz_decoder.h" + + +typedef struct { + /// LZMA1 decoder + lzma_next_coder lzma; + + /// Compressed size of the stream as given by the application. + /// This must be exactly correct. + /// + /// This will be decremented when input is read. + uint64_t comp_size; + + /// Uncompressed size of the stream as given by the application. + /// This may be less than the actual uncompressed size if + /// uncomp_size_is_exact is false. + /// + /// This will be decremented when output is produced. + lzma_vli uncomp_size; + + /// LZMA dictionary size as given by the application + uint32_t dict_size; + + /// If true, the exact uncompressed size is known. If false, + /// uncomp_size may be smaller than the real uncompressed size; + /// uncomp_size may never be bigger than the real uncompressed size. + bool uncomp_size_is_exact; + + /// True once the first byte of the MicroLZMA stream + /// has been processed. + bool props_decoded; +} lzma_microlzma_coder; + + +static lzma_ret +microlzma_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_microlzma_coder *coder = coder_ptr; + + // Remember the in start position so that we can update comp_size. + const size_t in_start = *in_pos; + + // Remember the out start position so that we can update uncomp_size. + const size_t out_start = *out_pos; + + // Limit the amount of input so that the decoder won't read more than + // comp_size. This is required when uncomp_size isn't exact because + // in that case the LZMA decoder will try to decode more input even + // when it has no output space (it can be looking for EOPM). + if (in_size - *in_pos > coder->comp_size) + in_size = *in_pos + (size_t)(coder->comp_size); + + // When the exact uncompressed size isn't known, we must limit + // the available output space to prevent the LZMA decoder from + // trying to decode too much. + if (!coder->uncomp_size_is_exact + && out_size - *out_pos > coder->uncomp_size) + out_size = *out_pos + (size_t)(coder->uncomp_size); + + if (!coder->props_decoded) { + // There must be at least one byte of input to decode + // the properties byte. + if (*in_pos >= in_size) + return LZMA_OK; + + lzma_options_lzma options = { + .dict_size = coder->dict_size, + .preset_dict = NULL, + .preset_dict_size = 0, + .ext_flags = 0, // EOPM not allowed when size is known + .ext_size_low = UINT32_MAX, // Unknown size by default + .ext_size_high = UINT32_MAX, + }; + + if (coder->uncomp_size_is_exact) + lzma_set_ext_size(options, coder->uncomp_size); + + // The properties are stored as bitwise-negation + // of the typical encoding. + if (lzma_lzma_lclppb_decode(&options, ~in[*in_pos])) + return LZMA_OPTIONS_ERROR; + + ++*in_pos; + + // Initialize the decoder. + lzma_filter_info filters[2] = { + { + .id = LZMA_FILTER_LZMA1EXT, + .init = &lzma_lzma_decoder_init, + .options = &options, + }, { + .init = NULL, + } + }; + + return_if_error(lzma_next_filter_init(&coder->lzma, + allocator, filters)); + + // Pass one dummy 0x00 byte to the LZMA decoder since that + // is what it expects the first byte to be. + const uint8_t dummy_in = 0; + size_t dummy_in_pos = 0; + if (coder->lzma.code(coder->lzma.coder, allocator, + &dummy_in, &dummy_in_pos, 1, + out, out_pos, out_size, LZMA_RUN) != LZMA_OK) + return LZMA_PROG_ERROR; + + assert(dummy_in_pos == 1); + coder->props_decoded = true; + } + + // The rest is normal LZMA decoding. + lzma_ret ret = coder->lzma.code(coder->lzma.coder, allocator, + in, in_pos, in_size, + out, out_pos, out_size, action); + + // Update the remaining compressed size. + assert(coder->comp_size >= *in_pos - in_start); + coder->comp_size -= *in_pos - in_start; + + if (coder->uncomp_size_is_exact) { + // After successful decompression of the complete stream + // the compressed size must match. + if (ret == LZMA_STREAM_END && coder->comp_size != 0) + ret = LZMA_DATA_ERROR; + } else { + // Update the amount of output remaining. + assert(coder->uncomp_size >= *out_pos - out_start); + coder->uncomp_size -= *out_pos - out_start; + + // - We must not get LZMA_STREAM_END because the stream + // shouldn't have EOPM. + // - We must use uncomp_size to determine when to + // return LZMA_STREAM_END. + if (ret == LZMA_STREAM_END) + ret = LZMA_DATA_ERROR; + else if (coder->uncomp_size == 0) + ret = LZMA_STREAM_END; + } + + return ret; +} + + +static void +microlzma_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_microlzma_coder *coder = coder_ptr; + lzma_next_end(&coder->lzma, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +microlzma_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t comp_size, + uint64_t uncomp_size, bool uncomp_size_is_exact, + uint32_t dict_size) +{ + lzma_next_coder_init(µlzma_decoder_init, next, allocator); + + lzma_microlzma_coder *coder = next->coder; + + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_microlzma_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = µlzma_decode; + next->end = µlzma_decoder_end; + + coder->lzma = LZMA_NEXT_CODER_INIT; + } + + // The public API is uint64_t but the internal LZ decoder API uses + // lzma_vli. + if (uncomp_size > LZMA_VLI_MAX) + return LZMA_OPTIONS_ERROR; + + coder->comp_size = comp_size; + coder->uncomp_size = uncomp_size; + coder->uncomp_size_is_exact = uncomp_size_is_exact; + coder->dict_size = dict_size; + + coder->props_decoded = false; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_microlzma_decoder(lzma_stream *strm, uint64_t comp_size, + uint64_t uncomp_size, lzma_bool uncomp_size_is_exact, + uint32_t dict_size) +{ + lzma_next_strm_init(microlzma_decoder_init, strm, comp_size, + uncomp_size, uncomp_size_is_exact, dict_size); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/microlzma_encoder.c b/src/liblzma/common/microlzma_encoder.c new file mode 100644 index 0000000..a787ca2 --- /dev/null +++ b/src/liblzma/common/microlzma_encoder.c @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file microlzma_encoder.c +/// \brief Encode into MicroLZMA format +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma_encoder.h" + + +typedef struct { + /// LZMA1 encoder + lzma_next_coder lzma; + + /// LZMA properties byte (lc/lp/pb) + uint8_t props; +} lzma_microlzma_coder; + + +static lzma_ret +microlzma_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_microlzma_coder *coder = coder_ptr; + + // Remember *out_pos so that we can overwrite the first byte with + // the LZMA properties byte. + const size_t out_start = *out_pos; + + // Remember *in_pos so that we can set it based on how many + // uncompressed bytes were actually encoded. + const size_t in_start = *in_pos; + + // Set the output size limit based on the available output space. + // We know that the encoder supports set_out_limit() so + // LZMA_OPTIONS_ERROR isn't possible. LZMA_BUF_ERROR is possible + // but lzma_code() has an assertion to not allow it to be returned + // from here and I don't want to change that for now, so + // LZMA_BUF_ERROR becomes LZMA_PROG_ERROR. + uint64_t uncomp_size; + if (coder->lzma.set_out_limit(coder->lzma.coder, + &uncomp_size, out_size - *out_pos) != LZMA_OK) + return LZMA_PROG_ERROR; + + // set_out_limit fails if this isn't true. + assert(out_size - *out_pos >= 6); + + // Encode as much as possible. + const lzma_ret ret = coder->lzma.code(coder->lzma.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, action); + + if (ret != LZMA_STREAM_END) { + if (ret == LZMA_OK) { + assert(0); + return LZMA_PROG_ERROR; + } + + return ret; + } + + // The first output byte is bitwise-negation of the properties byte. + // We know that there is space for this byte because set_out_limit + // and the actual encoding succeeded. + out[out_start] = (uint8_t)(~coder->props); + + // The LZMA encoder likely read more input than it was able to encode. + // Set *in_pos based on uncomp_size. + assert(uncomp_size <= in_size - in_start); + *in_pos = in_start + (size_t)(uncomp_size); + + return ret; +} + + +static void +microlzma_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_microlzma_coder *coder = coder_ptr; + lzma_next_end(&coder->lzma, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +microlzma_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_options_lzma *options) +{ + lzma_next_coder_init(µlzma_encoder_init, next, allocator); + + lzma_microlzma_coder *coder = next->coder; + + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_microlzma_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = µlzma_encode; + next->end = µlzma_encoder_end; + + coder->lzma = LZMA_NEXT_CODER_INIT; + } + + // Encode the properties byte. Bitwise-negation of it will be the + // first output byte. + if (lzma_lzma_lclppb_encode(options, &coder->props)) + return LZMA_OPTIONS_ERROR; + + // Initialize the LZMA encoder. + const lzma_filter_info filters[2] = { + { + .id = LZMA_FILTER_LZMA1, + .init = &lzma_lzma_encoder_init, + .options = (void *)(options), + }, { + .init = NULL, + } + }; + + return lzma_next_filter_init(&coder->lzma, allocator, filters); +} + + +extern LZMA_API(lzma_ret) +lzma_microlzma_encoder(lzma_stream *strm, const lzma_options_lzma *options) +{ + lzma_next_strm_init(microlzma_encoder_init, strm, options); + + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; + +} diff --git a/src/liblzma/common/outqueue.c b/src/liblzma/common/outqueue.c new file mode 100644 index 0000000..71e8648 --- /dev/null +++ b/src/liblzma/common/outqueue.c @@ -0,0 +1,287 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file outqueue.c +/// \brief Output queue handling in multithreaded coding +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "outqueue.h" + + +/// Get the maximum number of buffers that may be allocated based +/// on the number of threads. For now this is twice the number of threads. +/// It's a compromise between RAM usage and keeping the worker threads busy +/// when buffers finish out of order. +#define GET_BUFS_LIMIT(threads) (2 * (threads)) + + +extern uint64_t +lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads) +{ + // This is to ease integer overflow checking: We may allocate up to + // GET_BUFS_LIMIT(LZMA_THREADS_MAX) buffers and we need some extra + // memory for other data structures too (that's the /2). + // + // lzma_outq_prealloc_buf() will still accept bigger buffers than this. + const uint64_t limit + = UINT64_MAX / GET_BUFS_LIMIT(LZMA_THREADS_MAX) / 2; + + if (threads > LZMA_THREADS_MAX || buf_size_max > limit) + return UINT64_MAX; + + return GET_BUFS_LIMIT(threads) + * lzma_outq_outbuf_memusage(buf_size_max); +} + + +static void +move_head_to_cache(lzma_outq *outq, const lzma_allocator *allocator) +{ + assert(outq->head != NULL); + assert(outq->tail != NULL); + assert(outq->bufs_in_use > 0); + + lzma_outbuf *buf = outq->head; + outq->head = buf->next; + if (outq->head == NULL) + outq->tail = NULL; + + if (outq->cache != NULL && outq->cache->allocated != buf->allocated) + lzma_outq_clear_cache(outq, allocator); + + buf->next = outq->cache; + outq->cache = buf; + + --outq->bufs_in_use; + outq->mem_in_use -= lzma_outq_outbuf_memusage(buf->allocated); + + return; +} + + +static void +free_one_cached_buffer(lzma_outq *outq, const lzma_allocator *allocator) +{ + assert(outq->cache != NULL); + + lzma_outbuf *buf = outq->cache; + outq->cache = buf->next; + + --outq->bufs_allocated; + outq->mem_allocated -= lzma_outq_outbuf_memusage(buf->allocated); + + lzma_free(buf, allocator); + return; +} + + +extern void +lzma_outq_clear_cache(lzma_outq *outq, const lzma_allocator *allocator) +{ + while (outq->cache != NULL) + free_one_cached_buffer(outq, allocator); + + return; +} + + +extern void +lzma_outq_clear_cache2(lzma_outq *outq, const lzma_allocator *allocator, + size_t keep_size) +{ + if (outq->cache == NULL) + return; + + // Free all but one. + while (outq->cache->next != NULL) + free_one_cached_buffer(outq, allocator); + + // Free the last one only if its size doesn't equal to keep_size. + if (outq->cache->allocated != keep_size) + free_one_cached_buffer(outq, allocator); + + return; +} + + +extern lzma_ret +lzma_outq_init(lzma_outq *outq, const lzma_allocator *allocator, + uint32_t threads) +{ + if (threads > LZMA_THREADS_MAX) + return LZMA_OPTIONS_ERROR; + + const uint32_t bufs_limit = GET_BUFS_LIMIT(threads); + + // Clear head/tail. + while (outq->head != NULL) + move_head_to_cache(outq, allocator); + + // If new buf_limit is lower than the old one, we may need to free + // a few cached buffers. + while (bufs_limit < outq->bufs_allocated) + free_one_cached_buffer(outq, allocator); + + outq->bufs_limit = bufs_limit; + outq->read_pos = 0; + + return LZMA_OK; +} + + +extern void +lzma_outq_end(lzma_outq *outq, const lzma_allocator *allocator) +{ + while (outq->head != NULL) + move_head_to_cache(outq, allocator); + + lzma_outq_clear_cache(outq, allocator); + return; +} + + +extern lzma_ret +lzma_outq_prealloc_buf(lzma_outq *outq, const lzma_allocator *allocator, + size_t size) +{ + // Caller must have checked it with lzma_outq_has_buf(). + assert(outq->bufs_in_use < outq->bufs_limit); + + // If there already is appropriately-sized buffer in the cache, + // we need to do nothing. + if (outq->cache != NULL && outq->cache->allocated == size) + return LZMA_OK; + + if (size > SIZE_MAX - sizeof(lzma_outbuf)) + return LZMA_MEM_ERROR; + + const size_t alloc_size = lzma_outq_outbuf_memusage(size); + + // The cache may have buffers but their size is wrong. + lzma_outq_clear_cache(outq, allocator); + + outq->cache = lzma_alloc(alloc_size, allocator); + if (outq->cache == NULL) + return LZMA_MEM_ERROR; + + outq->cache->next = NULL; + outq->cache->allocated = size; + + ++outq->bufs_allocated; + outq->mem_allocated += alloc_size; + + return LZMA_OK; +} + + +extern lzma_outbuf * +lzma_outq_get_buf(lzma_outq *outq, void *worker) +{ + // Caller must have used lzma_outq_prealloc_buf() to ensure these. + assert(outq->bufs_in_use < outq->bufs_limit); + assert(outq->bufs_in_use < outq->bufs_allocated); + assert(outq->cache != NULL); + + lzma_outbuf *buf = outq->cache; + outq->cache = buf->next; + buf->next = NULL; + + if (outq->tail != NULL) { + assert(outq->head != NULL); + outq->tail->next = buf; + } else { + assert(outq->head == NULL); + outq->head = buf; + } + + outq->tail = buf; + + buf->worker = worker; + buf->finished = false; + buf->finish_ret = LZMA_STREAM_END; + buf->pos = 0; + buf->decoder_in_pos = 0; + + buf->unpadded_size = 0; + buf->uncompressed_size = 0; + + ++outq->bufs_in_use; + outq->mem_in_use += lzma_outq_outbuf_memusage(buf->allocated); + + return buf; +} + + +extern bool +lzma_outq_is_readable(const lzma_outq *outq) +{ + if (outq->head == NULL) + return false; + + return outq->read_pos < outq->head->pos || outq->head->finished; +} + + +extern lzma_ret +lzma_outq_read(lzma_outq *restrict outq, + const lzma_allocator *restrict allocator, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, + lzma_vli *restrict unpadded_size, + lzma_vli *restrict uncompressed_size) +{ + // There must be at least one buffer from which to read. + if (outq->bufs_in_use == 0) + return LZMA_OK; + + // Get the buffer. + lzma_outbuf *buf = outq->head; + + // Copy from the buffer to output. + // + // FIXME? In threaded decoder it may be bad to do this copy while + // the mutex is being held. + lzma_bufcpy(buf->buf, &outq->read_pos, buf->pos, + out, out_pos, out_size); + + // Return if we didn't get all the data from the buffer. + if (!buf->finished || outq->read_pos < buf->pos) + return LZMA_OK; + + // The buffer was finished. Tell the caller its size information. + if (unpadded_size != NULL) + *unpadded_size = buf->unpadded_size; + + if (uncompressed_size != NULL) + *uncompressed_size = buf->uncompressed_size; + + // Remember the return value. + const lzma_ret finish_ret = buf->finish_ret; + + // Free this buffer for further use. + move_head_to_cache(outq, allocator); + outq->read_pos = 0; + + return finish_ret; +} + + +extern void +lzma_outq_enable_partial_output(lzma_outq *outq, + void (*enable_partial_output)(void *worker)) +{ + if (outq->head != NULL && !outq->head->finished + && outq->head->worker != NULL) { + enable_partial_output(outq->head->worker); + + // Set it to NULL since calling it twice is pointless. + outq->head->worker = NULL; + } + + return; +} diff --git a/src/liblzma/common/outqueue.h b/src/liblzma/common/outqueue.h new file mode 100644 index 0000000..596911e --- /dev/null +++ b/src/liblzma/common/outqueue.h @@ -0,0 +1,254 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file outqueue.h +/// \brief Output queue handling in multithreaded coding +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +/// Output buffer for a single thread +typedef struct lzma_outbuf_s lzma_outbuf; +struct lzma_outbuf_s { + /// Pointer to the next buffer. This is used for the cached buffers. + /// The worker thread must not modify this. + lzma_outbuf *next; + + /// This initialized by lzma_outq_get_buf() and + /// is used by lzma_outq_enable_partial_output(). + /// The worker thread must not modify this. + void *worker; + + /// Amount of memory allocated for buf[]. + /// The worker thread must not modify this. + size_t allocated; + + /// Writing position in the worker thread or, in other words, the + /// amount of finished data written to buf[] which can be copied out + /// + /// \note This is read by another thread and thus access + /// to this variable needs a mutex. + size_t pos; + + /// Decompression: Position in the input buffer in the worker thread + /// that matches the output "pos" above. This is used to detect if + /// more output might be possible from the worker thread: if it has + /// consumed all its input, then more output isn't possible. + /// + /// \note This is read by another thread and thus access + /// to this variable needs a mutex. + size_t decoder_in_pos; + + /// True when no more data will be written into this buffer. + /// + /// \note This is read by another thread and thus access + /// to this variable needs a mutex. + bool finished; + + /// Return value for lzma_outq_read() when the last byte from + /// a finished buffer has been read. Defaults to LZMA_STREAM_END. + /// This must *not* be LZMA_OK. The idea is to allow a decoder to + /// pass an error code to the main thread, setting the code here + /// together with finished = true. + lzma_ret finish_ret; + + /// Additional size information. lzma_outq_read() may read these + /// when "finished" is true. + lzma_vli unpadded_size; + lzma_vli uncompressed_size; + + /// Buffer of "allocated" bytes + uint8_t buf[]; +}; + + +typedef struct { + /// Linked list of buffers in use. The next output byte will be + /// read from the head and buffers for the next thread will be + /// appended to the tail. tail->next is always NULL. + lzma_outbuf *head; + lzma_outbuf *tail; + + /// Number of bytes read from head->buf[] in lzma_outq_read() + size_t read_pos; + + /// Linked list of allocated buffers that aren't currently used. + /// This way buffers of similar size can be reused and don't + /// need to be reallocated every time. For simplicity, all + /// cached buffers in the list have the same allocated size. + lzma_outbuf *cache; + + /// Total amount of memory allocated for buffers + uint64_t mem_allocated; + + /// Amount of memory used by the buffers that are in use in + /// the head...tail linked list. + uint64_t mem_in_use; + + /// Number of buffers in use in the head...tail list. If and only if + /// this is zero, the pointers head and tail above are NULL. + uint32_t bufs_in_use; + + /// Number of buffers allocated (in use + cached) + uint32_t bufs_allocated; + + /// Maximum allowed number of allocated buffers + uint32_t bufs_limit; +} lzma_outq; + + +/** + * \brief Calculate the memory usage of an output queue + * + * \return Approximate memory usage in bytes or UINT64_MAX on error. + */ +extern uint64_t lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads); + + +/// \brief Initialize an output queue +/// +/// \param outq Pointer to an output queue. Before calling +/// this function the first time, *outq should +/// have been zeroed with memzero() so that this +/// function knows that there are no previous +/// allocations to free. +/// \param allocator Pointer to allocator or NULL +/// \param threads Number of buffers that may be in use +/// concurrently. Note that more than this number +/// of buffers may actually get allocated to +/// improve performance when buffers finish +/// out of order. The actual maximum number of +/// allocated buffers is derived from the number +/// of threads. +/// +/// \return - LZMA_OK +/// - LZMA_MEM_ERROR +/// +extern lzma_ret lzma_outq_init(lzma_outq *outq, + const lzma_allocator *allocator, uint32_t threads); + + +/// \brief Free the memory associated with the output queue +extern void lzma_outq_end(lzma_outq *outq, const lzma_allocator *allocator); + + +/// \brief Free all cached buffers that consume memory but aren't in use +extern void lzma_outq_clear_cache( + lzma_outq *outq, const lzma_allocator *allocator); + + +/// \brief Like lzma_outq_clear_cache() but might keep one buffer +/// +/// One buffer is not freed if its size is equal to keep_size. +/// This is useful if the caller knows that it will soon need a buffer of +/// keep_size bytes. This way it won't be freed and immediately reallocated. +extern void lzma_outq_clear_cache2( + lzma_outq *outq, const lzma_allocator *allocator, + size_t keep_size); + + +/// \brief Preallocate a new buffer into cache +/// +/// Splitting the buffer allocation into a separate function makes it +/// possible to ensure that way lzma_outq_get_buf() cannot fail. +/// If the preallocated buffer isn't actually used (for example, some +/// other error occurs), the caller has to do nothing as the buffer will +/// be used later or cleared from the cache when not needed. +/// +/// \return LZMA_OK on success, LZMA_MEM_ERROR if allocation fails +/// +extern lzma_ret lzma_outq_prealloc_buf( + lzma_outq *outq, const lzma_allocator *allocator, size_t size); + + +/// \brief Get a new buffer +/// +/// lzma_outq_prealloc_buf() must be used to ensure that there is a buffer +/// available before calling lzma_outq_get_buf(). +/// +extern lzma_outbuf *lzma_outq_get_buf(lzma_outq *outq, void *worker); + + +/// \brief Test if there is data ready to be read +/// +/// Call to this function must be protected with the same mutex that +/// is used to protect lzma_outbuf.finished. +/// +extern bool lzma_outq_is_readable(const lzma_outq *outq); + + +/// \brief Read finished data +/// +/// \param outq Pointer to an output queue +/// \param out Beginning of the output buffer +/// \param out_pos The next byte will be written to +/// out[*out_pos]. +/// \param out_size Size of the out buffer; the first byte into +/// which no data is written to is out[out_size]. +/// \param unpadded_size Unpadded Size from the Block encoder +/// \param uncompressed_size Uncompressed Size from the Block encoder +/// +/// \return - LZMA: All OK. Either no data was available or the buffer +/// being read didn't become empty yet. +/// - LZMA_STREAM_END: The buffer being read was finished. +/// *unpadded_size and *uncompressed_size were set if they +/// were not NULL. +/// +/// \note This reads lzma_outbuf.finished and .pos variables and thus +/// calls to this function need to be protected with a mutex. +/// +extern lzma_ret lzma_outq_read(lzma_outq *restrict outq, + const lzma_allocator *restrict allocator, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, lzma_vli *restrict unpadded_size, + lzma_vli *restrict uncompressed_size); + + +/// \brief Enable partial output from a worker thread +/// +/// If the buffer at the head of the output queue isn't finished, +/// this will call enable_partial_output on the worker associated with +/// that output buffer. +/// +/// \note This reads a lzma_outbuf.finished variable and thus +/// calls to this function need to be protected with a mutex. +/// +extern void lzma_outq_enable_partial_output(lzma_outq *outq, + void (*enable_partial_output)(void *worker)); + + +/// \brief Test if there is at least one buffer free +/// +/// This must be used before getting a new buffer with lzma_outq_get_buf(). +/// +static inline bool +lzma_outq_has_buf(const lzma_outq *outq) +{ + return outq->bufs_in_use < outq->bufs_limit; +} + + +/// \brief Test if the queue is completely empty +static inline bool +lzma_outq_is_empty(const lzma_outq *outq) +{ + return outq->bufs_in_use == 0; +} + + +/// \brief Get the amount of memory needed for a single lzma_outbuf +/// +/// \note Caller must check that the argument is significantly less +/// than SIZE_MAX to avoid an integer overflow! +static inline uint64_t +lzma_outq_outbuf_memusage(size_t buf_size) +{ + assert(buf_size <= SIZE_MAX - sizeof(lzma_outbuf)); + return sizeof(lzma_outbuf) + buf_size; +} diff --git a/src/liblzma/common/stream_buffer_decoder.c b/src/liblzma/common/stream_buffer_decoder.c new file mode 100644 index 0000000..b9745b5 --- /dev/null +++ b/src/liblzma/common/stream_buffer_decoder.c @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_buffer_decoder.c +/// \brief Single-call .xz Stream decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_decoder.h" + + +extern LZMA_API(lzma_ret) +lzma_stream_buffer_decode(uint64_t *memlimit, uint32_t flags, + const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + // Sanity checks + if (in_pos == NULL || (in == NULL && *in_pos != in_size) + || *in_pos > in_size || out_pos == NULL + || (out == NULL && *out_pos != out_size) + || *out_pos > out_size) + return LZMA_PROG_ERROR; + + // Catch flags that are not allowed in buffer-to-buffer decoding. + if (flags & LZMA_TELL_ANY_CHECK) + return LZMA_PROG_ERROR; + + // Initialize the Stream decoder. + // TODO: We need something to tell the decoder that it can use the + // output buffer as workspace, and thus save significant amount of RAM. + lzma_next_coder stream_decoder = LZMA_NEXT_CODER_INIT; + lzma_ret ret = lzma_stream_decoder_init( + &stream_decoder, allocator, *memlimit, flags); + + if (ret == LZMA_OK) { + // Save the positions so that we can restore them in case + // an error occurs. + const size_t in_start = *in_pos; + const size_t out_start = *out_pos; + + // Do the actual decoding. + ret = stream_decoder.code(stream_decoder.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + LZMA_FINISH); + + if (ret == LZMA_STREAM_END) { + ret = LZMA_OK; + } else { + // Something went wrong, restore the positions. + *in_pos = in_start; + *out_pos = out_start; + + if (ret == LZMA_OK) { + // Either the input was truncated or the + // output buffer was too small. + assert(*in_pos == in_size + || *out_pos == out_size); + + // If all the input was consumed, then the + // input is truncated, even if the output + // buffer is also full. This is because + // processing the last byte of the Stream + // never produces output. + if (*in_pos == in_size) + ret = LZMA_DATA_ERROR; + else + ret = LZMA_BUF_ERROR; + + } else if (ret == LZMA_MEMLIMIT_ERROR) { + // Let the caller know how much memory would + // have been needed. + uint64_t memusage; + (void)stream_decoder.memconfig( + stream_decoder.coder, + memlimit, &memusage, 0); + } + } + } + + // Free the decoder memory. This needs to be done even if + // initialization fails, because the internal API doesn't + // require the initialization function to free its memory on error. + lzma_next_end(&stream_decoder, allocator); + + return ret; +} diff --git a/src/liblzma/common/stream_buffer_encoder.c b/src/liblzma/common/stream_buffer_encoder.c new file mode 100644 index 0000000..7315759 --- /dev/null +++ b/src/liblzma/common/stream_buffer_encoder.c @@ -0,0 +1,142 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_buffer_encoder.c +/// \brief Single-call .xz Stream encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "index.h" + + +/// Maximum size of Index that has exactly one Record. +/// Index Indicator + Number of Records + Record + CRC32 rounded up to +/// the next multiple of four. +#define INDEX_BOUND ((1 + 1 + 2 * LZMA_VLI_BYTES_MAX + 4 + 3) & ~3) + +/// Stream Header, Stream Footer, and Index +#define HEADERS_BOUND (2 * LZMA_STREAM_HEADER_SIZE + INDEX_BOUND) + + +extern LZMA_API(size_t) +lzma_stream_buffer_bound(size_t uncompressed_size) +{ + // Get the maximum possible size of a Block. + const size_t block_bound = lzma_block_buffer_bound(uncompressed_size); + if (block_bound == 0) + return 0; + + // Catch the possible integer overflow and also prevent the size of + // the Stream exceeding LZMA_VLI_MAX (theoretically possible on + // 64-bit systems). + if (my_min(SIZE_MAX, LZMA_VLI_MAX) - block_bound < HEADERS_BOUND) + return 0; + + return block_bound + HEADERS_BOUND; +} + + +extern LZMA_API(lzma_ret) +lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check, + const lzma_allocator *allocator, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos_ptr, size_t out_size) +{ + // Sanity checks + if (filters == NULL || (unsigned int)(check) > LZMA_CHECK_ID_MAX + || (in == NULL && in_size != 0) || out == NULL + || out_pos_ptr == NULL || *out_pos_ptr > out_size) + return LZMA_PROG_ERROR; + + if (!lzma_check_is_supported(check)) + return LZMA_UNSUPPORTED_CHECK; + + // Note for the paranoids: Index encoder prevents the Stream from + // getting too big and still being accepted with LZMA_OK, and Block + // encoder catches if the input is too big. So we don't need to + // separately check if the buffers are too big. + + // Use a local copy. We update *out_pos_ptr only if everything + // succeeds. + size_t out_pos = *out_pos_ptr; + + // Check that there's enough space for both Stream Header and + // Stream Footer. + if (out_size - out_pos <= 2 * LZMA_STREAM_HEADER_SIZE) + return LZMA_BUF_ERROR; + + // Reserve space for Stream Footer so we don't need to check for + // available space again before encoding Stream Footer. + out_size -= LZMA_STREAM_HEADER_SIZE; + + // Encode the Stream Header. + lzma_stream_flags stream_flags = { + .version = 0, + .check = check, + }; + + if (lzma_stream_header_encode(&stream_flags, out + out_pos) + != LZMA_OK) + return LZMA_PROG_ERROR; + + out_pos += LZMA_STREAM_HEADER_SIZE; + + // Encode a Block but only if there is at least one byte of input. + lzma_block block = { + .version = 0, + .check = check, + .filters = filters, + }; + + if (in_size > 0) + return_if_error(lzma_block_buffer_encode(&block, allocator, + in, in_size, out, &out_pos, out_size)); + + // Index + { + // Create an Index. It will have one Record if there was + // at least one byte of input to encode. Otherwise the + // Index will be empty. + lzma_index *i = lzma_index_init(allocator); + if (i == NULL) + return LZMA_MEM_ERROR; + + lzma_ret ret = LZMA_OK; + + if (in_size > 0) + ret = lzma_index_append(i, allocator, + lzma_block_unpadded_size(&block), + block.uncompressed_size); + + // If adding the Record was successful, encode the Index + // and get its size which will be stored into Stream Footer. + if (ret == LZMA_OK) { + ret = lzma_index_buffer_encode( + i, out, &out_pos, out_size); + + stream_flags.backward_size = lzma_index_size(i); + } + + lzma_index_end(i, allocator); + + if (ret != LZMA_OK) + return ret; + } + + // Stream Footer. We have already reserved space for this. + if (lzma_stream_footer_encode(&stream_flags, out + out_pos) + != LZMA_OK) + return LZMA_PROG_ERROR; + + out_pos += LZMA_STREAM_HEADER_SIZE; + + // Everything went fine, make the new output position available + // to the application. + *out_pos_ptr = out_pos; + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c new file mode 100644 index 0000000..6428381 --- /dev/null +++ b/src/liblzma/common/stream_decoder.c @@ -0,0 +1,474 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_decoder.c +/// \brief Decodes .xz Streams +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_decoder.h" +#include "block_decoder.h" +#include "index.h" + + +typedef struct { + enum { + SEQ_STREAM_HEADER, + SEQ_BLOCK_HEADER, + SEQ_BLOCK_INIT, + SEQ_BLOCK_RUN, + SEQ_INDEX, + SEQ_STREAM_FOOTER, + SEQ_STREAM_PADDING, + } sequence; + + /// Block decoder + lzma_next_coder block_decoder; + + /// Block options decoded by the Block Header decoder and used by + /// the Block decoder. + lzma_block block_options; + + /// Stream Flags from Stream Header + lzma_stream_flags stream_flags; + + /// Index is hashed so that it can be compared to the sizes of Blocks + /// with O(1) memory usage. + lzma_index_hash *index_hash; + + /// Memory usage limit + uint64_t memlimit; + + /// Amount of memory actually needed (only an estimate) + uint64_t memusage; + + /// If true, LZMA_NO_CHECK is returned if the Stream has + /// no integrity check. + bool tell_no_check; + + /// If true, LZMA_UNSUPPORTED_CHECK is returned if the Stream has + /// an integrity check that isn't supported by this liblzma build. + bool tell_unsupported_check; + + /// If true, LZMA_GET_CHECK is returned after decoding Stream Header. + bool tell_any_check; + + /// If true, we will tell the Block decoder to skip calculating + /// and verifying the integrity check. + bool ignore_check; + + /// If true, we will decode concatenated Streams that possibly have + /// Stream Padding between or after them. LZMA_STREAM_END is returned + /// once the application isn't giving us any new input (LZMA_FINISH), + /// and we aren't in the middle of a Stream, and possible + /// Stream Padding is a multiple of four bytes. + bool concatenated; + + /// When decoding concatenated Streams, this is true as long as we + /// are decoding the first Stream. This is needed to avoid misleading + /// LZMA_FORMAT_ERROR in case the later Streams don't have valid magic + /// bytes. + bool first_stream; + + /// Write position in buffer[] and position in Stream Padding + size_t pos; + + /// Buffer to hold Stream Header, Block Header, and Stream Footer. + /// Block Header has biggest maximum size. + uint8_t buffer[LZMA_BLOCK_HEADER_SIZE_MAX]; +} lzma_stream_coder; + + +static lzma_ret +stream_decoder_reset(lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + // Initialize the Index hash used to verify the Index. + coder->index_hash = lzma_index_hash_init(coder->index_hash, allocator); + if (coder->index_hash == NULL) + return LZMA_MEM_ERROR; + + // Reset the rest of the variables. + coder->sequence = SEQ_STREAM_HEADER; + coder->pos = 0; + + return LZMA_OK; +} + + +static lzma_ret +stream_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_stream_coder *coder = coder_ptr; + + // When decoding the actual Block, it may be able to produce more + // output even if we don't give it any new input. + while (true) + switch (coder->sequence) { + case SEQ_STREAM_HEADER: { + // Copy the Stream Header to the internal buffer. + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + LZMA_STREAM_HEADER_SIZE); + + // Return if we didn't get the whole Stream Header yet. + if (coder->pos < LZMA_STREAM_HEADER_SIZE) + return LZMA_OK; + + coder->pos = 0; + + // Decode the Stream Header. + const lzma_ret ret = lzma_stream_header_decode( + &coder->stream_flags, coder->buffer); + if (ret != LZMA_OK) + return ret == LZMA_FORMAT_ERROR && !coder->first_stream + ? LZMA_DATA_ERROR : ret; + + // If we are decoding concatenated Streams, and the later + // Streams have invalid Header Magic Bytes, we give + // LZMA_DATA_ERROR instead of LZMA_FORMAT_ERROR. + coder->first_stream = false; + + // Copy the type of the Check so that Block Header and Block + // decoders see it. + coder->block_options.check = coder->stream_flags.check; + + // Even if we return LZMA_*_CHECK below, we want + // to continue from Block Header decoding. + coder->sequence = SEQ_BLOCK_HEADER; + + // Detect if there's no integrity check or if it is + // unsupported if those were requested by the application. + if (coder->tell_no_check && coder->stream_flags.check + == LZMA_CHECK_NONE) + return LZMA_NO_CHECK; + + if (coder->tell_unsupported_check + && !lzma_check_is_supported( + coder->stream_flags.check)) + return LZMA_UNSUPPORTED_CHECK; + + if (coder->tell_any_check) + return LZMA_GET_CHECK; + } + + // Fall through + + case SEQ_BLOCK_HEADER: { + if (*in_pos >= in_size) + return LZMA_OK; + + if (coder->pos == 0) { + // Detect if it's Index. + if (in[*in_pos] == INDEX_INDICATOR) { + coder->sequence = SEQ_INDEX; + break; + } + + // Calculate the size of the Block Header. Note that + // Block Header decoder wants to see this byte too + // so don't advance *in_pos. + coder->block_options.header_size + = lzma_block_header_size_decode( + in[*in_pos]); + } + + // Copy the Block Header to the internal buffer. + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + coder->block_options.header_size); + + // Return if we didn't get the whole Block Header yet. + if (coder->pos < coder->block_options.header_size) + return LZMA_OK; + + coder->pos = 0; + coder->sequence = SEQ_BLOCK_INIT; + } + + // Fall through + + case SEQ_BLOCK_INIT: { + // Checking memusage and doing the initialization needs + // its own sequence point because we need to be able to + // retry if we return LZMA_MEMLIMIT_ERROR. + + // Version 1 is needed to support the .ignore_check option. + coder->block_options.version = 1; + + // Set up a buffer to hold the filter chain. Block Header + // decoder will initialize all members of this array so + // we don't need to do it here. + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + coder->block_options.filters = filters; + + // Decode the Block Header. + return_if_error(lzma_block_header_decode(&coder->block_options, + allocator, coder->buffer)); + + // If LZMA_IGNORE_CHECK was used, this flag needs to be set. + // It has to be set after lzma_block_header_decode() because + // it always resets this to false. + coder->block_options.ignore_check = coder->ignore_check; + + // Check the memory usage limit. + const uint64_t memusage = lzma_raw_decoder_memusage(filters); + lzma_ret ret; + + if (memusage == UINT64_MAX) { + // One or more unknown Filter IDs. + ret = LZMA_OPTIONS_ERROR; + } else { + // Now we can set coder->memusage since we know that + // the filter chain is valid. We don't want + // lzma_memusage() to return UINT64_MAX in case of + // invalid filter chain. + coder->memusage = memusage; + + if (memusage > coder->memlimit) { + // The chain would need too much memory. + ret = LZMA_MEMLIMIT_ERROR; + } else { + // Memory usage is OK. + // Initialize the Block decoder. + ret = lzma_block_decoder_init( + &coder->block_decoder, + allocator, + &coder->block_options); + } + } + + // Free the allocated filter options since they are needed + // only to initialize the Block decoder. + lzma_filters_free(filters, allocator); + coder->block_options.filters = NULL; + + // Check if memory usage calculation and Block decoder + // initialization succeeded. + if (ret != LZMA_OK) + return ret; + + coder->sequence = SEQ_BLOCK_RUN; + } + + // Fall through + + case SEQ_BLOCK_RUN: { + const lzma_ret ret = coder->block_decoder.code( + coder->block_decoder.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + action); + + if (ret != LZMA_STREAM_END) + return ret; + + // Block decoded successfully. Add the new size pair to + // the Index hash. + return_if_error(lzma_index_hash_append(coder->index_hash, + lzma_block_unpadded_size( + &coder->block_options), + coder->block_options.uncompressed_size)); + + coder->sequence = SEQ_BLOCK_HEADER; + break; + } + + case SEQ_INDEX: { + // If we don't have any input, don't call + // lzma_index_hash_decode() since it would return + // LZMA_BUF_ERROR, which we must not do here. + if (*in_pos >= in_size) + return LZMA_OK; + + // Decode the Index and compare it to the hash calculated + // from the sizes of the Blocks (if any). + const lzma_ret ret = lzma_index_hash_decode(coder->index_hash, + in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + return ret; + + coder->sequence = SEQ_STREAM_FOOTER; + } + + // Fall through + + case SEQ_STREAM_FOOTER: { + // Copy the Stream Footer to the internal buffer. + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + LZMA_STREAM_HEADER_SIZE); + + // Return if we didn't get the whole Stream Footer yet. + if (coder->pos < LZMA_STREAM_HEADER_SIZE) + return LZMA_OK; + + coder->pos = 0; + + // Decode the Stream Footer. The decoder gives + // LZMA_FORMAT_ERROR if the magic bytes don't match, + // so convert that return code to LZMA_DATA_ERROR. + lzma_stream_flags footer_flags; + const lzma_ret ret = lzma_stream_footer_decode( + &footer_flags, coder->buffer); + if (ret != LZMA_OK) + return ret == LZMA_FORMAT_ERROR + ? LZMA_DATA_ERROR : ret; + + // Check that Index Size stored in the Stream Footer matches + // the real size of the Index field. + if (lzma_index_hash_size(coder->index_hash) + != footer_flags.backward_size) + return LZMA_DATA_ERROR; + + // Compare that the Stream Flags fields are identical in + // both Stream Header and Stream Footer. + return_if_error(lzma_stream_flags_compare( + &coder->stream_flags, &footer_flags)); + + if (!coder->concatenated) + return LZMA_STREAM_END; + + coder->sequence = SEQ_STREAM_PADDING; + } + + // Fall through + + case SEQ_STREAM_PADDING: + assert(coder->concatenated); + + // Skip over possible Stream Padding. + while (true) { + if (*in_pos >= in_size) { + // Unless LZMA_FINISH was used, we cannot + // know if there's more input coming later. + if (action != LZMA_FINISH) + return LZMA_OK; + + // Stream Padding must be a multiple of + // four bytes. + return coder->pos == 0 + ? LZMA_STREAM_END + : LZMA_DATA_ERROR; + } + + // If the byte is not zero, it probably indicates + // beginning of a new Stream (or the file is corrupt). + if (in[*in_pos] != 0x00) + break; + + ++*in_pos; + coder->pos = (coder->pos + 1) & 3; + } + + // Stream Padding must be a multiple of four bytes (empty + // Stream Padding is OK). + if (coder->pos != 0) { + ++*in_pos; + return LZMA_DATA_ERROR; + } + + // Prepare to decode the next Stream. + return_if_error(stream_decoder_reset(coder, allocator)); + break; + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + // Never reached +} + + +static void +stream_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_stream_coder *coder = coder_ptr; + lzma_next_end(&coder->block_decoder, allocator); + lzma_index_hash_end(coder->index_hash, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_check +stream_decoder_get_check(const void *coder_ptr) +{ + const lzma_stream_coder *coder = coder_ptr; + return coder->stream_flags.check; +} + + +static lzma_ret +stream_decoder_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + lzma_stream_coder *coder = coder_ptr; + + *memusage = coder->memusage; + *old_memlimit = coder->memlimit; + + if (new_memlimit != 0) { + if (new_memlimit < coder->memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit = new_memlimit; + } + + return LZMA_OK; +} + + +extern lzma_ret +lzma_stream_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, uint32_t flags) +{ + lzma_next_coder_init(&lzma_stream_decoder_init, next, allocator); + + if (flags & ~LZMA_SUPPORTED_FLAGS) + return LZMA_OPTIONS_ERROR; + + lzma_stream_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_stream_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &stream_decode; + next->end = &stream_decoder_end; + next->get_check = &stream_decoder_get_check; + next->memconfig = &stream_decoder_memconfig; + + coder->block_decoder = LZMA_NEXT_CODER_INIT; + coder->index_hash = NULL; + } + + coder->memlimit = my_max(1, memlimit); + coder->memusage = LZMA_MEMUSAGE_BASE; + coder->tell_no_check = (flags & LZMA_TELL_NO_CHECK) != 0; + coder->tell_unsupported_check + = (flags & LZMA_TELL_UNSUPPORTED_CHECK) != 0; + coder->tell_any_check = (flags & LZMA_TELL_ANY_CHECK) != 0; + coder->ignore_check = (flags & LZMA_IGNORE_CHECK) != 0; + coder->concatenated = (flags & LZMA_CONCATENATED) != 0; + coder->first_stream = true; + + return stream_decoder_reset(coder, allocator); +} + + +extern LZMA_API(lzma_ret) +lzma_stream_decoder(lzma_stream *strm, uint64_t memlimit, uint32_t flags) +{ + lzma_next_strm_init(lzma_stream_decoder_init, strm, memlimit, flags); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_decoder.h b/src/liblzma/common/stream_decoder.h new file mode 100644 index 0000000..c13c6ba --- /dev/null +++ b/src/liblzma/common/stream_decoder.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_decoder.h +/// \brief Decodes .xz Streams +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_STREAM_DECODER_H +#define LZMA_STREAM_DECODER_H + +#include "common.h" + +extern lzma_ret lzma_stream_decoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + uint64_t memlimit, uint32_t flags); + +#endif diff --git a/src/liblzma/common/stream_decoder_mt.c b/src/liblzma/common/stream_decoder_mt.c new file mode 100644 index 0000000..fd5cd7f --- /dev/null +++ b/src/liblzma/common/stream_decoder_mt.c @@ -0,0 +1,2016 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_decoder_mt.c +/// \brief Multithreaded .xz Stream decoder +// +// Authors: Sebastian Andrzej Siewior +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" +#include "block_decoder.h" +#include "stream_decoder.h" +#include "index.h" +#include "outqueue.h" + + +typedef enum { + /// Waiting for work. + /// Main thread may change this to THR_RUN or THR_EXIT. + THR_IDLE, + + /// Decoding is in progress. + /// Main thread may change this to THR_STOP or THR_EXIT. + /// The worker thread may change this to THR_IDLE. + THR_RUN, + + /// The main thread wants the thread to stop whatever it was doing + /// but not exit. Main thread may change this to THR_EXIT. + /// The worker thread may change this to THR_IDLE. + THR_STOP, + + /// The main thread wants the thread to exit. + THR_EXIT, + +} worker_state; + + +typedef enum { + /// Partial updates (storing of worker thread progress + /// to lzma_outbuf) are disabled. + PARTIAL_DISABLED, + + /// Main thread requests partial updates to be enabled but + /// no partial update has been done by the worker thread yet. + /// + /// Changing from PARTIAL_DISABLED to PARTIAL_START requires + /// use of the worker-thread mutex. Other transitions don't + /// need a mutex. + PARTIAL_START, + + /// Partial updates are enabled and the worker thread has done + /// at least one partial update. + PARTIAL_ENABLED, + +} partial_update_mode; + + +struct worker_thread { + /// Worker state is protected with our mutex. + worker_state state; + + /// Input buffer that will contain the whole Block except Block Header. + uint8_t *in; + + /// Amount of memory allocated for "in" + size_t in_size; + + /// Number of bytes written to "in" by the main thread + size_t in_filled; + + /// Number of bytes consumed from "in" by the worker thread. + size_t in_pos; + + /// Amount of uncompressed data that has been decoded. This local + /// copy is needed because updating outbuf->pos requires locking + /// the main mutex (coder->mutex). + size_t out_pos; + + /// Pointer to the main structure is needed to (1) lock the main + /// mutex (coder->mutex) when updating outbuf->pos and (2) when + /// putting this thread back to the stack of free threads. + struct lzma_stream_coder *coder; + + /// The allocator is set by the main thread. Since a copy of the + /// pointer is kept here, the application must not change the + /// allocator before calling lzma_end(). + const lzma_allocator *allocator; + + /// Output queue buffer to which the uncompressed data is written. + lzma_outbuf *outbuf; + + /// Amount of compressed data that has already been decompressed. + /// This is updated from in_pos when our mutex is locked. + /// This is size_t, not uint64_t, because per-thread progress + /// is limited to sizes of allocated buffers. + size_t progress_in; + + /// Like progress_in but for uncompressed data. + size_t progress_out; + + /// Updating outbuf->pos requires locking the main mutex + /// (coder->mutex). Since the main thread will only read output + /// from the oldest outbuf in the queue, only the worker thread + /// that is associated with the oldest outbuf needs to update its + /// outbuf->pos. This avoids useless mutex contention that would + /// happen if all worker threads were frequently locking the main + /// mutex to update their outbuf->pos. + /// + /// Only when partial_update is something else than PARTIAL_DISABLED, + /// this worker thread will update outbuf->pos after each call to + /// the Block decoder. + partial_update_mode partial_update; + + /// Block decoder + lzma_next_coder block_decoder; + + /// Thread-specific Block options are needed because the Block + /// decoder modifies the struct given to it at initialization. + lzma_block block_options; + + /// Filter chain memory usage + uint64_t mem_filters; + + /// Next structure in the stack of free worker threads. + struct worker_thread *next; + + mythread_mutex mutex; + mythread_cond cond; + + /// The ID of this thread is used to join the thread + /// when it's not needed anymore. + mythread thread_id; +}; + + +struct lzma_stream_coder { + enum { + SEQ_STREAM_HEADER, + SEQ_BLOCK_HEADER, + SEQ_BLOCK_INIT, + SEQ_BLOCK_THR_INIT, + SEQ_BLOCK_THR_RUN, + SEQ_BLOCK_DIRECT_INIT, + SEQ_BLOCK_DIRECT_RUN, + SEQ_INDEX_WAIT_OUTPUT, + SEQ_INDEX_DECODE, + SEQ_STREAM_FOOTER, + SEQ_STREAM_PADDING, + SEQ_ERROR, + } sequence; + + /// Block decoder + lzma_next_coder block_decoder; + + /// Every Block Header will be decoded into this structure. + /// This is also used to initialize a Block decoder when in + /// direct mode. In threaded mode, a thread-specific copy will + /// be made for decoder initialization because the Block decoder + /// will modify the structure given to it. + lzma_block block_options; + + /// Buffer to hold a filter chain for Block Header decoding and + /// initialization. These are freed after successful Block decoder + /// initialization or at stream_decoder_mt_end(). The thread-specific + /// copy of block_options won't hold a pointer to filters[] after + /// initialization. + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + + /// Stream Flags from Stream Header + lzma_stream_flags stream_flags; + + /// Index is hashed so that it can be compared to the sizes of Blocks + /// with O(1) memory usage. + lzma_index_hash *index_hash; + + + /// Maximum wait time if cannot use all the input and cannot + /// fill the output buffer. This is in milliseconds. + uint32_t timeout; + + + /// Error code from a worker thread. + /// + /// \note Use mutex. + lzma_ret thread_error; + + /// Error code to return after pending output has been copied out. If + /// set in read_output_and_wait(), this is a mirror of thread_error. + /// If set in stream_decode_mt() then it's, for example, error that + /// occurred when decoding Block Header. + lzma_ret pending_error; + + /// Number of threads that will be created at maximum. + uint32_t threads_max; + + /// Number of thread structures that have been initialized from + /// "threads", and thus the number of worker threads actually + /// created so far. + uint32_t threads_initialized; + + /// Array of allocated thread-specific structures. When no threads + /// are in use (direct mode) this is NULL. In threaded mode this + /// points to an array of threads_max number of worker_thread structs. + struct worker_thread *threads; + + /// Stack of free threads. When a thread finishes, it puts itself + /// back into this stack. This starts as empty because threads + /// are created only when actually needed. + /// + /// \note Use mutex. + struct worker_thread *threads_free; + + /// The most recent worker thread to which the main thread writes + /// the new input from the application. + struct worker_thread *thr; + + /// Output buffer queue for decompressed data from the worker threads + /// + /// \note Use mutex with operations that need it. + lzma_outq outq; + + mythread_mutex mutex; + mythread_cond cond; + + + /// Memory usage that will not be exceeded in multi-threaded mode. + /// Single-threaded mode can exceed this even by a large amount. + uint64_t memlimit_threading; + + /// Memory usage limit that should never be exceeded. + /// LZMA_MEMLIMIT_ERROR will be returned if decoding isn't possible + /// even in single-threaded mode without exceeding this limit. + uint64_t memlimit_stop; + + /// Amount of memory in use by the direct mode decoder + /// (coder->block_decoder). In threaded mode this is 0. + uint64_t mem_direct_mode; + + /// Amount of memory needed by the running worker threads. + /// This doesn't include the memory needed by the output buffer. + /// + /// \note Use mutex. + uint64_t mem_in_use; + + /// Amount of memory used by the idle (cached) threads. + /// + /// \note Use mutex. + uint64_t mem_cached; + + + /// Amount of memory needed for the filter chain of the next Block. + uint64_t mem_next_filters; + + /// Amount of memory needed for the thread-specific input buffer + /// for the next Block. + uint64_t mem_next_in; + + /// Amount of memory actually needed to decode the next Block + /// in threaded mode. This is + /// mem_next_filters + mem_next_in + memory needed for lzma_outbuf. + uint64_t mem_next_block; + + + /// Amount of compressed data in Stream Header + Blocks that have + /// already been finished. + /// + /// \note Use mutex. + uint64_t progress_in; + + /// Amount of uncompressed data in Blocks that have already + /// been finished. + /// + /// \note Use mutex. + uint64_t progress_out; + + + /// If true, LZMA_NO_CHECK is returned if the Stream has + /// no integrity check. + bool tell_no_check; + + /// If true, LZMA_UNSUPPORTED_CHECK is returned if the Stream has + /// an integrity check that isn't supported by this liblzma build. + bool tell_unsupported_check; + + /// If true, LZMA_GET_CHECK is returned after decoding Stream Header. + bool tell_any_check; + + /// If true, we will tell the Block decoder to skip calculating + /// and verifying the integrity check. + bool ignore_check; + + /// If true, we will decode concatenated Streams that possibly have + /// Stream Padding between or after them. LZMA_STREAM_END is returned + /// once the application isn't giving us any new input (LZMA_FINISH), + /// and we aren't in the middle of a Stream, and possible + /// Stream Padding is a multiple of four bytes. + bool concatenated; + + /// If true, we will return any errors immediately instead of first + /// producing all output before the location of the error. + bool fail_fast; + + + /// When decoding concatenated Streams, this is true as long as we + /// are decoding the first Stream. This is needed to avoid misleading + /// LZMA_FORMAT_ERROR in case the later Streams don't have valid magic + /// bytes. + bool first_stream; + + /// This is used to track if the previous call to stream_decode_mt() + /// had output space (*out_pos < out_size) and managed to fill the + /// output buffer (*out_pos == out_size). This may be set to true + /// in read_output_and_wait(). This is read and then reset to false + /// at the beginning of stream_decode_mt(). + /// + /// This is needed to support applications that call lzma_code() in + /// such a way that more input is provided only when lzma_code() + /// didn't fill the output buffer completely. Basically, this makes + /// it easier to convert such applications from single-threaded + /// decoder to multi-threaded decoder. + bool out_was_filled; + + /// Write position in buffer[] and position in Stream Padding + size_t pos; + + /// Buffer to hold Stream Header, Block Header, and Stream Footer. + /// Block Header has biggest maximum size. + uint8_t buffer[LZMA_BLOCK_HEADER_SIZE_MAX]; +}; + + +/// Enables updating of outbuf->pos. This is a callback function that is +/// used with lzma_outq_enable_partial_output(). +static void +worker_enable_partial_update(void *thr_ptr) +{ + struct worker_thread *thr = thr_ptr; + + mythread_sync(thr->mutex) { + thr->partial_update = PARTIAL_START; + mythread_cond_signal(&thr->cond); + } +} + + +/// Things do to at THR_STOP or when finishing a Block. +/// This is called with thr->mutex locked. +static void +worker_stop(struct worker_thread *thr) +{ + // Update memory usage counters. + thr->coder->mem_in_use -= thr->in_size; + thr->in_size = 0; // thr->in was freed above. + + thr->coder->mem_in_use -= thr->mem_filters; + thr->coder->mem_cached += thr->mem_filters; + + // Put this thread to the stack of free threads. + thr->next = thr->coder->threads_free; + thr->coder->threads_free = thr; + + mythread_cond_signal(&thr->coder->cond); + return; +} + + +static MYTHREAD_RET_TYPE +worker_decoder(void *thr_ptr) +{ + struct worker_thread *thr = thr_ptr; + size_t in_filled; + partial_update_mode partial_update; + lzma_ret ret; + +next_loop_lock: + + mythread_mutex_lock(&thr->mutex); +next_loop_unlocked: + + if (thr->state == THR_IDLE) { + mythread_cond_wait(&thr->cond, &thr->mutex); + goto next_loop_unlocked; + } + + if (thr->state == THR_EXIT) { + mythread_mutex_unlock(&thr->mutex); + + lzma_free(thr->in, thr->allocator); + lzma_next_end(&thr->block_decoder, thr->allocator); + + mythread_mutex_destroy(&thr->mutex); + mythread_cond_destroy(&thr->cond); + + return MYTHREAD_RET_VALUE; + } + + if (thr->state == THR_STOP) { + thr->state = THR_IDLE; + mythread_mutex_unlock(&thr->mutex); + + mythread_sync(thr->coder->mutex) { + worker_stop(thr); + } + + goto next_loop_lock; + } + + assert(thr->state == THR_RUN); + + // Update progress info for get_progress(). + thr->progress_in = thr->in_pos; + thr->progress_out = thr->out_pos; + + // If we don't have any new input, wait for a signal from the main + // thread except if partial output has just been enabled. In that + // case we will do one normal run so that the partial output info + // gets passed to the main thread. The call to block_decoder.code() + // is useless but harmless as it can occur only once per Block. + in_filled = thr->in_filled; + partial_update = thr->partial_update; + + if (in_filled == thr->in_pos && partial_update != PARTIAL_START) { + mythread_cond_wait(&thr->cond, &thr->mutex); + goto next_loop_unlocked; + } + + mythread_mutex_unlock(&thr->mutex); + + // Pass the input in small chunks to the Block decoder. + // This way we react reasonably fast if we are told to stop/exit, + // and (when partial update is enabled) we tell about our progress + // to the main thread frequently enough. + const size_t chunk_size = 16384; + if ((in_filled - thr->in_pos) > chunk_size) + in_filled = thr->in_pos + chunk_size; + + ret = thr->block_decoder.code( + thr->block_decoder.coder, thr->allocator, + thr->in, &thr->in_pos, in_filled, + thr->outbuf->buf, &thr->out_pos, + thr->outbuf->allocated, LZMA_RUN); + + if (ret == LZMA_OK) { + if (partial_update != PARTIAL_DISABLED) { + // The main thread uses thr->mutex to change from + // PARTIAL_DISABLED to PARTIAL_START. The main thread + // doesn't care about this variable after that so we + // can safely change it here to PARTIAL_ENABLED + // without a mutex. + thr->partial_update = PARTIAL_ENABLED; + + // The main thread is reading decompressed data + // from thr->outbuf. Tell the main thread about + // our progress. + // + // NOTE: It's possible that we consumed input without + // producing any new output so it's possible that + // only in_pos has changed. In case of PARTIAL_START + // it is possible that neither in_pos nor out_pos has + // changed. + mythread_sync(thr->coder->mutex) { + thr->outbuf->pos = thr->out_pos; + thr->outbuf->decoder_in_pos = thr->in_pos; + mythread_cond_signal(&thr->coder->cond); + } + } + + goto next_loop_lock; + } + + // Either we finished successfully (LZMA_STREAM_END) or an error + // occurred. Both cases are handled almost identically. The error + // case requires updating thr->coder->thread_error. + // + // The sizes are in the Block Header and the Block decoder + // checks that they match, thus we know these: + assert(ret != LZMA_STREAM_END || thr->in_pos == thr->in_size); + assert(ret != LZMA_STREAM_END + || thr->out_pos == thr->block_options.uncompressed_size); + + // Free the input buffer. Don't update in_size as we need + // it later to update thr->coder->mem_in_use. + lzma_free(thr->in, thr->allocator); + thr->in = NULL; + + mythread_sync(thr->mutex) { + if (thr->state != THR_EXIT) + thr->state = THR_IDLE; + } + + mythread_sync(thr->coder->mutex) { + // Move our progress info to the main thread. + thr->coder->progress_in += thr->in_pos; + thr->coder->progress_out += thr->out_pos; + thr->progress_in = 0; + thr->progress_out = 0; + + // Mark the outbuf as finished. + thr->outbuf->pos = thr->out_pos; + thr->outbuf->decoder_in_pos = thr->in_pos; + thr->outbuf->finished = true; + thr->outbuf->finish_ret = ret; + thr->outbuf = NULL; + + // If an error occurred, tell it to the main thread. + if (ret != LZMA_STREAM_END + && thr->coder->thread_error == LZMA_OK) + thr->coder->thread_error = ret; + + worker_stop(thr); + } + + goto next_loop_lock; +} + + +/// Tells the worker threads to exit and waits for them to terminate. +static void +threads_end(struct lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + coder->threads[i].state = THR_EXIT; + mythread_cond_signal(&coder->threads[i].cond); + } + } + + for (uint32_t i = 0; i < coder->threads_initialized; ++i) + mythread_join(coder->threads[i].thread_id); + + lzma_free(coder->threads, allocator); + coder->threads_initialized = 0; + coder->threads = NULL; + coder->threads_free = NULL; + + // The threads don't update these when they exit. Do it here. + coder->mem_in_use = 0; + coder->mem_cached = 0; + + return; +} + + +static void +threads_stop(struct lzma_stream_coder *coder) +{ + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + // The state must be changed conditionally because + // THR_IDLE -> THR_STOP is not a valid state change. + if (coder->threads[i].state != THR_IDLE) { + coder->threads[i].state = THR_STOP; + mythread_cond_signal(&coder->threads[i].cond); + } + } + } + + return; +} + + +/// Initialize a new worker_thread structure and create a new thread. +static lzma_ret +initialize_new_thread(struct lzma_stream_coder *coder, + const lzma_allocator *allocator) +{ + // Allocate the coder->threads array if needed. It's done here instead + // of when initializing the decoder because we don't need this if we + // use the direct mode (we may even free coder->threads in the middle + // of the file if we switch from threaded to direct mode). + if (coder->threads == NULL) { + coder->threads = lzma_alloc( + coder->threads_max * sizeof(struct worker_thread), + allocator); + + if (coder->threads == NULL) + return LZMA_MEM_ERROR; + } + + // Pick a free structure. + assert(coder->threads_initialized < coder->threads_max); + struct worker_thread *thr + = &coder->threads[coder->threads_initialized]; + + if (mythread_mutex_init(&thr->mutex)) + goto error_mutex; + + if (mythread_cond_init(&thr->cond)) + goto error_cond; + + thr->state = THR_IDLE; + thr->in = NULL; + thr->in_size = 0; + thr->allocator = allocator; + thr->coder = coder; + thr->outbuf = NULL; + thr->block_decoder = LZMA_NEXT_CODER_INIT; + thr->mem_filters = 0; + + if (mythread_create(&thr->thread_id, worker_decoder, thr)) + goto error_thread; + + ++coder->threads_initialized; + coder->thr = thr; + + return LZMA_OK; + +error_thread: + mythread_cond_destroy(&thr->cond); + +error_cond: + mythread_mutex_destroy(&thr->mutex); + +error_mutex: + return LZMA_MEM_ERROR; +} + + +static lzma_ret +get_thread(struct lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + // If there is a free structure on the stack, use it. + mythread_sync(coder->mutex) { + if (coder->threads_free != NULL) { + coder->thr = coder->threads_free; + coder->threads_free = coder->threads_free->next; + + // The thread is no longer in the cache so substract + // it from the cached memory usage. Don't add it + // to mem_in_use though; the caller will handle it + // since it knows how much memory it will actually + // use (the filter chain might change). + coder->mem_cached -= coder->thr->mem_filters; + } + } + + if (coder->thr == NULL) { + assert(coder->threads_initialized < coder->threads_max); + + // Initialize a new thread. + return_if_error(initialize_new_thread(coder, allocator)); + } + + coder->thr->in_filled = 0; + coder->thr->in_pos = 0; + coder->thr->out_pos = 0; + + coder->thr->progress_in = 0; + coder->thr->progress_out = 0; + + coder->thr->partial_update = PARTIAL_DISABLED; + + return LZMA_OK; +} + + +static lzma_ret +read_output_and_wait(struct lzma_stream_coder *coder, + const lzma_allocator *allocator, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, + bool *input_is_possible, + bool waiting_allowed, + mythread_condtime *wait_abs, bool *has_blocked) +{ + lzma_ret ret = LZMA_OK; + + mythread_sync(coder->mutex) { + do { + // Get as much output from the queue as is possible + // without blocking. + const size_t out_start = *out_pos; + do { + ret = lzma_outq_read(&coder->outq, allocator, + out, out_pos, out_size, + NULL, NULL); + + // If a Block was finished, tell the worker + // thread of the next Block (if it is still + // running) to start telling the main thread + // when new output is available. + if (ret == LZMA_STREAM_END) + lzma_outq_enable_partial_output( + &coder->outq, + &worker_enable_partial_update); + + // Loop until a Block wasn't finished. + // It's important to loop around even if + // *out_pos == out_size because there could + // be an empty Block that will return + // LZMA_STREAM_END without needing any + // output space. + } while (ret == LZMA_STREAM_END); + + // Check if lzma_outq_read reported an error from + // the Block decoder. + if (ret != LZMA_OK) + break; + + // If the output buffer is now full but it wasn't full + // when this function was called, set out_was_filled. + // This way the next call to stream_decode_mt() knows + // that some output was produced and no output space + // remained in the previous call to stream_decode_mt(). + if (*out_pos == out_size && *out_pos != out_start) + coder->out_was_filled = true; + + // Check if any thread has indicated an error. + if (coder->thread_error != LZMA_OK) { + // If LZMA_FAIL_FAST was used, report errors + // from worker threads immediately. + if (coder->fail_fast) { + ret = coder->thread_error; + break; + } + + // Otherwise set pending_error. The value we + // set here will not actually get used other + // than working as a flag that an error has + // occurred. This is because in SEQ_ERROR + // all output before the error will be read + // first by calling this function, and once we + // reach the location of the (first) error the + // error code from the above lzma_outq_read() + // will be returned to the application. + // + // Use LZMA_PROG_ERROR since the value should + // never leak to the application. It's + // possible that pending_error has already + // been set but that doesn't matter: if we get + // here, pending_error only works as a flag. + coder->pending_error = LZMA_PROG_ERROR; + } + + // Check if decoding of the next Block can be started. + // The memusage of the active threads must be low + // enough, there must be a free buffer slot in the + // output queue, and there must be a free thread + // (that can be either created or an existing one + // reused). + // + // NOTE: This is checked after reading the output + // above because reading the output can free a slot in + // the output queue and also reduce active memusage. + // + // NOTE: If output queue is empty, then input will + // always be possible. + if (input_is_possible != NULL + && coder->memlimit_threading + - coder->mem_in_use + - coder->outq.mem_in_use + >= coder->mem_next_block + && lzma_outq_has_buf(&coder->outq) + && (coder->threads_initialized + < coder->threads_max + || coder->threads_free + != NULL)) { + *input_is_possible = true; + break; + } + + // If the caller doesn't want us to block, return now. + if (!waiting_allowed) + break; + + // This check is needed only when input_is_possible + // is NULL. We must return if we aren't waiting for + // input to become possible and there is no more + // output coming from the queue. + if (lzma_outq_is_empty(&coder->outq)) { + assert(input_is_possible == NULL); + break; + } + + // If there is more data available from the queue, + // our out buffer must be full and we need to return + // so that the application can provide more output + // space. + // + // NOTE: In general lzma_outq_is_readable() can return + // true also when there are no more bytes available. + // This can happen when a Block has finished without + // providing any new output. We know that this is not + // the case because in the beginning of this loop we + // tried to read as much as possible even when we had + // no output space left and the mutex has been locked + // all the time (so worker threads cannot have changed + // anything). Thus there must be actual pending output + // in the queue. + if (lzma_outq_is_readable(&coder->outq)) { + assert(*out_pos == out_size); + break; + } + + // If the application stops providing more input + // in the middle of a Block, there will eventually + // be one worker thread left that is stuck waiting for + // more input (that might never arrive) and a matching + // outbuf which the worker thread cannot finish due + // to lack of input. We must detect this situation, + // otherwise we would end up waiting indefinitely + // (if no timeout is in use) or keep returning + // LZMA_TIMED_OUT while making no progress. Thus, the + // application would never get LZMA_BUF_ERROR from + // lzma_code() which would tell the application that + // no more progress is possible. No LZMA_BUF_ERROR + // means that, for example, truncated .xz files could + // cause an infinite loop. + // + // A worker thread doing partial updates will + // store not only the output position in outbuf->pos + // but also the matching input position in + // outbuf->decoder_in_pos. Here we check if that + // input position matches the amount of input that + // the worker thread has been given (in_filled). + // If so, we must return and not wait as no more + // output will be coming without first getting more + // input to the worker thread. If the application + // keeps calling lzma_code() without providing more + // input, it will eventually get LZMA_BUF_ERROR. + // + // NOTE: We can read partial_update and in_filled + // without thr->mutex as only the main thread + // modifies these variables. decoder_in_pos requires + // coder->mutex which we are already holding. + if (coder->thr != NULL && coder->thr->partial_update + != PARTIAL_DISABLED) { + // There is exactly one outbuf in the queue. + assert(coder->thr->outbuf == coder->outq.head); + assert(coder->thr->outbuf == coder->outq.tail); + + if (coder->thr->outbuf->decoder_in_pos + == coder->thr->in_filled) + break; + } + + // Wait for input or output to become possible. + if (coder->timeout != 0) { + // See the comment in stream_encoder_mt.c + // about why mythread_condtime_set() is used + // like this. + // + // FIXME? + // In contrast to the encoder, this calls + // _condtime_set while the mutex is locked. + if (!*has_blocked) { + *has_blocked = true; + mythread_condtime_set(wait_abs, + &coder->cond, + coder->timeout); + } + + if (mythread_cond_timedwait(&coder->cond, + &coder->mutex, + wait_abs) != 0) { + ret = LZMA_TIMED_OUT; + break; + } + } else { + mythread_cond_wait(&coder->cond, + &coder->mutex); + } + } while (ret == LZMA_OK); + } + + // If we are returning an error, then the application cannot get + // more output from us and thus keeping the threads running is + // useless and waste of CPU time. + if (ret != LZMA_OK && ret != LZMA_TIMED_OUT) + threads_stop(coder); + + return ret; +} + + +static lzma_ret +decode_block_header(struct lzma_stream_coder *coder, + const lzma_allocator *allocator, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size) +{ + if (*in_pos >= in_size) + return LZMA_OK; + + if (coder->pos == 0) { + // Detect if it's Index. + if (in[*in_pos] == INDEX_INDICATOR) + return LZMA_INDEX_DETECTED; + + // Calculate the size of the Block Header. Note that + // Block Header decoder wants to see this byte too + // so don't advance *in_pos. + coder->block_options.header_size + = lzma_block_header_size_decode( + in[*in_pos]); + } + + // Copy the Block Header to the internal buffer. + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + coder->block_options.header_size); + + // Return if we didn't get the whole Block Header yet. + if (coder->pos < coder->block_options.header_size) + return LZMA_OK; + + coder->pos = 0; + + // Version 1 is needed to support the .ignore_check option. + coder->block_options.version = 1; + + // Block Header decoder will initialize all members of this array + // so we don't need to do it here. + coder->block_options.filters = coder->filters; + + // Decode the Block Header. + return_if_error(lzma_block_header_decode(&coder->block_options, + allocator, coder->buffer)); + + // If LZMA_IGNORE_CHECK was used, this flag needs to be set. + // It has to be set after lzma_block_header_decode() because + // it always resets this to false. + coder->block_options.ignore_check = coder->ignore_check; + + // coder->block_options is ready now. + return LZMA_STREAM_END; +} + + +/// Get the size of the Compressed Data + Block Padding + Check. +static size_t +comp_blk_size(const struct lzma_stream_coder *coder) +{ + return vli_ceil4(coder->block_options.compressed_size) + + lzma_check_size(coder->stream_flags.check); +} + + +/// Returns true if the size (compressed or uncompressed) is such that +/// threaded decompression cannot be used. Sizes that are too big compared +/// to SIZE_MAX must be rejected to avoid integer overflows and truncations +/// when lzma_vli is assigned to a size_t. +static bool +is_direct_mode_needed(lzma_vli size) +{ + return size == LZMA_VLI_UNKNOWN || size > SIZE_MAX / 3; +} + + +static lzma_ret +stream_decoder_reset(struct lzma_stream_coder *coder, + const lzma_allocator *allocator) +{ + // Initialize the Index hash used to verify the Index. + coder->index_hash = lzma_index_hash_init(coder->index_hash, allocator); + if (coder->index_hash == NULL) + return LZMA_MEM_ERROR; + + // Reset the rest of the variables. + coder->sequence = SEQ_STREAM_HEADER; + coder->pos = 0; + + return LZMA_OK; +} + + +static lzma_ret +stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, lzma_action action) +{ + struct lzma_stream_coder *coder = coder_ptr; + + mythread_condtime wait_abs; + bool has_blocked = false; + + // Determine if in SEQ_BLOCK_HEADER and SEQ_BLOCK_THR_RUN we should + // tell read_output_and_wait() to wait until it can fill the output + // buffer (or a timeout occurs). Two conditions must be met: + // + // (1) If the caller provided no new input. The reason for this + // can be, for example, the end of the file or that there is + // a pause in the input stream and more input is available + // a little later. In this situation we should wait for output + // because otherwise we would end up in a busy-waiting loop where + // we make no progress and the application just calls us again + // without providing any new input. This would then result in + // LZMA_BUF_ERROR even though more output would be available + // once the worker threads decode more data. + // + // (2) Even if (1) is true, we will not wait if the previous call to + // this function managed to produce some output and the output + // buffer became full. This is for compatibility with applications + // that call lzma_code() in such a way that new input is provided + // only when the output buffer didn't become full. Without this + // trick such applications would have bad performance (bad + // parallelization due to decoder not getting input fast enough). + // + // NOTE: Such loops might require that timeout is disabled (0) + // if they assume that output-not-full implies that all input has + // been consumed. If and only if timeout is enabled, we may return + // when output isn't full *and* not all input has been consumed. + // + // However, if LZMA_FINISH is used, the above is ignored and we always + // wait (timeout can still cause us to return) because we know that + // we won't get any more input. This matters if the input file is + // truncated and we are doing single-shot decoding, that is, + // timeout = 0 and LZMA_FINISH is used on the first call to + // lzma_code() and the output buffer is known to be big enough + // to hold all uncompressed data: + // + // - If LZMA_FINISH wasn't handled specially, we could return + // LZMA_OK before providing all output that is possible with the + // truncated input. The rest would be available if lzma_code() was + // called again but then it's not single-shot decoding anymore. + // + // - By handling LZMA_FINISH specially here, the first call will + // produce all the output, matching the behavior of the + // single-threaded decoder. + // + // So it's a very specific corner case but also easy to avoid. Note + // that this special handling of LZMA_FINISH has no effect for + // single-shot decoding when the input file is valid (not truncated); + // premature LZMA_OK wouldn't be possible as long as timeout = 0. + const bool waiting_allowed = action == LZMA_FINISH + || (*in_pos == in_size && !coder->out_was_filled); + coder->out_was_filled = false; + + while (true) + switch (coder->sequence) { + case SEQ_STREAM_HEADER: { + // Copy the Stream Header to the internal buffer. + const size_t in_old = *in_pos; + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + LZMA_STREAM_HEADER_SIZE); + coder->progress_in += *in_pos - in_old; + + // Return if we didn't get the whole Stream Header yet. + if (coder->pos < LZMA_STREAM_HEADER_SIZE) + return LZMA_OK; + + coder->pos = 0; + + // Decode the Stream Header. + const lzma_ret ret = lzma_stream_header_decode( + &coder->stream_flags, coder->buffer); + if (ret != LZMA_OK) + return ret == LZMA_FORMAT_ERROR && !coder->first_stream + ? LZMA_DATA_ERROR : ret; + + // If we are decoding concatenated Streams, and the later + // Streams have invalid Header Magic Bytes, we give + // LZMA_DATA_ERROR instead of LZMA_FORMAT_ERROR. + coder->first_stream = false; + + // Copy the type of the Check so that Block Header and Block + // decoders see it. + coder->block_options.check = coder->stream_flags.check; + + // Even if we return LZMA_*_CHECK below, we want + // to continue from Block Header decoding. + coder->sequence = SEQ_BLOCK_HEADER; + + // Detect if there's no integrity check or if it is + // unsupported if those were requested by the application. + if (coder->tell_no_check && coder->stream_flags.check + == LZMA_CHECK_NONE) + return LZMA_NO_CHECK; + + if (coder->tell_unsupported_check + && !lzma_check_is_supported( + coder->stream_flags.check)) + return LZMA_UNSUPPORTED_CHECK; + + if (coder->tell_any_check) + return LZMA_GET_CHECK; + } + + // Fall through + + case SEQ_BLOCK_HEADER: { + const size_t in_old = *in_pos; + const lzma_ret ret = decode_block_header(coder, allocator, + in, in_pos, in_size); + coder->progress_in += *in_pos - in_old; + + if (ret == LZMA_OK) { + // We didn't decode the whole Block Header yet. + // + // Read output from the queue before returning. This + // is important because it is possible that the + // application doesn't have any new input available + // immediately. If we didn't try to copy output from + // the output queue here, lzma_code() could end up + // returning LZMA_BUF_ERROR even though queued output + // is available. + // + // If the lzma_code() call provided at least one input + // byte, only copy as much data from the output queue + // as is available immediately. This way the + // application will be able to provide more input + // without a delay. + // + // On the other hand, if lzma_code() was called with + // an empty input buffer(*), treat it specially: try + // to fill the output buffer even if it requires + // waiting for the worker threads to provide output + // (timeout, if specified, can still cause us to + // return). + // + // - This way the application will be able to get all + // data that can be decoded from the input provided + // so far. + // + // - We avoid both premature LZMA_BUF_ERROR and + // busy-waiting where the application repeatedly + // calls lzma_code() which immediately returns + // LZMA_OK without providing new data. + // + // - If the queue becomes empty, we won't wait + // anything and will return LZMA_OK immediately + // (coder->timeout is completely ignored). + // + // (*) See the comment at the beginning of this + // function how waiting_allowed is determined + // and why there is an exception to the rule + // of "called with an empty input buffer". + assert(*in_pos == in_size); + + // If LZMA_FINISH was used we know that we won't get + // more input, so the file must be truncated if we + // get here. If worker threads don't detect any + // errors, eventually there will be no more output + // while we keep returning LZMA_OK which gets + // converted to LZMA_BUF_ERROR in lzma_code(). + // + // If fail-fast is enabled then we will return + // immediately using LZMA_DATA_ERROR instead of + // LZMA_OK or LZMA_BUF_ERROR. Rationale for the + // error code: + // + // - Worker threads may have a large amount of + // not-yet-decoded input data and we don't + // know for sure if all data is valid. Bad + // data there would result in LZMA_DATA_ERROR + // when fail-fast isn't used. + // + // - Immediate LZMA_BUF_ERROR would be a bit weird + // considering the older liblzma code. lzma_code() + // even has an assertion to prevent coders from + // returning LZMA_BUF_ERROR directly. + // + // The downside of this is that with fail-fast apps + // cannot always distinguish between corrupt and + // truncated files. + if (action == LZMA_FINISH && coder->fail_fast) { + // We won't produce any more output. Stop + // the unfinished worker threads so they + // won't waste CPU time. + threads_stop(coder); + return LZMA_DATA_ERROR; + } + + // read_output_and_wait() will call threads_stop() + // if needed so with that we can use return_if_error. + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, waiting_allowed, + &wait_abs, &has_blocked)); + + if (coder->pending_error != LZMA_OK) { + coder->sequence = SEQ_ERROR; + break; + } + + return LZMA_OK; + } + + if (ret == LZMA_INDEX_DETECTED) { + coder->sequence = SEQ_INDEX_WAIT_OUTPUT; + break; + } + + // See if an error occurred. + if (ret != LZMA_STREAM_END) { + // NOTE: Here and in all other places where + // pending_error is set, it may overwrite the value + // (LZMA_PROG_ERROR) set by read_output_and_wait(). + // That function might overwrite value set here too. + // These are fine because when read_output_and_wait() + // sets pending_error, it actually works as a flag + // variable only ("some error has occurred") and the + // actual value of pending_error is not used in + // SEQ_ERROR. In such cases SEQ_ERROR will eventually + // get the correct error code from the return value of + // a later read_output_and_wait() call. + coder->pending_error = ret; + coder->sequence = SEQ_ERROR; + break; + } + + // Calculate the memory usage of the filters / Block decoder. + coder->mem_next_filters = lzma_raw_decoder_memusage( + coder->filters); + + if (coder->mem_next_filters == UINT64_MAX) { + // One or more unknown Filter IDs. + coder->pending_error = LZMA_OPTIONS_ERROR; + coder->sequence = SEQ_ERROR; + break; + } + + coder->sequence = SEQ_BLOCK_INIT; + } + + // Fall through + + case SEQ_BLOCK_INIT: { + // Check if decoding is possible at all with the current + // memlimit_stop which we must never exceed. + // + // This needs to be the first thing in SEQ_BLOCK_INIT + // to make it possible to restart decoding after increasing + // memlimit_stop with lzma_memlimit_set(). + if (coder->mem_next_filters > coder->memlimit_stop) { + // Flush pending output before returning + // LZMA_MEMLIMIT_ERROR. If the application doesn't + // want to increase the limit, at least it will get + // all the output possible so far. + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, true, &wait_abs, &has_blocked)); + + if (!lzma_outq_is_empty(&coder->outq)) + return LZMA_OK; + + return LZMA_MEMLIMIT_ERROR; + } + + // Check if the size information is available in Block Header. + // If it is, check if the sizes are small enough that we don't + // need to worry *too* much about integer overflows later in + // the code. If these conditions are not met, we must use the + // single-threaded direct mode. + if (is_direct_mode_needed(coder->block_options.compressed_size) + || is_direct_mode_needed( + coder->block_options.uncompressed_size)) { + coder->sequence = SEQ_BLOCK_DIRECT_INIT; + break; + } + + // Calculate the amount of memory needed for the input and + // output buffers in threaded mode. + // + // These cannot overflow because we already checked that + // the sizes are small enough using is_direct_mode_needed(). + coder->mem_next_in = comp_blk_size(coder); + const uint64_t mem_buffers = coder->mem_next_in + + lzma_outq_outbuf_memusage( + coder->block_options.uncompressed_size); + + // Add the amount needed by the filters. + // Avoid integer overflows. + if (UINT64_MAX - mem_buffers < coder->mem_next_filters) { + // Use direct mode if the memusage would overflow. + // This is a theoretical case that shouldn't happen + // in practice unless the input file is weird (broken + // or malicious). + coder->sequence = SEQ_BLOCK_DIRECT_INIT; + break; + } + + // Amount of memory needed to decode this Block in + // threaded mode: + coder->mem_next_block = coder->mem_next_filters + mem_buffers; + + // If this alone would exceed memlimit_threading, then we must + // use the single-threaded direct mode. + if (coder->mem_next_block > coder->memlimit_threading) { + coder->sequence = SEQ_BLOCK_DIRECT_INIT; + break; + } + + // Use the threaded mode. Free the direct mode decoder in + // case it has been initialized. + lzma_next_end(&coder->block_decoder, allocator); + coder->mem_direct_mode = 0; + + // Since we already know what the sizes are supposed to be, + // we can already add them to the Index hash. The Block + // decoder will verify the values while decoding. + const lzma_ret ret = lzma_index_hash_append(coder->index_hash, + lzma_block_unpadded_size( + &coder->block_options), + coder->block_options.uncompressed_size); + if (ret != LZMA_OK) { + coder->pending_error = ret; + coder->sequence = SEQ_ERROR; + break; + } + + coder->sequence = SEQ_BLOCK_THR_INIT; + } + + // Fall through + + case SEQ_BLOCK_THR_INIT: { + // We need to wait for a multiple conditions to become true + // until we can initialize the Block decoder and let a worker + // thread decode it: + // + // - Wait for the memory usage of the active threads to drop + // so that starting the decoding of this Block won't make + // us go over memlimit_threading. + // + // - Wait for at least one free output queue slot. + // + // - Wait for a free worker thread. + // + // While we wait, we must copy decompressed data to the out + // buffer and catch possible decoder errors. + // + // read_output_and_wait() does all the above. + bool block_can_start = false; + + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + &block_can_start, true, + &wait_abs, &has_blocked)); + + if (coder->pending_error != LZMA_OK) { + coder->sequence = SEQ_ERROR; + break; + } + + if (!block_can_start) { + // It's not a timeout because return_if_error handles + // it already. Output queue cannot be empty either + // because in that case block_can_start would have + // been true. Thus the output buffer must be full and + // the queue isn't empty. + assert(*out_pos == out_size); + assert(!lzma_outq_is_empty(&coder->outq)); + return LZMA_OK; + } + + // We know that we can start decoding this Block without + // exceeding memlimit_threading. However, to stay below + // memlimit_threading may require freeing some of the + // cached memory. + // + // Get a local copy of variables that require locking the + // mutex. It is fine if the worker threads modify the real + // values after we read these as those changes can only be + // towards more favorable conditions (less memory in use, + // more in cache). + uint64_t mem_in_use; + uint64_t mem_cached; + struct worker_thread *thr = NULL; // Init to silence warning. + + mythread_sync(coder->mutex) { + mem_in_use = coder->mem_in_use; + mem_cached = coder->mem_cached; + thr = coder->threads_free; + } + + // The maximum amount of memory that can be held by other + // threads and cached buffers while allowing us to start + // decoding the next Block. + const uint64_t mem_max = coder->memlimit_threading + - coder->mem_next_block; + + // If the existing allocations are so large that starting + // to decode this Block might exceed memlimit_threads, + // try to free memory from the output queue cache first. + // + // NOTE: This math assumes the worst case. It's possible + // that the limit wouldn't be exceeded if the existing cached + // allocations are reused. + if (mem_in_use + mem_cached + coder->outq.mem_allocated + > mem_max) { + // Clear the outq cache except leave one buffer in + // the cache if its size is correct. That way we + // don't free and almost immediately reallocate + // an identical buffer. + lzma_outq_clear_cache2(&coder->outq, allocator, + coder->block_options.uncompressed_size); + } + + // If there is at least one worker_thread in the cache and + // the existing allocations are so large that starting to + // decode this Block might exceed memlimit_threads, free + // memory by freeing cached Block decoders. + // + // NOTE: The comparison is different here than above. + // Here we don't care about cached buffers in outq anymore + // and only look at memory actually in use. This is because + // if there is something in outq cache, it's a single buffer + // that can be used as is. We ensured this in the above + // if-block. + uint64_t mem_freed = 0; + if (thr != NULL && mem_in_use + mem_cached + + coder->outq.mem_in_use > mem_max) { + // Don't free the first Block decoder if its memory + // usage isn't greater than what this Block will need. + // Typically the same filter chain is used for all + // Blocks so this way the allocations can be reused + // when get_thread() picks the first worker_thread + // from the cache. + if (thr->mem_filters <= coder->mem_next_filters) + thr = thr->next; + + while (thr != NULL) { + lzma_next_end(&thr->block_decoder, allocator); + mem_freed += thr->mem_filters; + thr->mem_filters = 0; + thr = thr->next; + } + } + + // Update the memory usage counters. Note that coder->mem_* + // may have changed since we read them so we must substract + // or add the changes. + mythread_sync(coder->mutex) { + coder->mem_cached -= mem_freed; + + // Memory needed for the filters and the input buffer. + // The output queue takes care of its own counter so + // we don't touch it here. + // + // NOTE: After this, coder->mem_in_use + + // coder->mem_cached might count the same thing twice. + // If so, this will get corrected in get_thread() when + // a worker_thread is picked from coder->free_threads + // and its memory usage is substracted from mem_cached. + coder->mem_in_use += coder->mem_next_in + + coder->mem_next_filters; + } + + // Allocate memory for the output buffer in the output queue. + lzma_ret ret = lzma_outq_prealloc_buf( + &coder->outq, allocator, + coder->block_options.uncompressed_size); + if (ret != LZMA_OK) { + threads_stop(coder); + return ret; + } + + // Set up coder->thr. + ret = get_thread(coder, allocator); + if (ret != LZMA_OK) { + threads_stop(coder); + return ret; + } + + // The new Block decoder memory usage is already counted in + // coder->mem_in_use. Store it in the thread too. + coder->thr->mem_filters = coder->mem_next_filters; + + // Initialize the Block decoder. + coder->thr->block_options = coder->block_options; + ret = lzma_block_decoder_init( + &coder->thr->block_decoder, allocator, + &coder->thr->block_options); + + // Free the allocated filter options since they are needed + // only to initialize the Block decoder. + lzma_filters_free(coder->filters, allocator); + coder->thr->block_options.filters = NULL; + + // Check if memory usage calculation and Block encoder + // initialization succeeded. + if (ret != LZMA_OK) { + coder->pending_error = ret; + coder->sequence = SEQ_ERROR; + break; + } + + // Allocate the input buffer. + coder->thr->in_size = coder->mem_next_in; + coder->thr->in = lzma_alloc(coder->thr->in_size, allocator); + if (coder->thr->in == NULL) { + threads_stop(coder); + return LZMA_MEM_ERROR; + } + + // Get the preallocated output buffer. + coder->thr->outbuf = lzma_outq_get_buf( + &coder->outq, coder->thr); + + // Start the decoder. + mythread_sync(coder->thr->mutex) { + assert(coder->thr->state == THR_IDLE); + coder->thr->state = THR_RUN; + mythread_cond_signal(&coder->thr->cond); + } + + // Enable output from the thread that holds the oldest output + // buffer in the output queue (if such a thread exists). + mythread_sync(coder->mutex) { + lzma_outq_enable_partial_output(&coder->outq, + &worker_enable_partial_update); + } + + coder->sequence = SEQ_BLOCK_THR_RUN; + } + + // Fall through + + case SEQ_BLOCK_THR_RUN: { + if (action == LZMA_FINISH && coder->fail_fast) { + // We know that we won't get more input and that + // the caller wants fail-fast behavior. If we see + // that we don't have enough input to finish this + // Block, return LZMA_DATA_ERROR immediately. + // See SEQ_BLOCK_HEADER for the error code rationale. + const size_t in_avail = in_size - *in_pos; + const size_t in_needed = coder->thr->in_size + - coder->thr->in_filled; + if (in_avail < in_needed) { + threads_stop(coder); + return LZMA_DATA_ERROR; + } + } + + // Copy input to the worker thread. + size_t cur_in_filled = coder->thr->in_filled; + lzma_bufcpy(in, in_pos, in_size, coder->thr->in, + &cur_in_filled, coder->thr->in_size); + + // Tell the thread how much we copied. + mythread_sync(coder->thr->mutex) { + coder->thr->in_filled = cur_in_filled; + + // NOTE: Most of the time we are copying input faster + // than the thread can decode so most of the time + // calling mythread_cond_signal() is useless but + // we cannot make it conditional because thr->in_pos + // is updated without a mutex. And the overhead should + // be very much negligible anyway. + mythread_cond_signal(&coder->thr->cond); + } + + // Read output from the output queue. Just like in + // SEQ_BLOCK_HEADER, we wait to fill the output buffer + // only if waiting_allowed was set to true in the beginning + // of this function (see the comment there). + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, waiting_allowed, + &wait_abs, &has_blocked)); + + if (coder->pending_error != LZMA_OK) { + coder->sequence = SEQ_ERROR; + break; + } + + // Return if the input didn't contain the whole Block. + if (coder->thr->in_filled < coder->thr->in_size) { + assert(*in_pos == in_size); + return LZMA_OK; + } + + // The whole Block has been copied to the thread-specific + // buffer. Continue from the next Block Header or Index. + coder->thr = NULL; + coder->sequence = SEQ_BLOCK_HEADER; + break; + } + + case SEQ_BLOCK_DIRECT_INIT: { + // Wait for the threads to finish and that all decoded data + // has been copied to the output. That is, wait until the + // output queue becomes empty. + // + // NOTE: No need to check for coder->pending_error as + // we aren't consuming any input until the queue is empty + // and if there is a pending error, read_output_and_wait() + // will eventually return it before the queue is empty. + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, true, &wait_abs, &has_blocked)); + if (!lzma_outq_is_empty(&coder->outq)) + return LZMA_OK; + + // Free the cached output buffers. + lzma_outq_clear_cache(&coder->outq, allocator); + + // Get rid of the worker threads, including the coder->threads + // array. + threads_end(coder, allocator); + + // Initialize the Block decoder. + const lzma_ret ret = lzma_block_decoder_init( + &coder->block_decoder, allocator, + &coder->block_options); + + // Free the allocated filter options since they are needed + // only to initialize the Block decoder. + lzma_filters_free(coder->filters, allocator); + coder->block_options.filters = NULL; + + // Check if Block decoder initialization succeeded. + if (ret != LZMA_OK) + return ret; + + // Make the memory usage visible to _memconfig(). + coder->mem_direct_mode = coder->mem_next_filters; + + coder->sequence = SEQ_BLOCK_DIRECT_RUN; + } + + // Fall through + + case SEQ_BLOCK_DIRECT_RUN: { + const size_t in_old = *in_pos; + const size_t out_old = *out_pos; + const lzma_ret ret = coder->block_decoder.code( + coder->block_decoder.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + action); + coder->progress_in += *in_pos - in_old; + coder->progress_out += *out_pos - out_old; + + if (ret != LZMA_STREAM_END) + return ret; + + // Block decoded successfully. Add the new size pair to + // the Index hash. + return_if_error(lzma_index_hash_append(coder->index_hash, + lzma_block_unpadded_size( + &coder->block_options), + coder->block_options.uncompressed_size)); + + coder->sequence = SEQ_BLOCK_HEADER; + break; + } + + case SEQ_INDEX_WAIT_OUTPUT: + // Flush the output from all worker threads so that we can + // decode the Index without thinking about threading. + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, true, &wait_abs, &has_blocked)); + + if (!lzma_outq_is_empty(&coder->outq)) + return LZMA_OK; + + coder->sequence = SEQ_INDEX_DECODE; + + // Fall through + + case SEQ_INDEX_DECODE: { + // If we don't have any input, don't call + // lzma_index_hash_decode() since it would return + // LZMA_BUF_ERROR, which we must not do here. + if (*in_pos >= in_size) + return LZMA_OK; + + // Decode the Index and compare it to the hash calculated + // from the sizes of the Blocks (if any). + const size_t in_old = *in_pos; + const lzma_ret ret = lzma_index_hash_decode(coder->index_hash, + in, in_pos, in_size); + coder->progress_in += *in_pos - in_old; + if (ret != LZMA_STREAM_END) + return ret; + + coder->sequence = SEQ_STREAM_FOOTER; + } + + // Fall through + + case SEQ_STREAM_FOOTER: { + // Copy the Stream Footer to the internal buffer. + const size_t in_old = *in_pos; + lzma_bufcpy(in, in_pos, in_size, coder->buffer, &coder->pos, + LZMA_STREAM_HEADER_SIZE); + coder->progress_in += *in_pos - in_old; + + // Return if we didn't get the whole Stream Footer yet. + if (coder->pos < LZMA_STREAM_HEADER_SIZE) + return LZMA_OK; + + coder->pos = 0; + + // Decode the Stream Footer. The decoder gives + // LZMA_FORMAT_ERROR if the magic bytes don't match, + // so convert that return code to LZMA_DATA_ERROR. + lzma_stream_flags footer_flags; + const lzma_ret ret = lzma_stream_footer_decode( + &footer_flags, coder->buffer); + if (ret != LZMA_OK) + return ret == LZMA_FORMAT_ERROR + ? LZMA_DATA_ERROR : ret; + + // Check that Index Size stored in the Stream Footer matches + // the real size of the Index field. + if (lzma_index_hash_size(coder->index_hash) + != footer_flags.backward_size) + return LZMA_DATA_ERROR; + + // Compare that the Stream Flags fields are identical in + // both Stream Header and Stream Footer. + return_if_error(lzma_stream_flags_compare( + &coder->stream_flags, &footer_flags)); + + if (!coder->concatenated) + return LZMA_STREAM_END; + + coder->sequence = SEQ_STREAM_PADDING; + } + + // Fall through + + case SEQ_STREAM_PADDING: + assert(coder->concatenated); + + // Skip over possible Stream Padding. + while (true) { + if (*in_pos >= in_size) { + // Unless LZMA_FINISH was used, we cannot + // know if there's more input coming later. + if (action != LZMA_FINISH) + return LZMA_OK; + + // Stream Padding must be a multiple of + // four bytes. + return coder->pos == 0 + ? LZMA_STREAM_END + : LZMA_DATA_ERROR; + } + + // If the byte is not zero, it probably indicates + // beginning of a new Stream (or the file is corrupt). + if (in[*in_pos] != 0x00) + break; + + ++*in_pos; + ++coder->progress_in; + coder->pos = (coder->pos + 1) & 3; + } + + // Stream Padding must be a multiple of four bytes (empty + // Stream Padding is OK). + if (coder->pos != 0) { + ++*in_pos; + ++coder->progress_in; + return LZMA_DATA_ERROR; + } + + // Prepare to decode the next Stream. + return_if_error(stream_decoder_reset(coder, allocator)); + break; + + case SEQ_ERROR: + if (!coder->fail_fast) { + // Let the application get all data before the point + // where the error was detected. This matches the + // behavior of single-threaded use. + // + // FIXME? Some errors (LZMA_MEM_ERROR) don't get here, + // they are returned immediately. Thus in rare cases + // the output will be less than in the single-threaded + // mode. Maybe this doesn't matter much in practice. + return_if_error(read_output_and_wait(coder, allocator, + out, out_pos, out_size, + NULL, true, &wait_abs, &has_blocked)); + + // We get here only if the error happened in the main + // thread, for example, unsupported Block Header. + if (!lzma_outq_is_empty(&coder->outq)) + return LZMA_OK; + } + + // We only get here if no errors were detected by the worker + // threads. Errors from worker threads would have already been + // returned by the call to read_output_and_wait() above. + return coder->pending_error; + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + // Never reached +} + + +static void +stream_decoder_mt_end(void *coder_ptr, const lzma_allocator *allocator) +{ + struct lzma_stream_coder *coder = coder_ptr; + + threads_end(coder, allocator); + lzma_outq_end(&coder->outq, allocator); + + lzma_next_end(&coder->block_decoder, allocator); + lzma_filters_free(coder->filters, allocator); + lzma_index_hash_end(coder->index_hash, allocator); + + lzma_free(coder, allocator); + return; +} + + +static lzma_check +stream_decoder_mt_get_check(const void *coder_ptr) +{ + const struct lzma_stream_coder *coder = coder_ptr; + return coder->stream_flags.check; +} + + +static lzma_ret +stream_decoder_mt_memconfig(void *coder_ptr, uint64_t *memusage, + uint64_t *old_memlimit, uint64_t new_memlimit) +{ + // NOTE: This function gets/sets memlimit_stop. For now, + // memlimit_threading cannot be modified after initialization. + // + // *memusage will include cached memory too. Excluding cached memory + // would be misleading and it wouldn't help the applications to + // know how much memory is actually needed to decompress the file + // because the higher the number of threads and the memlimits are + // the more memory the decoder may use. + // + // Setting a new limit includes the cached memory too and too low + // limits will be rejected. Alternative could be to free the cached + // memory immediately if that helps to bring the limit down but + // the current way is the simplest. It's unlikely that limit needs + // to be lowered in the middle of a file anyway; the typical reason + // to want a new limit is to increase after LZMA_MEMLIMIT_ERROR + // and even such use isn't common. + struct lzma_stream_coder *coder = coder_ptr; + + mythread_sync(coder->mutex) { + *memusage = coder->mem_direct_mode + + coder->mem_in_use + + coder->mem_cached + + coder->outq.mem_allocated; + } + + // If no filter chains are allocated, *memusage may be zero. + // Always return at least LZMA_MEMUSAGE_BASE. + if (*memusage < LZMA_MEMUSAGE_BASE) + *memusage = LZMA_MEMUSAGE_BASE; + + *old_memlimit = coder->memlimit_stop; + + if (new_memlimit != 0) { + if (new_memlimit < *memusage) + return LZMA_MEMLIMIT_ERROR; + + coder->memlimit_stop = new_memlimit; + } + + return LZMA_OK; +} + + +static void +stream_decoder_mt_get_progress(void *coder_ptr, + uint64_t *progress_in, uint64_t *progress_out) +{ + struct lzma_stream_coder *coder = coder_ptr; + + // Lock coder->mutex to prevent finishing threads from moving their + // progress info from the worker_thread structure to lzma_stream_coder. + mythread_sync(coder->mutex) { + *progress_in = coder->progress_in; + *progress_out = coder->progress_out; + + for (size_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + *progress_in += coder->threads[i].progress_in; + *progress_out += coder->threads[i] + .progress_out; + } + } + } + + return; +} + + +static lzma_ret +stream_decoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_mt *options) +{ + struct lzma_stream_coder *coder; + + if (options->threads == 0 || options->threads > LZMA_THREADS_MAX) + return LZMA_OPTIONS_ERROR; + + if (options->flags & ~LZMA_SUPPORTED_FLAGS) + return LZMA_OPTIONS_ERROR; + + lzma_next_coder_init(&stream_decoder_mt_init, next, allocator); + + coder = next->coder; + if (!coder) { + coder = lzma_alloc(sizeof(struct lzma_stream_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + + if (mythread_mutex_init(&coder->mutex)) { + lzma_free(coder, allocator); + return LZMA_MEM_ERROR; + } + + if (mythread_cond_init(&coder->cond)) { + mythread_mutex_destroy(&coder->mutex); + lzma_free(coder, allocator); + return LZMA_MEM_ERROR; + } + + next->code = &stream_decode_mt; + next->end = &stream_decoder_mt_end; + next->get_check = &stream_decoder_mt_get_check; + next->memconfig = &stream_decoder_mt_memconfig; + next->get_progress = &stream_decoder_mt_get_progress; + + coder->filters[0].id = LZMA_VLI_UNKNOWN; + memzero(&coder->outq, sizeof(coder->outq)); + + coder->block_decoder = LZMA_NEXT_CODER_INIT; + coder->mem_direct_mode = 0; + + coder->index_hash = NULL; + coder->threads = NULL; + coder->threads_free = NULL; + coder->threads_initialized = 0; + } + + // Cleanup old filter chain if one remains after unfinished decoding + // of a previous Stream. + lzma_filters_free(coder->filters, allocator); + + // By allocating threads from scratch we can start memory-usage + // accounting from scratch, too. Changes in filter and block sizes may + // affect number of threads. + // + // FIXME? Reusing should be easy but unlike the single-threaded + // decoder, with some types of input file combinations reusing + // could leave quite a lot of memory allocated but unused (first + // file could allocate a lot, the next files could use fewer + // threads and some of the allocations from the first file would not + // get freed unless memlimit_threading forces us to clear caches). + // + // NOTE: The direct mode decoder isn't freed here if one exists. + // It will be reused or freed as needed in the main loop. + threads_end(coder, allocator); + + // All memusage counters start at 0 (including mem_direct_mode). + // The little extra that is needed for the structs in this file + // get accounted well enough by the filter chain memory usage + // which adds LZMA_MEMUSAGE_BASE for each chain. However, + // stream_decoder_mt_memconfig() has to handle this specially so that + // it will never return less than LZMA_MEMUSAGE_BASE as memory usage. + coder->mem_in_use = 0; + coder->mem_cached = 0; + coder->mem_next_block = 0; + + coder->progress_in = 0; + coder->progress_out = 0; + + coder->sequence = SEQ_STREAM_HEADER; + coder->thread_error = LZMA_OK; + coder->pending_error = LZMA_OK; + coder->thr = NULL; + + coder->timeout = options->timeout; + + coder->memlimit_threading = my_max(1, options->memlimit_threading); + coder->memlimit_stop = my_max(1, options->memlimit_stop); + if (coder->memlimit_threading > coder->memlimit_stop) + coder->memlimit_threading = coder->memlimit_stop; + + coder->tell_no_check = (options->flags & LZMA_TELL_NO_CHECK) != 0; + coder->tell_unsupported_check + = (options->flags & LZMA_TELL_UNSUPPORTED_CHECK) != 0; + coder->tell_any_check = (options->flags & LZMA_TELL_ANY_CHECK) != 0; + coder->ignore_check = (options->flags & LZMA_IGNORE_CHECK) != 0; + coder->concatenated = (options->flags & LZMA_CONCATENATED) != 0; + coder->fail_fast = (options->flags & LZMA_FAIL_FAST) != 0; + + coder->first_stream = true; + coder->out_was_filled = false; + coder->pos = 0; + + coder->threads_max = options->threads; + + return_if_error(lzma_outq_init(&coder->outq, allocator, + coder->threads_max)); + + return stream_decoder_reset(coder, allocator); +} + + +extern LZMA_API(lzma_ret) +lzma_stream_decoder_mt(lzma_stream *strm, const lzma_mt *options) +{ + lzma_next_strm_init(stream_decoder_mt_init, strm, options); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_encoder.c b/src/liblzma/common/stream_encoder.c new file mode 100644 index 0000000..ee92046 --- /dev/null +++ b/src/liblzma/common/stream_encoder.c @@ -0,0 +1,355 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_encoder.c +/// \brief Encodes .xz Streams +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "block_encoder.h" +#include "index_encoder.h" + + +typedef struct { + enum { + SEQ_STREAM_HEADER, + SEQ_BLOCK_INIT, + SEQ_BLOCK_HEADER, + SEQ_BLOCK_ENCODE, + SEQ_INDEX_ENCODE, + SEQ_STREAM_FOOTER, + } sequence; + + /// True if Block encoder has been initialized by + /// stream_encoder_init() or stream_encoder_update() + /// and thus doesn't need to be initialized in stream_encode(). + bool block_encoder_is_initialized; + + /// Block + lzma_next_coder block_encoder; + + /// Options for the Block encoder + lzma_block block_options; + + /// The filter chain currently in use + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + + /// Index encoder. This is separate from Block encoder, because this + /// doesn't take much memory, and when encoding multiple Streams + /// with the same encoding options we avoid reallocating memory. + lzma_next_coder index_encoder; + + /// Index to hold sizes of the Blocks + lzma_index *index; + + /// Read position in buffer[] + size_t buffer_pos; + + /// Total number of bytes in buffer[] + size_t buffer_size; + + /// Buffer to hold Stream Header, Block Header, and Stream Footer. + /// Block Header has biggest maximum size. + uint8_t buffer[LZMA_BLOCK_HEADER_SIZE_MAX]; +} lzma_stream_coder; + + +static lzma_ret +block_encoder_init(lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + // Prepare the Block options. Even though Block encoder doesn't need + // compressed_size, uncompressed_size, and header_size to be + // initialized, it is a good idea to do it here, because this way + // we catch if someone gave us Filter ID that cannot be used in + // Blocks/Streams. + coder->block_options.compressed_size = LZMA_VLI_UNKNOWN; + coder->block_options.uncompressed_size = LZMA_VLI_UNKNOWN; + + return_if_error(lzma_block_header_size(&coder->block_options)); + + // Initialize the actual Block encoder. + return lzma_block_encoder_init(&coder->block_encoder, allocator, + &coder->block_options); +} + + +static lzma_ret +stream_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_stream_coder *coder = coder_ptr; + + // Main loop + while (*out_pos < out_size) + switch (coder->sequence) { + case SEQ_STREAM_HEADER: + case SEQ_BLOCK_HEADER: + case SEQ_STREAM_FOOTER: + lzma_bufcpy(coder->buffer, &coder->buffer_pos, + coder->buffer_size, out, out_pos, out_size); + if (coder->buffer_pos < coder->buffer_size) + return LZMA_OK; + + if (coder->sequence == SEQ_STREAM_FOOTER) + return LZMA_STREAM_END; + + coder->buffer_pos = 0; + ++coder->sequence; + break; + + case SEQ_BLOCK_INIT: { + if (*in_pos == in_size) { + // If we are requested to flush or finish the current + // Block, return LZMA_STREAM_END immediately since + // there's nothing to do. + if (action != LZMA_FINISH) + return action == LZMA_RUN + ? LZMA_OK : LZMA_STREAM_END; + + // The application had used LZMA_FULL_FLUSH to finish + // the previous Block, but now wants to finish without + // encoding new data, or it is simply creating an + // empty Stream with no Blocks. + // + // Initialize the Index encoder, and continue to + // actually encoding the Index. + return_if_error(lzma_index_encoder_init( + &coder->index_encoder, allocator, + coder->index)); + coder->sequence = SEQ_INDEX_ENCODE; + break; + } + + // Initialize the Block encoder unless it was already + // initialized by stream_encoder_init() or + // stream_encoder_update(). + if (!coder->block_encoder_is_initialized) + return_if_error(block_encoder_init(coder, allocator)); + + // Make it false so that we don't skip the initialization + // with the next Block. + coder->block_encoder_is_initialized = false; + + // Encode the Block Header. This shouldn't fail since we have + // already initialized the Block encoder. + if (lzma_block_header_encode(&coder->block_options, + coder->buffer) != LZMA_OK) + return LZMA_PROG_ERROR; + + coder->buffer_size = coder->block_options.header_size; + coder->sequence = SEQ_BLOCK_HEADER; + break; + } + + case SEQ_BLOCK_ENCODE: { + static const lzma_action convert[LZMA_ACTION_MAX + 1] = { + LZMA_RUN, + LZMA_SYNC_FLUSH, + LZMA_FINISH, + LZMA_FINISH, + LZMA_FINISH, + }; + + const lzma_ret ret = coder->block_encoder.code( + coder->block_encoder.coder, allocator, + in, in_pos, in_size, + out, out_pos, out_size, convert[action]); + if (ret != LZMA_STREAM_END || action == LZMA_SYNC_FLUSH) + return ret; + + // Add a new Index Record. + const lzma_vli unpadded_size = lzma_block_unpadded_size( + &coder->block_options); + assert(unpadded_size != 0); + return_if_error(lzma_index_append(coder->index, allocator, + unpadded_size, + coder->block_options.uncompressed_size)); + + coder->sequence = SEQ_BLOCK_INIT; + break; + } + + case SEQ_INDEX_ENCODE: { + // Call the Index encoder. It doesn't take any input, so + // those pointers can be NULL. + const lzma_ret ret = coder->index_encoder.code( + coder->index_encoder.coder, allocator, + NULL, NULL, 0, + out, out_pos, out_size, LZMA_RUN); + if (ret != LZMA_STREAM_END) + return ret; + + // Encode the Stream Footer into coder->buffer. + const lzma_stream_flags stream_flags = { + .version = 0, + .backward_size = lzma_index_size(coder->index), + .check = coder->block_options.check, + }; + + if (lzma_stream_footer_encode(&stream_flags, coder->buffer) + != LZMA_OK) + return LZMA_PROG_ERROR; + + coder->buffer_size = LZMA_STREAM_HEADER_SIZE; + coder->sequence = SEQ_STREAM_FOOTER; + break; + } + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + return LZMA_OK; +} + + +static void +stream_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_stream_coder *coder = coder_ptr; + + lzma_next_end(&coder->block_encoder, allocator); + lzma_next_end(&coder->index_encoder, allocator); + lzma_index_end(coder->index, allocator); + + lzma_filters_free(coder->filters, allocator); + + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +stream_encoder_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters, + const lzma_filter *reversed_filters) +{ + lzma_stream_coder *coder = coder_ptr; + lzma_ret ret; + + // Make a copy to a temporary buffer first. This way it is easier + // to keep the encoder state unchanged if an error occurs with + // lzma_filters_copy(). + lzma_filter temp[LZMA_FILTERS_MAX + 1]; + return_if_error(lzma_filters_copy(filters, temp, allocator)); + + if (coder->sequence <= SEQ_BLOCK_INIT) { + // There is no incomplete Block waiting to be finished, + // thus we can change the whole filter chain. Start by + // trying to initialize the Block encoder with the new + // chain. This way we detect if the chain is valid. + coder->block_encoder_is_initialized = false; + coder->block_options.filters = temp; + ret = block_encoder_init(coder, allocator); + coder->block_options.filters = coder->filters; + if (ret != LZMA_OK) + goto error; + + coder->block_encoder_is_initialized = true; + + } else if (coder->sequence <= SEQ_BLOCK_ENCODE) { + // We are in the middle of a Block. Try to update only + // the filter-specific options. + ret = coder->block_encoder.update( + coder->block_encoder.coder, allocator, + filters, reversed_filters); + if (ret != LZMA_OK) + goto error; + } else { + // Trying to update the filter chain when we are already + // encoding Index or Stream Footer. + ret = LZMA_PROG_ERROR; + goto error; + } + + // Free the options of the old chain. + lzma_filters_free(coder->filters, allocator); + + // Copy the new filter chain in place. + memcpy(coder->filters, temp, sizeof(temp)); + + return LZMA_OK; + +error: + lzma_filters_free(temp, allocator); + return ret; +} + + +static lzma_ret +stream_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter *filters, lzma_check check) +{ + lzma_next_coder_init(&stream_encoder_init, next, allocator); + + if (filters == NULL) + return LZMA_PROG_ERROR; + + lzma_stream_coder *coder = next->coder; + + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_stream_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &stream_encode; + next->end = &stream_encoder_end; + next->update = &stream_encoder_update; + + coder->filters[0].id = LZMA_VLI_UNKNOWN; + coder->block_encoder = LZMA_NEXT_CODER_INIT; + coder->index_encoder = LZMA_NEXT_CODER_INIT; + coder->index = NULL; + } + + // Basic initializations + coder->sequence = SEQ_STREAM_HEADER; + coder->block_options.version = 0; + coder->block_options.check = check; + + // Initialize the Index + lzma_index_end(coder->index, allocator); + coder->index = lzma_index_init(allocator); + if (coder->index == NULL) + return LZMA_MEM_ERROR; + + // Encode the Stream Header + lzma_stream_flags stream_flags = { + .version = 0, + .check = check, + }; + return_if_error(lzma_stream_header_encode( + &stream_flags, coder->buffer)); + + coder->buffer_pos = 0; + coder->buffer_size = LZMA_STREAM_HEADER_SIZE; + + // Initialize the Block encoder. This way we detect unsupported + // filter chains when initializing the Stream encoder instead of + // giving an error after Stream Header has already been written out. + return stream_encoder_update(coder, allocator, filters, NULL); +} + + +extern LZMA_API(lzma_ret) +lzma_stream_encoder(lzma_stream *strm, + const lzma_filter *filters, lzma_check check) +{ + lzma_next_strm_init(stream_encoder_init, strm, filters, check); + + strm->internal->supported_actions[LZMA_RUN] = true; + strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true; + strm->internal->supported_actions[LZMA_FULL_FLUSH] = true; + strm->internal->supported_actions[LZMA_FULL_BARRIER] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_encoder_mt.c b/src/liblzma/common/stream_encoder_mt.c new file mode 100644 index 0000000..f4497c1 --- /dev/null +++ b/src/liblzma/common/stream_encoder_mt.c @@ -0,0 +1,1283 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_encoder_mt.c +/// \brief Multithreaded .xz Stream encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_encoder.h" +#include "easy_preset.h" +#include "block_encoder.h" +#include "block_buffer_encoder.h" +#include "index_encoder.h" +#include "outqueue.h" + + +/// Maximum supported block size. This makes it simpler to prevent integer +/// overflows if we are given unusually large block size. +#define BLOCK_SIZE_MAX (UINT64_MAX / LZMA_THREADS_MAX) + + +typedef enum { + /// Waiting for work. + THR_IDLE, + + /// Encoding is in progress. + THR_RUN, + + /// Encoding is in progress but no more input data will + /// be read. + THR_FINISH, + + /// The main thread wants the thread to stop whatever it was doing + /// but not exit. + THR_STOP, + + /// The main thread wants the thread to exit. We could use + /// cancellation but since there's stopped anyway, this is lazier. + THR_EXIT, + +} worker_state; + +typedef struct lzma_stream_coder_s lzma_stream_coder; + +typedef struct worker_thread_s worker_thread; +struct worker_thread_s { + worker_state state; + + /// Input buffer of coder->block_size bytes. The main thread will + /// put new input into this and update in_size accordingly. Once + /// no more input is coming, state will be set to THR_FINISH. + uint8_t *in; + + /// Amount of data available in the input buffer. This is modified + /// only by the main thread. + size_t in_size; + + /// Output buffer for this thread. This is set by the main + /// thread every time a new Block is started with this thread + /// structure. + lzma_outbuf *outbuf; + + /// Pointer to the main structure is needed when putting this + /// thread back to the stack of free threads. + lzma_stream_coder *coder; + + /// The allocator is set by the main thread. Since a copy of the + /// pointer is kept here, the application must not change the + /// allocator before calling lzma_end(). + const lzma_allocator *allocator; + + /// Amount of uncompressed data that has already been compressed. + uint64_t progress_in; + + /// Amount of compressed data that is ready. + uint64_t progress_out; + + /// Block encoder + lzma_next_coder block_encoder; + + /// Compression options for this Block + lzma_block block_options; + + /// Filter chain for this thread. By copying the filters array + /// to each thread it is possible to change the filter chain + /// between Blocks using lzma_filters_update(). + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + + /// Next structure in the stack of free worker threads. + worker_thread *next; + + mythread_mutex mutex; + mythread_cond cond; + + /// The ID of this thread is used to join the thread + /// when it's not needed anymore. + mythread thread_id; +}; + + +struct lzma_stream_coder_s { + enum { + SEQ_STREAM_HEADER, + SEQ_BLOCK, + SEQ_INDEX, + SEQ_STREAM_FOOTER, + } sequence; + + /// Start a new Block every block_size bytes of input unless + /// LZMA_FULL_FLUSH or LZMA_FULL_BARRIER is used earlier. + size_t block_size; + + /// The filter chain to use for the next Block. + /// This can be updated using lzma_filters_update() + /// after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + + /// A copy of filters[] will be put here when attempting to get + /// a new worker thread. This will be copied to a worker thread + /// when a thread becomes free and then this cache is marked as + /// empty by setting [0].id = LZMA_VLI_UNKNOWN. Without this cache + /// the filter options from filters[] would get uselessly copied + /// multiple times (allocated and freed) when waiting for a new free + /// worker thread. + /// + /// This is freed if filters[] is updated via lzma_filters_update(). + lzma_filter filters_cache[LZMA_FILTERS_MAX + 1]; + + + /// Index to hold sizes of the Blocks + lzma_index *index; + + /// Index encoder + lzma_next_coder index_encoder; + + + /// Stream Flags for encoding the Stream Header and Stream Footer. + lzma_stream_flags stream_flags; + + /// Buffer to hold Stream Header and Stream Footer. + uint8_t header[LZMA_STREAM_HEADER_SIZE]; + + /// Read position in header[] + size_t header_pos; + + + /// Output buffer queue for compressed data + lzma_outq outq; + + /// How much memory to allocate for each lzma_outbuf.buf + size_t outbuf_alloc_size; + + + /// Maximum wait time if cannot use all the input and cannot + /// fill the output buffer. This is in milliseconds. + uint32_t timeout; + + + /// Error code from a worker thread + lzma_ret thread_error; + + /// Array of allocated thread-specific structures + worker_thread *threads; + + /// Number of structures in "threads" above. This is also the + /// number of threads that will be created at maximum. + uint32_t threads_max; + + /// Number of thread structures that have been initialized, and + /// thus the number of worker threads actually created so far. + uint32_t threads_initialized; + + /// Stack of free threads. When a thread finishes, it puts itself + /// back into this stack. This starts as empty because threads + /// are created only when actually needed. + worker_thread *threads_free; + + /// The most recent worker thread to which the main thread writes + /// the new input from the application. + worker_thread *thr; + + + /// Amount of uncompressed data in Blocks that have already + /// been finished. + uint64_t progress_in; + + /// Amount of compressed data in Stream Header + Blocks that + /// have already been finished. + uint64_t progress_out; + + + mythread_mutex mutex; + mythread_cond cond; +}; + + +/// Tell the main thread that something has gone wrong. +static void +worker_error(worker_thread *thr, lzma_ret ret) +{ + assert(ret != LZMA_OK); + assert(ret != LZMA_STREAM_END); + + mythread_sync(thr->coder->mutex) { + if (thr->coder->thread_error == LZMA_OK) + thr->coder->thread_error = ret; + + mythread_cond_signal(&thr->coder->cond); + } + + return; +} + + +static worker_state +worker_encode(worker_thread *thr, size_t *out_pos, worker_state state) +{ + assert(thr->progress_in == 0); + assert(thr->progress_out == 0); + + // Set the Block options. + thr->block_options = (lzma_block){ + .version = 0, + .check = thr->coder->stream_flags.check, + .compressed_size = thr->outbuf->allocated, + .uncompressed_size = thr->coder->block_size, + .filters = thr->filters, + }; + + // Calculate maximum size of the Block Header. This amount is + // reserved in the beginning of the buffer so that Block Header + // along with Compressed Size and Uncompressed Size can be + // written there. + lzma_ret ret = lzma_block_header_size(&thr->block_options); + if (ret != LZMA_OK) { + worker_error(thr, ret); + return THR_STOP; + } + + // Initialize the Block encoder. + ret = lzma_block_encoder_init(&thr->block_encoder, + thr->allocator, &thr->block_options); + if (ret != LZMA_OK) { + worker_error(thr, ret); + return THR_STOP; + } + + size_t in_pos = 0; + size_t in_size = 0; + + *out_pos = thr->block_options.header_size; + const size_t out_size = thr->outbuf->allocated; + + do { + mythread_sync(thr->mutex) { + // Store in_pos and *out_pos into *thr so that + // an application may read them via + // lzma_get_progress() to get progress information. + // + // NOTE: These aren't updated when the encoding + // finishes. Instead, the final values are taken + // later from thr->outbuf. + thr->progress_in = in_pos; + thr->progress_out = *out_pos; + + while (in_size == thr->in_size + && thr->state == THR_RUN) + mythread_cond_wait(&thr->cond, &thr->mutex); + + state = thr->state; + in_size = thr->in_size; + } + + // Return if we were asked to stop or exit. + if (state >= THR_STOP) + return state; + + lzma_action action = state == THR_FINISH + ? LZMA_FINISH : LZMA_RUN; + + // Limit the amount of input given to the Block encoder + // at once. This way this thread can react fairly quickly + // if the main thread wants us to stop or exit. + static const size_t in_chunk_max = 16384; + size_t in_limit = in_size; + if (in_size - in_pos > in_chunk_max) { + in_limit = in_pos + in_chunk_max; + action = LZMA_RUN; + } + + ret = thr->block_encoder.code( + thr->block_encoder.coder, thr->allocator, + thr->in, &in_pos, in_limit, thr->outbuf->buf, + out_pos, out_size, action); + } while (ret == LZMA_OK && *out_pos < out_size); + + switch (ret) { + case LZMA_STREAM_END: + assert(state == THR_FINISH); + + // Encode the Block Header. By doing it after + // the compression, we can store the Compressed Size + // and Uncompressed Size fields. + ret = lzma_block_header_encode(&thr->block_options, + thr->outbuf->buf); + if (ret != LZMA_OK) { + worker_error(thr, ret); + return THR_STOP; + } + + break; + + case LZMA_OK: + // The data was incompressible. Encode it using uncompressed + // LZMA2 chunks. + // + // First wait that we have gotten all the input. + mythread_sync(thr->mutex) { + while (thr->state == THR_RUN) + mythread_cond_wait(&thr->cond, &thr->mutex); + + state = thr->state; + in_size = thr->in_size; + } + + if (state >= THR_STOP) + return state; + + // Do the encoding. This takes care of the Block Header too. + *out_pos = 0; + ret = lzma_block_uncomp_encode(&thr->block_options, + thr->in, in_size, thr->outbuf->buf, + out_pos, out_size); + + // It shouldn't fail. + if (ret != LZMA_OK) { + worker_error(thr, LZMA_PROG_ERROR); + return THR_STOP; + } + + break; + + default: + worker_error(thr, ret); + return THR_STOP; + } + + // Set the size information that will be read by the main thread + // to write the Index field. + thr->outbuf->unpadded_size + = lzma_block_unpadded_size(&thr->block_options); + assert(thr->outbuf->unpadded_size != 0); + thr->outbuf->uncompressed_size = thr->block_options.uncompressed_size; + + return THR_FINISH; +} + + +static MYTHREAD_RET_TYPE +worker_start(void *thr_ptr) +{ + worker_thread *thr = thr_ptr; + worker_state state = THR_IDLE; // Init to silence a warning + + while (true) { + // Wait for work. + mythread_sync(thr->mutex) { + while (true) { + // The thread is already idle so if we are + // requested to stop, just set the state. + if (thr->state == THR_STOP) { + thr->state = THR_IDLE; + mythread_cond_signal(&thr->cond); + } + + state = thr->state; + if (state != THR_IDLE) + break; + + mythread_cond_wait(&thr->cond, &thr->mutex); + } + } + + size_t out_pos = 0; + + assert(state != THR_IDLE); + assert(state != THR_STOP); + + if (state <= THR_FINISH) + state = worker_encode(thr, &out_pos, state); + + if (state == THR_EXIT) + break; + + // Mark the thread as idle unless the main thread has + // told us to exit. Signal is needed for the case + // where the main thread is waiting for the threads to stop. + mythread_sync(thr->mutex) { + if (thr->state != THR_EXIT) { + thr->state = THR_IDLE; + mythread_cond_signal(&thr->cond); + } + } + + mythread_sync(thr->coder->mutex) { + // If no errors occurred, make the encoded data + // available to be copied out. + if (state == THR_FINISH) { + thr->outbuf->pos = out_pos; + thr->outbuf->finished = true; + } + + // Update the main progress info. + thr->coder->progress_in + += thr->outbuf->uncompressed_size; + thr->coder->progress_out += out_pos; + thr->progress_in = 0; + thr->progress_out = 0; + + // Return this thread to the stack of free threads. + thr->next = thr->coder->threads_free; + thr->coder->threads_free = thr; + + mythread_cond_signal(&thr->coder->cond); + } + } + + // Exiting, free the resources. + lzma_filters_free(thr->filters, thr->allocator); + + mythread_mutex_destroy(&thr->mutex); + mythread_cond_destroy(&thr->cond); + + lzma_next_end(&thr->block_encoder, thr->allocator); + lzma_free(thr->in, thr->allocator); + return MYTHREAD_RET_VALUE; +} + + +/// Make the threads stop but not exit. Optionally wait for them to stop. +static void +threads_stop(lzma_stream_coder *coder, bool wait_for_threads) +{ + // Tell the threads to stop. + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + coder->threads[i].state = THR_STOP; + mythread_cond_signal(&coder->threads[i].cond); + } + } + + if (!wait_for_threads) + return; + + // Wait for the threads to settle in the idle state. + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + while (coder->threads[i].state != THR_IDLE) + mythread_cond_wait(&coder->threads[i].cond, + &coder->threads[i].mutex); + } + } + + return; +} + + +/// Stop the threads and free the resources associated with them. +/// Wait until the threads have exited. +static void +threads_end(lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + coder->threads[i].state = THR_EXIT; + mythread_cond_signal(&coder->threads[i].cond); + } + } + + for (uint32_t i = 0; i < coder->threads_initialized; ++i) { + int ret = mythread_join(coder->threads[i].thread_id); + assert(ret == 0); + (void)ret; + } + + lzma_free(coder->threads, allocator); + return; +} + + +/// Initialize a new worker_thread structure and create a new thread. +static lzma_ret +initialize_new_thread(lzma_stream_coder *coder, + const lzma_allocator *allocator) +{ + worker_thread *thr = &coder->threads[coder->threads_initialized]; + + thr->in = lzma_alloc(coder->block_size, allocator); + if (thr->in == NULL) + return LZMA_MEM_ERROR; + + if (mythread_mutex_init(&thr->mutex)) + goto error_mutex; + + if (mythread_cond_init(&thr->cond)) + goto error_cond; + + thr->state = THR_IDLE; + thr->allocator = allocator; + thr->coder = coder; + thr->progress_in = 0; + thr->progress_out = 0; + thr->block_encoder = LZMA_NEXT_CODER_INIT; + thr->filters[0].id = LZMA_VLI_UNKNOWN; + + if (mythread_create(&thr->thread_id, &worker_start, thr)) + goto error_thread; + + ++coder->threads_initialized; + coder->thr = thr; + + return LZMA_OK; + +error_thread: + mythread_cond_destroy(&thr->cond); + +error_cond: + mythread_mutex_destroy(&thr->mutex); + +error_mutex: + lzma_free(thr->in, allocator); + return LZMA_MEM_ERROR; +} + + +static lzma_ret +get_thread(lzma_stream_coder *coder, const lzma_allocator *allocator) +{ + // If there are no free output subqueues, there is no + // point to try getting a thread. + if (!lzma_outq_has_buf(&coder->outq)) + return LZMA_OK; + + // That's also true if we cannot allocate memory for the output + // buffer in the output queue. + return_if_error(lzma_outq_prealloc_buf(&coder->outq, allocator, + coder->outbuf_alloc_size)); + + // Make a thread-specific copy of the filter chain. Put it in + // the cache array first so that if we cannot get a new thread yet, + // the allocation is ready when we try again. + if (coder->filters_cache[0].id == LZMA_VLI_UNKNOWN) + return_if_error(lzma_filters_copy( + coder->filters, coder->filters_cache, allocator)); + + // If there is a free structure on the stack, use it. + mythread_sync(coder->mutex) { + if (coder->threads_free != NULL) { + coder->thr = coder->threads_free; + coder->threads_free = coder->threads_free->next; + } + } + + if (coder->thr == NULL) { + // If there are no uninitialized structures left, return. + if (coder->threads_initialized == coder->threads_max) + return LZMA_OK; + + // Initialize a new thread. + return_if_error(initialize_new_thread(coder, allocator)); + } + + // Reset the parts of the thread state that have to be done + // in the main thread. + mythread_sync(coder->thr->mutex) { + coder->thr->state = THR_RUN; + coder->thr->in_size = 0; + coder->thr->outbuf = lzma_outq_get_buf(&coder->outq, NULL); + + // Free the old thread-specific filter options and replace + // them with the already-allocated new options from + // coder->filters_cache[]. Then mark the cache as empty. + lzma_filters_free(coder->thr->filters, allocator); + memcpy(coder->thr->filters, coder->filters_cache, + sizeof(coder->filters_cache)); + coder->filters_cache[0].id = LZMA_VLI_UNKNOWN; + + mythread_cond_signal(&coder->thr->cond); + } + + return LZMA_OK; +} + + +static lzma_ret +stream_encode_in(lzma_stream_coder *coder, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, lzma_action action) +{ + while (*in_pos < in_size + || (coder->thr != NULL && action != LZMA_RUN)) { + if (coder->thr == NULL) { + // Get a new thread. + const lzma_ret ret = get_thread(coder, allocator); + if (coder->thr == NULL) + return ret; + } + + // Copy the input data to thread's buffer. + size_t thr_in_size = coder->thr->in_size; + lzma_bufcpy(in, in_pos, in_size, coder->thr->in, + &thr_in_size, coder->block_size); + + // Tell the Block encoder to finish if + // - it has got block_size bytes of input; or + // - all input was used and LZMA_FINISH, LZMA_FULL_FLUSH, + // or LZMA_FULL_BARRIER was used. + // + // TODO: LZMA_SYNC_FLUSH and LZMA_SYNC_BARRIER. + const bool finish = thr_in_size == coder->block_size + || (*in_pos == in_size && action != LZMA_RUN); + + bool block_error = false; + + mythread_sync(coder->thr->mutex) { + if (coder->thr->state == THR_IDLE) { + // Something has gone wrong with the Block + // encoder. It has set coder->thread_error + // which we will read a few lines later. + block_error = true; + } else { + // Tell the Block encoder its new amount + // of input and update the state if needed. + coder->thr->in_size = thr_in_size; + + if (finish) + coder->thr->state = THR_FINISH; + + mythread_cond_signal(&coder->thr->cond); + } + } + + if (block_error) { + lzma_ret ret; + + mythread_sync(coder->mutex) { + ret = coder->thread_error; + } + + return ret; + } + + if (finish) + coder->thr = NULL; + } + + return LZMA_OK; +} + + +/// Wait until more input can be consumed, more output can be read, or +/// an optional timeout is reached. +static bool +wait_for_work(lzma_stream_coder *coder, mythread_condtime *wait_abs, + bool *has_blocked, bool has_input) +{ + if (coder->timeout != 0 && !*has_blocked) { + // Every time when stream_encode_mt() is called via + // lzma_code(), *has_blocked starts as false. We set it + // to true here and calculate the absolute time when + // we must return if there's nothing to do. + // + // This way if we block multiple times for short moments + // less than "timeout" milliseconds, we will return once + // "timeout" amount of time has passed since the *first* + // blocking occurred. If the absolute time was calculated + // again every time we block, "timeout" would effectively + // be meaningless if we never consecutively block longer + // than "timeout" ms. + *has_blocked = true; + mythread_condtime_set(wait_abs, &coder->cond, coder->timeout); + } + + bool timed_out = false; + + mythread_sync(coder->mutex) { + // There are four things that we wait. If one of them + // becomes possible, we return. + // - If there is input left, we need to get a free + // worker thread and an output buffer for it. + // - Data ready to be read from the output queue. + // - A worker thread indicates an error. + // - Time out occurs. + while ((!has_input || coder->threads_free == NULL + || !lzma_outq_has_buf(&coder->outq)) + && !lzma_outq_is_readable(&coder->outq) + && coder->thread_error == LZMA_OK + && !timed_out) { + if (coder->timeout != 0) + timed_out = mythread_cond_timedwait( + &coder->cond, &coder->mutex, + wait_abs) != 0; + else + mythread_cond_wait(&coder->cond, + &coder->mutex); + } + } + + return timed_out; +} + + +static lzma_ret +stream_encode_mt(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_stream_coder *coder = coder_ptr; + + switch (coder->sequence) { + case SEQ_STREAM_HEADER: + lzma_bufcpy(coder->header, &coder->header_pos, + sizeof(coder->header), + out, out_pos, out_size); + if (coder->header_pos < sizeof(coder->header)) + return LZMA_OK; + + coder->header_pos = 0; + coder->sequence = SEQ_BLOCK; + + // Fall through + + case SEQ_BLOCK: { + // Initialized to silence warnings. + lzma_vli unpadded_size = 0; + lzma_vli uncompressed_size = 0; + lzma_ret ret = LZMA_OK; + + // These are for wait_for_work(). + bool has_blocked = false; + mythread_condtime wait_abs; + + while (true) { + mythread_sync(coder->mutex) { + // Check for Block encoder errors. + ret = coder->thread_error; + if (ret != LZMA_OK) { + assert(ret != LZMA_STREAM_END); + break; // Break out of mythread_sync. + } + + // Try to read compressed data to out[]. + ret = lzma_outq_read(&coder->outq, allocator, + out, out_pos, out_size, + &unpadded_size, + &uncompressed_size); + } + + if (ret == LZMA_STREAM_END) { + // End of Block. Add it to the Index. + ret = lzma_index_append(coder->index, + allocator, unpadded_size, + uncompressed_size); + if (ret != LZMA_OK) { + threads_stop(coder, false); + return ret; + } + + // If we didn't fill the output buffer yet, + // try to read more data. Maybe the next + // outbuf has been finished already too. + if (*out_pos < out_size) + continue; + } + + if (ret != LZMA_OK) { + // coder->thread_error was set. + threads_stop(coder, false); + return ret; + } + + // Try to give uncompressed data to a worker thread. + ret = stream_encode_in(coder, allocator, + in, in_pos, in_size, action); + if (ret != LZMA_OK) { + threads_stop(coder, false); + return ret; + } + + // See if we should wait or return. + // + // TODO: LZMA_SYNC_FLUSH and LZMA_SYNC_BARRIER. + if (*in_pos == in_size) { + // LZMA_RUN: More data is probably coming + // so return to let the caller fill the + // input buffer. + if (action == LZMA_RUN) + return LZMA_OK; + + // LZMA_FULL_BARRIER: The same as with + // LZMA_RUN but tell the caller that the + // barrier was completed. + if (action == LZMA_FULL_BARRIER) + return LZMA_STREAM_END; + + // Finishing or flushing isn't completed until + // all input data has been encoded and copied + // to the output buffer. + if (lzma_outq_is_empty(&coder->outq)) { + // LZMA_FINISH: Continue to encode + // the Index field. + if (action == LZMA_FINISH) + break; + + // LZMA_FULL_FLUSH: Return to tell + // the caller that flushing was + // completed. + if (action == LZMA_FULL_FLUSH) + return LZMA_STREAM_END; + } + } + + // Return if there is no output space left. + // This check must be done after testing the input + // buffer, because we might want to use a different + // return code. + if (*out_pos == out_size) + return LZMA_OK; + + // Neither in nor out has been used completely. + // Wait until there's something we can do. + if (wait_for_work(coder, &wait_abs, &has_blocked, + *in_pos < in_size)) + return LZMA_TIMED_OUT; + } + + // All Blocks have been encoded and the threads have stopped. + // Prepare to encode the Index field. + return_if_error(lzma_index_encoder_init( + &coder->index_encoder, allocator, + coder->index)); + coder->sequence = SEQ_INDEX; + + // Update the progress info to take the Index and + // Stream Footer into account. Those are very fast to encode + // so in terms of progress information they can be thought + // to be ready to be copied out. + coder->progress_out += lzma_index_size(coder->index) + + LZMA_STREAM_HEADER_SIZE; + } + + // Fall through + + case SEQ_INDEX: { + // Call the Index encoder. It doesn't take any input, so + // those pointers can be NULL. + const lzma_ret ret = coder->index_encoder.code( + coder->index_encoder.coder, allocator, + NULL, NULL, 0, + out, out_pos, out_size, LZMA_RUN); + if (ret != LZMA_STREAM_END) + return ret; + + // Encode the Stream Footer into coder->buffer. + coder->stream_flags.backward_size + = lzma_index_size(coder->index); + if (lzma_stream_footer_encode(&coder->stream_flags, + coder->header) != LZMA_OK) + return LZMA_PROG_ERROR; + + coder->sequence = SEQ_STREAM_FOOTER; + } + + // Fall through + + case SEQ_STREAM_FOOTER: + lzma_bufcpy(coder->header, &coder->header_pos, + sizeof(coder->header), + out, out_pos, out_size); + return coder->header_pos < sizeof(coder->header) + ? LZMA_OK : LZMA_STREAM_END; + } + + assert(0); + return LZMA_PROG_ERROR; +} + + +static void +stream_encoder_mt_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_stream_coder *coder = coder_ptr; + + // Threads must be killed before the output queue can be freed. + threads_end(coder, allocator); + lzma_outq_end(&coder->outq, allocator); + + lzma_filters_free(coder->filters, allocator); + lzma_filters_free(coder->filters_cache, allocator); + + lzma_next_end(&coder->index_encoder, allocator); + lzma_index_end(coder->index, allocator); + + mythread_cond_destroy(&coder->cond); + mythread_mutex_destroy(&coder->mutex); + + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +stream_encoder_mt_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters, + const lzma_filter *reversed_filters + lzma_attribute((__unused__))) +{ + lzma_stream_coder *coder = coder_ptr; + + // Applications shouldn't attempt to change the options when + // we are already encoding the Index or Stream Footer. + if (coder->sequence > SEQ_BLOCK) + return LZMA_PROG_ERROR; + + // For now the threaded encoder doesn't support changing + // the options in the middle of a Block. + if (coder->thr != NULL) + return LZMA_PROG_ERROR; + + // Check if the filter chain seems mostly valid. See the comment + // in stream_encoder_mt_init(). + if (lzma_raw_encoder_memusage(filters) == UINT64_MAX) + return LZMA_OPTIONS_ERROR; + + // Make a copy to a temporary buffer first. This way the encoder + // state stays unchanged if an error occurs in lzma_filters_copy(). + lzma_filter temp[LZMA_FILTERS_MAX + 1]; + return_if_error(lzma_filters_copy(filters, temp, allocator)); + + // Free the options of the old chain as well as the cache. + lzma_filters_free(coder->filters, allocator); + lzma_filters_free(coder->filters_cache, allocator); + + // Copy the new filter chain in place. + memcpy(coder->filters, temp, sizeof(temp)); + + return LZMA_OK; +} + + +/// Options handling for lzma_stream_encoder_mt_init() and +/// lzma_stream_encoder_mt_memusage() +static lzma_ret +get_options(const lzma_mt *options, lzma_options_easy *opt_easy, + const lzma_filter **filters, uint64_t *block_size, + uint64_t *outbuf_size_max) +{ + // Validate some of the options. + if (options == NULL) + return LZMA_PROG_ERROR; + + if (options->flags != 0 || options->threads == 0 + || options->threads > LZMA_THREADS_MAX) + return LZMA_OPTIONS_ERROR; + + if (options->filters != NULL) { + // Filter chain was given, use it as is. + *filters = options->filters; + } else { + // Use a preset. + if (lzma_easy_preset(opt_easy, options->preset)) + return LZMA_OPTIONS_ERROR; + + *filters = opt_easy->filters; + } + + // Block size + if (options->block_size > 0) { + if (options->block_size > BLOCK_SIZE_MAX) + return LZMA_OPTIONS_ERROR; + + *block_size = options->block_size; + } else { + // Determine the Block size from the filter chain. + *block_size = lzma_mt_block_size(*filters); + if (*block_size == 0) + return LZMA_OPTIONS_ERROR; + + assert(*block_size <= BLOCK_SIZE_MAX); + } + + // Calculate the maximum amount output that a single output buffer + // may need to hold. This is the same as the maximum total size of + // a Block. + *outbuf_size_max = lzma_block_buffer_bound64(*block_size); + if (*outbuf_size_max == 0) + return LZMA_MEM_ERROR; + + return LZMA_OK; +} + + +static void +get_progress(void *coder_ptr, uint64_t *progress_in, uint64_t *progress_out) +{ + lzma_stream_coder *coder = coder_ptr; + + // Lock coder->mutex to prevent finishing threads from moving their + // progress info from the worker_thread structure to lzma_stream_coder. + mythread_sync(coder->mutex) { + *progress_in = coder->progress_in; + *progress_out = coder->progress_out; + + for (size_t i = 0; i < coder->threads_initialized; ++i) { + mythread_sync(coder->threads[i].mutex) { + *progress_in += coder->threads[i].progress_in; + *progress_out += coder->threads[i] + .progress_out; + } + } + } + + return; +} + + +static lzma_ret +stream_encoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_mt *options) +{ + lzma_next_coder_init(&stream_encoder_mt_init, next, allocator); + + // Get the filter chain. + lzma_options_easy easy; + const lzma_filter *filters; + uint64_t block_size; + uint64_t outbuf_size_max; + return_if_error(get_options(options, &easy, &filters, + &block_size, &outbuf_size_max)); + +#if SIZE_MAX < UINT64_MAX + if (block_size > SIZE_MAX || outbuf_size_max > SIZE_MAX) + return LZMA_MEM_ERROR; +#endif + + // Validate the filter chain so that we can give an error in this + // function instead of delaying it to the first call to lzma_code(). + // The memory usage calculation verifies the filter chain as + // a side effect so we take advantage of that. It's not a perfect + // check though as raw encoder allows LZMA1 too but such problems + // will be caught eventually with Block Header encoder. + if (lzma_raw_encoder_memusage(filters) == UINT64_MAX) + return LZMA_OPTIONS_ERROR; + + // Validate the Check ID. + if ((unsigned int)(options->check) > LZMA_CHECK_ID_MAX) + return LZMA_PROG_ERROR; + + if (!lzma_check_is_supported(options->check)) + return LZMA_UNSUPPORTED_CHECK; + + // Allocate and initialize the base structure if needed. + lzma_stream_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_stream_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + + // For the mutex and condition variable initializations + // the error handling has to be done here because + // stream_encoder_mt_end() doesn't know if they have + // already been initialized or not. + if (mythread_mutex_init(&coder->mutex)) { + lzma_free(coder, allocator); + next->coder = NULL; + return LZMA_MEM_ERROR; + } + + if (mythread_cond_init(&coder->cond)) { + mythread_mutex_destroy(&coder->mutex); + lzma_free(coder, allocator); + next->coder = NULL; + return LZMA_MEM_ERROR; + } + + next->code = &stream_encode_mt; + next->end = &stream_encoder_mt_end; + next->get_progress = &get_progress; + next->update = &stream_encoder_mt_update; + + coder->filters[0].id = LZMA_VLI_UNKNOWN; + coder->filters_cache[0].id = LZMA_VLI_UNKNOWN; + coder->index_encoder = LZMA_NEXT_CODER_INIT; + coder->index = NULL; + memzero(&coder->outq, sizeof(coder->outq)); + coder->threads = NULL; + coder->threads_max = 0; + coder->threads_initialized = 0; + } + + // Basic initializations + coder->sequence = SEQ_STREAM_HEADER; + coder->block_size = (size_t)(block_size); + coder->outbuf_alloc_size = (size_t)(outbuf_size_max); + coder->thread_error = LZMA_OK; + coder->thr = NULL; + + // Allocate the thread-specific base structures. + assert(options->threads > 0); + if (coder->threads_max != options->threads) { + threads_end(coder, allocator); + + coder->threads = NULL; + coder->threads_max = 0; + + coder->threads_initialized = 0; + coder->threads_free = NULL; + + coder->threads = lzma_alloc( + options->threads * sizeof(worker_thread), + allocator); + if (coder->threads == NULL) + return LZMA_MEM_ERROR; + + coder->threads_max = options->threads; + } else { + // Reuse the old structures and threads. Tell the running + // threads to stop and wait until they have stopped. + threads_stop(coder, true); + } + + // Output queue + return_if_error(lzma_outq_init(&coder->outq, allocator, + options->threads)); + + // Timeout + coder->timeout = options->timeout; + + // Free the old filter chain and the cache. + lzma_filters_free(coder->filters, allocator); + lzma_filters_free(coder->filters_cache, allocator); + + // Copy the new filter chain. + return_if_error(lzma_filters_copy( + filters, coder->filters, allocator)); + + // Index + lzma_index_end(coder->index, allocator); + coder->index = lzma_index_init(allocator); + if (coder->index == NULL) + return LZMA_MEM_ERROR; + + // Stream Header + coder->stream_flags.version = 0; + coder->stream_flags.check = options->check; + return_if_error(lzma_stream_header_encode( + &coder->stream_flags, coder->header)); + + coder->header_pos = 0; + + // Progress info + coder->progress_in = 0; + coder->progress_out = LZMA_STREAM_HEADER_SIZE; + + return LZMA_OK; +} + + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +// These are for compatibility with binaries linked against liblzma that +// has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7. +// Actually that patch didn't create lzma_stream_encoder_mt@XZ_5.2.2 +// but it has been added here anyway since someone might misread the +// RHEL patch and think both @XZ_5.1.2alpha and @XZ_5.2.2 exist. +LZMA_SYMVER_API("lzma_stream_encoder_mt@XZ_5.1.2alpha", + lzma_ret, lzma_stream_encoder_mt_512a)( + lzma_stream *strm, const lzma_mt *options) + lzma_nothrow lzma_attr_warn_unused_result + __attribute__((__alias__("lzma_stream_encoder_mt_52"))); + +LZMA_SYMVER_API("lzma_stream_encoder_mt@XZ_5.2.2", + lzma_ret, lzma_stream_encoder_mt_522)( + lzma_stream *strm, const lzma_mt *options) + lzma_nothrow lzma_attr_warn_unused_result + __attribute__((__alias__("lzma_stream_encoder_mt_52"))); + +LZMA_SYMVER_API("lzma_stream_encoder_mt@@XZ_5.2", + lzma_ret, lzma_stream_encoder_mt_52)( + lzma_stream *strm, const lzma_mt *options) + lzma_nothrow lzma_attr_warn_unused_result; + +#define lzma_stream_encoder_mt lzma_stream_encoder_mt_52 +#endif +extern LZMA_API(lzma_ret) +lzma_stream_encoder_mt(lzma_stream *strm, const lzma_mt *options) +{ + lzma_next_strm_init(stream_encoder_mt_init, strm, options); + + strm->internal->supported_actions[LZMA_RUN] = true; +// strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true; + strm->internal->supported_actions[LZMA_FULL_FLUSH] = true; + strm->internal->supported_actions[LZMA_FULL_BARRIER] = true; + strm->internal->supported_actions[LZMA_FINISH] = true; + + return LZMA_OK; +} + + +#ifdef HAVE_SYMBOL_VERSIONS_LINUX +LZMA_SYMVER_API("lzma_stream_encoder_mt_memusage@XZ_5.1.2alpha", + uint64_t, lzma_stream_encoder_mt_memusage_512a)( + const lzma_mt *options) lzma_nothrow lzma_attr_pure + __attribute__((__alias__("lzma_stream_encoder_mt_memusage_52"))); + +LZMA_SYMVER_API("lzma_stream_encoder_mt_memusage@XZ_5.2.2", + uint64_t, lzma_stream_encoder_mt_memusage_522)( + const lzma_mt *options) lzma_nothrow lzma_attr_pure + __attribute__((__alias__("lzma_stream_encoder_mt_memusage_52"))); + +LZMA_SYMVER_API("lzma_stream_encoder_mt_memusage@@XZ_5.2", + uint64_t, lzma_stream_encoder_mt_memusage_52)( + const lzma_mt *options) lzma_nothrow lzma_attr_pure; + +#define lzma_stream_encoder_mt_memusage lzma_stream_encoder_mt_memusage_52 +#endif +// This function name is a monster but it's consistent with the older +// monster names. :-( 31 chars is the max that C99 requires so in that +// sense it's not too long. ;-) +extern LZMA_API(uint64_t) +lzma_stream_encoder_mt_memusage(const lzma_mt *options) +{ + lzma_options_easy easy; + const lzma_filter *filters; + uint64_t block_size; + uint64_t outbuf_size_max; + + if (get_options(options, &easy, &filters, &block_size, + &outbuf_size_max) != LZMA_OK) + return UINT64_MAX; + + // Memory usage of the input buffers + const uint64_t inbuf_memusage = options->threads * block_size; + + // Memory usage of the filter encoders + uint64_t filters_memusage = lzma_raw_encoder_memusage(filters); + if (filters_memusage == UINT64_MAX) + return UINT64_MAX; + + filters_memusage *= options->threads; + + // Memory usage of the output queue + const uint64_t outq_memusage = lzma_outq_memusage( + outbuf_size_max, options->threads); + if (outq_memusage == UINT64_MAX) + return UINT64_MAX; + + // Sum them with overflow checking. + uint64_t total_memusage = LZMA_MEMUSAGE_BASE + + sizeof(lzma_stream_coder) + + options->threads * sizeof(worker_thread); + + if (UINT64_MAX - total_memusage < inbuf_memusage) + return UINT64_MAX; + + total_memusage += inbuf_memusage; + + if (UINT64_MAX - total_memusage < filters_memusage) + return UINT64_MAX; + + total_memusage += filters_memusage; + + if (UINT64_MAX - total_memusage < outq_memusage) + return UINT64_MAX; + + return total_memusage + outq_memusage; +} diff --git a/src/liblzma/common/stream_flags_common.c b/src/liblzma/common/stream_flags_common.c new file mode 100644 index 0000000..fbe8eb8 --- /dev/null +++ b/src/liblzma/common/stream_flags_common.c @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_flags_common.c +/// \brief Common stuff for Stream flags coders +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_flags_common.h" + + +const uint8_t lzma_header_magic[6] = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 }; +const uint8_t lzma_footer_magic[2] = { 0x59, 0x5A }; + + +extern LZMA_API(lzma_ret) +lzma_stream_flags_compare( + const lzma_stream_flags *a, const lzma_stream_flags *b) +{ + // We can compare only version 0 structures. + if (a->version != 0 || b->version != 0) + return LZMA_OPTIONS_ERROR; + + // Check type + if ((unsigned int)(a->check) > LZMA_CHECK_ID_MAX + || (unsigned int)(b->check) > LZMA_CHECK_ID_MAX) + return LZMA_PROG_ERROR; + + if (a->check != b->check) + return LZMA_DATA_ERROR; + + // Backward Sizes are compared only if they are known in both. + if (a->backward_size != LZMA_VLI_UNKNOWN + && b->backward_size != LZMA_VLI_UNKNOWN) { + if (!is_backward_size_valid(a) || !is_backward_size_valid(b)) + return LZMA_PROG_ERROR; + + if (a->backward_size != b->backward_size) + return LZMA_DATA_ERROR; + } + + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_flags_common.h b/src/liblzma/common/stream_flags_common.h new file mode 100644 index 0000000..9f3122a --- /dev/null +++ b/src/liblzma/common/stream_flags_common.h @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_flags_common.h +/// \brief Common stuff for Stream flags coders +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_STREAM_FLAGS_COMMON_H +#define LZMA_STREAM_FLAGS_COMMON_H + +#include "common.h" + +/// Size of the Stream Flags field +#define LZMA_STREAM_FLAGS_SIZE 2 + +extern const uint8_t lzma_header_magic[6]; +extern const uint8_t lzma_footer_magic[2]; + + +static inline bool +is_backward_size_valid(const lzma_stream_flags *options) +{ + return options->backward_size >= LZMA_BACKWARD_SIZE_MIN + && options->backward_size <= LZMA_BACKWARD_SIZE_MAX + && (options->backward_size & 3) == 0; +} + +#endif diff --git a/src/liblzma/common/stream_flags_decoder.c b/src/liblzma/common/stream_flags_decoder.c new file mode 100644 index 0000000..b8d263b --- /dev/null +++ b/src/liblzma/common/stream_flags_decoder.c @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_flags_decoder.c +/// \brief Decodes Stream Header and Stream Footer from .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_flags_common.h" + + +static bool +stream_flags_decode(lzma_stream_flags *options, const uint8_t *in) +{ + // Reserved bits must be unset. + if (in[0] != 0x00 || (in[1] & 0xF0)) + return true; + + options->version = 0; + options->check = in[1] & 0x0F; + + return false; +} + + +extern LZMA_API(lzma_ret) +lzma_stream_header_decode(lzma_stream_flags *options, const uint8_t *in) +{ + // Magic + if (memcmp(in, lzma_header_magic, sizeof(lzma_header_magic)) != 0) + return LZMA_FORMAT_ERROR; + + // Verify the CRC32 so we can distinguish between corrupt + // and unsupported files. + const uint32_t crc = lzma_crc32(in + sizeof(lzma_header_magic), + LZMA_STREAM_FLAGS_SIZE, 0); + if (crc != read32le(in + sizeof(lzma_header_magic) + + LZMA_STREAM_FLAGS_SIZE)) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + return LZMA_DATA_ERROR; +#endif + } + + // Stream Flags + if (stream_flags_decode(options, in + sizeof(lzma_header_magic))) + return LZMA_OPTIONS_ERROR; + + // Set Backward Size to indicate unknown value. That way + // lzma_stream_flags_compare() can be used to compare Stream Header + // and Stream Footer while keeping it useful also for comparing + // two Stream Footers. + options->backward_size = LZMA_VLI_UNKNOWN; + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_stream_footer_decode(lzma_stream_flags *options, const uint8_t *in) +{ + // Magic + if (memcmp(in + sizeof(uint32_t) * 2 + LZMA_STREAM_FLAGS_SIZE, + lzma_footer_magic, sizeof(lzma_footer_magic)) != 0) + return LZMA_FORMAT_ERROR; + + // CRC32 + const uint32_t crc = lzma_crc32(in + sizeof(uint32_t), + sizeof(uint32_t) + LZMA_STREAM_FLAGS_SIZE, 0); + if (crc != read32le(in)) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + return LZMA_DATA_ERROR; +#endif + } + + // Stream Flags + if (stream_flags_decode(options, in + sizeof(uint32_t) * 2)) + return LZMA_OPTIONS_ERROR; + + // Backward Size + options->backward_size = read32le(in + sizeof(uint32_t)); + options->backward_size = (options->backward_size + 1) * 4; + + return LZMA_OK; +} diff --git a/src/liblzma/common/stream_flags_encoder.c b/src/liblzma/common/stream_flags_encoder.c new file mode 100644 index 0000000..b98ab17 --- /dev/null +++ b/src/liblzma/common/stream_flags_encoder.c @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file stream_flags_encoder.c +/// \brief Encodes Stream Header and Stream Footer for .xz files +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "stream_flags_common.h" + + +static bool +stream_flags_encode(const lzma_stream_flags *options, uint8_t *out) +{ + if ((unsigned int)(options->check) > LZMA_CHECK_ID_MAX) + return true; + + out[0] = 0x00; + out[1] = options->check; + + return false; +} + + +extern LZMA_API(lzma_ret) +lzma_stream_header_encode(const lzma_stream_flags *options, uint8_t *out) +{ + assert(sizeof(lzma_header_magic) + LZMA_STREAM_FLAGS_SIZE + + 4 == LZMA_STREAM_HEADER_SIZE); + + if (options->version != 0) + return LZMA_OPTIONS_ERROR; + + // Magic + memcpy(out, lzma_header_magic, sizeof(lzma_header_magic)); + + // Stream Flags + if (stream_flags_encode(options, out + sizeof(lzma_header_magic))) + return LZMA_PROG_ERROR; + + // CRC32 of the Stream Header + const uint32_t crc = lzma_crc32(out + sizeof(lzma_header_magic), + LZMA_STREAM_FLAGS_SIZE, 0); + + write32le(out + sizeof(lzma_header_magic) + LZMA_STREAM_FLAGS_SIZE, + crc); + + return LZMA_OK; +} + + +extern LZMA_API(lzma_ret) +lzma_stream_footer_encode(const lzma_stream_flags *options, uint8_t *out) +{ + assert(2 * 4 + LZMA_STREAM_FLAGS_SIZE + sizeof(lzma_footer_magic) + == LZMA_STREAM_HEADER_SIZE); + + if (options->version != 0) + return LZMA_OPTIONS_ERROR; + + // Backward Size + if (!is_backward_size_valid(options)) + return LZMA_PROG_ERROR; + + write32le(out + 4, options->backward_size / 4 - 1); + + // Stream Flags + if (stream_flags_encode(options, out + 2 * 4)) + return LZMA_PROG_ERROR; + + // CRC32 + const uint32_t crc = lzma_crc32( + out + 4, 4 + LZMA_STREAM_FLAGS_SIZE, 0); + + write32le(out, crc); + + // Magic + memcpy(out + 2 * 4 + LZMA_STREAM_FLAGS_SIZE, + lzma_footer_magic, sizeof(lzma_footer_magic)); + + return LZMA_OK; +} diff --git a/src/liblzma/common/string_conversion.c b/src/liblzma/common/string_conversion.c new file mode 100644 index 0000000..53fdff2 --- /dev/null +++ b/src/liblzma/common/string_conversion.c @@ -0,0 +1,1317 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file string_conversion.c +/// \brief Conversion of strings to filter chain and vice versa +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "filter_common.h" + + +///////////////////// +// String building // +///////////////////// + +/// How much memory to allocate for strings. For now, no realloc is used +/// so this needs to be big enough even though there of course is +/// an overflow check still. +/// +/// FIXME? Using a fixed size is wasteful if the application doesn't free +/// the string fairly quickly but this can be improved later if needed. +#define STR_ALLOC_SIZE 800 + + +typedef struct { + char *buf; + size_t pos; +} lzma_str; + + +static lzma_ret +str_init(lzma_str *str, const lzma_allocator *allocator) +{ + str->buf = lzma_alloc(STR_ALLOC_SIZE, allocator); + if (str->buf == NULL) + return LZMA_MEM_ERROR; + + str->pos = 0; + return LZMA_OK; +} + + +static void +str_free(lzma_str *str, const lzma_allocator *allocator) +{ + lzma_free(str->buf, allocator); + return; +} + + +static bool +str_is_full(const lzma_str *str) +{ + return str->pos == STR_ALLOC_SIZE - 1; +} + + +static lzma_ret +str_finish(char **dest, lzma_str *str, const lzma_allocator *allocator) +{ + if (str_is_full(str)) { + // The preallocated buffer was too small. + // This shouldn't happen as STR_ALLOC_SIZE should + // be adjusted if new filters are added. + lzma_free(str->buf, allocator); + *dest = NULL; + assert(0); + return LZMA_PROG_ERROR; + } + + str->buf[str->pos] = '\0'; + *dest = str->buf; + return LZMA_OK; +} + + +static void +str_append_str(lzma_str *str, const char *s) +{ + const size_t len = strlen(s); + const size_t limit = STR_ALLOC_SIZE - 1 - str->pos; + const size_t copy_size = my_min(len, limit); + + memcpy(str->buf + str->pos, s, copy_size); + str->pos += copy_size; + return; +} + + +static void +str_append_u32(lzma_str *str, uint32_t v, bool use_byte_suffix) +{ + if (v == 0) { + str_append_str(str, "0"); + } else { + // NOTE: Don't use plain "B" because xz and the parser in this + // file don't support it and at glance it may look like 8 + // (there cannot be a space before the suffix). + static const char suffixes[4][4] = { "", "KiB", "MiB", "GiB" }; + + size_t suf = 0; + if (use_byte_suffix) { + while ((v & 1023) == 0 + && suf < ARRAY_SIZE(suffixes) - 1) { + v >>= 10; + ++suf; + } + } + + // UINT32_MAX in base 10 would need 10 + 1 bytes. Remember + // that initializing to "" initializes all elements to + // zero so '\0'-termination gets handled by this. + char buf[16] = ""; + size_t pos = sizeof(buf) - 1; + + do { + buf[--pos] = '0' + (v % 10); + v /= 10; + } while (v != 0); + + str_append_str(str, buf + pos); + str_append_str(str, suffixes[suf]); + } + + return; +} + + +////////////////////////////////////////////// +// Parsing and stringification declarations // +////////////////////////////////////////////// + +/// Maximum length for filter and option names. +/// 11 chars + terminating '\0' + sizeof(uint32_t) = 16 bytes +#define NAME_LEN_MAX 11 + + +/// For option_map.flags: Use .u.map to do convert the input value +/// to an integer. Without this flag, .u.range.{min,max} are used +/// as the allowed range for the integer. +#define OPTMAP_USE_NAME_VALUE_MAP 0x01 + +/// For option_map.flags: Allow KiB/MiB/GiB in input string and use them in +/// the stringified output if the value is an exact multiple of these. +/// This is used e.g. for LZMA1/2 dictionary size. +#define OPTMAP_USE_BYTE_SUFFIX 0x02 + +/// For option_map.flags: If the integer value is zero then this option +/// won't be included in the stringified output. It's used e.g. for +/// BCJ filter start offset which usually is zero. +#define OPTMAP_NO_STRFY_ZERO 0x04 + +/// Possible values for option_map.type. Since OPTMAP_TYPE_UINT32 is 0, +/// it doesn't need to be specified in the initializers as it is +/// the implicit value. +enum { + OPTMAP_TYPE_UINT32, + OPTMAP_TYPE_LZMA_MODE, + OPTMAP_TYPE_LZMA_MATCH_FINDER, + OPTMAP_TYPE_LZMA_PRESET, +}; + + +/// This is for mapping string values in options to integers. +/// The last element of an array must have "" as the name. +/// It's used e.g. for match finder names in LZMA1/2. +typedef struct { + const char name[NAME_LEN_MAX + 1]; + const uint32_t value; +} name_value_map; + + +/// Each filter that has options needs an array of option_map structures. +/// The array doesn't need to be terminated as the functions take the +/// length of the array as an argument. +/// +/// When converting a string to filter options structure, option values +/// will be handled in a few different ways: +/// +/// (1) If .type equals OPTMAP_TYPE_LZMA_PRESET then LZMA1/2 preset string +/// is handled specially. +/// +/// (2) If .flags has OPTMAP_USE_NAME_VALUE_MAP set then the string is +/// converted to an integer using the name_value_map pointed by .u.map. +/// The last element in .u.map must have .name = "" as the terminator. +/// +/// (3) Otherwise the string is treated as a non-negative unsigned decimal +/// integer which must be in the range set in .u.range. If .flags has +/// OPTMAP_USE_BYTE_SUFFIX then KiB, MiB, and GiB suffixes are allowed. +/// +/// The integer value from (2) or (3) is then stored to filter_options +/// at the offset specified in .offset using the type specified in .type +/// (default is uint32_t). +/// +/// Stringifying a filter is done by processing a given number of options +/// in oder from the beginning of an option_map array. The integer is +/// read from filter_options at .offset using the type from .type. +/// +/// If the integer is zero and .flags has OPTMAP_NO_STRFY_ZERO then the +/// option is skipped. +/// +/// If .flags has OPTMAP_USE_NAME_VALUE_MAP set then .u.map will be used +/// to convert the option to a string. If the map doesn't contain a string +/// for the integer value then "UNKNOWN" is used. +/// +/// If .flags doesn't have OPTMAP_USE_NAME_VALUE_MAP set then the integer is +/// converted to a decimal value. If OPTMAP_USE_BYTE_SUFFIX is used then KiB, +/// MiB, or GiB suffix is used if the value is an exact multiple of these. +/// Plain "B" suffix is never used. +typedef struct { + char name[NAME_LEN_MAX + 1]; + uint8_t type; + uint8_t flags; + uint16_t offset; + + union { + struct { + uint32_t min; + uint32_t max; + } range; + + const name_value_map *map; + } u; +} option_map; + + +static const char *parse_options(const char **const str, const char *str_end, + void *filter_options, + const option_map *const optmap, const size_t optmap_size); + + +///////// +// BCJ // +///////// + +#if defined(HAVE_ENCODER_X86) \ + || defined(HAVE_DECODER_X86) \ + || defined(HAVE_ENCODER_ARM) \ + || defined(HAVE_DECODER_ARM) \ + || defined(HAVE_ENCODER_ARMTHUMB) \ + || defined(HAVE_DECODER_ARMTHUMB) \ + || defined(HAVE_ENCODER_ARM64) \ + || defined(HAVE_DECODER_ARM64) \ + || defined(HAVE_ENCODER_POWERPC) \ + || defined(HAVE_DECODER_POWERPC) \ + || defined(HAVE_ENCODER_IA64) \ + || defined(HAVE_DECODER_IA64) \ + || defined(HAVE_ENCODER_SPARC) \ + || defined(HAVE_DECODER_SPARC) +static const option_map bcj_optmap[] = { + { + .name = "start", + .flags = OPTMAP_NO_STRFY_ZERO | OPTMAP_USE_BYTE_SUFFIX, + .offset = offsetof(lzma_options_bcj, start_offset), + .u.range.min = 0, + .u.range.max = UINT32_MAX, + } +}; + + +static const char * +parse_bcj(const char **const str, const char *str_end, void *filter_options) +{ + // filter_options was zeroed on allocation and that is enough + // for the default value. + return parse_options(str, str_end, filter_options, + bcj_optmap, ARRAY_SIZE(bcj_optmap)); +} +#endif + + +/////////// +// Delta // +/////////// + +#if defined(HAVE_ENCODER_DELTA) || defined(HAVE_DECODER_DELTA) +static const option_map delta_optmap[] = { + { + .name = "dist", + .offset = offsetof(lzma_options_delta, dist), + .u.range.min = LZMA_DELTA_DIST_MIN, + .u.range.max = LZMA_DELTA_DIST_MAX, + } +}; + + +static const char * +parse_delta(const char **const str, const char *str_end, void *filter_options) +{ + lzma_options_delta *opts = filter_options; + opts->type = LZMA_DELTA_TYPE_BYTE; + opts->dist = LZMA_DELTA_DIST_MIN; + + return parse_options(str, str_end, filter_options, + delta_optmap, ARRAY_SIZE(delta_optmap)); +} +#endif + + +/////////////////// +// LZMA1 & LZMA2 // +/////////////////// + +/// Help string for presets +#define LZMA12_PRESET_STR "0-9[e]" + + +static const char * +parse_lzma12_preset(const char **const str, const char *str_end, + uint32_t *preset) +{ + assert(*str < str_end); + *preset = (uint32_t)(**str - '0'); + + // NOTE: Remember to update LZMA_PRESET_STR if this is modified! + while (++*str < str_end) { + switch (**str) { + case 'e': + *preset |= LZMA_PRESET_EXTREME; + break; + + default: + return "Unsupported preset flag"; + } + } + + return NULL; +} + + +static const char * +set_lzma12_preset(const char **const str, const char *str_end, + void *filter_options) +{ + uint32_t preset; + const char *errmsg = parse_lzma12_preset(str, str_end, &preset); + if (errmsg != NULL) + return errmsg; + + lzma_options_lzma *opts = filter_options; + if (lzma_lzma_preset(opts, preset)) + return "Unsupported preset"; + + return NULL; +} + + +static const name_value_map lzma12_mode_map[] = { + { "fast", LZMA_MODE_FAST }, + { "normal", LZMA_MODE_NORMAL }, + { "", 0 } +}; + + +static const name_value_map lzma12_mf_map[] = { + { "hc3", LZMA_MF_HC3 }, + { "hc4", LZMA_MF_HC4 }, + { "bt2", LZMA_MF_BT2 }, + { "bt3", LZMA_MF_BT3 }, + { "bt4", LZMA_MF_BT4 }, + { "", 0 } +}; + + +static const option_map lzma12_optmap[] = { + { + .name = "preset", + .type = OPTMAP_TYPE_LZMA_PRESET, + }, { + .name = "dict", + .flags = OPTMAP_USE_BYTE_SUFFIX, + .offset = offsetof(lzma_options_lzma, dict_size), + .u.range.min = LZMA_DICT_SIZE_MIN, + // FIXME? The max is really max for encoding but decoding + // would allow 4 GiB - 1 B. + .u.range.max = (UINT32_C(1) << 30) + (UINT32_C(1) << 29), + }, { + .name = "lc", + .offset = offsetof(lzma_options_lzma, lc), + .u.range.min = LZMA_LCLP_MIN, + .u.range.max = LZMA_LCLP_MAX, + }, { + .name = "lp", + .offset = offsetof(lzma_options_lzma, lp), + .u.range.min = LZMA_LCLP_MIN, + .u.range.max = LZMA_LCLP_MAX, + }, { + .name = "pb", + .offset = offsetof(lzma_options_lzma, pb), + .u.range.min = LZMA_PB_MIN, + .u.range.max = LZMA_PB_MAX, + }, { + .name = "mode", + .type = OPTMAP_TYPE_LZMA_MODE, + .flags = OPTMAP_USE_NAME_VALUE_MAP, + .offset = offsetof(lzma_options_lzma, mode), + .u.map = lzma12_mode_map, + }, { + .name = "nice", + .offset = offsetof(lzma_options_lzma, nice_len), + .u.range.min = 2, + .u.range.max = 273, + }, { + .name = "mf", + .type = OPTMAP_TYPE_LZMA_MATCH_FINDER, + .flags = OPTMAP_USE_NAME_VALUE_MAP, + .offset = offsetof(lzma_options_lzma, mf), + .u.map = lzma12_mf_map, + }, { + .name = "depth", + .offset = offsetof(lzma_options_lzma, depth), + .u.range.min = 0, + .u.range.max = UINT32_MAX, + } +}; + + +static const char * +parse_lzma12(const char **const str, const char *str_end, void *filter_options) +{ + lzma_options_lzma *opts = filter_options; + + // It cannot fail. + const bool preset_ret = lzma_lzma_preset(opts, LZMA_PRESET_DEFAULT); + assert(!preset_ret); + (void)preset_ret; + + const char *errmsg = parse_options(str, str_end, filter_options, + lzma12_optmap, ARRAY_SIZE(lzma12_optmap)); + if (errmsg != NULL) + return errmsg; + + if (opts->lc + opts->lp > LZMA_LCLP_MAX) + return "The sum of lc and lp must not exceed 4"; + + return NULL; +} + + +///////////////////////////////////////// +// Generic parsing and stringification // +///////////////////////////////////////// + +static const struct { + /// Name of the filter + char name[NAME_LEN_MAX + 1]; + + /// For lzma_str_to_filters: + /// Size of the filter-specific options structure. + uint32_t opts_size; + + /// Filter ID + lzma_vli id; + + /// For lzma_str_to_filters: + /// Function to parse the filter-specific options. The filter_options + /// will already have been allocated using lzma_alloc_zero(). + const char *(*parse)(const char **str, const char *str_end, + void *filter_options); + + /// For lzma_str_from_filters: + /// If the flag LZMA_STR_ENCODER is used then the first + /// strfy_encoder elements of optmap are stringified. + /// With LZMA_STR_DECODER strfy_decoder is used. + /// Currently encoders use all flags that decoders do but if + /// that changes then this needs to be changed too, for example, + /// add a new OPTMAP flag to skip printing some decoder-only flags. + const option_map *optmap; + uint8_t strfy_encoder; + uint8_t strfy_decoder; + + /// For lzma_str_from_filters: + /// If true, lzma_filter.options is allowed to be NULL. In that case, + /// only the filter name is printed without any options. + bool allow_null; + +} filter_name_map[] = { +#if defined (HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) + { "lzma1", sizeof(lzma_options_lzma), LZMA_FILTER_LZMA1, + &parse_lzma12, lzma12_optmap, 9, 5, false }, +#endif + +#if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2) + { "lzma2", sizeof(lzma_options_lzma), LZMA_FILTER_LZMA2, + &parse_lzma12, lzma12_optmap, 9, 2, false }, +#endif + +#if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86) + { "x86", sizeof(lzma_options_bcj), LZMA_FILTER_X86, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_ARM) || defined(HAVE_DECODER_ARM) + { "arm", sizeof(lzma_options_bcj), LZMA_FILTER_ARM, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_ARMTHUMB) || defined(HAVE_DECODER_ARMTHUMB) + { "armthumb", sizeof(lzma_options_bcj), LZMA_FILTER_ARMTHUMB, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_ARM64) || defined(HAVE_DECODER_ARM64) + { "arm64", sizeof(lzma_options_bcj), LZMA_FILTER_ARM64, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC) + { "powerpc", sizeof(lzma_options_bcj), LZMA_FILTER_POWERPC, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64) + { "ia64", sizeof(lzma_options_bcj), LZMA_FILTER_IA64, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_SPARC) || defined(HAVE_DECODER_SPARC) + { "sparc", sizeof(lzma_options_bcj), LZMA_FILTER_SPARC, + &parse_bcj, bcj_optmap, 1, 1, true }, +#endif + +#if defined(HAVE_ENCODER_DELTA) || defined(HAVE_DECODER_DELTA) + { "delta", sizeof(lzma_options_delta), LZMA_FILTER_DELTA, + &parse_delta, delta_optmap, 1, 1, false }, +#endif +}; + + +/// Decodes options from a string for one filter (name1=value1,name2=value2). +/// Caller must have allocated memory for filter_options already and set +/// the initial default values. This is called from the filter-specific +/// parse_* functions. +/// +/// The input string starts at *str and the address in str_end is the first +/// char that is not part of the string anymore. So no '\0' terminator is +/// used. *str is advanced everytime something has been decoded successfully. +static const char * +parse_options(const char **const str, const char *str_end, + void *filter_options, + const option_map *const optmap, const size_t optmap_size) +{ + while (*str < str_end && **str != '\0') { + // Each option is of the form name=value. + // Commas (',') separate options. Extra commas are ignored. + // Ignoring extra commas makes it simpler if an optional + // option stored in a shell variable which can be empty. + if (**str == ',') { + ++*str; + continue; + } + + // Find where the next name=value ends. + const size_t str_len = (size_t)(str_end - *str); + const char *name_eq_value_end = memchr(*str, ',', str_len); + if (name_eq_value_end == NULL) + name_eq_value_end = str_end; + + const char *equals_sign = memchr(*str, '=', + (size_t)(name_eq_value_end - *str)); + + // Fail if the '=' wasn't found or the option name is missing + // (the first char is '='). + if (equals_sign == NULL || **str == '=') + return "Options must be 'name=value' pairs separated " + "with commas"; + + // Reject a too long option name so that the memcmp() + // in the loop below won't read past the end of the + // string in optmap[i].name. + const size_t name_len = (size_t)(equals_sign - *str); + if (name_len > NAME_LEN_MAX) + return "Unknown option name"; + + // Find the option name from optmap[]. + size_t i = 0; + while (true) { + if (i == optmap_size) + return "Unknown option name"; + + if (memcmp(*str, optmap[i].name, name_len) == 0 + && optmap[i].name[name_len] == '\0') + break; + + ++i; + } + + // The input string is good at least until the start of + // the option value. + *str = equals_sign + 1; + + // The code assumes that the option value isn't an empty + // string so check it here. + const size_t value_len = (size_t)(name_eq_value_end - *str); + if (value_len == 0) + return "Option value cannot be empty"; + + // LZMA1/2 preset has its own parsing function. + if (optmap[i].type == OPTMAP_TYPE_LZMA_PRESET) { + const char *errmsg = set_lzma12_preset(str, + name_eq_value_end, filter_options); + if (errmsg != NULL) + return errmsg; + + continue; + } + + // It's an integer value. + uint32_t v; + if (optmap[i].flags & OPTMAP_USE_NAME_VALUE_MAP) { + // The integer is picked from a string-to-integer map. + // + // Reject a too long value string so that the memcmp() + // in the loop below won't read past the end of the + // string in optmap[i].u.map[j].name. + if (value_len > NAME_LEN_MAX) + return "Invalid option value"; + + const name_value_map *map = optmap[i].u.map; + size_t j = 0; + while (true) { + // The array is terminated with an empty name. + if (map[j].name[0] == '\0') + return "Invalid option value"; + + if (memcmp(*str, map[j].name, value_len) == 0 + && map[j].name[value_len] + == '\0') { + v = map[j].value; + break; + } + + ++j; + } + } else if (**str < '0' || **str > '9') { + // Note that "max" isn't supported while it is + // supported in xz. It's not useful here. + return "Value is not a non-negative decimal integer"; + } else { + // strtoul() has locale-specific behavior so it cannot + // be relied on to get reproducible results since we + // cannot change the locate in a thread-safe library. + // It also needs '\0'-termination. + // + // Use a temporary pointer so that *str will point + // to the beginning of the value string in case + // an error occurs. + const char *p = *str; + v = 0; + do { + if (v > UINT32_MAX / 10) + return "Value out of range"; + + v *= 10; + + const uint32_t add = (uint32_t)(*p - '0'); + if (UINT32_MAX - add < v) + return "Value out of range"; + + v += add; + ++p; + } while (p < name_eq_value_end + && *p >= '0' && *p <= '9'); + + if (p < name_eq_value_end) { + // Remember this position so that it an be + // used for error messages that are + // specifically about the suffix. (Out of + // range values are about the whole value + // and those error messages point to the + // beginning of the number part, + // not to the suffix.) + const char *multiplier_start = p; + + // If multiplier suffix shouldn't be used + // then don't allow them even if the value + // would stay within limits. This is a somewhat + // unnecessary check but it rejects silly + // things like lzma2:pb=0MiB which xz allows. + if ((optmap[i].flags & OPTMAP_USE_BYTE_SUFFIX) + == 0) { + *str = multiplier_start; + return "This option does not support " + "any integer suffixes"; + } + + uint32_t shift; + + switch (*p) { + case 'k': + case 'K': + shift = 10; + break; + + case 'm': + case 'M': + shift = 20; + break; + + case 'g': + case 'G': + shift = 30; + break; + + default: + *str = multiplier_start; + return "Invalid multiplier suffix " + "(KiB, MiB, or GiB)"; + } + + ++p; + + // Allow "M", "Mi", "MB", "MiB" and the same + // for the other five characters from the + // switch-statement above. All are handled + // as base-2 (perhaps a mistake, perhaps not). + // Note that 'i' and 'B' are case sensitive. + if (p < name_eq_value_end && *p == 'i') + ++p; + + if (p < name_eq_value_end && *p == 'B') + ++p; + + // Now we must have no chars remaining. + if (p < name_eq_value_end) { + *str = multiplier_start; + return "Invalid multiplier suffix " + "(KiB, MiB, or GiB)"; + } + + if (v > (UINT32_MAX >> shift)) + return "Value out of range"; + + v <<= shift; + } + + if (v < optmap[i].u.range.min + || v > optmap[i].u.range.max) + return "Value out of range"; + } + + // Set the value in filter_options. Enums are handled + // specially since the underlying type isn't the same + // as uint32_t on all systems. + void *ptr = (char *)filter_options + optmap[i].offset; + switch (optmap[i].type) { + case OPTMAP_TYPE_LZMA_MODE: + *(lzma_mode *)ptr = (lzma_mode)v; + break; + + case OPTMAP_TYPE_LZMA_MATCH_FINDER: + *(lzma_match_finder *)ptr = (lzma_match_finder)v; + break; + + default: + *(uint32_t *)ptr = v; + break; + } + + // This option has been successfully handled. + *str = name_eq_value_end; + } + + // No errors. + return NULL; +} + + +/// Finds the name of the filter at the beginning of the string and +/// calls filter_name_map[i].parse() to decode the filter-specific options. +/// The caller must have set str_end so that exactly one filter and its +/// options are present without any trailing characters. +static const char * +parse_filter(const char **const str, const char *str_end, lzma_filter *filter, + const lzma_allocator *allocator, bool only_xz) +{ + // Search for a colon or equals sign that would separate the filter + // name from filter options. If neither is found, then the input + // string only contains a filter name and there are no options. + // + // First assume that a colon or equals sign won't be found: + const char *name_end = str_end; + const char *opts_start = str_end; + + for (const char *p = *str; p < str_end; ++p) { + if (*p == ':' || *p == '=') { + name_end = p; + + // Filter options (name1=value1,name2=value2,...) + // begin after the colon or equals sign. + opts_start = p + 1; + break; + } + } + + // Reject a too long filter name so that the memcmp() + // in the loop below won't read past the end of the + // string in filter_name_map[i].name. + const size_t name_len = (size_t)(name_end - *str); + if (name_len > NAME_LEN_MAX) + return "Unknown filter name"; + + for (size_t i = 0; i < ARRAY_SIZE(filter_name_map); ++i) { + if (memcmp(*str, filter_name_map[i].name, name_len) == 0 + && filter_name_map[i].name[name_len] == '\0') { + if (only_xz && filter_name_map[i].id + >= LZMA_FILTER_RESERVED_START) + return "This filter cannot be used in " + "the .xz format"; + + // Allocate the filter-specific options and + // initialize the memory with zeros. + void *options = lzma_alloc_zero( + filter_name_map[i].opts_size, + allocator); + if (options == NULL) + return "Memory allocation failed"; + + // Filter name was found so the input string is good + // at least this far. + *str = opts_start; + + const char *errmsg = filter_name_map[i].parse( + str, str_end, options); + if (errmsg != NULL) { + lzma_free(options, allocator); + return errmsg; + } + + // *filter is modified only when parsing is successful. + filter->id = filter_name_map[i].id; + filter->options = options; + return NULL; + } + } + + return "Unknown filter name"; +} + + +/// Converts the string to a filter chain (array of lzma_filter structures). +/// +/// *str is advanced everytime something has been decoded successfully. +/// This way the caller knows where in the string a possible error occurred. +static const char * +str_to_filters(const char **const str, lzma_filter *filters, uint32_t flags, + const lzma_allocator *allocator) +{ + const char *errmsg; + + // Skip leading spaces. + while (**str == ' ') + ++*str; + + if (**str == '\0') + return "Empty string is not allowed, " + "try \"6\" if a default value is needed"; + + // Detect the type of the string. + // + // A string beginning with a digit or a string beginning with + // one dash and a digit are treated as presets. Trailing spaces + // will be ignored too (leading spaces were already ignored above). + // + // For example, "6", "7 ", "-9e", or " -3 " are treated as presets. + // Strings like "-" or "- " aren't preset. +#define MY_IS_DIGIT(c) ((c) >= '0' && (c) <= '9') + if (MY_IS_DIGIT(**str) || (**str == '-' && MY_IS_DIGIT((*str)[1]))) { + if (**str == '-') + ++*str; + + // Ignore trailing spaces. + const size_t str_len = strlen(*str); + const char *str_end = memchr(*str, ' ', str_len); + if (str_end != NULL) { + // There is at least one trailing space. Check that + // there are no chars other than spaces. + for (size_t i = 1; str_end[i] != '\0'; ++i) + if (str_end[i] != ' ') + return "Unsupported preset"; + } else { + // There are no trailing spaces. Use the whole string. + str_end = *str + str_len; + } + + uint32_t preset; + errmsg = parse_lzma12_preset(str, str_end, &preset); + if (errmsg != NULL) + return errmsg; + + lzma_options_lzma *opts = lzma_alloc(sizeof(*opts), allocator); + if (opts == NULL) + return "Memory allocation failed"; + + if (lzma_lzma_preset(opts, preset)) { + lzma_free(opts, allocator); + return "Unsupported preset"; + } + + filters[0].id = LZMA_FILTER_LZMA2; + filters[0].options = opts; + filters[1].id = LZMA_VLI_UNKNOWN; + filters[1].options = NULL; + + return NULL; + } + + // Not a preset so it must be a filter chain. + // + // If LZMA_STR_ALL_FILTERS isn't used we allow only filters that + // can be used in .xz. + const bool only_xz = (flags & LZMA_STR_ALL_FILTERS) == 0; + + // Use a temporary array so that we don't modify the caller-supplied + // one until we know that no errors occurred. + lzma_filter temp_filters[LZMA_FILTERS_MAX + 1]; + + size_t i = 0; + do { + if (i == LZMA_FILTERS_MAX) { + errmsg = "The maximum number of filters is four"; + goto error; + } + + // Skip "--" if present. + if ((*str)[0] == '-' && (*str)[1] == '-') + *str += 2; + + // Locate the end of "filter:name1=value1,name2=value2", + // stopping at the first "--" or a single space. + const char *filter_end = *str; + while (filter_end[0] != '\0') { + if ((filter_end[0] == '-' && filter_end[1] == '-') + || filter_end[0] == ' ') + break; + + ++filter_end; + } + + // Inputs that have "--" at the end or "-- " in the middle + // will result in an empty filter name. + if (filter_end == *str) { + errmsg = "Filter name is missing"; + goto error; + } + + errmsg = parse_filter(str, filter_end, &temp_filters[i], + allocator, only_xz); + if (errmsg != NULL) + goto error; + + // Skip trailing spaces. + while (**str == ' ') + ++*str; + + ++i; + } while (**str != '\0'); + + // Seems to be good, terminate the array so that + // basic validation can be done. + temp_filters[i].id = LZMA_VLI_UNKNOWN; + temp_filters[i].options = NULL; + + // Do basic validation if the application didn't prohibit it. + if ((flags & LZMA_STR_NO_VALIDATION) == 0) { + size_t dummy; + const lzma_ret ret = lzma_validate_chain(temp_filters, &dummy); + assert(ret == LZMA_OK || ret == LZMA_OPTIONS_ERROR); + if (ret != LZMA_OK) { + errmsg = "Invalid filter chain " + "('lzma2' missing at the end?)"; + goto error; + } + } + + // All good. Copy the filters to the application supplied array. + memcpy(filters, temp_filters, (i + 1) * sizeof(lzma_filter)); + return NULL; + +error: + // Free the filter options that were successfully decoded. + while (i-- > 0) + lzma_free(temp_filters[i].options, allocator); + + return errmsg; +} + + +extern LZMA_API(const char *) +lzma_str_to_filters(const char *str, int *error_pos, lzma_filter *filters, + uint32_t flags, const lzma_allocator *allocator) +{ + if (str == NULL || filters == NULL) + return "Unexpected NULL pointer argument(s) " + "to lzma_str_to_filters()"; + + // Validate the flags. + const uint32_t supported_flags + = LZMA_STR_ALL_FILTERS + | LZMA_STR_NO_VALIDATION; + + if (flags & ~supported_flags) + return "Unsupported flags to lzma_str_to_filters()"; + + const char *used = str; + const char *errmsg = str_to_filters(&used, filters, flags, allocator); + + if (error_pos != NULL) { + const size_t n = (size_t)(used - str); + *error_pos = n > INT_MAX ? INT_MAX : (int)n; + } + + return errmsg; +} + + +/// Converts options of one filter to a string. +/// +/// The caller must have already put the filter name in the destination +/// string. Since it is possible that no options will be needed, the caller +/// won't have put a delimiter character (':' or '=') in the string yet. +/// We will add it if at least one option will be added to the string. +static void +strfy_filter(lzma_str *dest, const char *delimiter, + const option_map *optmap, size_t optmap_count, + const void *filter_options) +{ + for (size_t i = 0; i < optmap_count; ++i) { + // No attempt is made to reverse LZMA1/2 preset. + if (optmap[i].type == OPTMAP_TYPE_LZMA_PRESET) + continue; + + // All options have integer values, some just are mapped + // to a string with a name_value_map. LZMA1/2 preset + // isn't reversed back to preset=PRESET form. + uint32_t v; + const void *ptr + = (const char *)filter_options + optmap[i].offset; + switch (optmap[i].type) { + case OPTMAP_TYPE_LZMA_MODE: + v = *(const lzma_mode *)ptr; + break; + + case OPTMAP_TYPE_LZMA_MATCH_FINDER: + v = *(const lzma_match_finder *)ptr; + break; + + default: + v = *(const uint32_t *)ptr; + break; + } + + // Skip this if this option should be omitted from + // the string when the value is zero. + if (v == 0 && (optmap[i].flags & OPTMAP_NO_STRFY_ZERO)) + continue; + + // Before the first option we add whatever delimiter + // the caller gave us. For later options a comma is used. + str_append_str(dest, delimiter); + delimiter = ","; + + // Add the option name and equals sign. + str_append_str(dest, optmap[i].name); + str_append_str(dest, "="); + + if (optmap[i].flags & OPTMAP_USE_NAME_VALUE_MAP) { + const name_value_map *map = optmap[i].u.map; + size_t j = 0; + while (true) { + if (map[j].name[0] == '\0') { + str_append_str(dest, "UNKNOWN"); + break; + } + + if (map[j].value == v) { + str_append_str(dest, map[j].name); + break; + } + + ++j; + } + } else { + str_append_u32(dest, v, + optmap[i].flags & OPTMAP_USE_BYTE_SUFFIX); + } + } + + return; +} + + +extern LZMA_API(lzma_ret) +lzma_str_from_filters(char **output_str, const lzma_filter *filters, + uint32_t flags, const lzma_allocator *allocator) +{ + // On error *output_str is always set to NULL. + // Do it as the very first step. + if (output_str == NULL) + return LZMA_PROG_ERROR; + + *output_str = NULL; + + if (filters == NULL) + return LZMA_PROG_ERROR; + + // Validate the flags. + const uint32_t supported_flags + = LZMA_STR_ENCODER + | LZMA_STR_DECODER + | LZMA_STR_GETOPT_LONG + | LZMA_STR_NO_SPACES; + + if (flags & ~supported_flags) + return LZMA_OPTIONS_ERROR; + + // There must be at least one filter. + if (filters[0].id == LZMA_VLI_UNKNOWN) + return LZMA_OPTIONS_ERROR; + + // Allocate memory for the output string. + lzma_str dest; + return_if_error(str_init(&dest, allocator)); + + const bool show_opts = (flags & (LZMA_STR_ENCODER | LZMA_STR_DECODER)); + + const char *opt_delim = (flags & LZMA_STR_GETOPT_LONG) ? "=" : ":"; + + for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) { + // Don't add a space between filters if the caller + // doesn't want them. + if (i > 0 && !(flags & LZMA_STR_NO_SPACES)) + str_append_str(&dest, " "); + + // Use dashes for xz getopt_long() compatible syntax but also + // use dashes to separate filters when spaces weren't wanted. + if ((flags & LZMA_STR_GETOPT_LONG) + || (i > 0 && (flags & LZMA_STR_NO_SPACES))) + str_append_str(&dest, "--"); + + size_t j = 0; + while (true) { + if (j == ARRAY_SIZE(filter_name_map)) { + // Filter ID in filters[i].id isn't supported. + str_free(&dest, allocator); + return LZMA_OPTIONS_ERROR; + } + + if (filter_name_map[j].id == filters[i].id) { + // Add the filter name. + str_append_str(&dest, filter_name_map[j].name); + + // If only the filter names were wanted then + // skip to the next filter. In this case + // .options is ignored and may be NULL even + // when the filter doesn't allow NULL options. + if (!show_opts) + break; + + if (filters[i].options == NULL) { + if (!filter_name_map[j].allow_null) { + // Filter-specific options + // are missing but with + // this filter the options + // structure is mandatory. + str_free(&dest, allocator); + return LZMA_OPTIONS_ERROR; + } + + // .options is allowed to be NULL. + // There is no need to add any + // options to the string. + break; + } + + // Options structure is available. Add + // the filter options to the string. + const size_t optmap_count + = (flags & LZMA_STR_ENCODER) + ? filter_name_map[j].strfy_encoder + : filter_name_map[j].strfy_decoder; + strfy_filter(&dest, opt_delim, + filter_name_map[j].optmap, + optmap_count, + filters[i].options); + break; + } + + ++j; + } + } + + return str_finish(output_str, &dest, allocator); +} + + +extern LZMA_API(lzma_ret) +lzma_str_list_filters(char **output_str, lzma_vli filter_id, uint32_t flags, + const lzma_allocator *allocator) +{ + // On error *output_str is always set to NULL. + // Do it as the very first step. + if (output_str == NULL) + return LZMA_PROG_ERROR; + + *output_str = NULL; + + // Validate the flags. + const uint32_t supported_flags + = LZMA_STR_ALL_FILTERS + | LZMA_STR_ENCODER + | LZMA_STR_DECODER + | LZMA_STR_GETOPT_LONG; + + if (flags & ~supported_flags) + return LZMA_OPTIONS_ERROR; + + // Allocate memory for the output string. + lzma_str dest; + return_if_error(str_init(&dest, allocator)); + + // If only listing the filter names then separate them with spaces. + // Otherwise use newlines. + const bool show_opts = (flags & (LZMA_STR_ENCODER | LZMA_STR_DECODER)); + const char *filter_delim = show_opts ? "\n" : " "; + + const char *opt_delim = (flags & LZMA_STR_GETOPT_LONG) ? "=" : ":"; + bool first_filter_printed = false; + + for (size_t i = 0; i < ARRAY_SIZE(filter_name_map); ++i) { + // If we are printing only one filter then skip others. + if (filter_id != LZMA_VLI_UNKNOWN + && filter_id != filter_name_map[i].id) + continue; + + // If we are printing only .xz filters then skip the others. + if (filter_name_map[i].id >= LZMA_FILTER_RESERVED_START + && (flags & LZMA_STR_ALL_FILTERS) == 0 + && filter_id == LZMA_VLI_UNKNOWN) + continue; + + // Add a new line if this isn't the first filter being + // written to the string. + if (first_filter_printed) + str_append_str(&dest, filter_delim); + + first_filter_printed = true; + + if (flags & LZMA_STR_GETOPT_LONG) + str_append_str(&dest, "--"); + + str_append_str(&dest, filter_name_map[i].name); + + // If only the filter names were wanted then continue + // to the next filter. + if (!show_opts) + continue; + + const option_map *optmap = filter_name_map[i].optmap; + const char *d = opt_delim; + + const size_t end = (flags & LZMA_STR_ENCODER) + ? filter_name_map[i].strfy_encoder + : filter_name_map[i].strfy_decoder; + + for (size_t j = 0; j < end; ++j) { + // The first option is delimited from the filter + // name using "=" or ":" and the rest of the options + // are separated with ",". + str_append_str(&dest, d); + d = ","; + + // optname= + str_append_str(&dest, optmap[j].name); + str_append_str(&dest, "=<"); + + if (optmap[j].type == OPTMAP_TYPE_LZMA_PRESET) { + // LZMA1/2 preset has its custom help string. + str_append_str(&dest, LZMA12_PRESET_STR); + } else if (optmap[j].flags + & OPTMAP_USE_NAME_VALUE_MAP) { + // Separate the possible option values by "|". + const name_value_map *m = optmap[j].u.map; + for (size_t k = 0; m[k].name[0] != '\0'; ++k) { + if (k > 0) + str_append_str(&dest, "|"); + + str_append_str(&dest, m[k].name); + } + } else { + // Integer range is shown as min-max. + const bool use_byte_suffix = optmap[j].flags + & OPTMAP_USE_BYTE_SUFFIX; + str_append_u32(&dest, optmap[j].u.range.min, + use_byte_suffix); + str_append_str(&dest, "-"); + str_append_u32(&dest, optmap[j].u.range.max, + use_byte_suffix); + } + + str_append_str(&dest, ">"); + } + } + + // If no filters were added to the string then it must be because + // the caller provided an unsupported Filter ID. + if (!first_filter_printed) { + str_free(&dest, allocator); + return LZMA_OPTIONS_ERROR; + } + + return str_finish(output_str, &dest, allocator); +} diff --git a/src/liblzma/common/vli_decoder.c b/src/liblzma/common/vli_decoder.c new file mode 100644 index 0000000..af2799d --- /dev/null +++ b/src/liblzma/common/vli_decoder.c @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file vli_decoder.c +/// \brief Decodes variable-length integers +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +extern LZMA_API(lzma_ret) +lzma_vli_decode(lzma_vli *restrict vli, size_t *vli_pos, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size) +{ + // If we haven't been given vli_pos, work in single-call mode. + size_t vli_pos_internal = 0; + if (vli_pos == NULL) { + vli_pos = &vli_pos_internal; + *vli = 0; + + // If there's no input, use LZMA_DATA_ERROR. This way it is + // easy to decode VLIs from buffers that have known size, + // and get the correct error code in case the buffer is + // too short. + if (*in_pos >= in_size) + return LZMA_DATA_ERROR; + + } else { + // Initialize *vli when starting to decode a new integer. + if (*vli_pos == 0) + *vli = 0; + + // Validate the arguments. + if (*vli_pos >= LZMA_VLI_BYTES_MAX + || (*vli >> (*vli_pos * 7)) != 0) + return LZMA_PROG_ERROR;; + + if (*in_pos >= in_size) + return LZMA_BUF_ERROR; + } + + do { + // Read the next byte. Use a temporary variable so that we + // can update *in_pos immediately. + const uint8_t byte = in[*in_pos]; + ++*in_pos; + + // Add the newly read byte to *vli. + *vli += (lzma_vli)(byte & 0x7F) << (*vli_pos * 7); + ++*vli_pos; + + // Check if this is the last byte of a multibyte integer. + if ((byte & 0x80) == 0) { + // We don't allow using variable-length integers as + // padding i.e. the encoding must use the most the + // compact form. + if (byte == 0x00 && *vli_pos > 1) + return LZMA_DATA_ERROR; + + return vli_pos == &vli_pos_internal + ? LZMA_OK : LZMA_STREAM_END; + } + + // There is at least one more byte coming. If we have already + // read maximum number of bytes, the integer is considered + // corrupt. + // + // If we need bigger integers in future, old versions liblzma + // will confusingly indicate the file being corrupt instead of + // unsupported. I suppose it's still better this way, because + // in the foreseeable future (writing this in 2008) the only + // reason why files would appear having over 63-bit integers + // is that the files are simply corrupt. + if (*vli_pos == LZMA_VLI_BYTES_MAX) + return LZMA_DATA_ERROR; + + } while (*in_pos < in_size); + + return vli_pos == &vli_pos_internal ? LZMA_DATA_ERROR : LZMA_OK; +} diff --git a/src/liblzma/common/vli_encoder.c b/src/liblzma/common/vli_encoder.c new file mode 100644 index 0000000..f864269 --- /dev/null +++ b/src/liblzma/common/vli_encoder.c @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file vli_encoder.c +/// \brief Encodes variable-length integers +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +extern LZMA_API(lzma_ret) +lzma_vli_encode(lzma_vli vli, size_t *vli_pos, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size) +{ + // If we haven't been given vli_pos, work in single-call mode. + size_t vli_pos_internal = 0; + if (vli_pos == NULL) { + vli_pos = &vli_pos_internal; + + // In single-call mode, we expect that the caller has + // reserved enough output space. + if (*out_pos >= out_size) + return LZMA_PROG_ERROR; + } else { + // This never happens when we are called by liblzma, but + // may happen if called directly from an application. + if (*out_pos >= out_size) + return LZMA_BUF_ERROR; + } + + // Validate the arguments. + if (*vli_pos >= LZMA_VLI_BYTES_MAX || vli > LZMA_VLI_MAX) + return LZMA_PROG_ERROR; + + // Shift vli so that the next bits to encode are the lowest. In + // single-call mode this never changes vli since *vli_pos is zero. + vli >>= *vli_pos * 7; + + // Write the non-last bytes in a loop. + while (vli >= 0x80) { + // We don't need *vli_pos during this function call anymore, + // but update it here so that it is ready if we need to + // return before the whole integer has been decoded. + ++*vli_pos; + assert(*vli_pos < LZMA_VLI_BYTES_MAX); + + // Write the next byte. + out[*out_pos] = (uint8_t)(vli) | 0x80; + vli >>= 7; + + if (++*out_pos == out_size) + return vli_pos == &vli_pos_internal + ? LZMA_PROG_ERROR : LZMA_OK; + } + + // Write the last byte. + out[*out_pos] = (uint8_t)(vli); + ++*out_pos; + ++*vli_pos; + + return vli_pos == &vli_pos_internal ? LZMA_OK : LZMA_STREAM_END; + +} diff --git a/src/liblzma/common/vli_size.c b/src/liblzma/common/vli_size.c new file mode 100644 index 0000000..ec1b4fa --- /dev/null +++ b/src/liblzma/common/vli_size.c @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file vli_size.c +/// \brief Calculates the encoded size of a variable-length integer +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +extern LZMA_API(uint32_t) +lzma_vli_size(lzma_vli vli) +{ + if (vli > LZMA_VLI_MAX) + return 0; + + uint32_t i = 0; + do { + vli >>= 7; + ++i; + } while (vli != 0); + + assert(i <= LZMA_VLI_BYTES_MAX); + return i; +} diff --git a/src/liblzma/delta/delta_common.c b/src/liblzma/delta/delta_common.c new file mode 100644 index 0000000..4768201 --- /dev/null +++ b/src/liblzma/delta/delta_common.c @@ -0,0 +1,73 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_common.c +/// \brief Common stuff for Delta encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "delta_common.h" +#include "delta_private.h" + + +static void +delta_coder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_delta_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder, allocator); + return; +} + + +extern lzma_ret +lzma_delta_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + // Allocate memory for the decoder if needed. + lzma_delta_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_delta_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + + // End function is the same for encoder and decoder. + next->end = &delta_coder_end; + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Validate the options. + if (lzma_delta_coder_memusage(filters[0].options) == UINT64_MAX) + return LZMA_OPTIONS_ERROR; + + // Set the delta distance. + const lzma_options_delta *opt = filters[0].options; + coder->distance = opt->dist; + + // Initialize the rest of the variables. + coder->pos = 0; + memzero(coder->history, LZMA_DELTA_DIST_MAX); + + // Initialize the next decoder in the chain, if any. + return lzma_next_filter_init(&coder->next, allocator, filters + 1); +} + + +extern uint64_t +lzma_delta_coder_memusage(const void *options) +{ + const lzma_options_delta *opt = options; + + if (opt == NULL || opt->type != LZMA_DELTA_TYPE_BYTE + || opt->dist < LZMA_DELTA_DIST_MIN + || opt->dist > LZMA_DELTA_DIST_MAX) + return UINT64_MAX; + + return sizeof(lzma_delta_coder); +} diff --git a/src/liblzma/delta/delta_common.h b/src/liblzma/delta/delta_common.h new file mode 100644 index 0000000..7e7e1ba --- /dev/null +++ b/src/liblzma/delta/delta_common.h @@ -0,0 +1,20 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_common.h +/// \brief Common stuff for Delta encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_DELTA_COMMON_H +#define LZMA_DELTA_COMMON_H + +#include "common.h" + +extern uint64_t lzma_delta_coder_memusage(const void *options); + +#endif diff --git a/src/liblzma/delta/delta_decoder.c b/src/liblzma/delta/delta_decoder.c new file mode 100644 index 0000000..13d8a28 --- /dev/null +++ b/src/liblzma/delta/delta_decoder.c @@ -0,0 +1,78 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_decoder.c +/// \brief Delta filter decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "delta_decoder.h" +#include "delta_private.h" + + +static void +decode_buffer(lzma_delta_coder *coder, uint8_t *buffer, size_t size) +{ + const size_t distance = coder->distance; + + for (size_t i = 0; i < size; ++i) { + buffer[i] += coder->history[(distance + coder->pos) & 0xFF]; + coder->history[coder->pos-- & 0xFF] = buffer[i]; + } +} + + +static lzma_ret +delta_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_delta_coder *coder = coder_ptr; + + assert(coder->next.code != NULL); + + const size_t out_start = *out_pos; + + const lzma_ret ret = coder->next.code(coder->next.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + action); + + decode_buffer(coder, out + out_start, *out_pos - out_start); + + return ret; +} + + +extern lzma_ret +lzma_delta_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + next->code = &delta_decode; + return lzma_delta_coder_init(next, allocator, filters); +} + + +extern lzma_ret +lzma_delta_props_decode(void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) +{ + if (props_size != 1) + return LZMA_OPTIONS_ERROR; + + lzma_options_delta *opt + = lzma_alloc(sizeof(lzma_options_delta), allocator); + if (opt == NULL) + return LZMA_MEM_ERROR; + + opt->type = LZMA_DELTA_TYPE_BYTE; + opt->dist = props[0] + 1U; + + *options = opt; + + return LZMA_OK; +} diff --git a/src/liblzma/delta/delta_decoder.h b/src/liblzma/delta/delta_decoder.h new file mode 100644 index 0000000..ad89cc6 --- /dev/null +++ b/src/liblzma/delta/delta_decoder.h @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_decoder.h +/// \brief Delta filter decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_DELTA_DECODER_H +#define LZMA_DELTA_DECODER_H + +#include "delta_common.h" + +extern lzma_ret lzma_delta_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_delta_props_decode( + void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size); + +#endif diff --git a/src/liblzma/delta/delta_encoder.c b/src/liblzma/delta/delta_encoder.c new file mode 100644 index 0000000..3841651 --- /dev/null +++ b/src/liblzma/delta/delta_encoder.c @@ -0,0 +1,125 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_encoder.c +/// \brief Delta filter encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "delta_encoder.h" +#include "delta_private.h" + + +/// Copies and encodes the data at the same time. This is used when Delta +/// is the first filter in the chain (and thus the last filter in the +/// encoder's filter stack). +static void +copy_and_encode(lzma_delta_coder *coder, + const uint8_t *restrict in, uint8_t *restrict out, size_t size) +{ + const size_t distance = coder->distance; + + for (size_t i = 0; i < size; ++i) { + const uint8_t tmp = coder->history[ + (distance + coder->pos) & 0xFF]; + coder->history[coder->pos-- & 0xFF] = in[i]; + out[i] = in[i] - tmp; + } +} + + +/// Encodes the data in place. This is used when we are the last filter +/// in the chain (and thus non-last filter in the encoder's filter stack). +static void +encode_in_place(lzma_delta_coder *coder, uint8_t *buffer, size_t size) +{ + const size_t distance = coder->distance; + + for (size_t i = 0; i < size; ++i) { + const uint8_t tmp = coder->history[ + (distance + coder->pos) & 0xFF]; + coder->history[coder->pos-- & 0xFF] = buffer[i]; + buffer[i] -= tmp; + } +} + + +static lzma_ret +delta_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_delta_coder *coder = coder_ptr; + + lzma_ret ret; + + if (coder->next.code == NULL) { + const size_t in_avail = in_size - *in_pos; + const size_t out_avail = out_size - *out_pos; + const size_t size = my_min(in_avail, out_avail); + + copy_and_encode(coder, in + *in_pos, out + *out_pos, size); + + *in_pos += size; + *out_pos += size; + + ret = action != LZMA_RUN && *in_pos == in_size + ? LZMA_STREAM_END : LZMA_OK; + + } else { + const size_t out_start = *out_pos; + + ret = coder->next.code(coder->next.coder, allocator, + in, in_pos, in_size, out, out_pos, out_size, + action); + + encode_in_place(coder, out + out_start, *out_pos - out_start); + } + + return ret; +} + + +static lzma_ret +delta_encoder_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters_null lzma_attribute((__unused__)), + const lzma_filter *reversed_filters) +{ + lzma_delta_coder *coder = coder_ptr; + + // Delta doesn't and will never support changing the options in + // the middle of encoding. If the app tries to change them, we + // simply ignore them. + return lzma_next_filter_update( + &coder->next, allocator, reversed_filters + 1); +} + + +extern lzma_ret +lzma_delta_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + next->code = &delta_encode; + next->update = &delta_encoder_update; + return lzma_delta_coder_init(next, allocator, filters); +} + + +extern lzma_ret +lzma_delta_props_encode(const void *options, uint8_t *out) +{ + // The caller must have already validated the options, so it's + // LZMA_PROG_ERROR if they are invalid. + if (lzma_delta_coder_memusage(options) == UINT64_MAX) + return LZMA_PROG_ERROR; + + const lzma_options_delta *opt = options; + out[0] = opt->dist - LZMA_DELTA_DIST_MIN; + + return LZMA_OK; +} diff --git a/src/liblzma/delta/delta_encoder.h b/src/liblzma/delta/delta_encoder.h new file mode 100644 index 0000000..4ab9847 --- /dev/null +++ b/src/liblzma/delta/delta_encoder.h @@ -0,0 +1,24 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_encoder.h +/// \brief Delta filter encoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_DELTA_ENCODER_H +#define LZMA_DELTA_ENCODER_H + +#include "delta_common.h" + +extern lzma_ret lzma_delta_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_delta_props_encode(const void *options, uint8_t *out); + +#endif diff --git a/src/liblzma/delta/delta_private.h b/src/liblzma/delta/delta_private.h new file mode 100644 index 0000000..0d6cb38 --- /dev/null +++ b/src/liblzma/delta/delta_private.h @@ -0,0 +1,37 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file delta_private.h +/// \brief Private common stuff for Delta encoder and decoder +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_DELTA_PRIVATE_H +#define LZMA_DELTA_PRIVATE_H + +#include "delta_common.h" + +typedef struct { + /// Next coder in the chain + lzma_next_coder next; + + /// Delta distance + size_t distance; + + /// Position in history[] + uint8_t pos; + + /// Buffer to hold history of the original data + uint8_t history[LZMA_DELTA_DIST_MAX]; +} lzma_delta_coder; + + +extern lzma_ret lzma_delta_coder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters); + +#endif diff --git a/src/liblzma/liblzma.pc.in b/src/liblzma/liblzma.pc.in new file mode 100644 index 0000000..9fa4891 --- /dev/null +++ b/src/liblzma/liblzma.pc.in @@ -0,0 +1,19 @@ +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: liblzma +Description: General purpose data compression library +URL: @PACKAGE_URL@ +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -llzma +Libs.private: @PTHREAD_CFLAGS@ @LIBS@ diff --git a/src/liblzma/liblzma_generic.map b/src/liblzma/liblzma_generic.map new file mode 100644 index 0000000..bb82167 --- /dev/null +++ b/src/liblzma/liblzma_generic.map @@ -0,0 +1,121 @@ +XZ_5.0 { +global: + lzma_alone_decoder; + lzma_alone_encoder; + lzma_auto_decoder; + lzma_block_buffer_bound; + lzma_block_buffer_decode; + lzma_block_buffer_encode; + lzma_block_compressed_size; + lzma_block_decoder; + lzma_block_encoder; + lzma_block_header_decode; + lzma_block_header_encode; + lzma_block_header_size; + lzma_block_total_size; + lzma_block_unpadded_size; + lzma_check_is_supported; + lzma_check_size; + lzma_code; + lzma_crc32; + lzma_crc64; + lzma_easy_buffer_encode; + lzma_easy_decoder_memusage; + lzma_easy_encoder; + lzma_easy_encoder_memusage; + lzma_end; + lzma_filter_decoder_is_supported; + lzma_filter_encoder_is_supported; + lzma_filter_flags_decode; + lzma_filter_flags_encode; + lzma_filter_flags_size; + lzma_filters_copy; + lzma_filters_update; + lzma_get_check; + lzma_index_append; + lzma_index_block_count; + lzma_index_buffer_decode; + lzma_index_buffer_encode; + lzma_index_cat; + lzma_index_checks; + lzma_index_decoder; + lzma_index_dup; + lzma_index_encoder; + lzma_index_end; + lzma_index_file_size; + lzma_index_hash_append; + lzma_index_hash_decode; + lzma_index_hash_end; + lzma_index_hash_init; + lzma_index_hash_size; + lzma_index_init; + lzma_index_iter_init; + lzma_index_iter_locate; + lzma_index_iter_next; + lzma_index_iter_rewind; + lzma_index_memusage; + lzma_index_memused; + lzma_index_size; + lzma_index_stream_count; + lzma_index_stream_flags; + lzma_index_stream_padding; + lzma_index_stream_size; + lzma_index_total_size; + lzma_index_uncompressed_size; + lzma_lzma_preset; + lzma_memlimit_get; + lzma_memlimit_set; + lzma_memusage; + lzma_mf_is_supported; + lzma_mode_is_supported; + lzma_physmem; + lzma_properties_decode; + lzma_properties_encode; + lzma_properties_size; + lzma_raw_buffer_decode; + lzma_raw_buffer_encode; + lzma_raw_decoder; + lzma_raw_decoder_memusage; + lzma_raw_encoder; + lzma_raw_encoder_memusage; + lzma_stream_buffer_bound; + lzma_stream_buffer_decode; + lzma_stream_buffer_encode; + lzma_stream_decoder; + lzma_stream_encoder; + lzma_stream_flags_compare; + lzma_stream_footer_decode; + lzma_stream_footer_encode; + lzma_stream_header_decode; + lzma_stream_header_encode; + lzma_version_number; + lzma_version_string; + lzma_vli_decode; + lzma_vli_encode; + lzma_vli_size; + +local: + *; +}; + +XZ_5.2 { +global: + lzma_block_uncomp_encode; + lzma_cputhreads; + lzma_get_progress; + lzma_stream_encoder_mt; + lzma_stream_encoder_mt_memusage; +} XZ_5.0; + +XZ_5.4 { +global: + lzma_file_info_decoder; + lzma_filters_free; + lzma_lzip_decoder; + lzma_microlzma_decoder; + lzma_microlzma_encoder; + lzma_stream_decoder_mt; + lzma_str_from_filters; + lzma_str_list_filters; + lzma_str_to_filters; +} XZ_5.2; diff --git a/src/liblzma/liblzma_linux.map b/src/liblzma/liblzma_linux.map new file mode 100644 index 0000000..449f5fd --- /dev/null +++ b/src/liblzma/liblzma_linux.map @@ -0,0 +1,136 @@ +XZ_5.0 { +global: + lzma_alone_decoder; + lzma_alone_encoder; + lzma_auto_decoder; + lzma_block_buffer_bound; + lzma_block_buffer_decode; + lzma_block_buffer_encode; + lzma_block_compressed_size; + lzma_block_decoder; + lzma_block_encoder; + lzma_block_header_decode; + lzma_block_header_encode; + lzma_block_header_size; + lzma_block_total_size; + lzma_block_unpadded_size; + lzma_check_is_supported; + lzma_check_size; + lzma_code; + lzma_crc32; + lzma_crc64; + lzma_easy_buffer_encode; + lzma_easy_decoder_memusage; + lzma_easy_encoder; + lzma_easy_encoder_memusage; + lzma_end; + lzma_filter_decoder_is_supported; + lzma_filter_encoder_is_supported; + lzma_filter_flags_decode; + lzma_filter_flags_encode; + lzma_filter_flags_size; + lzma_filters_copy; + lzma_filters_update; + lzma_get_check; + lzma_index_append; + lzma_index_block_count; + lzma_index_buffer_decode; + lzma_index_buffer_encode; + lzma_index_cat; + lzma_index_checks; + lzma_index_decoder; + lzma_index_dup; + lzma_index_encoder; + lzma_index_end; + lzma_index_file_size; + lzma_index_hash_append; + lzma_index_hash_decode; + lzma_index_hash_end; + lzma_index_hash_init; + lzma_index_hash_size; + lzma_index_init; + lzma_index_iter_init; + lzma_index_iter_locate; + lzma_index_iter_next; + lzma_index_iter_rewind; + lzma_index_memusage; + lzma_index_memused; + lzma_index_size; + lzma_index_stream_count; + lzma_index_stream_flags; + lzma_index_stream_padding; + lzma_index_stream_size; + lzma_index_total_size; + lzma_index_uncompressed_size; + lzma_lzma_preset; + lzma_memlimit_get; + lzma_memlimit_set; + lzma_memusage; + lzma_mf_is_supported; + lzma_mode_is_supported; + lzma_physmem; + lzma_properties_decode; + lzma_properties_encode; + lzma_properties_size; + lzma_raw_buffer_decode; + lzma_raw_buffer_encode; + lzma_raw_decoder; + lzma_raw_decoder_memusage; + lzma_raw_encoder; + lzma_raw_encoder_memusage; + lzma_stream_buffer_bound; + lzma_stream_buffer_decode; + lzma_stream_buffer_encode; + lzma_stream_decoder; + lzma_stream_encoder; + lzma_stream_flags_compare; + lzma_stream_footer_decode; + lzma_stream_footer_encode; + lzma_stream_header_decode; + lzma_stream_header_encode; + lzma_version_number; + lzma_version_string; + lzma_vli_decode; + lzma_vli_encode; + lzma_vli_size; + +local: + *; +}; + +XZ_5.2 { +global: + lzma_block_uncomp_encode; + lzma_cputhreads; + lzma_get_progress; + lzma_stream_encoder_mt; + lzma_stream_encoder_mt_memusage; +} XZ_5.0; + +XZ_5.1.2alpha { +global: + lzma_stream_encoder_mt; + lzma_stream_encoder_mt_memusage; +} XZ_5.0; + +XZ_5.2.2 { +global: + lzma_block_uncomp_encode; + lzma_cputhreads; + lzma_get_progress; + lzma_stream_encoder_mt; + lzma_stream_encoder_mt_memusage; +} XZ_5.1.2alpha; + +XZ_5.4 { +global: + lzma_file_info_decoder; + lzma_filters_free; + lzma_lzip_decoder; + lzma_microlzma_decoder; + lzma_microlzma_encoder; + lzma_stream_decoder_mt; + lzma_str_from_filters; + lzma_str_list_filters; + lzma_str_to_filters; +} XZ_5.2; diff --git a/src/liblzma/liblzma_w32res.rc b/src/liblzma/liblzma_w32res.rc new file mode 100644 index 0000000..d4d8159 --- /dev/null +++ b/src/liblzma/liblzma_w32res.rc @@ -0,0 +1,12 @@ +/* + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#define MY_TYPE VFT_DLL +#define MY_NAME "liblzma" +#define MY_SUFFIX ".dll" +#define MY_DESC "liblzma data compression library" +#include "common_w32res.rc" diff --git a/src/liblzma/lz/lz_decoder.c b/src/liblzma/lz/lz_decoder.c new file mode 100644 index 0000000..06c95c1 --- /dev/null +++ b/src/liblzma/lz/lz_decoder.c @@ -0,0 +1,304 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_decoder.c +/// \brief LZ out window +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +// liblzma supports multiple LZ77-based filters. The LZ part is shared +// between these filters. The LZ code takes care of dictionary handling +// and passing the data between filters in the chain. The filter-specific +// part decodes from the input buffer to the dictionary. + + +#include "lz_decoder.h" + + +typedef struct { + /// Dictionary (history buffer) + lzma_dict dict; + + /// The actual LZ-based decoder e.g. LZMA + lzma_lz_decoder lz; + + /// Next filter in the chain, if any. Note that LZMA and LZMA2 are + /// only allowed as the last filter, but the long-range filter in + /// future can be in the middle of the chain. + lzma_next_coder next; + + /// True if the next filter in the chain has returned LZMA_STREAM_END. + bool next_finished; + + /// True if the LZ decoder (e.g. LZMA) has detected end of payload + /// marker. This may become true before next_finished becomes true. + bool this_finished; + + /// Temporary buffer needed when the LZ-based filter is not the last + /// filter in the chain. The output of the next filter is first + /// decoded into buffer[], which is then used as input for the actual + /// LZ-based decoder. + struct { + size_t pos; + size_t size; + uint8_t buffer[LZMA_BUFFER_SIZE]; + } temp; +} lzma_coder; + + +static void +lz_decoder_reset(lzma_coder *coder) +{ + coder->dict.pos = 0; + coder->dict.full = 0; + coder->dict.buf[coder->dict.size - 1] = '\0'; + coder->dict.need_reset = false; + return; +} + + +static lzma_ret +decode_buffer(lzma_coder *coder, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size) +{ + while (true) { + // Wrap the dictionary if needed. + if (coder->dict.pos == coder->dict.size) + coder->dict.pos = 0; + + // Store the current dictionary position. It is needed to know + // where to start copying to the out[] buffer. + const size_t dict_start = coder->dict.pos; + + // Calculate how much we allow coder->lz.code() to decode. + // It must not decode past the end of the dictionary + // buffer, and we don't want it to decode more than is + // actually needed to fill the out[] buffer. + coder->dict.limit = coder->dict.pos + + my_min(out_size - *out_pos, + coder->dict.size - coder->dict.pos); + + // Call the coder->lz.code() to do the actual decoding. + const lzma_ret ret = coder->lz.code( + coder->lz.coder, &coder->dict, + in, in_pos, in_size); + + // Copy the decoded data from the dictionary to the out[] + // buffer. Do it conditionally because out can be NULL + // (in which case copy_size is always 0). Calling memcpy() + // with a null-pointer is undefined even if the third + // argument is 0. + const size_t copy_size = coder->dict.pos - dict_start; + assert(copy_size <= out_size - *out_pos); + + if (copy_size > 0) + memcpy(out + *out_pos, coder->dict.buf + dict_start, + copy_size); + + *out_pos += copy_size; + + // Reset the dictionary if so requested by coder->lz.code(). + if (coder->dict.need_reset) { + lz_decoder_reset(coder); + + // Since we reset dictionary, we don't check if + // dictionary became full. + if (ret != LZMA_OK || *out_pos == out_size) + return ret; + } else { + // Return if everything got decoded or an error + // occurred, or if there's no more data to decode. + // + // Note that detecting if there's something to decode + // is done by looking if dictionary become full + // instead of looking if *in_pos == in_size. This + // is because it is possible that all the input was + // consumed already but some data is pending to be + // written to the dictionary. + if (ret != LZMA_OK || *out_pos == out_size + || coder->dict.pos < coder->dict.size) + return ret; + } + } +} + + +static lzma_ret +lz_decode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + lzma_action action) +{ + lzma_coder *coder = coder_ptr; + + if (coder->next.code == NULL) + return decode_buffer(coder, in, in_pos, in_size, + out, out_pos, out_size); + + // We aren't the last coder in the chain, we need to decode + // our input to a temporary buffer. + while (*out_pos < out_size) { + // Fill the temporary buffer if it is empty. + if (!coder->next_finished + && coder->temp.pos == coder->temp.size) { + coder->temp.pos = 0; + coder->temp.size = 0; + + const lzma_ret ret = coder->next.code( + coder->next.coder, + allocator, in, in_pos, in_size, + coder->temp.buffer, &coder->temp.size, + LZMA_BUFFER_SIZE, action); + + if (ret == LZMA_STREAM_END) + coder->next_finished = true; + else if (ret != LZMA_OK || coder->temp.size == 0) + return ret; + } + + if (coder->this_finished) { + if (coder->temp.size != 0) + return LZMA_DATA_ERROR; + + if (coder->next_finished) + return LZMA_STREAM_END; + + return LZMA_OK; + } + + const lzma_ret ret = decode_buffer(coder, coder->temp.buffer, + &coder->temp.pos, coder->temp.size, + out, out_pos, out_size); + + if (ret == LZMA_STREAM_END) + coder->this_finished = true; + else if (ret != LZMA_OK) + return ret; + else if (coder->next_finished && *out_pos < out_size) + return LZMA_DATA_ERROR; + } + + return LZMA_OK; +} + + +static void +lz_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_coder *coder = coder_ptr; + + lzma_next_end(&coder->next, allocator); + lzma_free(coder->dict.buf, allocator); + + if (coder->lz.end != NULL) + coder->lz.end(coder->lz.coder, allocator); + else + lzma_free(coder->lz.coder, allocator); + + lzma_free(coder, allocator); + return; +} + + +extern lzma_ret +lzma_lz_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, + lzma_ret (*lz_init)(lzma_lz_decoder *lz, + const lzma_allocator *allocator, + lzma_vli id, const void *options, + lzma_lz_options *lz_options)) +{ + // Allocate the base structure if it isn't already allocated. + lzma_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &lz_decode; + next->end = &lz_decoder_end; + + coder->dict.buf = NULL; + coder->dict.size = 0; + coder->lz = LZMA_LZ_DECODER_INIT; + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Allocate and initialize the LZ-based decoder. It will also give + // us the dictionary size. + lzma_lz_options lz_options; + return_if_error(lz_init(&coder->lz, allocator, + filters[0].id, filters[0].options, &lz_options)); + + // If the dictionary size is very small, increase it to 4096 bytes. + // This is to prevent constant wrapping of the dictionary, which + // would slow things down. The downside is that since we don't check + // separately for the real dictionary size, we may happily accept + // corrupt files. + if (lz_options.dict_size < 4096) + lz_options.dict_size = 4096; + + // Make dictionary size a multiple of 16. Some LZ-based decoders like + // LZMA use the lowest bits lzma_dict.pos to know the alignment of the + // data. Aligned buffer is also good when memcpying from the + // dictionary to the output buffer, since applications are + // recommended to give aligned buffers to liblzma. + // + // Avoid integer overflow. + if (lz_options.dict_size > SIZE_MAX - 15) + return LZMA_MEM_ERROR; + + lz_options.dict_size = (lz_options.dict_size + 15) & ~((size_t)(15)); + + // Allocate and initialize the dictionary. + if (coder->dict.size != lz_options.dict_size) { + lzma_free(coder->dict.buf, allocator); + coder->dict.buf + = lzma_alloc(lz_options.dict_size, allocator); + if (coder->dict.buf == NULL) + return LZMA_MEM_ERROR; + + coder->dict.size = lz_options.dict_size; + } + + lz_decoder_reset(next->coder); + + // Use the preset dictionary if it was given to us. + if (lz_options.preset_dict != NULL + && lz_options.preset_dict_size > 0) { + // If the preset dictionary is bigger than the actual + // dictionary, copy only the tail. + const size_t copy_size = my_min(lz_options.preset_dict_size, + lz_options.dict_size); + const size_t offset = lz_options.preset_dict_size - copy_size; + memcpy(coder->dict.buf, lz_options.preset_dict + offset, + copy_size); + coder->dict.pos = copy_size; + coder->dict.full = copy_size; + } + + // Miscellaneous initializations + coder->next_finished = false; + coder->this_finished = false; + coder->temp.pos = 0; + coder->temp.size = 0; + + // Initialize the next filter in the chain, if any. + return lzma_next_filter_init(&coder->next, allocator, filters + 1); +} + + +extern uint64_t +lzma_lz_decoder_memusage(size_t dictionary_size) +{ + return sizeof(lzma_coder) + (uint64_t)(dictionary_size); +} diff --git a/src/liblzma/lz/lz_decoder.h b/src/liblzma/lz/lz_decoder.h new file mode 100644 index 0000000..ad80d4d --- /dev/null +++ b/src/liblzma/lz/lz_decoder.h @@ -0,0 +1,234 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_decoder.h +/// \brief LZ out window +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZ_DECODER_H +#define LZMA_LZ_DECODER_H + +#include "common.h" + + +typedef struct { + /// Pointer to the dictionary buffer. It can be an allocated buffer + /// internal to liblzma, or it can a be a buffer given by the + /// application when in single-call mode (not implemented yet). + uint8_t *buf; + + /// Write position in dictionary. The next byte will be written to + /// buf[pos]. + size_t pos; + + /// Indicates how full the dictionary is. This is used by + /// dict_is_distance_valid() to detect corrupt files that would + /// read beyond the beginning of the dictionary. + size_t full; + + /// Write limit + size_t limit; + + /// Size of the dictionary + size_t size; + + /// True when dictionary should be reset before decoding more data. + bool need_reset; + +} lzma_dict; + + +typedef struct { + size_t dict_size; + const uint8_t *preset_dict; + size_t preset_dict_size; +} lzma_lz_options; + + +typedef struct { + /// Data specific to the LZ-based decoder + void *coder; + + /// Function to decode from in[] to *dict + lzma_ret (*code)(void *coder, + lzma_dict *restrict dict, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size); + + void (*reset)(void *coder, const void *options); + + /// Set the uncompressed size. If uncompressed_size == LZMA_VLI_UNKNOWN + /// then allow_eopm will always be true. + void (*set_uncompressed)(void *coder, lzma_vli uncompressed_size, + bool allow_eopm); + + /// Free allocated resources + void (*end)(void *coder, const lzma_allocator *allocator); + +} lzma_lz_decoder; + + +#define LZMA_LZ_DECODER_INIT \ + (lzma_lz_decoder){ \ + .coder = NULL, \ + .code = NULL, \ + .reset = NULL, \ + .set_uncompressed = NULL, \ + .end = NULL, \ + } + + +extern lzma_ret lzma_lz_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters, + lzma_ret (*lz_init)(lzma_lz_decoder *lz, + const lzma_allocator *allocator, + lzma_vli id, const void *options, + lzma_lz_options *lz_options)); + +extern uint64_t lzma_lz_decoder_memusage(size_t dictionary_size); + + +////////////////////// +// Inline functions // +////////////////////// + +/// Get a byte from the history buffer. +static inline uint8_t +dict_get(const lzma_dict *const dict, const uint32_t distance) +{ + return dict->buf[dict->pos - distance - 1 + + (distance < dict->pos ? 0 : dict->size)]; +} + + +/// Test if dictionary is empty. +static inline bool +dict_is_empty(const lzma_dict *const dict) +{ + return dict->full == 0; +} + + +/// Validate the match distance +static inline bool +dict_is_distance_valid(const lzma_dict *const dict, const size_t distance) +{ + return dict->full > distance; +} + + +/// Repeat *len bytes at distance. +static inline bool +dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len) +{ + // Don't write past the end of the dictionary. + const size_t dict_avail = dict->limit - dict->pos; + uint32_t left = my_min(dict_avail, *len); + *len -= left; + + // Repeat a block of data from the history. Because memcpy() is faster + // than copying byte by byte in a loop, the copying process gets split + // into three cases. + if (distance < left) { + // Source and target areas overlap, thus we can't use + // memcpy() nor even memmove() safely. + do { + dict->buf[dict->pos] = dict_get(dict, distance); + ++dict->pos; + } while (--left > 0); + + } else if (distance < dict->pos) { + // The easiest and fastest case + memcpy(dict->buf + dict->pos, + dict->buf + dict->pos - distance - 1, + left); + dict->pos += left; + + } else { + // The bigger the dictionary, the more rare this + // case occurs. We need to "wrap" the dict, thus + // we might need two memcpy() to copy all the data. + assert(dict->full == dict->size); + const uint32_t copy_pos + = dict->pos - distance - 1 + dict->size; + uint32_t copy_size = dict->size - copy_pos; + + if (copy_size < left) { + memmove(dict->buf + dict->pos, dict->buf + copy_pos, + copy_size); + dict->pos += copy_size; + copy_size = left - copy_size; + memcpy(dict->buf + dict->pos, dict->buf, copy_size); + dict->pos += copy_size; + } else { + memmove(dict->buf + dict->pos, dict->buf + copy_pos, + left); + dict->pos += left; + } + } + + // Update how full the dictionary is. + if (dict->full < dict->pos) + dict->full = dict->pos; + + return unlikely(*len != 0); +} + + +/// Puts one byte into the dictionary. Returns true if the dictionary was +/// already full and the byte couldn't be added. +static inline bool +dict_put(lzma_dict *dict, uint8_t byte) +{ + if (unlikely(dict->pos == dict->limit)) + return true; + + dict->buf[dict->pos++] = byte; + + if (dict->pos > dict->full) + dict->full = dict->pos; + + return false; +} + + +/// Copies arbitrary amount of data into the dictionary. +static inline void +dict_write(lzma_dict *restrict dict, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size, + size_t *restrict left) +{ + // NOTE: If we are being given more data than the size of the + // dictionary, it could be possible to optimize the LZ decoder + // so that not everything needs to go through the dictionary. + // This shouldn't be very common thing in practice though, and + // the slowdown of one extra memcpy() isn't bad compared to how + // much time it would have taken if the data were compressed. + + if (in_size - *in_pos > *left) + in_size = *in_pos + *left; + + *left -= lzma_bufcpy(in, in_pos, in_size, + dict->buf, &dict->pos, dict->limit); + + if (dict->pos > dict->full) + dict->full = dict->pos; + + return; +} + + +static inline void +dict_reset(lzma_dict *dict) +{ + dict->need_reset = true; + return; +} + +#endif diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c new file mode 100644 index 0000000..5489085 --- /dev/null +++ b/src/liblzma/lz/lz_encoder.c @@ -0,0 +1,633 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_encoder.c +/// \brief LZ in window +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lz_encoder.h" +#include "lz_encoder_hash.h" + +// See lz_encoder_hash.h. This is a bit hackish but avoids making +// endianness a conditional in makefiles. +#if defined(WORDS_BIGENDIAN) && !defined(HAVE_SMALL) +# include "lz_encoder_hash_table.h" +#endif + +#include "memcmplen.h" + + +typedef struct { + /// LZ-based encoder e.g. LZMA + lzma_lz_encoder lz; + + /// History buffer and match finder + lzma_mf mf; + + /// Next coder in the chain + lzma_next_coder next; +} lzma_coder; + + +/// \brief Moves the data in the input window to free space for new data +/// +/// mf->buffer is a sliding input window, which keeps mf->keep_size_before +/// bytes of input history available all the time. Now and then we need to +/// "slide" the buffer to make space for the new data to the end of the +/// buffer. At the same time, data older than keep_size_before is dropped. +/// +static void +move_window(lzma_mf *mf) +{ + // Align the move to a multiple of 16 bytes. Some LZ-based encoders + // like LZMA use the lowest bits of mf->read_pos to know the + // alignment of the uncompressed data. We also get better speed + // for memmove() with aligned buffers. + assert(mf->read_pos > mf->keep_size_before); + const uint32_t move_offset + = (mf->read_pos - mf->keep_size_before) & ~UINT32_C(15); + + assert(mf->write_pos > move_offset); + const size_t move_size = mf->write_pos - move_offset; + + assert(move_offset + move_size <= mf->size); + + memmove(mf->buffer, mf->buffer + move_offset, move_size); + + mf->offset += move_offset; + mf->read_pos -= move_offset; + mf->read_limit -= move_offset; + mf->write_pos -= move_offset; + + return; +} + + +/// \brief Tries to fill the input window (mf->buffer) +/// +/// If we are the last encoder in the chain, our input data is in in[]. +/// Otherwise we call the next filter in the chain to process in[] and +/// write its output to mf->buffer. +/// +/// This function must not be called once it has returned LZMA_STREAM_END. +/// +static lzma_ret +fill_window(lzma_coder *coder, const lzma_allocator *allocator, + const uint8_t *in, size_t *in_pos, size_t in_size, + lzma_action action) +{ + assert(coder->mf.read_pos <= coder->mf.write_pos); + + // Move the sliding window if needed. + if (coder->mf.read_pos >= coder->mf.size - coder->mf.keep_size_after) + move_window(&coder->mf); + + // Maybe this is ugly, but lzma_mf uses uint32_t for most things + // (which I find cleanest), but we need size_t here when filling + // the history window. + size_t write_pos = coder->mf.write_pos; + lzma_ret ret; + if (coder->next.code == NULL) { + // Not using a filter, simply memcpy() as much as possible. + lzma_bufcpy(in, in_pos, in_size, coder->mf.buffer, + &write_pos, coder->mf.size); + + ret = action != LZMA_RUN && *in_pos == in_size + ? LZMA_STREAM_END : LZMA_OK; + + } else { + ret = coder->next.code(coder->next.coder, allocator, + in, in_pos, in_size, + coder->mf.buffer, &write_pos, + coder->mf.size, action); + } + + coder->mf.write_pos = write_pos; + + // Silence Valgrind. lzma_memcmplen() can read extra bytes + // and Valgrind will give warnings if those bytes are uninitialized + // because Valgrind cannot see that the values of the uninitialized + // bytes are eventually ignored. + memzero(coder->mf.buffer + write_pos, LZMA_MEMCMPLEN_EXTRA); + + // If end of stream has been reached or flushing completed, we allow + // the encoder to process all the input (that is, read_pos is allowed + // to reach write_pos). Otherwise we keep keep_size_after bytes + // available as prebuffer. + if (ret == LZMA_STREAM_END) { + assert(*in_pos == in_size); + ret = LZMA_OK; + coder->mf.action = action; + coder->mf.read_limit = coder->mf.write_pos; + + } else if (coder->mf.write_pos > coder->mf.keep_size_after) { + // This needs to be done conditionally, because if we got + // only little new input, there may be too little input + // to do any encoding yet. + coder->mf.read_limit = coder->mf.write_pos + - coder->mf.keep_size_after; + } + + // Restart the match finder after finished LZMA_SYNC_FLUSH. + if (coder->mf.pending > 0 + && coder->mf.read_pos < coder->mf.read_limit) { + // Match finder may update coder->pending and expects it to + // start from zero, so use a temporary variable. + const uint32_t pending = coder->mf.pending; + coder->mf.pending = 0; + + // Rewind read_pos so that the match finder can hash + // the pending bytes. + assert(coder->mf.read_pos >= pending); + coder->mf.read_pos -= pending; + + // Call the skip function directly instead of using + // mf_skip(), since we don't want to touch mf->read_ahead. + coder->mf.skip(&coder->mf, pending); + } + + return ret; +} + + +static lzma_ret +lz_encode(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, lzma_action action) +{ + lzma_coder *coder = coder_ptr; + + while (*out_pos < out_size + && (*in_pos < in_size || action != LZMA_RUN)) { + // Read more data to coder->mf.buffer if needed. + if (coder->mf.action == LZMA_RUN && coder->mf.read_pos + >= coder->mf.read_limit) + return_if_error(fill_window(coder, allocator, + in, in_pos, in_size, action)); + + // Encode + const lzma_ret ret = coder->lz.code(coder->lz.coder, + &coder->mf, out, out_pos, out_size); + if (ret != LZMA_OK) { + // Setting this to LZMA_RUN for cases when we are + // flushing. It doesn't matter when finishing or if + // an error occurred. + coder->mf.action = LZMA_RUN; + return ret; + } + } + + return LZMA_OK; +} + + +static bool +lz_encoder_prepare(lzma_mf *mf, const lzma_allocator *allocator, + const lzma_lz_options *lz_options) +{ + // For now, the dictionary size is limited to 1.5 GiB. This may grow + // in the future if needed, but it needs a little more work than just + // changing this check. + if (lz_options->dict_size < LZMA_DICT_SIZE_MIN + || lz_options->dict_size + > (UINT32_C(1) << 30) + (UINT32_C(1) << 29) + || lz_options->nice_len > lz_options->match_len_max) + return true; + + mf->keep_size_before = lz_options->before_size + lz_options->dict_size; + + mf->keep_size_after = lz_options->after_size + + lz_options->match_len_max; + + // To avoid constant memmove()s, allocate some extra space. Since + // memmove()s become more expensive when the size of the buffer + // increases, we reserve more space when a large dictionary is + // used to make the memmove() calls rarer. + // + // This works with dictionaries up to about 3 GiB. If bigger + // dictionary is wanted, some extra work is needed: + // - Several variables in lzma_mf have to be changed from uint32_t + // to size_t. + // - Memory usage calculation needs something too, e.g. use uint64_t + // for mf->size. + uint32_t reserve = lz_options->dict_size / 2; + if (reserve > (UINT32_C(1) << 30)) + reserve /= 2; + + reserve += (lz_options->before_size + lz_options->match_len_max + + lz_options->after_size) / 2 + (UINT32_C(1) << 19); + + const uint32_t old_size = mf->size; + mf->size = mf->keep_size_before + reserve + mf->keep_size_after; + + // Deallocate the old history buffer if it exists but has different + // size than what is needed now. + if (mf->buffer != NULL && old_size != mf->size) { + lzma_free(mf->buffer, allocator); + mf->buffer = NULL; + } + + // Match finder options + mf->match_len_max = lz_options->match_len_max; + mf->nice_len = lz_options->nice_len; + + // cyclic_size has to stay smaller than 2 Gi. Note that this doesn't + // mean limiting dictionary size to less than 2 GiB. With a match + // finder that uses multibyte resolution (hashes start at e.g. every + // fourth byte), cyclic_size would stay below 2 Gi even when + // dictionary size is greater than 2 GiB. + // + // It would be possible to allow cyclic_size >= 2 Gi, but then we + // would need to be careful to use 64-bit types in various places + // (size_t could do since we would need bigger than 32-bit address + // space anyway). It would also require either zeroing a multigigabyte + // buffer at initialization (waste of time and RAM) or allow + // normalization in lz_encoder_mf.c to access uninitialized + // memory to keep the code simpler. The current way is simple and + // still allows pretty big dictionaries, so I don't expect these + // limits to change. + mf->cyclic_size = lz_options->dict_size + 1; + + // Validate the match finder ID and setup the function pointers. + switch (lz_options->match_finder) { +#ifdef HAVE_MF_HC3 + case LZMA_MF_HC3: + mf->find = &lzma_mf_hc3_find; + mf->skip = &lzma_mf_hc3_skip; + break; +#endif +#ifdef HAVE_MF_HC4 + case LZMA_MF_HC4: + mf->find = &lzma_mf_hc4_find; + mf->skip = &lzma_mf_hc4_skip; + break; +#endif +#ifdef HAVE_MF_BT2 + case LZMA_MF_BT2: + mf->find = &lzma_mf_bt2_find; + mf->skip = &lzma_mf_bt2_skip; + break; +#endif +#ifdef HAVE_MF_BT3 + case LZMA_MF_BT3: + mf->find = &lzma_mf_bt3_find; + mf->skip = &lzma_mf_bt3_skip; + break; +#endif +#ifdef HAVE_MF_BT4 + case LZMA_MF_BT4: + mf->find = &lzma_mf_bt4_find; + mf->skip = &lzma_mf_bt4_skip; + break; +#endif + + default: + return true; + } + + // Calculate the sizes of mf->hash and mf->son. + // + // NOTE: Since 5.3.5beta the LZMA encoder ensures that nice_len + // is big enough for the selected match finder. This makes it + // easier for applications as nice_len = 2 will always be accepted + // even though the effective value can be slightly bigger. + const uint32_t hash_bytes + = mf_get_hash_bytes(lz_options->match_finder); + assert(hash_bytes <= mf->nice_len); + + const bool is_bt = (lz_options->match_finder & 0x10) != 0; + uint32_t hs; + + if (hash_bytes == 2) { + hs = 0xFFFF; + } else { + // Round dictionary size up to the next 2^n - 1 so it can + // be used as a hash mask. + hs = lz_options->dict_size - 1; + hs |= hs >> 1; + hs |= hs >> 2; + hs |= hs >> 4; + hs |= hs >> 8; + hs >>= 1; + hs |= 0xFFFF; + + if (hs > (UINT32_C(1) << 24)) { + if (hash_bytes == 3) + hs = (UINT32_C(1) << 24) - 1; + else + hs >>= 1; + } + } + + mf->hash_mask = hs; + + ++hs; + if (hash_bytes > 2) + hs += HASH_2_SIZE; + if (hash_bytes > 3) + hs += HASH_3_SIZE; +/* + No match finder uses this at the moment. + if (mf->hash_bytes > 4) + hs += HASH_4_SIZE; +*/ + + const uint32_t old_hash_count = mf->hash_count; + const uint32_t old_sons_count = mf->sons_count; + mf->hash_count = hs; + mf->sons_count = mf->cyclic_size; + if (is_bt) + mf->sons_count *= 2; + + // Deallocate the old hash array if it exists and has different size + // than what is needed now. + if (old_hash_count != mf->hash_count + || old_sons_count != mf->sons_count) { + lzma_free(mf->hash, allocator); + mf->hash = NULL; + + lzma_free(mf->son, allocator); + mf->son = NULL; + } + + // Maximum number of match finder cycles + mf->depth = lz_options->depth; + if (mf->depth == 0) { + if (is_bt) + mf->depth = 16 + mf->nice_len / 2; + else + mf->depth = 4 + mf->nice_len / 4; + } + + return false; +} + + +static bool +lz_encoder_init(lzma_mf *mf, const lzma_allocator *allocator, + const lzma_lz_options *lz_options) +{ + // Allocate the history buffer. + if (mf->buffer == NULL) { + // lzma_memcmplen() is used for the dictionary buffer + // so we need to allocate a few extra bytes to prevent + // it from reading past the end of the buffer. + mf->buffer = lzma_alloc(mf->size + LZMA_MEMCMPLEN_EXTRA, + allocator); + if (mf->buffer == NULL) + return true; + + // Keep Valgrind happy with lzma_memcmplen() and initialize + // the extra bytes whose value may get read but which will + // effectively get ignored. + memzero(mf->buffer + mf->size, LZMA_MEMCMPLEN_EXTRA); + } + + // Use cyclic_size as initial mf->offset. This allows + // avoiding a few branches in the match finders. The downside is + // that match finder needs to be normalized more often, which may + // hurt performance with huge dictionaries. + mf->offset = mf->cyclic_size; + mf->read_pos = 0; + mf->read_ahead = 0; + mf->read_limit = 0; + mf->write_pos = 0; + mf->pending = 0; + +#if UINT32_MAX >= SIZE_MAX / 4 + // Check for integer overflow. (Huge dictionaries are not + // possible on 32-bit CPU.) + if (mf->hash_count > SIZE_MAX / sizeof(uint32_t) + || mf->sons_count > SIZE_MAX / sizeof(uint32_t)) + return true; +#endif + + // Allocate and initialize the hash table. Since EMPTY_HASH_VALUE + // is zero, we can use lzma_alloc_zero() or memzero() for mf->hash. + // + // We don't need to initialize mf->son, but not doing that may + // make Valgrind complain in normalization (see normalize() in + // lz_encoder_mf.c). Skipping the initialization is *very* good + // when big dictionary is used but only small amount of data gets + // actually compressed: most of the mf->son won't get actually + // allocated by the kernel, so we avoid wasting RAM and improve + // initialization speed a lot. + if (mf->hash == NULL) { + mf->hash = lzma_alloc_zero(mf->hash_count * sizeof(uint32_t), + allocator); + mf->son = lzma_alloc(mf->sons_count * sizeof(uint32_t), + allocator); + + if (mf->hash == NULL || mf->son == NULL) { + lzma_free(mf->hash, allocator); + mf->hash = NULL; + + lzma_free(mf->son, allocator); + mf->son = NULL; + + return true; + } + } else { +/* + for (uint32_t i = 0; i < mf->hash_count; ++i) + mf->hash[i] = EMPTY_HASH_VALUE; +*/ + memzero(mf->hash, mf->hash_count * sizeof(uint32_t)); + } + + mf->cyclic_pos = 0; + + // Handle preset dictionary. + if (lz_options->preset_dict != NULL + && lz_options->preset_dict_size > 0) { + // If the preset dictionary is bigger than the actual + // dictionary, use only the tail. + mf->write_pos = my_min(lz_options->preset_dict_size, mf->size); + memcpy(mf->buffer, lz_options->preset_dict + + lz_options->preset_dict_size - mf->write_pos, + mf->write_pos); + mf->action = LZMA_SYNC_FLUSH; + mf->skip(mf, mf->write_pos); + } + + mf->action = LZMA_RUN; + + return false; +} + + +extern uint64_t +lzma_lz_encoder_memusage(const lzma_lz_options *lz_options) +{ + // Old buffers must not exist when calling lz_encoder_prepare(). + lzma_mf mf = { + .buffer = NULL, + .hash = NULL, + .son = NULL, + .hash_count = 0, + .sons_count = 0, + }; + + // Setup the size information into mf. + if (lz_encoder_prepare(&mf, NULL, lz_options)) + return UINT64_MAX; + + // Calculate the memory usage. + return ((uint64_t)(mf.hash_count) + mf.sons_count) * sizeof(uint32_t) + + mf.size + sizeof(lzma_coder); +} + + +static void +lz_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_coder *coder = coder_ptr; + + lzma_next_end(&coder->next, allocator); + + lzma_free(coder->mf.son, allocator); + lzma_free(coder->mf.hash, allocator); + lzma_free(coder->mf.buffer, allocator); + + if (coder->lz.end != NULL) + coder->lz.end(coder->lz.coder, allocator); + else + lzma_free(coder->lz.coder, allocator); + + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +lz_encoder_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters_null lzma_attribute((__unused__)), + const lzma_filter *reversed_filters) +{ + lzma_coder *coder = coder_ptr; + + if (coder->lz.options_update == NULL) + return LZMA_PROG_ERROR; + + return_if_error(coder->lz.options_update( + coder->lz.coder, reversed_filters)); + + return lzma_next_filter_update( + &coder->next, allocator, reversed_filters + 1); +} + + +static lzma_ret +lz_encoder_set_out_limit(void *coder_ptr, uint64_t *uncomp_size, + uint64_t out_limit) +{ + lzma_coder *coder = coder_ptr; + + // This is supported only if there are no other filters chained. + if (coder->next.code == NULL && coder->lz.set_out_limit != NULL) + return coder->lz.set_out_limit( + coder->lz.coder, uncomp_size, out_limit); + + return LZMA_OPTIONS_ERROR; +} + + +extern lzma_ret +lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, + lzma_ret (*lz_init)(lzma_lz_encoder *lz, + const lzma_allocator *allocator, + lzma_vli id, const void *options, + lzma_lz_options *lz_options)) +{ +#if defined(HAVE_SMALL) && !defined(HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR) + // We need that the CRC32 table has been initialized. + lzma_crc32_init(); +#endif + + // Allocate and initialize the base data structure. + lzma_coder *coder = next->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &lz_encode; + next->end = &lz_encoder_end; + next->update = &lz_encoder_update; + next->set_out_limit = &lz_encoder_set_out_limit; + + coder->lz.coder = NULL; + coder->lz.code = NULL; + coder->lz.end = NULL; + + // mf.size is initialized to silence Valgrind + // when used on optimized binaries (GCC may reorder + // code in a way that Valgrind gets unhappy). + coder->mf.buffer = NULL; + coder->mf.size = 0; + coder->mf.hash = NULL; + coder->mf.son = NULL; + coder->mf.hash_count = 0; + coder->mf.sons_count = 0; + + coder->next = LZMA_NEXT_CODER_INIT; + } + + // Initialize the LZ-based encoder. + lzma_lz_options lz_options; + return_if_error(lz_init(&coder->lz, allocator, + filters[0].id, filters[0].options, &lz_options)); + + // Setup the size information into coder->mf and deallocate + // old buffers if they have wrong size. + if (lz_encoder_prepare(&coder->mf, allocator, &lz_options)) + return LZMA_OPTIONS_ERROR; + + // Allocate new buffers if needed, and do the rest of + // the initialization. + if (lz_encoder_init(&coder->mf, allocator, &lz_options)) + return LZMA_MEM_ERROR; + + // Initialize the next filter in the chain, if any. + return lzma_next_filter_init(&coder->next, allocator, filters + 1); +} + + +extern LZMA_API(lzma_bool) +lzma_mf_is_supported(lzma_match_finder mf) +{ + switch (mf) { +#ifdef HAVE_MF_HC3 + case LZMA_MF_HC3: + return true; +#endif +#ifdef HAVE_MF_HC4 + case LZMA_MF_HC4: + return true; +#endif +#ifdef HAVE_MF_BT2 + case LZMA_MF_BT2: + return true; +#endif +#ifdef HAVE_MF_BT3 + case LZMA_MF_BT3: + return true; +#endif +#ifdef HAVE_MF_BT4 + case LZMA_MF_BT4: + return true; +#endif + default: + return false; + } +} diff --git a/src/liblzma/lz/lz_encoder.h b/src/liblzma/lz/lz_encoder.h new file mode 100644 index 0000000..7950a2f --- /dev/null +++ b/src/liblzma/lz/lz_encoder.h @@ -0,0 +1,341 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_encoder.h +/// \brief LZ in window and match finder API +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZ_ENCODER_H +#define LZMA_LZ_ENCODER_H + +#include "common.h" + + +/// A table of these is used by the LZ-based encoder to hold +/// the length-distance pairs found by the match finder. +typedef struct { + uint32_t len; + uint32_t dist; +} lzma_match; + + +typedef struct lzma_mf_s lzma_mf; +struct lzma_mf_s { + /////////////// + // In Window // + /////////////// + + /// Pointer to buffer with data to be compressed + uint8_t *buffer; + + /// Total size of the allocated buffer (that is, including all + /// the extra space) + uint32_t size; + + /// Number of bytes that must be kept available in our input history. + /// That is, once keep_size_before bytes have been processed, + /// buffer[read_pos - keep_size_before] is the oldest byte that + /// must be available for reading. + uint32_t keep_size_before; + + /// Number of bytes that must be kept in buffer after read_pos. + /// That is, read_pos <= write_pos - keep_size_after as long as + /// action is LZMA_RUN; when action != LZMA_RUN, read_pos is allowed + /// to reach write_pos so that the last bytes get encoded too. + uint32_t keep_size_after; + + /// Match finders store locations of matches using 32-bit integers. + /// To avoid adjusting several megabytes of integers every time the + /// input window is moved with move_window, we only adjust the + /// offset of the buffer. Thus, buffer[value_in_hash_table - offset] + /// is the byte pointed by value_in_hash_table. + uint32_t offset; + + /// buffer[read_pos] is the next byte to run through the match + /// finder. This is incremented in the match finder once the byte + /// has been processed. + uint32_t read_pos; + + /// Number of bytes that have been ran through the match finder, but + /// which haven't been encoded by the LZ-based encoder yet. + uint32_t read_ahead; + + /// As long as read_pos is less than read_limit, there is enough + /// input available in buffer for at least one encoding loop. + /// + /// Because of the stateful API, read_limit may and will get greater + /// than read_pos quite often. This is taken into account when + /// calculating the value for keep_size_after. + uint32_t read_limit; + + /// buffer[write_pos] is the first byte that doesn't contain valid + /// uncompressed data; that is, the next input byte will be copied + /// to buffer[write_pos]. + uint32_t write_pos; + + /// Number of bytes not hashed before read_pos. This is needed to + /// restart the match finder after LZMA_SYNC_FLUSH. + uint32_t pending; + + ////////////////// + // Match Finder // + ////////////////// + + /// Find matches. Returns the number of distance-length pairs written + /// to the matches array. This is called only via lzma_mf_find(). + uint32_t (*find)(lzma_mf *mf, lzma_match *matches); + + /// Skips num bytes. This is like find() but doesn't make the + /// distance-length pairs available, thus being a little faster. + /// This is called only via mf_skip(). + void (*skip)(lzma_mf *mf, uint32_t num); + + uint32_t *hash; + uint32_t *son; + uint32_t cyclic_pos; + uint32_t cyclic_size; // Must be dictionary size + 1. + uint32_t hash_mask; + + /// Maximum number of loops in the match finder + uint32_t depth; + + /// Maximum length of a match that the match finder will try to find. + uint32_t nice_len; + + /// Maximum length of a match supported by the LZ-based encoder. + /// If the longest match found by the match finder is nice_len, + /// mf_find() tries to expand it up to match_len_max bytes. + uint32_t match_len_max; + + /// When running out of input, binary tree match finders need to know + /// if it is due to flushing or finishing. The action is used also + /// by the LZ-based encoders themselves. + lzma_action action; + + /// Number of elements in hash[] + uint32_t hash_count; + + /// Number of elements in son[] + uint32_t sons_count; +}; + + +typedef struct { + /// Extra amount of data to keep available before the "actual" + /// dictionary. + size_t before_size; + + /// Size of the history buffer + size_t dict_size; + + /// Extra amount of data to keep available after the "actual" + /// dictionary. + size_t after_size; + + /// Maximum length of a match that the LZ-based encoder can accept. + /// This is used to extend matches of length nice_len to the + /// maximum possible length. + size_t match_len_max; + + /// Match finder will search matches up to this length. + /// This must be less than or equal to match_len_max. + size_t nice_len; + + /// Type of the match finder to use + lzma_match_finder match_finder; + + /// Maximum search depth + uint32_t depth; + + /// TODO: Comment + const uint8_t *preset_dict; + + uint32_t preset_dict_size; + +} lzma_lz_options; + + +// The total usable buffer space at any moment outside the match finder: +// before_size + dict_size + after_size + match_len_max +// +// In reality, there's some extra space allocated to prevent the number of +// memmove() calls reasonable. The bigger the dict_size is, the bigger +// this extra buffer will be since with bigger dictionaries memmove() would +// also take longer. +// +// A single encoder loop in the LZ-based encoder may call the match finder +// (mf_find() or mf_skip()) at most after_size times. In other words, +// a single encoder loop may increment lzma_mf.read_pos at most after_size +// times. Since matches are looked up to +// lzma_mf.buffer[lzma_mf.read_pos + match_len_max - 1], the total +// amount of extra buffer needed after dict_size becomes +// after_size + match_len_max. +// +// before_size has two uses. The first one is to keep literals available +// in cases when the LZ-based encoder has made some read ahead. +// TODO: Maybe this could be changed by making the LZ-based encoders to +// store the actual literals as they do with length-distance pairs. +// +// Algorithms such as LZMA2 first try to compress a chunk, and then check +// if the encoded result is smaller than the uncompressed one. If the chunk +// was uncompressible, it is better to store it in uncompressed form in +// the output stream. To do this, the whole uncompressed chunk has to be +// still available in the history buffer. before_size achieves that. + + +typedef struct { + /// Data specific to the LZ-based encoder + void *coder; + + /// Function to encode from *dict to out[] + lzma_ret (*code)(void *coder, + lzma_mf *restrict mf, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size); + + /// Free allocated resources + void (*end)(void *coder, const lzma_allocator *allocator); + + /// Update the options in the middle of the encoding. + lzma_ret (*options_update)(void *coder, const lzma_filter *filter); + + /// Set maximum allowed output size + lzma_ret (*set_out_limit)(void *coder, uint64_t *uncomp_size, + uint64_t out_limit); + +} lzma_lz_encoder; + + +// Basic steps: +// 1. Input gets copied into the dictionary. +// 2. Data in dictionary gets run through the match finder byte by byte. +// 3. The literals and matches are encoded using e.g. LZMA. +// +// The bytes that have been ran through the match finder, but not encoded yet, +// are called `read ahead'. + + +/// Get how many bytes the match finder hashes in its initial step. +/// This is also the minimum nice_len value with the match finder. +static inline uint32_t +mf_get_hash_bytes(lzma_match_finder match_finder) +{ + return (uint32_t)match_finder & 0x0F; +} + + +/// Get pointer to the first byte not ran through the match finder +static inline const uint8_t * +mf_ptr(const lzma_mf *mf) +{ + return mf->buffer + mf->read_pos; +} + + +/// Get the number of bytes that haven't been ran through the match finder yet. +static inline uint32_t +mf_avail(const lzma_mf *mf) +{ + return mf->write_pos - mf->read_pos; +} + + +/// Get the number of bytes that haven't been encoded yet (some of these +/// bytes may have been ran through the match finder though). +static inline uint32_t +mf_unencoded(const lzma_mf *mf) +{ + return mf->write_pos - mf->read_pos + mf->read_ahead; +} + + +/// Calculate the absolute offset from the beginning of the most recent +/// dictionary reset. Only the lowest four bits are important, so there's no +/// problem that we don't know the 64-bit size of the data encoded so far. +/// +/// NOTE: When moving the input window, we need to do it so that the lowest +/// bits of dict->read_pos are not modified to keep this macro working +/// as intended. +static inline uint32_t +mf_position(const lzma_mf *mf) +{ + return mf->read_pos - mf->read_ahead; +} + + +/// Since everything else begins with mf_, use it also for lzma_mf_find(). +#define mf_find lzma_mf_find + + +/// Skip the given number of bytes. This is used when a good match was found. +/// For example, if mf_find() finds a match of 200 bytes long, the first byte +/// of that match was already consumed by mf_find(), and the rest 199 bytes +/// have to be skipped with mf_skip(mf, 199). +static inline void +mf_skip(lzma_mf *mf, uint32_t amount) +{ + if (amount != 0) { + mf->skip(mf, amount); + mf->read_ahead += amount; + } +} + + +/// Copies at most *left number of bytes from the history buffer +/// to out[]. This is needed by LZMA2 to encode uncompressed chunks. +static inline void +mf_read(lzma_mf *mf, uint8_t *out, size_t *out_pos, size_t out_size, + size_t *left) +{ + const size_t out_avail = out_size - *out_pos; + const size_t copy_size = my_min(out_avail, *left); + + assert(mf->read_ahead == 0); + assert(mf->read_pos >= *left); + + memcpy(out + *out_pos, mf->buffer + mf->read_pos - *left, + copy_size); + + *out_pos += copy_size; + *left -= copy_size; + return; +} + + +extern lzma_ret lzma_lz_encoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, + lzma_ret (*lz_init)(lzma_lz_encoder *lz, + const lzma_allocator *allocator, + lzma_vli id, const void *options, + lzma_lz_options *lz_options)); + + +extern uint64_t lzma_lz_encoder_memusage(const lzma_lz_options *lz_options); + + +// These are only for LZ encoder's internal use. +extern uint32_t lzma_mf_find( + lzma_mf *mf, uint32_t *count, lzma_match *matches); + +extern uint32_t lzma_mf_hc3_find(lzma_mf *dict, lzma_match *matches); +extern void lzma_mf_hc3_skip(lzma_mf *dict, uint32_t amount); + +extern uint32_t lzma_mf_hc4_find(lzma_mf *dict, lzma_match *matches); +extern void lzma_mf_hc4_skip(lzma_mf *dict, uint32_t amount); + +extern uint32_t lzma_mf_bt2_find(lzma_mf *dict, lzma_match *matches); +extern void lzma_mf_bt2_skip(lzma_mf *dict, uint32_t amount); + +extern uint32_t lzma_mf_bt3_find(lzma_mf *dict, lzma_match *matches); +extern void lzma_mf_bt3_skip(lzma_mf *dict, uint32_t amount); + +extern uint32_t lzma_mf_bt4_find(lzma_mf *dict, lzma_match *matches); +extern void lzma_mf_bt4_skip(lzma_mf *dict, uint32_t amount); + +#endif diff --git a/src/liblzma/lz/lz_encoder_hash.h b/src/liblzma/lz/lz_encoder_hash.h new file mode 100644 index 0000000..fb15c58 --- /dev/null +++ b/src/liblzma/lz/lz_encoder_hash.h @@ -0,0 +1,108 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_encoder_hash.h +/// \brief Hash macros for match finders +// +// Author: Igor Pavlov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZ_ENCODER_HASH_H +#define LZMA_LZ_ENCODER_HASH_H + +#if defined(WORDS_BIGENDIAN) && !defined(HAVE_SMALL) + // This is to make liblzma produce the same output on big endian + // systems that it does on little endian systems. lz_encoder.c + // takes care of including the actual table. + extern const uint32_t lzma_lz_hash_table[256]; +# define hash_table lzma_lz_hash_table +#else +# include "check.h" +# define hash_table lzma_crc32_table[0] +#endif + +#define HASH_2_SIZE (UINT32_C(1) << 10) +#define HASH_3_SIZE (UINT32_C(1) << 16) +#define HASH_4_SIZE (UINT32_C(1) << 20) + +#define HASH_2_MASK (HASH_2_SIZE - 1) +#define HASH_3_MASK (HASH_3_SIZE - 1) +#define HASH_4_MASK (HASH_4_SIZE - 1) + +#define FIX_3_HASH_SIZE (HASH_2_SIZE) +#define FIX_4_HASH_SIZE (HASH_2_SIZE + HASH_3_SIZE) +#define FIX_5_HASH_SIZE (HASH_2_SIZE + HASH_3_SIZE + HASH_4_SIZE) + +// Endianness doesn't matter in hash_2_calc() (no effect on the output). +#ifdef TUKLIB_FAST_UNALIGNED_ACCESS +# define hash_2_calc() \ + const uint32_t hash_value = read16ne(cur) +#else +# define hash_2_calc() \ + const uint32_t hash_value \ + = (uint32_t)(cur[0]) | ((uint32_t)(cur[1]) << 8) +#endif + +#define hash_3_calc() \ + const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \ + const uint32_t hash_2_value = temp & HASH_2_MASK; \ + const uint32_t hash_value \ + = (temp ^ ((uint32_t)(cur[2]) << 8)) & mf->hash_mask + +#define hash_4_calc() \ + const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \ + const uint32_t hash_2_value = temp & HASH_2_MASK; \ + const uint32_t hash_3_value \ + = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \ + const uint32_t hash_value = (temp ^ ((uint32_t)(cur[2]) << 8) \ + ^ (hash_table[cur[3]] << 5)) & mf->hash_mask + + +// The following are not currently used. + +#define hash_5_calc() \ + const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \ + const uint32_t hash_2_value = temp & HASH_2_MASK; \ + const uint32_t hash_3_value \ + = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \ + uint32_t hash_4_value = (temp ^ ((uint32_t)(cur[2]) << 8) ^ \ + ^ hash_table[cur[3]] << 5); \ + const uint32_t hash_value \ + = (hash_4_value ^ (hash_table[cur[4]] << 3)) \ + & mf->hash_mask; \ + hash_4_value &= HASH_4_MASK + +/* +#define hash_zip_calc() \ + const uint32_t hash_value \ + = (((uint32_t)(cur[0]) | ((uint32_t)(cur[1]) << 8)) \ + ^ hash_table[cur[2]]) & 0xFFFF +*/ + +#define hash_zip_calc() \ + const uint32_t hash_value \ + = (((uint32_t)(cur[2]) | ((uint32_t)(cur[0]) << 8)) \ + ^ hash_table[cur[1]]) & 0xFFFF + +#define mt_hash_2_calc() \ + const uint32_t hash_2_value \ + = (hash_table[cur[0]] ^ cur[1]) & HASH_2_MASK + +#define mt_hash_3_calc() \ + const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \ + const uint32_t hash_2_value = temp & HASH_2_MASK; \ + const uint32_t hash_3_value \ + = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK + +#define mt_hash_4_calc() \ + const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \ + const uint32_t hash_2_value = temp & HASH_2_MASK; \ + const uint32_t hash_3_value \ + = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \ + const uint32_t hash_4_value = (temp ^ ((uint32_t)(cur[2]) << 8) ^ \ + (hash_table[cur[3]] << 5)) & HASH_4_MASK + +#endif diff --git a/src/liblzma/lz/lz_encoder_hash_table.h b/src/liblzma/lz/lz_encoder_hash_table.h new file mode 100644 index 0000000..8c51717 --- /dev/null +++ b/src/liblzma/lz/lz_encoder_hash_table.h @@ -0,0 +1,68 @@ +/* This file has been automatically generated by crc32_tablegen.c. */ + +const uint32_t lzma_lz_hash_table[256] = { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; diff --git a/src/liblzma/lz/lz_encoder_mf.c b/src/liblzma/lz/lz_encoder_mf.c new file mode 100644 index 0000000..d03657a --- /dev/null +++ b/src/liblzma/lz/lz_encoder_mf.c @@ -0,0 +1,744 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lz_encoder_mf.c +/// \brief Match finders +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lz_encoder.h" +#include "lz_encoder_hash.h" +#include "memcmplen.h" + + +/// \brief Find matches starting from the current byte +/// +/// \return The length of the longest match found +extern uint32_t +lzma_mf_find(lzma_mf *mf, uint32_t *count_ptr, lzma_match *matches) +{ + // Call the match finder. It returns the number of length-distance + // pairs found. + // FIXME: Minimum count is zero, what _exactly_ is the maximum? + const uint32_t count = mf->find(mf, matches); + + // Length of the longest match; assume that no matches were found + // and thus the maximum length is zero. + uint32_t len_best = 0; + + if (count > 0) { +#ifndef NDEBUG + // Validate the matches. + for (uint32_t i = 0; i < count; ++i) { + assert(matches[i].len <= mf->nice_len); + assert(matches[i].dist < mf->read_pos); + assert(memcmp(mf_ptr(mf) - 1, + mf_ptr(mf) - matches[i].dist - 2, + matches[i].len) == 0); + } +#endif + + // The last used element in the array contains + // the longest match. + len_best = matches[count - 1].len; + + // If a match of maximum search length was found, try to + // extend the match to maximum possible length. + if (len_best == mf->nice_len) { + // The limit for the match length is either the + // maximum match length supported by the LZ-based + // encoder or the number of bytes left in the + // dictionary, whichever is smaller. + uint32_t limit = mf_avail(mf) + 1; + if (limit > mf->match_len_max) + limit = mf->match_len_max; + + // Pointer to the byte we just ran through + // the match finder. + const uint8_t *p1 = mf_ptr(mf) - 1; + + // Pointer to the beginning of the match. We need -1 + // here because the match distances are zero based. + const uint8_t *p2 = p1 - matches[count - 1].dist - 1; + + len_best = lzma_memcmplen(p1, p2, len_best, limit); + } + } + + *count_ptr = count; + + // Finally update the read position to indicate that match finder was + // run for this dictionary offset. + ++mf->read_ahead; + + return len_best; +} + + +/// Hash value to indicate unused element in the hash. Since we start the +/// positions from dict_size + 1, zero is always too far to qualify +/// as usable match position. +#define EMPTY_HASH_VALUE 0 + + +/// Normalization must be done when lzma_mf.offset + lzma_mf.read_pos +/// reaches MUST_NORMALIZE_POS. +#define MUST_NORMALIZE_POS UINT32_MAX + + +/// \brief Normalizes hash values +/// +/// The hash arrays store positions of match candidates. The positions are +/// relative to an arbitrary offset that is not the same as the absolute +/// offset in the input stream. The relative position of the current byte +/// is lzma_mf.offset + lzma_mf.read_pos. The distances of the matches are +/// the differences of the current read position and the position found from +/// the hash. +/// +/// To prevent integer overflows of the offsets stored in the hash arrays, +/// we need to "normalize" the stored values now and then. During the +/// normalization, we drop values that indicate distance greater than the +/// dictionary size, thus making space for new values. +static void +normalize(lzma_mf *mf) +{ + assert(mf->read_pos + mf->offset == MUST_NORMALIZE_POS); + + // In future we may not want to touch the lowest bits, because there + // may be match finders that use larger resolution than one byte. + const uint32_t subvalue + = (MUST_NORMALIZE_POS - mf->cyclic_size); + // & ~((UINT32_C(1) << 10) - 1); + + for (uint32_t i = 0; i < mf->hash_count; ++i) { + // If the distance is greater than the dictionary size, + // we can simply mark the hash element as empty. + if (mf->hash[i] <= subvalue) + mf->hash[i] = EMPTY_HASH_VALUE; + else + mf->hash[i] -= subvalue; + } + + for (uint32_t i = 0; i < mf->sons_count; ++i) { + // Do the same for mf->son. + // + // NOTE: There may be uninitialized elements in mf->son. + // Valgrind may complain that the "if" below depends on + // an uninitialized value. In this case it is safe to ignore + // the warning. See also the comments in lz_encoder_init() + // in lz_encoder.c. + if (mf->son[i] <= subvalue) + mf->son[i] = EMPTY_HASH_VALUE; + else + mf->son[i] -= subvalue; + } + + // Update offset to match the new locations. + mf->offset -= subvalue; + + return; +} + + +/// Mark the current byte as processed from point of view of the match finder. +static void +move_pos(lzma_mf *mf) +{ + if (++mf->cyclic_pos == mf->cyclic_size) + mf->cyclic_pos = 0; + + ++mf->read_pos; + assert(mf->read_pos <= mf->write_pos); + + if (unlikely(mf->read_pos + mf->offset == UINT32_MAX)) + normalize(mf); +} + + +/// When flushing, we cannot run the match finder unless there is nice_len +/// bytes available in the dictionary. Instead, we skip running the match +/// finder (indicating that no match was found), and count how many bytes we +/// have ignored this way. +/// +/// When new data is given after the flushing was completed, the match finder +/// is restarted by rewinding mf->read_pos backwards by mf->pending. Then +/// the missed bytes are added to the hash using the match finder's skip +/// function (with small amount of input, it may start using mf->pending +/// again if flushing). +/// +/// Due to this rewinding, we don't touch cyclic_pos or test for +/// normalization. It will be done when the match finder's skip function +/// catches up after a flush. +static void +move_pending(lzma_mf *mf) +{ + ++mf->read_pos; + assert(mf->read_pos <= mf->write_pos); + ++mf->pending; +} + + +/// Calculate len_limit and determine if there is enough input to run +/// the actual match finder code. Sets up "cur" and "pos". This macro +/// is used by all find functions and binary tree skip functions. Hash +/// chain skip function doesn't need len_limit so a simpler code is used +/// in them. +#define header(is_bt, len_min, ret_op) \ + uint32_t len_limit = mf_avail(mf); \ + if (mf->nice_len <= len_limit) { \ + len_limit = mf->nice_len; \ + } else if (len_limit < (len_min) \ + || (is_bt && mf->action == LZMA_SYNC_FLUSH)) { \ + assert(mf->action != LZMA_RUN); \ + move_pending(mf); \ + ret_op; \ + } \ + const uint8_t *cur = mf_ptr(mf); \ + const uint32_t pos = mf->read_pos + mf->offset + + +/// Header for find functions. "return 0" indicates that zero matches +/// were found. +#define header_find(is_bt, len_min) \ + header(is_bt, len_min, return 0); \ + uint32_t matches_count = 0 + + +/// Header for a loop in a skip function. "continue" tells to skip the rest +/// of the code in the loop. +#define header_skip(is_bt, len_min) \ + header(is_bt, len_min, continue) + + +/// Calls hc_find_func() or bt_find_func() and calculates the total number +/// of matches found. Updates the dictionary position and returns the number +/// of matches found. +#define call_find(func, len_best) \ +do { \ + matches_count = func(len_limit, pos, cur, cur_match, mf->depth, \ + mf->son, mf->cyclic_pos, mf->cyclic_size, \ + matches + matches_count, len_best) \ + - matches; \ + move_pos(mf); \ + return matches_count; \ +} while (0) + + +//////////////// +// Hash Chain // +//////////////// + +#if defined(HAVE_MF_HC3) || defined(HAVE_MF_HC4) +/// +/// +/// \param len_limit Don't look for matches longer than len_limit. +/// \param pos lzma_mf.read_pos + lzma_mf.offset +/// \param cur Pointer to current byte (mf_ptr(mf)) +/// \param cur_match Start position of the current match candidate +/// \param depth Maximum length of the hash chain +/// \param son lzma_mf.son (contains the hash chain) +/// \param cyclic_pos +/// \param cyclic_size +/// \param matches Array to hold the matches. +/// \param len_best The length of the longest match found so far. +static lzma_match * +hc_find_func( + const uint32_t len_limit, + const uint32_t pos, + const uint8_t *const cur, + uint32_t cur_match, + uint32_t depth, + uint32_t *const son, + const uint32_t cyclic_pos, + const uint32_t cyclic_size, + lzma_match *matches, + uint32_t len_best) +{ + son[cyclic_pos] = cur_match; + + while (true) { + const uint32_t delta = pos - cur_match; + if (depth-- == 0 || delta >= cyclic_size) + return matches; + + const uint8_t *const pb = cur - delta; + cur_match = son[cyclic_pos - delta + + (delta > cyclic_pos ? cyclic_size : 0)]; + + if (pb[len_best] == cur[len_best] && pb[0] == cur[0]) { + uint32_t len = lzma_memcmplen(pb, cur, 1, len_limit); + + if (len_best < len) { + len_best = len; + matches->len = len; + matches->dist = delta - 1; + ++matches; + + if (len == len_limit) + return matches; + } + } + } +} + + +#define hc_find(len_best) \ + call_find(hc_find_func, len_best) + + +#define hc_skip() \ +do { \ + mf->son[mf->cyclic_pos] = cur_match; \ + move_pos(mf); \ +} while (0) + +#endif + + +#ifdef HAVE_MF_HC3 +extern uint32_t +lzma_mf_hc3_find(lzma_mf *mf, lzma_match *matches) +{ + header_find(false, 3); + + hash_3_calc(); + + const uint32_t delta2 = pos - mf->hash[hash_2_value]; + const uint32_t cur_match = mf->hash[FIX_3_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_value] = pos; + + uint32_t len_best = 2; + + if (delta2 < mf->cyclic_size && *(cur - delta2) == *cur) { + len_best = lzma_memcmplen(cur - delta2, cur, + len_best, len_limit); + + matches[0].len = len_best; + matches[0].dist = delta2 - 1; + matches_count = 1; + + if (len_best == len_limit) { + hc_skip(); + return 1; // matches_count + } + } + + hc_find(len_best); +} + + +extern void +lzma_mf_hc3_skip(lzma_mf *mf, uint32_t amount) +{ + do { + if (mf_avail(mf) < 3) { + move_pending(mf); + continue; + } + + const uint8_t *cur = mf_ptr(mf); + const uint32_t pos = mf->read_pos + mf->offset; + + hash_3_calc(); + + const uint32_t cur_match + = mf->hash[FIX_3_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_value] = pos; + + hc_skip(); + + } while (--amount != 0); +} +#endif + + +#ifdef HAVE_MF_HC4 +extern uint32_t +lzma_mf_hc4_find(lzma_mf *mf, lzma_match *matches) +{ + header_find(false, 4); + + hash_4_calc(); + + uint32_t delta2 = pos - mf->hash[hash_2_value]; + const uint32_t delta3 + = pos - mf->hash[FIX_3_HASH_SIZE + hash_3_value]; + const uint32_t cur_match = mf->hash[FIX_4_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value ] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_3_value] = pos; + mf->hash[FIX_4_HASH_SIZE + hash_value] = pos; + + uint32_t len_best = 1; + + if (delta2 < mf->cyclic_size && *(cur - delta2) == *cur) { + len_best = 2; + matches[0].len = 2; + matches[0].dist = delta2 - 1; + matches_count = 1; + } + + if (delta2 != delta3 && delta3 < mf->cyclic_size + && *(cur - delta3) == *cur) { + len_best = 3; + matches[matches_count++].dist = delta3 - 1; + delta2 = delta3; + } + + if (matches_count != 0) { + len_best = lzma_memcmplen(cur - delta2, cur, + len_best, len_limit); + + matches[matches_count - 1].len = len_best; + + if (len_best == len_limit) { + hc_skip(); + return matches_count; + } + } + + if (len_best < 3) + len_best = 3; + + hc_find(len_best); +} + + +extern void +lzma_mf_hc4_skip(lzma_mf *mf, uint32_t amount) +{ + do { + if (mf_avail(mf) < 4) { + move_pending(mf); + continue; + } + + const uint8_t *cur = mf_ptr(mf); + const uint32_t pos = mf->read_pos + mf->offset; + + hash_4_calc(); + + const uint32_t cur_match + = mf->hash[FIX_4_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_3_value] = pos; + mf->hash[FIX_4_HASH_SIZE + hash_value] = pos; + + hc_skip(); + + } while (--amount != 0); +} +#endif + + +///////////////// +// Binary Tree // +///////////////// + +#if defined(HAVE_MF_BT2) || defined(HAVE_MF_BT3) || defined(HAVE_MF_BT4) +static lzma_match * +bt_find_func( + const uint32_t len_limit, + const uint32_t pos, + const uint8_t *const cur, + uint32_t cur_match, + uint32_t depth, + uint32_t *const son, + const uint32_t cyclic_pos, + const uint32_t cyclic_size, + lzma_match *matches, + uint32_t len_best) +{ + uint32_t *ptr0 = son + (cyclic_pos << 1) + 1; + uint32_t *ptr1 = son + (cyclic_pos << 1); + + uint32_t len0 = 0; + uint32_t len1 = 0; + + while (true) { + const uint32_t delta = pos - cur_match; + if (depth-- == 0 || delta >= cyclic_size) { + *ptr0 = EMPTY_HASH_VALUE; + *ptr1 = EMPTY_HASH_VALUE; + return matches; + } + + uint32_t *const pair = son + ((cyclic_pos - delta + + (delta > cyclic_pos ? cyclic_size : 0)) + << 1); + + const uint8_t *const pb = cur - delta; + uint32_t len = my_min(len0, len1); + + if (pb[len] == cur[len]) { + len = lzma_memcmplen(pb, cur, len + 1, len_limit); + + if (len_best < len) { + len_best = len; + matches->len = len; + matches->dist = delta - 1; + ++matches; + + if (len == len_limit) { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return matches; + } + } + } + + if (pb[len] < cur[len]) { + *ptr1 = cur_match; + ptr1 = pair + 1; + cur_match = *ptr1; + len1 = len; + } else { + *ptr0 = cur_match; + ptr0 = pair; + cur_match = *ptr0; + len0 = len; + } + } +} + + +static void +bt_skip_func( + const uint32_t len_limit, + const uint32_t pos, + const uint8_t *const cur, + uint32_t cur_match, + uint32_t depth, + uint32_t *const son, + const uint32_t cyclic_pos, + const uint32_t cyclic_size) +{ + uint32_t *ptr0 = son + (cyclic_pos << 1) + 1; + uint32_t *ptr1 = son + (cyclic_pos << 1); + + uint32_t len0 = 0; + uint32_t len1 = 0; + + while (true) { + const uint32_t delta = pos - cur_match; + if (depth-- == 0 || delta >= cyclic_size) { + *ptr0 = EMPTY_HASH_VALUE; + *ptr1 = EMPTY_HASH_VALUE; + return; + } + + uint32_t *pair = son + ((cyclic_pos - delta + + (delta > cyclic_pos ? cyclic_size : 0)) + << 1); + const uint8_t *pb = cur - delta; + uint32_t len = my_min(len0, len1); + + if (pb[len] == cur[len]) { + len = lzma_memcmplen(pb, cur, len + 1, len_limit); + + if (len == len_limit) { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return; + } + } + + if (pb[len] < cur[len]) { + *ptr1 = cur_match; + ptr1 = pair + 1; + cur_match = *ptr1; + len1 = len; + } else { + *ptr0 = cur_match; + ptr0 = pair; + cur_match = *ptr0; + len0 = len; + } + } +} + + +#define bt_find(len_best) \ + call_find(bt_find_func, len_best) + +#define bt_skip() \ +do { \ + bt_skip_func(len_limit, pos, cur, cur_match, mf->depth, \ + mf->son, mf->cyclic_pos, \ + mf->cyclic_size); \ + move_pos(mf); \ +} while (0) + +#endif + + +#ifdef HAVE_MF_BT2 +extern uint32_t +lzma_mf_bt2_find(lzma_mf *mf, lzma_match *matches) +{ + header_find(true, 2); + + hash_2_calc(); + + const uint32_t cur_match = mf->hash[hash_value]; + mf->hash[hash_value] = pos; + + bt_find(1); +} + + +extern void +lzma_mf_bt2_skip(lzma_mf *mf, uint32_t amount) +{ + do { + header_skip(true, 2); + + hash_2_calc(); + + const uint32_t cur_match = mf->hash[hash_value]; + mf->hash[hash_value] = pos; + + bt_skip(); + + } while (--amount != 0); +} +#endif + + +#ifdef HAVE_MF_BT3 +extern uint32_t +lzma_mf_bt3_find(lzma_mf *mf, lzma_match *matches) +{ + header_find(true, 3); + + hash_3_calc(); + + const uint32_t delta2 = pos - mf->hash[hash_2_value]; + const uint32_t cur_match = mf->hash[FIX_3_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_value] = pos; + + uint32_t len_best = 2; + + if (delta2 < mf->cyclic_size && *(cur - delta2) == *cur) { + len_best = lzma_memcmplen( + cur, cur - delta2, len_best, len_limit); + + matches[0].len = len_best; + matches[0].dist = delta2 - 1; + matches_count = 1; + + if (len_best == len_limit) { + bt_skip(); + return 1; // matches_count + } + } + + bt_find(len_best); +} + + +extern void +lzma_mf_bt3_skip(lzma_mf *mf, uint32_t amount) +{ + do { + header_skip(true, 3); + + hash_3_calc(); + + const uint32_t cur_match + = mf->hash[FIX_3_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_value] = pos; + + bt_skip(); + + } while (--amount != 0); +} +#endif + + +#ifdef HAVE_MF_BT4 +extern uint32_t +lzma_mf_bt4_find(lzma_mf *mf, lzma_match *matches) +{ + header_find(true, 4); + + hash_4_calc(); + + uint32_t delta2 = pos - mf->hash[hash_2_value]; + const uint32_t delta3 + = pos - mf->hash[FIX_3_HASH_SIZE + hash_3_value]; + const uint32_t cur_match = mf->hash[FIX_4_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_3_value] = pos; + mf->hash[FIX_4_HASH_SIZE + hash_value] = pos; + + uint32_t len_best = 1; + + if (delta2 < mf->cyclic_size && *(cur - delta2) == *cur) { + len_best = 2; + matches[0].len = 2; + matches[0].dist = delta2 - 1; + matches_count = 1; + } + + if (delta2 != delta3 && delta3 < mf->cyclic_size + && *(cur - delta3) == *cur) { + len_best = 3; + matches[matches_count++].dist = delta3 - 1; + delta2 = delta3; + } + + if (matches_count != 0) { + len_best = lzma_memcmplen( + cur, cur - delta2, len_best, len_limit); + + matches[matches_count - 1].len = len_best; + + if (len_best == len_limit) { + bt_skip(); + return matches_count; + } + } + + if (len_best < 3) + len_best = 3; + + bt_find(len_best); +} + + +extern void +lzma_mf_bt4_skip(lzma_mf *mf, uint32_t amount) +{ + do { + header_skip(true, 4); + + hash_4_calc(); + + const uint32_t cur_match + = mf->hash[FIX_4_HASH_SIZE + hash_value]; + + mf->hash[hash_2_value] = pos; + mf->hash[FIX_3_HASH_SIZE + hash_3_value] = pos; + mf->hash[FIX_4_HASH_SIZE + hash_value] = pos; + + bt_skip(); + + } while (--amount != 0); +} +#endif diff --git a/src/liblzma/lzma/fastpos.h b/src/liblzma/lzma/fastpos.h new file mode 100644 index 0000000..cba442c --- /dev/null +++ b/src/liblzma/lzma/fastpos.h @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file fastpos.h +/// \brief Kind of two-bit version of bit scan reverse +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_FASTPOS_H +#define LZMA_FASTPOS_H + +// LZMA encodes match distances by storing the highest two bits using +// a six-bit value [0, 63], and then the missing lower bits. +// Dictionary size is also stored using this encoding in the .xz +// file format header. +// +// fastpos.h provides a way to quickly find out the correct six-bit +// values. The following table gives some examples of this encoding: +// +// dist return +// 0 0 +// 1 1 +// 2 2 +// 3 3 +// 4 4 +// 5 4 +// 6 5 +// 7 5 +// 8 6 +// 11 6 +// 12 7 +// ... ... +// 15 7 +// 16 8 +// 17 8 +// ... ... +// 23 8 +// 24 9 +// 25 9 +// ... ... +// +// +// Provided functions or macros +// ---------------------------- +// +// get_dist_slot(dist) is the basic version. get_dist_slot_2(dist) +// assumes that dist >= FULL_DISTANCES, thus the result is at least +// FULL_DISTANCES_BITS * 2. Using get_dist_slot(dist) instead of +// get_dist_slot_2(dist) would give the same result, but get_dist_slot_2(dist) +// should be tiny bit faster due to the assumption being made. +// +// +// Size vs. speed +// -------------- +// +// With some CPUs that have fast BSR (bit scan reverse) instruction, the +// size optimized version is slightly faster than the bigger table based +// approach. Such CPUs include Intel Pentium Pro, Pentium II, Pentium III +// and Core 2 (possibly others). AMD K7 seems to have slower BSR, but that +// would still have speed roughly comparable to the table version. Older +// x86 CPUs like the original Pentium have very slow BSR; on those systems +// the table version is a lot faster. +// +// On some CPUs, the table version is a lot faster when using position +// dependent code, but with position independent code the size optimized +// version is slightly faster. This occurs at least on 32-bit SPARC (no +// ASM optimizations). +// +// I'm making the table version the default, because that has good speed +// on all systems I have tried. The size optimized version is sometimes +// slightly faster, but sometimes it is a lot slower. + +#ifdef HAVE_SMALL +# define get_dist_slot(dist) \ + ((dist) <= 4 ? (dist) : get_dist_slot_2(dist)) + +static inline uint32_t +get_dist_slot_2(uint32_t dist) +{ + const uint32_t i = bsr32(dist); + return (i + i) + ((dist >> (i - 1)) & 1); +} + + +#else + +#define FASTPOS_BITS 13 + +extern const uint8_t lzma_fastpos[1 << FASTPOS_BITS]; + + +#define fastpos_shift(extra, n) \ + ((extra) + (n) * (FASTPOS_BITS - 1)) + +#define fastpos_limit(extra, n) \ + (UINT32_C(1) << (FASTPOS_BITS + fastpos_shift(extra, n))) + +#define fastpos_result(dist, extra, n) \ + (uint32_t)(lzma_fastpos[(dist) >> fastpos_shift(extra, n)]) \ + + 2 * fastpos_shift(extra, n) + + +static inline uint32_t +get_dist_slot(uint32_t dist) +{ + // If it is small enough, we can pick the result directly from + // the precalculated table. + if (dist < fastpos_limit(0, 0)) + return lzma_fastpos[dist]; + + if (dist < fastpos_limit(0, 1)) + return fastpos_result(dist, 0, 1); + + return fastpos_result(dist, 0, 2); +} + + +#ifdef FULL_DISTANCES_BITS +static inline uint32_t +get_dist_slot_2(uint32_t dist) +{ + assert(dist >= FULL_DISTANCES); + + if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 0)) + return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 0); + + if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 1)) + return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 1); + + return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 2); +} +#endif + +#endif + +#endif diff --git a/src/liblzma/lzma/fastpos_table.c b/src/liblzma/lzma/fastpos_table.c new file mode 100644 index 0000000..6a3ceac --- /dev/null +++ b/src/liblzma/lzma/fastpos_table.c @@ -0,0 +1,519 @@ +/* This file has been automatically generated by fastpos_tablegen.c. */ + +#include "common.h" +#include "fastpos.h" + +const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 +}; diff --git a/src/liblzma/lzma/fastpos_tablegen.c b/src/liblzma/lzma/fastpos_tablegen.c new file mode 100644 index 0000000..d4484c8 --- /dev/null +++ b/src/liblzma/lzma/fastpos_tablegen.c @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file fastpos_tablegen.c +/// \brief Generates the lzma_fastpos[] lookup table +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "fastpos.h" + + +int +main(void) +{ + uint8_t fastpos[1 << FASTPOS_BITS]; + + const uint8_t fast_slots = 2 * FASTPOS_BITS; + uint32_t c = 2; + + fastpos[0] = 0; + fastpos[1] = 1; + + for (uint8_t slot_fast = 2; slot_fast < fast_slots; ++slot_fast) { + const uint32_t k = 1 << ((slot_fast >> 1) - 1); + for (uint32_t j = 0; j < k; ++j, ++c) + fastpos[c] = slot_fast; + } + + printf("/* This file has been automatically generated " + "by fastpos_tablegen.c. */\n\n" + "#include \"common.h\"\n" + "#include \"fastpos.h\"\n\n" + "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {"); + + for (size_t i = 0; i < (1 << FASTPOS_BITS); ++i) { + if (i % 16 == 0) + printf("\n\t"); + + printf("%3u", (unsigned int)(fastpos[i])); + + if (i != (1 << FASTPOS_BITS) - 1) + printf(","); + } + + printf("\n};\n"); + + return 0; +} diff --git a/src/liblzma/lzma/lzma2_decoder.c b/src/liblzma/lzma/lzma2_decoder.c new file mode 100644 index 0000000..567df49 --- /dev/null +++ b/src/liblzma/lzma/lzma2_decoder.c @@ -0,0 +1,311 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma2_decoder.c +/// \brief LZMA2 decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma2_decoder.h" +#include "lz_decoder.h" +#include "lzma_decoder.h" + + +typedef struct { + enum sequence { + SEQ_CONTROL, + SEQ_UNCOMPRESSED_1, + SEQ_UNCOMPRESSED_2, + SEQ_COMPRESSED_0, + SEQ_COMPRESSED_1, + SEQ_PROPERTIES, + SEQ_LZMA, + SEQ_COPY, + } sequence; + + /// Sequence after the size fields have been decoded. + enum sequence next_sequence; + + /// LZMA decoder + lzma_lz_decoder lzma; + + /// Uncompressed size of LZMA chunk + size_t uncompressed_size; + + /// Compressed size of the chunk (naturally equals to uncompressed + /// size of uncompressed chunk) + size_t compressed_size; + + /// True if properties are needed. This is false before the + /// first LZMA chunk. + bool need_properties; + + /// True if dictionary reset is needed. This is false before the + /// first chunk (LZMA or uncompressed). + bool need_dictionary_reset; + + lzma_options_lzma options; +} lzma_lzma2_coder; + + +static lzma_ret +lzma2_decode(void *coder_ptr, lzma_dict *restrict dict, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size) +{ + lzma_lzma2_coder *restrict coder = coder_ptr; + + // With SEQ_LZMA it is possible that no new input is needed to do + // some progress. The rest of the sequences assume that there is + // at least one byte of input. + while (*in_pos < in_size || coder->sequence == SEQ_LZMA) + switch (coder->sequence) { + case SEQ_CONTROL: { + const uint32_t control = in[*in_pos]; + ++*in_pos; + + // End marker + if (control == 0x00) + return LZMA_STREAM_END; + + if (control >= 0xE0 || control == 1) { + // Dictionary reset implies that next LZMA chunk has + // to set new properties. + coder->need_properties = true; + coder->need_dictionary_reset = true; + } else if (coder->need_dictionary_reset) { + return LZMA_DATA_ERROR; + } + + if (control >= 0x80) { + // LZMA chunk. The highest five bits of the + // uncompressed size are taken from the control byte. + coder->uncompressed_size = (control & 0x1F) << 16; + coder->sequence = SEQ_UNCOMPRESSED_1; + + // See if there are new properties or if we need to + // reset the state. + if (control >= 0xC0) { + // When there are new properties, state reset + // is done at SEQ_PROPERTIES. + coder->need_properties = false; + coder->next_sequence = SEQ_PROPERTIES; + + } else if (coder->need_properties) { + return LZMA_DATA_ERROR; + + } else { + coder->next_sequence = SEQ_LZMA; + + // If only state reset is wanted with old + // properties, do the resetting here for + // simplicity. + if (control >= 0xA0) + coder->lzma.reset(coder->lzma.coder, + &coder->options); + } + } else { + // Invalid control values + if (control > 2) + return LZMA_DATA_ERROR; + + // It's uncompressed chunk + coder->sequence = SEQ_COMPRESSED_0; + coder->next_sequence = SEQ_COPY; + } + + if (coder->need_dictionary_reset) { + // Finish the dictionary reset and let the caller + // flush the dictionary to the actual output buffer. + coder->need_dictionary_reset = false; + dict_reset(dict); + return LZMA_OK; + } + + break; + } + + case SEQ_UNCOMPRESSED_1: + coder->uncompressed_size += (uint32_t)(in[(*in_pos)++]) << 8; + coder->sequence = SEQ_UNCOMPRESSED_2; + break; + + case SEQ_UNCOMPRESSED_2: + coder->uncompressed_size += in[(*in_pos)++] + 1U; + coder->sequence = SEQ_COMPRESSED_0; + coder->lzma.set_uncompressed(coder->lzma.coder, + coder->uncompressed_size, false); + break; + + case SEQ_COMPRESSED_0: + coder->compressed_size = (uint32_t)(in[(*in_pos)++]) << 8; + coder->sequence = SEQ_COMPRESSED_1; + break; + + case SEQ_COMPRESSED_1: + coder->compressed_size += in[(*in_pos)++] + 1U; + coder->sequence = coder->next_sequence; + break; + + case SEQ_PROPERTIES: + if (lzma_lzma_lclppb_decode(&coder->options, in[(*in_pos)++])) + return LZMA_DATA_ERROR; + + coder->lzma.reset(coder->lzma.coder, &coder->options); + + coder->sequence = SEQ_LZMA; + break; + + case SEQ_LZMA: { + // Store the start offset so that we can update + // coder->compressed_size later. + const size_t in_start = *in_pos; + + // Decode from in[] to *dict. + const lzma_ret ret = coder->lzma.code(coder->lzma.coder, + dict, in, in_pos, in_size); + + // Validate and update coder->compressed_size. + const size_t in_used = *in_pos - in_start; + if (in_used > coder->compressed_size) + return LZMA_DATA_ERROR; + + coder->compressed_size -= in_used; + + // Return if we didn't finish the chunk, or an error occurred. + if (ret != LZMA_STREAM_END) + return ret; + + // The LZMA decoder must have consumed the whole chunk now. + // We don't need to worry about uncompressed size since it + // is checked by the LZMA decoder. + if (coder->compressed_size != 0) + return LZMA_DATA_ERROR; + + coder->sequence = SEQ_CONTROL; + break; + } + + case SEQ_COPY: { + // Copy from input to the dictionary as is. + dict_write(dict, in, in_pos, in_size, &coder->compressed_size); + if (coder->compressed_size != 0) + return LZMA_OK; + + coder->sequence = SEQ_CONTROL; + break; + } + + default: + assert(0); + return LZMA_PROG_ERROR; + } + + return LZMA_OK; +} + + +static void +lzma2_decoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_lzma2_coder *coder = coder_ptr; + + assert(coder->lzma.end == NULL); + lzma_free(coder->lzma.coder, allocator); + + lzma_free(coder, allocator); + + return; +} + + +static lzma_ret +lzma2_decoder_init(lzma_lz_decoder *lz, const lzma_allocator *allocator, + lzma_vli id lzma_attribute((__unused__)), const void *opt, + lzma_lz_options *lz_options) +{ + lzma_lzma2_coder *coder = lz->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_lzma2_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + lz->coder = coder; + lz->code = &lzma2_decode; + lz->end = &lzma2_decoder_end; + + coder->lzma = LZMA_LZ_DECODER_INIT; + } + + const lzma_options_lzma *options = opt; + + coder->sequence = SEQ_CONTROL; + coder->need_properties = true; + coder->need_dictionary_reset = options->preset_dict == NULL + || options->preset_dict_size == 0; + + return lzma_lzma_decoder_create(&coder->lzma, + allocator, options, lz_options); +} + + +extern lzma_ret +lzma_lzma2_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + // LZMA2 can only be the last filter in the chain. This is enforced + // by the raw_decoder initialization. + assert(filters[1].init == NULL); + + return lzma_lz_decoder_init(next, allocator, filters, + &lzma2_decoder_init); +} + + +extern uint64_t +lzma_lzma2_decoder_memusage(const void *options) +{ + return sizeof(lzma_lzma2_coder) + + lzma_lzma_decoder_memusage_nocheck(options); +} + + +extern lzma_ret +lzma_lzma2_props_decode(void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) +{ + if (props_size != 1) + return LZMA_OPTIONS_ERROR; + + // Check that reserved bits are unset. + if (props[0] & 0xC0) + return LZMA_OPTIONS_ERROR; + + // Decode the dictionary size. + if (props[0] > 40) + return LZMA_OPTIONS_ERROR; + + lzma_options_lzma *opt = lzma_alloc( + sizeof(lzma_options_lzma), allocator); + if (opt == NULL) + return LZMA_MEM_ERROR; + + if (props[0] == 40) { + opt->dict_size = UINT32_MAX; + } else { + opt->dict_size = 2 | (props[0] & 1U); + opt->dict_size <<= props[0] / 2U + 11; + } + + opt->preset_dict = NULL; + opt->preset_dict_size = 0; + + *options = opt; + + return LZMA_OK; +} diff --git a/src/liblzma/lzma/lzma2_decoder.h b/src/liblzma/lzma/lzma2_decoder.h new file mode 100644 index 0000000..ef2dcbf --- /dev/null +++ b/src/liblzma/lzma/lzma2_decoder.h @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma2_decoder.h +/// \brief LZMA2 decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA2_DECODER_H +#define LZMA_LZMA2_DECODER_H + +#include "common.h" + +extern lzma_ret lzma_lzma2_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern uint64_t lzma_lzma2_decoder_memusage(const void *options); + +extern lzma_ret lzma_lzma2_props_decode( + void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size); + +#endif diff --git a/src/liblzma/lzma/lzma2_encoder.c b/src/liblzma/lzma/lzma2_encoder.c new file mode 100644 index 0000000..4b6b231 --- /dev/null +++ b/src/liblzma/lzma/lzma2_encoder.c @@ -0,0 +1,414 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma2_encoder.c +/// \brief LZMA2 encoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lz_encoder.h" +#include "lzma_encoder.h" +#include "fastpos.h" +#include "lzma2_encoder.h" + + +typedef struct { + enum { + SEQ_INIT, + SEQ_LZMA_ENCODE, + SEQ_LZMA_COPY, + SEQ_UNCOMPRESSED_HEADER, + SEQ_UNCOMPRESSED_COPY, + } sequence; + + /// LZMA encoder + void *lzma; + + /// LZMA options currently in use. + lzma_options_lzma opt_cur; + + bool need_properties; + bool need_state_reset; + bool need_dictionary_reset; + + /// Uncompressed size of a chunk + size_t uncompressed_size; + + /// Compressed size of a chunk (excluding headers); this is also used + /// to indicate the end of buf[] in SEQ_LZMA_COPY. + size_t compressed_size; + + /// Read position in buf[] + size_t buf_pos; + + /// Buffer to hold the chunk header and LZMA compressed data + uint8_t buf[LZMA2_HEADER_MAX + LZMA2_CHUNK_MAX]; +} lzma_lzma2_coder; + + +static void +lzma2_header_lzma(lzma_lzma2_coder *coder) +{ + assert(coder->uncompressed_size > 0); + assert(coder->uncompressed_size <= LZMA2_UNCOMPRESSED_MAX); + assert(coder->compressed_size > 0); + assert(coder->compressed_size <= LZMA2_CHUNK_MAX); + + size_t pos; + + if (coder->need_properties) { + pos = 0; + + if (coder->need_dictionary_reset) + coder->buf[pos] = 0x80 + (3 << 5); + else + coder->buf[pos] = 0x80 + (2 << 5); + } else { + pos = 1; + + if (coder->need_state_reset) + coder->buf[pos] = 0x80 + (1 << 5); + else + coder->buf[pos] = 0x80; + } + + // Set the start position for copying. + coder->buf_pos = pos; + + // Uncompressed size + size_t size = coder->uncompressed_size - 1; + coder->buf[pos++] += size >> 16; + coder->buf[pos++] = (size >> 8) & 0xFF; + coder->buf[pos++] = size & 0xFF; + + // Compressed size + size = coder->compressed_size - 1; + coder->buf[pos++] = size >> 8; + coder->buf[pos++] = size & 0xFF; + + // Properties, if needed + if (coder->need_properties) + lzma_lzma_lclppb_encode(&coder->opt_cur, coder->buf + pos); + + coder->need_properties = false; + coder->need_state_reset = false; + coder->need_dictionary_reset = false; + + // The copying code uses coder->compressed_size to indicate the end + // of coder->buf[], so we need add the maximum size of the header here. + coder->compressed_size += LZMA2_HEADER_MAX; + + return; +} + + +static void +lzma2_header_uncompressed(lzma_lzma2_coder *coder) +{ + assert(coder->uncompressed_size > 0); + assert(coder->uncompressed_size <= LZMA2_CHUNK_MAX); + + // If this is the first chunk, we need to include dictionary + // reset indicator. + if (coder->need_dictionary_reset) + coder->buf[0] = 1; + else + coder->buf[0] = 2; + + coder->need_dictionary_reset = false; + + // "Compressed" size + coder->buf[1] = (coder->uncompressed_size - 1) >> 8; + coder->buf[2] = (coder->uncompressed_size - 1) & 0xFF; + + // Set the start position for copying. + coder->buf_pos = 0; + return; +} + + +static lzma_ret +lzma2_encode(void *coder_ptr, lzma_mf *restrict mf, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size) +{ + lzma_lzma2_coder *restrict coder = coder_ptr; + + while (*out_pos < out_size) + switch (coder->sequence) { + case SEQ_INIT: + // If there's no input left and we are flushing or finishing, + // don't start a new chunk. + if (mf_unencoded(mf) == 0) { + // Write end of payload marker if finishing. + if (mf->action == LZMA_FINISH) + out[(*out_pos)++] = 0; + + return mf->action == LZMA_RUN + ? LZMA_OK : LZMA_STREAM_END; + } + + if (coder->need_state_reset) + return_if_error(lzma_lzma_encoder_reset( + coder->lzma, &coder->opt_cur)); + + coder->uncompressed_size = 0; + coder->compressed_size = 0; + coder->sequence = SEQ_LZMA_ENCODE; + + // Fall through + + case SEQ_LZMA_ENCODE: { + // Calculate how much more uncompressed data this chunk + // could accept. + const uint32_t left = LZMA2_UNCOMPRESSED_MAX + - coder->uncompressed_size; + uint32_t limit; + + if (left < mf->match_len_max) { + // Must flush immediately since the next LZMA symbol + // could make the uncompressed size of the chunk too + // big. + limit = 0; + } else { + // Calculate maximum read_limit that is OK from point + // of view of LZMA2 chunk size. + limit = mf->read_pos - mf->read_ahead + + left - mf->match_len_max; + } + + // Save the start position so that we can update + // coder->uncompressed_size. + const uint32_t read_start = mf->read_pos - mf->read_ahead; + + // Call the LZMA encoder until the chunk is finished. + const lzma_ret ret = lzma_lzma_encode(coder->lzma, mf, + coder->buf + LZMA2_HEADER_MAX, + &coder->compressed_size, + LZMA2_CHUNK_MAX, limit); + + coder->uncompressed_size += mf->read_pos - mf->read_ahead + - read_start; + + assert(coder->compressed_size <= LZMA2_CHUNK_MAX); + assert(coder->uncompressed_size <= LZMA2_UNCOMPRESSED_MAX); + + if (ret != LZMA_STREAM_END) + return LZMA_OK; + + // See if the chunk compressed. If it didn't, we encode it + // as uncompressed chunk. This saves a few bytes of space + // and makes decoding faster. + if (coder->compressed_size >= coder->uncompressed_size) { + coder->uncompressed_size += mf->read_ahead; + assert(coder->uncompressed_size + <= LZMA2_UNCOMPRESSED_MAX); + mf->read_ahead = 0; + lzma2_header_uncompressed(coder); + coder->need_state_reset = true; + coder->sequence = SEQ_UNCOMPRESSED_HEADER; + break; + } + + // The chunk did compress at least by one byte, so we store + // the chunk as LZMA. + lzma2_header_lzma(coder); + + coder->sequence = SEQ_LZMA_COPY; + } + + // Fall through + + case SEQ_LZMA_COPY: + // Copy the compressed chunk along its headers to the + // output buffer. + lzma_bufcpy(coder->buf, &coder->buf_pos, + coder->compressed_size, + out, out_pos, out_size); + if (coder->buf_pos != coder->compressed_size) + return LZMA_OK; + + coder->sequence = SEQ_INIT; + break; + + case SEQ_UNCOMPRESSED_HEADER: + // Copy the three-byte header to indicate uncompressed chunk. + lzma_bufcpy(coder->buf, &coder->buf_pos, + LZMA2_HEADER_UNCOMPRESSED, + out, out_pos, out_size); + if (coder->buf_pos != LZMA2_HEADER_UNCOMPRESSED) + return LZMA_OK; + + coder->sequence = SEQ_UNCOMPRESSED_COPY; + + // Fall through + + case SEQ_UNCOMPRESSED_COPY: + // Copy the uncompressed data as is from the dictionary + // to the output buffer. + mf_read(mf, out, out_pos, out_size, &coder->uncompressed_size); + if (coder->uncompressed_size != 0) + return LZMA_OK; + + coder->sequence = SEQ_INIT; + break; + } + + return LZMA_OK; +} + + +static void +lzma2_encoder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_lzma2_coder *coder = coder_ptr; + lzma_free(coder->lzma, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +lzma2_encoder_options_update(void *coder_ptr, const lzma_filter *filter) +{ + lzma_lzma2_coder *coder = coder_ptr; + + // New options can be set only when there is no incomplete chunk. + // This is the case at the beginning of the raw stream and right + // after LZMA_SYNC_FLUSH. + if (filter->options == NULL || coder->sequence != SEQ_INIT) + return LZMA_PROG_ERROR; + + // Look if there are new options. At least for now, + // only lc/lp/pb can be changed. + const lzma_options_lzma *opt = filter->options; + if (coder->opt_cur.lc != opt->lc || coder->opt_cur.lp != opt->lp + || coder->opt_cur.pb != opt->pb) { + // Validate the options. + if (opt->lc > LZMA_LCLP_MAX || opt->lp > LZMA_LCLP_MAX + || opt->lc + opt->lp > LZMA_LCLP_MAX + || opt->pb > LZMA_PB_MAX) + return LZMA_OPTIONS_ERROR; + + // The new options will be used when the encoder starts + // a new LZMA2 chunk. + coder->opt_cur.lc = opt->lc; + coder->opt_cur.lp = opt->lp; + coder->opt_cur.pb = opt->pb; + coder->need_properties = true; + coder->need_state_reset = true; + } + + return LZMA_OK; +} + + +static lzma_ret +lzma2_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator, + lzma_vli id lzma_attribute((__unused__)), const void *options, + lzma_lz_options *lz_options) +{ + if (options == NULL) + return LZMA_PROG_ERROR; + + lzma_lzma2_coder *coder = lz->coder; + if (coder == NULL) { + coder = lzma_alloc(sizeof(lzma_lzma2_coder), allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + lz->coder = coder; + lz->code = &lzma2_encode; + lz->end = &lzma2_encoder_end; + lz->options_update = &lzma2_encoder_options_update; + + coder->lzma = NULL; + } + + coder->opt_cur = *(const lzma_options_lzma *)(options); + + coder->sequence = SEQ_INIT; + coder->need_properties = true; + coder->need_state_reset = false; + coder->need_dictionary_reset + = coder->opt_cur.preset_dict == NULL + || coder->opt_cur.preset_dict_size == 0; + + // Initialize LZMA encoder + return_if_error(lzma_lzma_encoder_create(&coder->lzma, allocator, + LZMA_FILTER_LZMA2, &coder->opt_cur, lz_options)); + + // Make sure that we will always have enough history available in + // case we need to use uncompressed chunks. They are used when the + // compressed size of a chunk is not smaller than the uncompressed + // size, so we need to have at least LZMA2_COMPRESSED_MAX bytes + // history available. + if (lz_options->before_size + lz_options->dict_size < LZMA2_CHUNK_MAX) + lz_options->before_size + = LZMA2_CHUNK_MAX - lz_options->dict_size; + + return LZMA_OK; +} + + +extern lzma_ret +lzma_lzma2_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return lzma_lz_encoder_init( + next, allocator, filters, &lzma2_encoder_init); +} + + +extern uint64_t +lzma_lzma2_encoder_memusage(const void *options) +{ + const uint64_t lzma_mem = lzma_lzma_encoder_memusage(options); + if (lzma_mem == UINT64_MAX) + return UINT64_MAX; + + return sizeof(lzma_lzma2_coder) + lzma_mem; +} + + +extern lzma_ret +lzma_lzma2_props_encode(const void *options, uint8_t *out) +{ + if (options == NULL) + return LZMA_PROG_ERROR; + + const lzma_options_lzma *const opt = options; + uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN); + + // Round up to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending + // on which one is the next: + --d; + d |= d >> 2; + d |= d >> 3; + d |= d >> 4; + d |= d >> 8; + d |= d >> 16; + + // Get the highest two bits using the proper encoding: + if (d == UINT32_MAX) + out[0] = 40; + else + out[0] = get_dist_slot(d + 1) - 24; + + return LZMA_OK; +} + + +extern uint64_t +lzma_lzma2_block_size(const void *options) +{ + const lzma_options_lzma *const opt = options; + + // Use at least 1 MiB to keep compression ratio better. + return my_max((uint64_t)(opt->dict_size) * 3, UINT64_C(1) << 20); +} diff --git a/src/liblzma/lzma/lzma2_encoder.h b/src/liblzma/lzma/lzma2_encoder.h new file mode 100644 index 0000000..515f183 --- /dev/null +++ b/src/liblzma/lzma/lzma2_encoder.h @@ -0,0 +1,43 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma2_encoder.h +/// \brief LZMA2 encoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA2_ENCODER_H +#define LZMA_LZMA2_ENCODER_H + +#include "common.h" + + +/// Maximum number of bytes of actual data per chunk (no headers) +#define LZMA2_CHUNK_MAX (UINT32_C(1) << 16) + +/// Maximum uncompressed size of LZMA chunk (no headers) +#define LZMA2_UNCOMPRESSED_MAX (UINT32_C(1) << 21) + +/// Maximum size of LZMA2 headers +#define LZMA2_HEADER_MAX 6 + +/// Size of a header for uncompressed chunk +#define LZMA2_HEADER_UNCOMPRESSED 3 + + +extern lzma_ret lzma_lzma2_encoder_init( + lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern uint64_t lzma_lzma2_encoder_memusage(const void *options); + +extern lzma_ret lzma_lzma2_props_encode(const void *options, uint8_t *out); + +extern uint64_t lzma_lzma2_block_size(const void *options); + +#endif diff --git a/src/liblzma/lzma/lzma_common.h b/src/liblzma/lzma/lzma_common.h new file mode 100644 index 0000000..9d040d9 --- /dev/null +++ b/src/liblzma/lzma/lzma_common.h @@ -0,0 +1,225 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_common.h +/// \brief Private definitions common to LZMA encoder and decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA_COMMON_H +#define LZMA_LZMA_COMMON_H + +#include "common.h" +#include "range_common.h" + + +/////////////////// +// Miscellaneous // +/////////////////// + +/// Maximum number of position states. A position state is the lowest pos bits +/// number of bits of the current uncompressed offset. In some places there +/// are different sets of probabilities for different pos states. +#define POS_STATES_MAX (1 << LZMA_PB_MAX) + + +/// Validates lc, lp, and pb. +static inline bool +is_lclppb_valid(const lzma_options_lzma *options) +{ + return options->lc <= LZMA_LCLP_MAX && options->lp <= LZMA_LCLP_MAX + && options->lc + options->lp <= LZMA_LCLP_MAX + && options->pb <= LZMA_PB_MAX; +} + + +/////////// +// State // +/////////// + +/// This enum is used to track which events have occurred most recently and +/// in which order. This information is used to predict the next event. +/// +/// Events: +/// - Literal: One 8-bit byte +/// - Match: Repeat a chunk of data at some distance +/// - Long repeat: Multi-byte match at a recently seen distance +/// - Short repeat: One-byte repeat at a recently seen distance +/// +/// The event names are in from STATE_oldest_older_previous. REP means +/// either short or long repeated match, and NONLIT means any non-literal. +typedef enum { + STATE_LIT_LIT, + STATE_MATCH_LIT_LIT, + STATE_REP_LIT_LIT, + STATE_SHORTREP_LIT_LIT, + STATE_MATCH_LIT, + STATE_REP_LIT, + STATE_SHORTREP_LIT, + STATE_LIT_MATCH, + STATE_LIT_LONGREP, + STATE_LIT_SHORTREP, + STATE_NONLIT_MATCH, + STATE_NONLIT_REP, +} lzma_lzma_state; + + +/// Total number of states +#define STATES 12 + +/// The lowest 7 states indicate that the previous state was a literal. +#define LIT_STATES 7 + + +/// Indicate that the latest state was a literal. +#define update_literal(state) \ + state = ((state) <= STATE_SHORTREP_LIT_LIT \ + ? STATE_LIT_LIT \ + : ((state) <= STATE_LIT_SHORTREP \ + ? (state) - 3 \ + : (state) - 6)) + +/// Indicate that the latest state was a match. +#define update_match(state) \ + state = ((state) < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH) + +/// Indicate that the latest state was a long repeated match. +#define update_long_rep(state) \ + state = ((state) < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP) + +/// Indicate that the latest state was a short match. +#define update_short_rep(state) \ + state = ((state) < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP) + +/// Test if the previous state was a literal. +#define is_literal_state(state) \ + ((state) < LIT_STATES) + + +///////////// +// Literal // +///////////// + +/// Each literal coder is divided in three sections: +/// - 0x001-0x0FF: Without match byte +/// - 0x101-0x1FF: With match byte; match bit is 0 +/// - 0x201-0x2FF: With match byte; match bit is 1 +/// +/// Match byte is used when the previous LZMA symbol was something else than +/// a literal (that is, it was some kind of match). +#define LITERAL_CODER_SIZE 0x300 + +/// Maximum number of literal coders +#define LITERAL_CODERS_MAX (1 << LZMA_LCLP_MAX) + +/// Locate the literal coder for the next literal byte. The choice depends on +/// - the lowest literal_pos_bits bits of the position of the current +/// byte; and +/// - the highest literal_context_bits bits of the previous byte. +#define literal_subcoder(probs, lc, lp_mask, pos, prev_byte) \ + ((probs)[(((pos) & (lp_mask)) << (lc)) \ + + ((uint32_t)(prev_byte) >> (8U - (lc)))]) + + +static inline void +literal_init(probability (*probs)[LITERAL_CODER_SIZE], + uint32_t lc, uint32_t lp) +{ + assert(lc + lp <= LZMA_LCLP_MAX); + + const uint32_t coders = 1U << (lc + lp); + + for (uint32_t i = 0; i < coders; ++i) + for (uint32_t j = 0; j < LITERAL_CODER_SIZE; ++j) + bit_reset(probs[i][j]); + + return; +} + + +////////////////// +// Match length // +////////////////// + +// Minimum length of a match is two bytes. +#define MATCH_LEN_MIN 2 + +// Match length is encoded with 4, 5, or 10 bits. +// +// Length Bits +// 2-9 4 = Choice=0 + 3 bits +// 10-17 5 = Choice=1 + Choice2=0 + 3 bits +// 18-273 10 = Choice=1 + Choice2=1 + 8 bits +#define LEN_LOW_BITS 3 +#define LEN_LOW_SYMBOLS (1 << LEN_LOW_BITS) +#define LEN_MID_BITS 3 +#define LEN_MID_SYMBOLS (1 << LEN_MID_BITS) +#define LEN_HIGH_BITS 8 +#define LEN_HIGH_SYMBOLS (1 << LEN_HIGH_BITS) +#define LEN_SYMBOLS (LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS + LEN_HIGH_SYMBOLS) + +// Maximum length of a match is 273 which is a result of the encoding +// described above. +#define MATCH_LEN_MAX (MATCH_LEN_MIN + LEN_SYMBOLS - 1) + + +//////////////////// +// Match distance // +//////////////////// + +// Different sets of probabilities are used for match distances that have very +// short match length: Lengths of 2, 3, and 4 bytes have a separate set of +// probabilities for each length. The matches with longer length use a shared +// set of probabilities. +#define DIST_STATES 4 + +// Macro to get the index of the appropriate probability array. +#define get_dist_state(len) \ + ((len) < DIST_STATES + MATCH_LEN_MIN \ + ? (len) - MATCH_LEN_MIN \ + : DIST_STATES - 1) + +// The highest two bits of a match distance (distance slot) are encoded +// using six bits. See fastpos.h for more explanation. +#define DIST_SLOT_BITS 6 +#define DIST_SLOTS (1 << DIST_SLOT_BITS) + +// Match distances up to 127 are fully encoded using probabilities. Since +// the highest two bits (distance slot) are always encoded using six bits, +// the distances 0-3 don't need any additional bits to encode, since the +// distance slot itself is the same as the actual distance. DIST_MODEL_START +// indicates the first distance slot where at least one additional bit is +// needed. +#define DIST_MODEL_START 4 + +// Match distances greater than 127 are encoded in three pieces: +// - distance slot: the highest two bits +// - direct bits: 2-26 bits below the highest two bits +// - alignment bits: four lowest bits +// +// Direct bits don't use any probabilities. +// +// The distance slot value of 14 is for distances 128-191 (see the table in +// fastpos.h to understand why). +#define DIST_MODEL_END 14 + +// Distance slots that indicate a distance <= 127. +#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2) +#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS) + +// For match distances greater than 127, only the highest two bits and the +// lowest four bits (alignment) is encoded using probabilities. +#define ALIGN_BITS 4 +#define ALIGN_SIZE (1 << ALIGN_BITS) +#define ALIGN_MASK (ALIGN_SIZE - 1) + +// LZMA remembers the four most recent match distances. Reusing these distances +// tends to take less space than re-encoding the actual distance value. +#define REPS 4 + +#endif diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c new file mode 100644 index 0000000..26c148a --- /dev/null +++ b/src/liblzma/lzma/lzma_decoder.c @@ -0,0 +1,1133 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_decoder.c +/// \brief LZMA decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lz_decoder.h" +#include "lzma_common.h" +#include "lzma_decoder.h" +#include "range_decoder.h" + +// The macros unroll loops with switch statements. +// Silence warnings about missing fall-through comments. +#if TUKLIB_GNUC_REQ(7, 0) +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif + + +#ifdef HAVE_SMALL + +// Macros for (somewhat) size-optimized code. +#define seq_4(seq) seq + +#define seq_6(seq) seq + +#define seq_8(seq) seq + +#define seq_len(seq) \ + seq ## _CHOICE, \ + seq ## _CHOICE2, \ + seq ## _BITTREE + +#define len_decode(target, ld, pos_state, seq) \ +do { \ +case seq ## _CHOICE: \ + rc_if_0(ld.choice, seq ## _CHOICE) { \ + rc_update_0(ld.choice); \ + probs = ld.low[pos_state];\ + limit = LEN_LOW_SYMBOLS; \ + target = MATCH_LEN_MIN; \ + } else { \ + rc_update_1(ld.choice); \ +case seq ## _CHOICE2: \ + rc_if_0(ld.choice2, seq ## _CHOICE2) { \ + rc_update_0(ld.choice2); \ + probs = ld.mid[pos_state]; \ + limit = LEN_MID_SYMBOLS; \ + target = MATCH_LEN_MIN + LEN_LOW_SYMBOLS; \ + } else { \ + rc_update_1(ld.choice2); \ + probs = ld.high; \ + limit = LEN_HIGH_SYMBOLS; \ + target = MATCH_LEN_MIN + LEN_LOW_SYMBOLS \ + + LEN_MID_SYMBOLS; \ + } \ + } \ + symbol = 1; \ +case seq ## _BITTREE: \ + do { \ + rc_bit(probs[symbol], , , seq ## _BITTREE); \ + } while (symbol < limit); \ + target += symbol - limit; \ +} while (0) + +#else // HAVE_SMALL + +// Unrolled versions +#define seq_4(seq) \ + seq ## 0, \ + seq ## 1, \ + seq ## 2, \ + seq ## 3 + +#define seq_6(seq) \ + seq ## 0, \ + seq ## 1, \ + seq ## 2, \ + seq ## 3, \ + seq ## 4, \ + seq ## 5 + +#define seq_8(seq) \ + seq ## 0, \ + seq ## 1, \ + seq ## 2, \ + seq ## 3, \ + seq ## 4, \ + seq ## 5, \ + seq ## 6, \ + seq ## 7 + +#define seq_len(seq) \ + seq ## _CHOICE, \ + seq ## _LOW0, \ + seq ## _LOW1, \ + seq ## _LOW2, \ + seq ## _CHOICE2, \ + seq ## _MID0, \ + seq ## _MID1, \ + seq ## _MID2, \ + seq ## _HIGH0, \ + seq ## _HIGH1, \ + seq ## _HIGH2, \ + seq ## _HIGH3, \ + seq ## _HIGH4, \ + seq ## _HIGH5, \ + seq ## _HIGH6, \ + seq ## _HIGH7 + +#define len_decode(target, ld, pos_state, seq) \ +do { \ + symbol = 1; \ +case seq ## _CHOICE: \ + rc_if_0(ld.choice, seq ## _CHOICE) { \ + rc_update_0(ld.choice); \ + rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW0); \ + rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW1); \ + rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW2); \ + target = symbol - LEN_LOW_SYMBOLS + MATCH_LEN_MIN; \ + } else { \ + rc_update_1(ld.choice); \ +case seq ## _CHOICE2: \ + rc_if_0(ld.choice2, seq ## _CHOICE2) { \ + rc_update_0(ld.choice2); \ + rc_bit_case(ld.mid[pos_state][symbol], , , \ + seq ## _MID0); \ + rc_bit_case(ld.mid[pos_state][symbol], , , \ + seq ## _MID1); \ + rc_bit_case(ld.mid[pos_state][symbol], , , \ + seq ## _MID2); \ + target = symbol - LEN_MID_SYMBOLS \ + + MATCH_LEN_MIN + LEN_LOW_SYMBOLS; \ + } else { \ + rc_update_1(ld.choice2); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH0); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH1); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH2); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH3); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH4); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH5); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH6); \ + rc_bit_case(ld.high[symbol], , , seq ## _HIGH7); \ + target = symbol - LEN_HIGH_SYMBOLS \ + + MATCH_LEN_MIN \ + + LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS; \ + } \ + } \ +} while (0) + +#endif // HAVE_SMALL + + +/// Length decoder probabilities; see comments in lzma_common.h. +typedef struct { + probability choice; + probability choice2; + probability low[POS_STATES_MAX][LEN_LOW_SYMBOLS]; + probability mid[POS_STATES_MAX][LEN_MID_SYMBOLS]; + probability high[LEN_HIGH_SYMBOLS]; +} lzma_length_decoder; + + +typedef struct { + /////////////////// + // Probabilities // + /////////////////// + + /// Literals; see comments in lzma_common.h. + probability literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE]; + + /// If 1, it's a match. Otherwise it's a single 8-bit literal. + probability is_match[STATES][POS_STATES_MAX]; + + /// If 1, it's a repeated match. The distance is one of rep0 .. rep3. + probability is_rep[STATES]; + + /// If 0, distance of a repeated match is rep0. + /// Otherwise check is_rep1. + probability is_rep0[STATES]; + + /// If 0, distance of a repeated match is rep1. + /// Otherwise check is_rep2. + probability is_rep1[STATES]; + + /// If 0, distance of a repeated match is rep2. Otherwise it is rep3. + probability is_rep2[STATES]; + + /// If 1, the repeated match has length of one byte. Otherwise + /// the length is decoded from rep_len_decoder. + probability is_rep0_long[STATES][POS_STATES_MAX]; + + /// Probability tree for the highest two bits of the match distance. + /// There is a separate probability tree for match lengths of + /// 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273]. + probability dist_slot[DIST_STATES][DIST_SLOTS]; + + /// Probability trees for additional bits for match distance when the + /// distance is in the range [4, 127]. + probability pos_special[FULL_DISTANCES - DIST_MODEL_END]; + + /// Probability tree for the lowest four bits of a match distance + /// that is equal to or greater than 128. + probability pos_align[ALIGN_SIZE]; + + /// Length of a normal match + lzma_length_decoder match_len_decoder; + + /// Length of a repeated match + lzma_length_decoder rep_len_decoder; + + /////////////////// + // Decoder state // + /////////////////// + + // Range coder + lzma_range_decoder rc; + + // Types of the most recently seen LZMA symbols + lzma_lzma_state state; + + uint32_t rep0; ///< Distance of the latest match + uint32_t rep1; ///< Distance of second latest match + uint32_t rep2; ///< Distance of third latest match + uint32_t rep3; ///< Distance of fourth latest match + + uint32_t pos_mask; // (1U << pb) - 1 + uint32_t literal_context_bits; + uint32_t literal_pos_mask; + + /// Uncompressed size as bytes, or LZMA_VLI_UNKNOWN if end of + /// payload marker is expected. + lzma_vli uncompressed_size; + + /// True if end of payload marker (EOPM) is allowed even when + /// uncompressed_size is known; false if EOPM must not be present. + /// This is ignored if uncompressed_size == LZMA_VLI_UNKNOWN. + bool allow_eopm; + + //////////////////////////////// + // State of incomplete symbol // + //////////////////////////////// + + /// Position where to continue the decoder loop + enum { + SEQ_NORMALIZE, + SEQ_IS_MATCH, + seq_8(SEQ_LITERAL), + seq_8(SEQ_LITERAL_MATCHED), + SEQ_LITERAL_WRITE, + SEQ_IS_REP, + seq_len(SEQ_MATCH_LEN), + seq_6(SEQ_DIST_SLOT), + SEQ_DIST_MODEL, + SEQ_DIRECT, + seq_4(SEQ_ALIGN), + SEQ_EOPM, + SEQ_IS_REP0, + SEQ_SHORTREP, + SEQ_IS_REP0_LONG, + SEQ_IS_REP1, + SEQ_IS_REP2, + seq_len(SEQ_REP_LEN), + SEQ_COPY, + } sequence; + + /// Base of the current probability tree + probability *probs; + + /// Symbol being decoded. This is also used as an index variable in + /// bittree decoders: probs[symbol] + uint32_t symbol; + + /// Used as a loop termination condition on bittree decoders and + /// direct bits decoder. + uint32_t limit; + + /// Matched literal decoder: 0x100 or 0 to help avoiding branches. + /// Bittree reverse decoders: Offset of the next bit: 1 << offset + uint32_t offset; + + /// If decoding a literal: match byte. + /// If decoding a match: length of the match. + uint32_t len; +} lzma_lzma1_decoder; + + +static lzma_ret +lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr, + const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size) +{ + lzma_lzma1_decoder *restrict coder = coder_ptr; + + //////////////////// + // Initialization // + //////////////////// + + { + const lzma_ret ret = rc_read_init( + &coder->rc, in, in_pos, in_size); + if (ret != LZMA_STREAM_END) + return ret; + } + + /////////////// + // Variables // + /////////////// + + // Making local copies of often-used variables improves both + // speed and readability. + + lzma_dict dict = *dictptr; + + const size_t dict_start = dict.pos; + + // Range decoder + rc_to_local(coder->rc, *in_pos); + + // State + uint32_t state = coder->state; + uint32_t rep0 = coder->rep0; + uint32_t rep1 = coder->rep1; + uint32_t rep2 = coder->rep2; + uint32_t rep3 = coder->rep3; + + const uint32_t pos_mask = coder->pos_mask; + + // These variables are actually needed only if we last time ran + // out of input in the middle of the decoder loop. + probability *probs = coder->probs; + uint32_t symbol = coder->symbol; + uint32_t limit = coder->limit; + uint32_t offset = coder->offset; + uint32_t len = coder->len; + + const uint32_t literal_pos_mask = coder->literal_pos_mask; + const uint32_t literal_context_bits = coder->literal_context_bits; + + // Temporary variables + uint32_t pos_state = dict.pos & pos_mask; + + lzma_ret ret = LZMA_OK; + + // This is true when the next LZMA symbol is allowed to be EOPM. + // That is, if this is false, then EOPM is considered + // an invalid symbol and we will return LZMA_DATA_ERROR. + // + // EOPM is always required (not just allowed) when + // the uncompressed size isn't known. When uncompressed size + // is known, eopm_is_valid may be set to true later. + bool eopm_is_valid = coder->uncompressed_size == LZMA_VLI_UNKNOWN; + + // If uncompressed size is known and there is enough output space + // to decode all the data, limit the available buffer space so that + // the main loop won't try to decode past the end of the stream. + bool might_finish_without_eopm = false; + if (coder->uncompressed_size != LZMA_VLI_UNKNOWN + && coder->uncompressed_size <= dict.limit - dict.pos) { + dict.limit = dict.pos + (size_t)(coder->uncompressed_size); + might_finish_without_eopm = true; + } + + // The main decoder loop. The "switch" is used to restart the decoder at + // correct location. Once restarted, the "switch" is no longer used. + switch (coder->sequence) + while (true) { + // Calculate new pos_state. This is skipped on the first loop + // since we already calculated it when setting up the local + // variables. + pos_state = dict.pos & pos_mask; + + case SEQ_NORMALIZE: + case SEQ_IS_MATCH: + if (unlikely(might_finish_without_eopm + && dict.pos == dict.limit)) { + // In rare cases there is a useless byte that needs + // to be read anyway. + rc_normalize(SEQ_NORMALIZE); + + // If the range decoder state is such that we can + // be at the end of the LZMA stream, then the + // decoding is finished. + if (rc_is_finished(rc)) { + ret = LZMA_STREAM_END; + goto out; + } + + // If the caller hasn't allowed EOPM to be present + // together with known uncompressed size, then the + // LZMA stream is corrupt. + if (!coder->allow_eopm) { + ret = LZMA_DATA_ERROR; + goto out; + } + + // Otherwise continue decoding with the expectation + // that the next LZMA symbol is EOPM. + eopm_is_valid = true; + } + + rc_if_0(coder->is_match[state][pos_state], SEQ_IS_MATCH) { + rc_update_0(coder->is_match[state][pos_state]); + + // It's a literal i.e. a single 8-bit byte. + + probs = literal_subcoder(coder->literal, + literal_context_bits, literal_pos_mask, + dict.pos, dict_get(&dict, 0)); + symbol = 1; + + if (is_literal_state(state)) { + // Decode literal without match byte. +#ifdef HAVE_SMALL + case SEQ_LITERAL: + do { + rc_bit(probs[symbol], , , SEQ_LITERAL); + } while (symbol < (1 << 8)); +#else + rc_bit_case(probs[symbol], , , SEQ_LITERAL0); + rc_bit_case(probs[symbol], , , SEQ_LITERAL1); + rc_bit_case(probs[symbol], , , SEQ_LITERAL2); + rc_bit_case(probs[symbol], , , SEQ_LITERAL3); + rc_bit_case(probs[symbol], , , SEQ_LITERAL4); + rc_bit_case(probs[symbol], , , SEQ_LITERAL5); + rc_bit_case(probs[symbol], , , SEQ_LITERAL6); + rc_bit_case(probs[symbol], , , SEQ_LITERAL7); +#endif + } else { + // Decode literal with match byte. + // + // We store the byte we compare against + // ("match byte") to "len" to minimize the + // number of variables we need to store + // between decoder calls. + len = (uint32_t)(dict_get(&dict, rep0)) << 1; + + // The usage of "offset" allows omitting some + // branches, which should give tiny speed + // improvement on some CPUs. "offset" gets + // set to zero if match_bit didn't match. + offset = 0x100; + +#ifdef HAVE_SMALL + case SEQ_LITERAL_MATCHED: + do { + const uint32_t match_bit + = len & offset; + const uint32_t subcoder_index + = offset + match_bit + + symbol; + + rc_bit(probs[subcoder_index], + offset &= ~match_bit, + offset &= match_bit, + SEQ_LITERAL_MATCHED); + + // It seems to be faster to do this + // here instead of putting it to the + // beginning of the loop and then + // putting the "case" in the middle + // of the loop. + len <<= 1; + + } while (symbol < (1 << 8)); +#else + // Unroll the loop. + uint32_t match_bit; + uint32_t subcoder_index; + +# define d(seq) \ + case seq: \ + match_bit = len & offset; \ + subcoder_index = offset + match_bit + symbol; \ + rc_bit(probs[subcoder_index], \ + offset &= ~match_bit, \ + offset &= match_bit, \ + seq) + + d(SEQ_LITERAL_MATCHED0); + len <<= 1; + d(SEQ_LITERAL_MATCHED1); + len <<= 1; + d(SEQ_LITERAL_MATCHED2); + len <<= 1; + d(SEQ_LITERAL_MATCHED3); + len <<= 1; + d(SEQ_LITERAL_MATCHED4); + len <<= 1; + d(SEQ_LITERAL_MATCHED5); + len <<= 1; + d(SEQ_LITERAL_MATCHED6); + len <<= 1; + d(SEQ_LITERAL_MATCHED7); +# undef d +#endif + } + + //update_literal(state); + // Use a lookup table to update to literal state, + // since compared to other state updates, this would + // need two branches. + static const lzma_lzma_state next_state[] = { + STATE_LIT_LIT, + STATE_LIT_LIT, + STATE_LIT_LIT, + STATE_LIT_LIT, + STATE_MATCH_LIT_LIT, + STATE_REP_LIT_LIT, + STATE_SHORTREP_LIT_LIT, + STATE_MATCH_LIT, + STATE_REP_LIT, + STATE_SHORTREP_LIT, + STATE_MATCH_LIT, + STATE_REP_LIT + }; + state = next_state[state]; + + case SEQ_LITERAL_WRITE: + if (unlikely(dict_put(&dict, symbol))) { + coder->sequence = SEQ_LITERAL_WRITE; + goto out; + } + + continue; + } + + // Instead of a new byte we are going to get a byte range + // (distance and length) which will be repeated from our + // output history. + + rc_update_1(coder->is_match[state][pos_state]); + + case SEQ_IS_REP: + rc_if_0(coder->is_rep[state], SEQ_IS_REP) { + // Not a repeated match + rc_update_0(coder->is_rep[state]); + update_match(state); + + // The latest three match distances are kept in + // memory in case there are repeated matches. + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + + // Decode the length of the match. + len_decode(len, coder->match_len_decoder, + pos_state, SEQ_MATCH_LEN); + + // Prepare to decode the highest two bits of the + // match distance. + probs = coder->dist_slot[get_dist_state(len)]; + symbol = 1; + +#ifdef HAVE_SMALL + case SEQ_DIST_SLOT: + do { + rc_bit(probs[symbol], , , SEQ_DIST_SLOT); + } while (symbol < DIST_SLOTS); +#else + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT0); + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT1); + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT2); + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT3); + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT4); + rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT5); +#endif + // Get rid of the highest bit that was needed for + // indexing of the probability array. + symbol -= DIST_SLOTS; + assert(symbol <= 63); + + if (symbol < DIST_MODEL_START) { + // Match distances [0, 3] have only two bits. + rep0 = symbol; + } else { + // Decode the lowest [1, 29] bits of + // the match distance. + limit = (symbol >> 1) - 1; + assert(limit >= 1 && limit <= 30); + rep0 = 2 + (symbol & 1); + + if (symbol < DIST_MODEL_END) { + // Prepare to decode the low bits for + // a distance of [4, 127]. + assert(limit <= 5); + rep0 <<= limit; + assert(rep0 <= 96); + // -1 is fine, because we start + // decoding at probs[1], not probs[0]. + // NOTE: This violates the C standard, + // since we are doing pointer + // arithmetic past the beginning of + // the array. + assert((int32_t)(rep0 - symbol - 1) + >= -1); + assert((int32_t)(rep0 - symbol - 1) + <= 82); + probs = coder->pos_special + rep0 + - symbol - 1; + symbol = 1; + offset = 0; + case SEQ_DIST_MODEL: +#ifdef HAVE_SMALL + do { + rc_bit(probs[symbol], , + rep0 += 1U << offset, + SEQ_DIST_MODEL); + } while (++offset < limit); +#else + switch (limit) { + case 5: + assert(offset == 0); + rc_bit(probs[symbol], , + rep0 += 1U, + SEQ_DIST_MODEL); + ++offset; + --limit; + case 4: + rc_bit(probs[symbol], , + rep0 += 1U << offset, + SEQ_DIST_MODEL); + ++offset; + --limit; + case 3: + rc_bit(probs[symbol], , + rep0 += 1U << offset, + SEQ_DIST_MODEL); + ++offset; + --limit; + case 2: + rc_bit(probs[symbol], , + rep0 += 1U << offset, + SEQ_DIST_MODEL); + ++offset; + --limit; + case 1: + // We need "symbol" only for + // indexing the probability + // array, thus we can use + // rc_bit_last() here to omit + // the unneeded updating of + // "symbol". + rc_bit_last(probs[symbol], , + rep0 += 1U << offset, + SEQ_DIST_MODEL); + } +#endif + } else { + // The distance is >= 128. Decode the + // lower bits without probabilities + // except the lowest four bits. + assert(symbol >= 14); + assert(limit >= 6); + limit -= ALIGN_BITS; + assert(limit >= 2); + case SEQ_DIRECT: + // Not worth manual unrolling + do { + rc_direct(rep0, SEQ_DIRECT); + } while (--limit > 0); + + // Decode the lowest four bits using + // probabilities. + rep0 <<= ALIGN_BITS; + symbol = 1; +#ifdef HAVE_SMALL + offset = 0; + case SEQ_ALIGN: + do { + rc_bit(coder->pos_align[ + symbol], , + rep0 += 1U << offset, + SEQ_ALIGN); + } while (++offset < ALIGN_BITS); +#else + case SEQ_ALIGN0: + rc_bit(coder->pos_align[symbol], , + rep0 += 1, SEQ_ALIGN0); + case SEQ_ALIGN1: + rc_bit(coder->pos_align[symbol], , + rep0 += 2, SEQ_ALIGN1); + case SEQ_ALIGN2: + rc_bit(coder->pos_align[symbol], , + rep0 += 4, SEQ_ALIGN2); + case SEQ_ALIGN3: + // Like in SEQ_DIST_MODEL, we don't + // need "symbol" for anything else + // than indexing the probability array. + rc_bit_last(coder->pos_align[symbol], , + rep0 += 8, SEQ_ALIGN3); +#endif + + if (rep0 == UINT32_MAX) { + // End of payload marker was + // found. It may only be + // present if + // - uncompressed size is + // unknown or + // - after known uncompressed + // size amount of bytes has + // been decompressed and + // caller has indicated + // that EOPM might be used + // (it's not allowed in + // LZMA2). + if (!eopm_is_valid) { + ret = LZMA_DATA_ERROR; + goto out; + } + + case SEQ_EOPM: + // LZMA1 stream with + // end-of-payload marker. + rc_normalize(SEQ_EOPM); + ret = rc_is_finished(rc) + ? LZMA_STREAM_END + : LZMA_DATA_ERROR; + goto out; + } + } + } + + // Validate the distance we just decoded. + if (unlikely(!dict_is_distance_valid(&dict, rep0))) { + ret = LZMA_DATA_ERROR; + goto out; + } + + } else { + rc_update_1(coder->is_rep[state]); + + // Repeated match + // + // The match distance is a value that we have had + // earlier. The latest four match distances are + // available as rep0, rep1, rep2 and rep3. We will + // now decode which of them is the new distance. + // + // There cannot be a match if we haven't produced + // any output, so check that first. + if (unlikely(!dict_is_distance_valid(&dict, 0))) { + ret = LZMA_DATA_ERROR; + goto out; + } + + case SEQ_IS_REP0: + rc_if_0(coder->is_rep0[state], SEQ_IS_REP0) { + rc_update_0(coder->is_rep0[state]); + // The distance is rep0. + + case SEQ_IS_REP0_LONG: + rc_if_0(coder->is_rep0_long[state][pos_state], + SEQ_IS_REP0_LONG) { + rc_update_0(coder->is_rep0_long[ + state][pos_state]); + + update_short_rep(state); + + case SEQ_SHORTREP: + if (unlikely(dict_put(&dict, dict_get( + &dict, rep0)))) { + coder->sequence = SEQ_SHORTREP; + goto out; + } + + continue; + } + + // Repeating more than one byte at + // distance of rep0. + rc_update_1(coder->is_rep0_long[ + state][pos_state]); + + } else { + rc_update_1(coder->is_rep0[state]); + + case SEQ_IS_REP1: + // The distance is rep1, rep2 or rep3. Once + // we find out which one of these three, it + // is stored to rep0 and rep1, rep2 and rep3 + // are updated accordingly. + rc_if_0(coder->is_rep1[state], SEQ_IS_REP1) { + rc_update_0(coder->is_rep1[state]); + + const uint32_t distance = rep1; + rep1 = rep0; + rep0 = distance; + + } else { + rc_update_1(coder->is_rep1[state]); + case SEQ_IS_REP2: + rc_if_0(coder->is_rep2[state], + SEQ_IS_REP2) { + rc_update_0(coder->is_rep2[ + state]); + + const uint32_t distance = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance; + + } else { + rc_update_1(coder->is_rep2[ + state]); + + const uint32_t distance = rep3; + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance; + } + } + } + + update_long_rep(state); + + // Decode the length of the repeated match. + len_decode(len, coder->rep_len_decoder, + pos_state, SEQ_REP_LEN); + } + + ///////////////////////////////// + // Repeat from history buffer. // + ///////////////////////////////// + + // The length is always between these limits. There is no way + // to trigger the algorithm to set len outside this range. + assert(len >= MATCH_LEN_MIN); + assert(len <= MATCH_LEN_MAX); + + case SEQ_COPY: + // Repeat len bytes from distance of rep0. + if (unlikely(dict_repeat(&dict, rep0, &len))) { + coder->sequence = SEQ_COPY; + goto out; + } + } + +out: + // Save state + + // NOTE: Must not copy dict.limit. + dictptr->pos = dict.pos; + dictptr->full = dict.full; + + rc_from_local(coder->rc, *in_pos); + + coder->state = state; + coder->rep0 = rep0; + coder->rep1 = rep1; + coder->rep2 = rep2; + coder->rep3 = rep3; + + coder->probs = probs; + coder->symbol = symbol; + coder->limit = limit; + coder->offset = offset; + coder->len = len; + + // Update the remaining amount of uncompressed data if uncompressed + // size was known. + if (coder->uncompressed_size != LZMA_VLI_UNKNOWN) { + coder->uncompressed_size -= dict.pos - dict_start; + + // If we have gotten all the output but the decoder wants + // to write more output, the file is corrupt. There are + // three SEQ values where output is produced. + if (coder->uncompressed_size == 0 && ret == LZMA_OK + && (coder->sequence == SEQ_LITERAL_WRITE + || coder->sequence == SEQ_SHORTREP + || coder->sequence == SEQ_COPY)) + ret = LZMA_DATA_ERROR; + } + + if (ret == LZMA_STREAM_END) { + // Reset the range decoder so that it is ready to reinitialize + // for a new LZMA2 chunk. + rc_reset(coder->rc); + coder->sequence = SEQ_IS_MATCH; + } + + return ret; +} + + + +static void +lzma_decoder_uncompressed(void *coder_ptr, lzma_vli uncompressed_size, + bool allow_eopm) +{ + lzma_lzma1_decoder *coder = coder_ptr; + coder->uncompressed_size = uncompressed_size; + coder->allow_eopm = allow_eopm; +} + + +static void +lzma_decoder_reset(void *coder_ptr, const void *opt) +{ + lzma_lzma1_decoder *coder = coder_ptr; + const lzma_options_lzma *options = opt; + + // NOTE: We assume that lc/lp/pb are valid since they were + // successfully decoded with lzma_lzma_decode_properties(). + + // Calculate pos_mask. We don't need pos_bits as is for anything. + coder->pos_mask = (1U << options->pb) - 1; + + // Initialize the literal decoder. + literal_init(coder->literal, options->lc, options->lp); + + coder->literal_context_bits = options->lc; + coder->literal_pos_mask = (1U << options->lp) - 1; + + // State + coder->state = STATE_LIT_LIT; + coder->rep0 = 0; + coder->rep1 = 0; + coder->rep2 = 0; + coder->rep3 = 0; + coder->pos_mask = (1U << options->pb) - 1; + + // Range decoder + rc_reset(coder->rc); + + // Bit and bittree decoders + for (uint32_t i = 0; i < STATES; ++i) { + for (uint32_t j = 0; j <= coder->pos_mask; ++j) { + bit_reset(coder->is_match[i][j]); + bit_reset(coder->is_rep0_long[i][j]); + } + + bit_reset(coder->is_rep[i]); + bit_reset(coder->is_rep0[i]); + bit_reset(coder->is_rep1[i]); + bit_reset(coder->is_rep2[i]); + } + + for (uint32_t i = 0; i < DIST_STATES; ++i) + bittree_reset(coder->dist_slot[i], DIST_SLOT_BITS); + + for (uint32_t i = 0; i < FULL_DISTANCES - DIST_MODEL_END; ++i) + bit_reset(coder->pos_special[i]); + + bittree_reset(coder->pos_align, ALIGN_BITS); + + // Len decoders (also bit/bittree) + const uint32_t num_pos_states = 1U << options->pb; + bit_reset(coder->match_len_decoder.choice); + bit_reset(coder->match_len_decoder.choice2); + bit_reset(coder->rep_len_decoder.choice); + bit_reset(coder->rep_len_decoder.choice2); + + for (uint32_t pos_state = 0; pos_state < num_pos_states; ++pos_state) { + bittree_reset(coder->match_len_decoder.low[pos_state], + LEN_LOW_BITS); + bittree_reset(coder->match_len_decoder.mid[pos_state], + LEN_MID_BITS); + + bittree_reset(coder->rep_len_decoder.low[pos_state], + LEN_LOW_BITS); + bittree_reset(coder->rep_len_decoder.mid[pos_state], + LEN_MID_BITS); + } + + bittree_reset(coder->match_len_decoder.high, LEN_HIGH_BITS); + bittree_reset(coder->rep_len_decoder.high, LEN_HIGH_BITS); + + coder->sequence = SEQ_IS_MATCH; + coder->probs = NULL; + coder->symbol = 0; + coder->limit = 0; + coder->offset = 0; + coder->len = 0; + + return; +} + + +extern lzma_ret +lzma_lzma_decoder_create(lzma_lz_decoder *lz, const lzma_allocator *allocator, + const lzma_options_lzma *options, lzma_lz_options *lz_options) +{ + if (lz->coder == NULL) { + lz->coder = lzma_alloc(sizeof(lzma_lzma1_decoder), allocator); + if (lz->coder == NULL) + return LZMA_MEM_ERROR; + + lz->code = &lzma_decode; + lz->reset = &lzma_decoder_reset; + lz->set_uncompressed = &lzma_decoder_uncompressed; + } + + // All dictionary sizes are OK here. LZ decoder will take care of + // the special cases. + lz_options->dict_size = options->dict_size; + lz_options->preset_dict = options->preset_dict; + lz_options->preset_dict_size = options->preset_dict_size; + + return LZMA_OK; +} + + +/// Allocate and initialize LZMA decoder. This is used only via LZ +/// initialization (lzma_lzma_decoder_init() passes function pointer to +/// the LZ initialization). +static lzma_ret +lzma_decoder_init(lzma_lz_decoder *lz, const lzma_allocator *allocator, + lzma_vli id, const void *options, lzma_lz_options *lz_options) +{ + if (!is_lclppb_valid(options)) + return LZMA_PROG_ERROR; + + lzma_vli uncomp_size = LZMA_VLI_UNKNOWN; + bool allow_eopm = true; + + if (id == LZMA_FILTER_LZMA1EXT) { + const lzma_options_lzma *opt = options; + + // Only one flag is supported. + if (opt->ext_flags & ~LZMA_LZMA1EXT_ALLOW_EOPM) + return LZMA_OPTIONS_ERROR; + + // FIXME? Using lzma_vli instead of uint64_t is weird because + // this has nothing to do with .xz headers and variable-length + // integer encoding. On the other hand, using LZMA_VLI_UNKNOWN + // instead of UINT64_MAX is clearer when unknown size is + // meant. A problem with using lzma_vli is that now we + // allow > LZMA_VLI_MAX which is fine in this file but + // it's still confusing. Note that alone_decoder.c also + // allows > LZMA_VLI_MAX when setting uncompressed size. + uncomp_size = opt->ext_size_low + + ((uint64_t)(opt->ext_size_high) << 32); + allow_eopm = (opt->ext_flags & LZMA_LZMA1EXT_ALLOW_EOPM) != 0 + || uncomp_size == LZMA_VLI_UNKNOWN; + } + + return_if_error(lzma_lzma_decoder_create( + lz, allocator, options, lz_options)); + + lzma_decoder_reset(lz->coder, options); + lzma_decoder_uncompressed(lz->coder, uncomp_size, allow_eopm); + + return LZMA_OK; +} + + +extern lzma_ret +lzma_lzma_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + // LZMA can only be the last filter in the chain. This is enforced + // by the raw_decoder initialization. + assert(filters[1].init == NULL); + + return lzma_lz_decoder_init(next, allocator, filters, + &lzma_decoder_init); +} + + +extern bool +lzma_lzma_lclppb_decode(lzma_options_lzma *options, uint8_t byte) +{ + if (byte > (4 * 5 + 4) * 9 + 8) + return true; + + // See the file format specification to understand this. + options->pb = byte / (9 * 5); + byte -= options->pb * 9 * 5; + options->lp = byte / 9; + options->lc = byte - options->lp * 9; + + return options->lc + options->lp > LZMA_LCLP_MAX; +} + + +extern uint64_t +lzma_lzma_decoder_memusage_nocheck(const void *options) +{ + const lzma_options_lzma *const opt = options; + return sizeof(lzma_lzma1_decoder) + + lzma_lz_decoder_memusage(opt->dict_size); +} + + +extern uint64_t +lzma_lzma_decoder_memusage(const void *options) +{ + if (!is_lclppb_valid(options)) + return UINT64_MAX; + + return lzma_lzma_decoder_memusage_nocheck(options); +} + + +extern lzma_ret +lzma_lzma_props_decode(void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) +{ + if (props_size != 5) + return LZMA_OPTIONS_ERROR; + + lzma_options_lzma *opt + = lzma_alloc(sizeof(lzma_options_lzma), allocator); + if (opt == NULL) + return LZMA_MEM_ERROR; + + if (lzma_lzma_lclppb_decode(opt, props[0])) + goto error; + + // All dictionary sizes are accepted, including zero. LZ decoder + // will automatically use a dictionary at least a few KiB even if + // a smaller dictionary is requested. + opt->dict_size = read32le(props + 1); + + opt->preset_dict = NULL; + opt->preset_dict_size = 0; + + *options = opt; + + return LZMA_OK; + +error: + lzma_free(opt, allocator); + return LZMA_OPTIONS_ERROR; +} diff --git a/src/liblzma/lzma/lzma_decoder.h b/src/liblzma/lzma/lzma_decoder.h new file mode 100644 index 0000000..1427bc2 --- /dev/null +++ b/src/liblzma/lzma/lzma_decoder.h @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_decoder.h +/// \brief LZMA decoder API +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA_DECODER_H +#define LZMA_LZMA_DECODER_H + +#include "common.h" + + +/// Allocates and initializes LZMA decoder +extern lzma_ret lzma_lzma_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern uint64_t lzma_lzma_decoder_memusage(const void *options); + +extern lzma_ret lzma_lzma_props_decode( + void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size); + + +/// \brief Decodes the LZMA Properties byte (lc/lp/pb) +/// +/// \return true if error occurred, false on success +/// +extern bool lzma_lzma_lclppb_decode( + lzma_options_lzma *options, uint8_t byte); + + +#ifdef LZMA_LZ_DECODER_H +/// Allocate and setup function pointers only. This is used by LZMA1 and +/// LZMA2 decoders. +extern lzma_ret lzma_lzma_decoder_create( + lzma_lz_decoder *lz, const lzma_allocator *allocator, + const lzma_options_lzma *opt, lzma_lz_options *lz_options); + +/// Gets memory usage without validating lc/lp/pb. This is used by LZMA2 +/// decoder, because raw LZMA2 decoding doesn't need lc/lp/pb. +extern uint64_t lzma_lzma_decoder_memusage_nocheck(const void *options); + +#endif + +#endif diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c new file mode 100644 index 0000000..dc62f44 --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder.c @@ -0,0 +1,784 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder.c +/// \brief LZMA encoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma2_encoder.h" +#include "lzma_encoder_private.h" +#include "fastpos.h" + + +///////////// +// Literal // +///////////// + +static inline void +literal_matched(lzma_range_encoder *rc, probability *subcoder, + uint32_t match_byte, uint32_t symbol) +{ + uint32_t offset = 0x100; + symbol += UINT32_C(1) << 8; + + do { + match_byte <<= 1; + const uint32_t match_bit = match_byte & offset; + const uint32_t subcoder_index + = offset + match_bit + (symbol >> 8); + const uint32_t bit = (symbol >> 7) & 1; + rc_bit(rc, &subcoder[subcoder_index], bit); + + symbol <<= 1; + offset &= ~(match_byte ^ symbol); + + } while (symbol < (UINT32_C(1) << 16)); +} + + +static inline void +literal(lzma_lzma1_encoder *coder, lzma_mf *mf, uint32_t position) +{ + // Locate the literal byte to be encoded and the subcoder. + const uint8_t cur_byte = mf->buffer[ + mf->read_pos - mf->read_ahead]; + probability *subcoder = literal_subcoder(coder->literal, + coder->literal_context_bits, coder->literal_pos_mask, + position, mf->buffer[mf->read_pos - mf->read_ahead - 1]); + + if (is_literal_state(coder->state)) { + // Previous LZMA-symbol was a literal. Encode a normal + // literal without a match byte. + rc_bittree(&coder->rc, subcoder, 8, cur_byte); + } else { + // Previous LZMA-symbol was a match. Use the last byte of + // the match as a "match byte". That is, compare the bits + // of the current literal and the match byte. + const uint8_t match_byte = mf->buffer[ + mf->read_pos - coder->reps[0] - 1 + - mf->read_ahead]; + literal_matched(&coder->rc, subcoder, match_byte, cur_byte); + } + + update_literal(coder->state); +} + + +////////////////// +// Match length // +////////////////// + +static void +length_update_prices(lzma_length_encoder *lc, const uint32_t pos_state) +{ + const uint32_t table_size = lc->table_size; + lc->counters[pos_state] = table_size; + + const uint32_t a0 = rc_bit_0_price(lc->choice); + const uint32_t a1 = rc_bit_1_price(lc->choice); + const uint32_t b0 = a1 + rc_bit_0_price(lc->choice2); + const uint32_t b1 = a1 + rc_bit_1_price(lc->choice2); + uint32_t *const prices = lc->prices[pos_state]; + + uint32_t i; + for (i = 0; i < table_size && i < LEN_LOW_SYMBOLS; ++i) + prices[i] = a0 + rc_bittree_price(lc->low[pos_state], + LEN_LOW_BITS, i); + + for (; i < table_size && i < LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS; ++i) + prices[i] = b0 + rc_bittree_price(lc->mid[pos_state], + LEN_MID_BITS, i - LEN_LOW_SYMBOLS); + + for (; i < table_size; ++i) + prices[i] = b1 + rc_bittree_price(lc->high, LEN_HIGH_BITS, + i - LEN_LOW_SYMBOLS - LEN_MID_SYMBOLS); + + return; +} + + +static inline void +length(lzma_range_encoder *rc, lzma_length_encoder *lc, + const uint32_t pos_state, uint32_t len, const bool fast_mode) +{ + assert(len <= MATCH_LEN_MAX); + len -= MATCH_LEN_MIN; + + if (len < LEN_LOW_SYMBOLS) { + rc_bit(rc, &lc->choice, 0); + rc_bittree(rc, lc->low[pos_state], LEN_LOW_BITS, len); + } else { + rc_bit(rc, &lc->choice, 1); + len -= LEN_LOW_SYMBOLS; + + if (len < LEN_MID_SYMBOLS) { + rc_bit(rc, &lc->choice2, 0); + rc_bittree(rc, lc->mid[pos_state], LEN_MID_BITS, len); + } else { + rc_bit(rc, &lc->choice2, 1); + len -= LEN_MID_SYMBOLS; + rc_bittree(rc, lc->high, LEN_HIGH_BITS, len); + } + } + + // Only getoptimum uses the prices so don't update the table when + // in fast mode. + if (!fast_mode) + if (--lc->counters[pos_state] == 0) + length_update_prices(lc, pos_state); +} + + +/////////// +// Match // +/////////// + +static inline void +match(lzma_lzma1_encoder *coder, const uint32_t pos_state, + const uint32_t distance, const uint32_t len) +{ + update_match(coder->state); + + length(&coder->rc, &coder->match_len_encoder, pos_state, len, + coder->fast_mode); + + const uint32_t dist_slot = get_dist_slot(distance); + const uint32_t dist_state = get_dist_state(len); + rc_bittree(&coder->rc, coder->dist_slot[dist_state], + DIST_SLOT_BITS, dist_slot); + + if (dist_slot >= DIST_MODEL_START) { + const uint32_t footer_bits = (dist_slot >> 1) - 1; + const uint32_t base = (2 | (dist_slot & 1)) << footer_bits; + const uint32_t dist_reduced = distance - base; + + if (dist_slot < DIST_MODEL_END) { + // Careful here: base - dist_slot - 1 can be -1, but + // rc_bittree_reverse starts at probs[1], not probs[0]. + rc_bittree_reverse(&coder->rc, + coder->dist_special + base - dist_slot - 1, + footer_bits, dist_reduced); + } else { + rc_direct(&coder->rc, dist_reduced >> ALIGN_BITS, + footer_bits - ALIGN_BITS); + rc_bittree_reverse( + &coder->rc, coder->dist_align, + ALIGN_BITS, dist_reduced & ALIGN_MASK); + ++coder->align_price_count; + } + } + + coder->reps[3] = coder->reps[2]; + coder->reps[2] = coder->reps[1]; + coder->reps[1] = coder->reps[0]; + coder->reps[0] = distance; + ++coder->match_price_count; +} + + +//////////////////// +// Repeated match // +//////////////////// + +static inline void +rep_match(lzma_lzma1_encoder *coder, const uint32_t pos_state, + const uint32_t rep, const uint32_t len) +{ + if (rep == 0) { + rc_bit(&coder->rc, &coder->is_rep0[coder->state], 0); + rc_bit(&coder->rc, + &coder->is_rep0_long[coder->state][pos_state], + len != 1); + } else { + const uint32_t distance = coder->reps[rep]; + rc_bit(&coder->rc, &coder->is_rep0[coder->state], 1); + + if (rep == 1) { + rc_bit(&coder->rc, &coder->is_rep1[coder->state], 0); + } else { + rc_bit(&coder->rc, &coder->is_rep1[coder->state], 1); + rc_bit(&coder->rc, &coder->is_rep2[coder->state], + rep - 2); + + if (rep == 3) + coder->reps[3] = coder->reps[2]; + + coder->reps[2] = coder->reps[1]; + } + + coder->reps[1] = coder->reps[0]; + coder->reps[0] = distance; + } + + if (len == 1) { + update_short_rep(coder->state); + } else { + length(&coder->rc, &coder->rep_len_encoder, pos_state, len, + coder->fast_mode); + update_long_rep(coder->state); + } +} + + +////////// +// Main // +////////// + +static void +encode_symbol(lzma_lzma1_encoder *coder, lzma_mf *mf, + uint32_t back, uint32_t len, uint32_t position) +{ + const uint32_t pos_state = position & coder->pos_mask; + + if (back == UINT32_MAX) { + // Literal i.e. eight-bit byte + assert(len == 1); + rc_bit(&coder->rc, + &coder->is_match[coder->state][pos_state], 0); + literal(coder, mf, position); + } else { + // Some type of match + rc_bit(&coder->rc, + &coder->is_match[coder->state][pos_state], 1); + + if (back < REPS) { + // It's a repeated match i.e. the same distance + // has been used earlier. + rc_bit(&coder->rc, &coder->is_rep[coder->state], 1); + rep_match(coder, pos_state, back, len); + } else { + // Normal match + rc_bit(&coder->rc, &coder->is_rep[coder->state], 0); + match(coder, pos_state, back - REPS, len); + } + } + + assert(mf->read_ahead >= len); + mf->read_ahead -= len; +} + + +static bool +encode_init(lzma_lzma1_encoder *coder, lzma_mf *mf) +{ + assert(mf_position(mf) == 0); + assert(coder->uncomp_size == 0); + + if (mf->read_pos == mf->read_limit) { + if (mf->action == LZMA_RUN) + return false; // We cannot do anything. + + // We are finishing (we cannot get here when flushing). + assert(mf->write_pos == mf->read_pos); + assert(mf->action == LZMA_FINISH); + } else { + // Do the actual initialization. The first LZMA symbol must + // always be a literal. + mf_skip(mf, 1); + mf->read_ahead = 0; + rc_bit(&coder->rc, &coder->is_match[0][0], 0); + rc_bittree(&coder->rc, coder->literal[0], 8, mf->buffer[0]); + ++coder->uncomp_size; + } + + // Initialization is done (except if empty file). + coder->is_initialized = true; + + return true; +} + + +static void +encode_eopm(lzma_lzma1_encoder *coder, uint32_t position) +{ + const uint32_t pos_state = position & coder->pos_mask; + rc_bit(&coder->rc, &coder->is_match[coder->state][pos_state], 1); + rc_bit(&coder->rc, &coder->is_rep[coder->state], 0); + match(coder, pos_state, UINT32_MAX, MATCH_LEN_MIN); +} + + +/// Number of bytes that a single encoding loop in lzma_lzma_encode() can +/// consume from the dictionary. This limit comes from lzma_lzma_optimum() +/// and may need to be updated if that function is significantly modified. +#define LOOP_INPUT_MAX (OPTS + 1) + + +extern lzma_ret +lzma_lzma_encode(lzma_lzma1_encoder *restrict coder, lzma_mf *restrict mf, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size, uint32_t limit) +{ + // Initialize the stream if no data has been encoded yet. + if (!coder->is_initialized && !encode_init(coder, mf)) + return LZMA_OK; + + // Encode pending output bytes from the range encoder. + // At the start of the stream, encode_init() encodes one literal. + // Later there can be pending output only with LZMA1 because LZMA2 + // ensures that there is always enough output space. Thus when using + // LZMA2, rc_encode() calls in this function will always return false. + if (rc_encode(&coder->rc, out, out_pos, out_size)) { + // We don't get here with LZMA2. + assert(limit == UINT32_MAX); + return LZMA_OK; + } + + // If the range encoder was flushed in an earlier call to this + // function but there wasn't enough output buffer space, those + // bytes would have now been encoded by the above rc_encode() call + // and the stream has now been finished. This can only happen with + // LZMA1 as LZMA2 always provides enough output buffer space. + if (coder->is_flushed) { + assert(limit == UINT32_MAX); + return LZMA_STREAM_END; + } + + while (true) { + // With LZMA2 we need to take care that compressed size of + // a chunk doesn't get too big. + // FIXME? Check if this could be improved. + if (limit != UINT32_MAX + && (mf->read_pos - mf->read_ahead >= limit + || *out_pos + rc_pending(&coder->rc) + >= LZMA2_CHUNK_MAX + - LOOP_INPUT_MAX)) + break; + + // Check that there is some input to process. + if (mf->read_pos >= mf->read_limit) { + if (mf->action == LZMA_RUN) + return LZMA_OK; + + if (mf->read_ahead == 0) + break; + } + + // Get optimal match (repeat position and length). + // Value ranges for pos: + // - [0, REPS): repeated match + // - [REPS, UINT32_MAX): + // match at (pos - REPS) + // - UINT32_MAX: not a match but a literal + // Value ranges for len: + // - [MATCH_LEN_MIN, MATCH_LEN_MAX] + uint32_t len; + uint32_t back; + + if (coder->fast_mode) + lzma_lzma_optimum_fast(coder, mf, &back, &len); + else + lzma_lzma_optimum_normal(coder, mf, &back, &len, + (uint32_t)(coder->uncomp_size)); + + encode_symbol(coder, mf, back, len, + (uint32_t)(coder->uncomp_size)); + + // If output size limiting is active (out_limit != 0), check + // if encoding this LZMA symbol would make the output size + // exceed the specified limit. + if (coder->out_limit != 0 && rc_encode_dummy( + &coder->rc, coder->out_limit)) { + // The most recent LZMA symbol would make the output + // too big. Throw it away. + rc_forget(&coder->rc); + + // FIXME: Tell the LZ layer to not read more input as + // it would be waste of time. This doesn't matter if + // output-size-limited encoding is done with a single + // call though. + + break; + } + + // This symbol will be encoded so update the uncompressed size. + coder->uncomp_size += len; + + // Encode the LZMA symbol. + if (rc_encode(&coder->rc, out, out_pos, out_size)) { + // Once again, this can only happen with LZMA1. + assert(limit == UINT32_MAX); + return LZMA_OK; + } + } + + // Make the uncompressed size available to the application. + if (coder->uncomp_size_ptr != NULL) + *coder->uncomp_size_ptr = coder->uncomp_size; + + // LZMA2 doesn't use EOPM at LZMA level. + // + // Plain LZMA streams without EOPM aren't supported except when + // output size limiting is enabled. + if (coder->use_eopm) + encode_eopm(coder, (uint32_t)(coder->uncomp_size)); + + // Flush the remaining bytes from the range encoder. + rc_flush(&coder->rc); + + // Copy the remaining bytes to the output buffer. If there + // isn't enough output space, we will copy out the remaining + // bytes on the next call to this function. + if (rc_encode(&coder->rc, out, out_pos, out_size)) { + // This cannot happen with LZMA2. + assert(limit == UINT32_MAX); + + coder->is_flushed = true; + return LZMA_OK; + } + + return LZMA_STREAM_END; +} + + +static lzma_ret +lzma_encode(void *coder, lzma_mf *restrict mf, + uint8_t *restrict out, size_t *restrict out_pos, + size_t out_size) +{ + // Plain LZMA has no support for sync-flushing. + if (unlikely(mf->action == LZMA_SYNC_FLUSH)) + return LZMA_OPTIONS_ERROR; + + return lzma_lzma_encode(coder, mf, out, out_pos, out_size, UINT32_MAX); +} + + +static lzma_ret +lzma_lzma_set_out_limit( + void *coder_ptr, uint64_t *uncomp_size, uint64_t out_limit) +{ + // Minimum output size is 5 bytes but that cannot hold any output + // so we use 6 bytes. + if (out_limit < 6) + return LZMA_BUF_ERROR; + + lzma_lzma1_encoder *coder = coder_ptr; + coder->out_limit = out_limit; + coder->uncomp_size_ptr = uncomp_size; + coder->use_eopm = false; + return LZMA_OK; +} + + +//////////////////// +// Initialization // +//////////////////// + +static bool +is_options_valid(const lzma_options_lzma *options) +{ + // Validate some of the options. LZ encoder validates nice_len too + // but we need a valid value here earlier. + return is_lclppb_valid(options) + && options->nice_len >= MATCH_LEN_MIN + && options->nice_len <= MATCH_LEN_MAX + && (options->mode == LZMA_MODE_FAST + || options->mode == LZMA_MODE_NORMAL); +} + + +static void +set_lz_options(lzma_lz_options *lz_options, const lzma_options_lzma *options) +{ + // LZ encoder initialization does the validation for these so we + // don't need to validate here. + lz_options->before_size = OPTS; + lz_options->dict_size = options->dict_size; + lz_options->after_size = LOOP_INPUT_MAX; + lz_options->match_len_max = MATCH_LEN_MAX; + lz_options->nice_len = my_max(mf_get_hash_bytes(options->mf), + options->nice_len); + lz_options->match_finder = options->mf; + lz_options->depth = options->depth; + lz_options->preset_dict = options->preset_dict; + lz_options->preset_dict_size = options->preset_dict_size; + return; +} + + +static void +length_encoder_reset(lzma_length_encoder *lencoder, + const uint32_t num_pos_states, const bool fast_mode) +{ + bit_reset(lencoder->choice); + bit_reset(lencoder->choice2); + + for (size_t pos_state = 0; pos_state < num_pos_states; ++pos_state) { + bittree_reset(lencoder->low[pos_state], LEN_LOW_BITS); + bittree_reset(lencoder->mid[pos_state], LEN_MID_BITS); + } + + bittree_reset(lencoder->high, LEN_HIGH_BITS); + + if (!fast_mode) + for (uint32_t pos_state = 0; pos_state < num_pos_states; + ++pos_state) + length_update_prices(lencoder, pos_state); + + return; +} + + +extern lzma_ret +lzma_lzma_encoder_reset(lzma_lzma1_encoder *coder, + const lzma_options_lzma *options) +{ + if (!is_options_valid(options)) + return LZMA_OPTIONS_ERROR; + + coder->pos_mask = (1U << options->pb) - 1; + coder->literal_context_bits = options->lc; + coder->literal_pos_mask = (1U << options->lp) - 1; + + // Range coder + rc_reset(&coder->rc); + + // State + coder->state = STATE_LIT_LIT; + for (size_t i = 0; i < REPS; ++i) + coder->reps[i] = 0; + + literal_init(coder->literal, options->lc, options->lp); + + // Bit encoders + for (size_t i = 0; i < STATES; ++i) { + for (size_t j = 0; j <= coder->pos_mask; ++j) { + bit_reset(coder->is_match[i][j]); + bit_reset(coder->is_rep0_long[i][j]); + } + + bit_reset(coder->is_rep[i]); + bit_reset(coder->is_rep0[i]); + bit_reset(coder->is_rep1[i]); + bit_reset(coder->is_rep2[i]); + } + + for (size_t i = 0; i < FULL_DISTANCES - DIST_MODEL_END; ++i) + bit_reset(coder->dist_special[i]); + + // Bit tree encoders + for (size_t i = 0; i < DIST_STATES; ++i) + bittree_reset(coder->dist_slot[i], DIST_SLOT_BITS); + + bittree_reset(coder->dist_align, ALIGN_BITS); + + // Length encoders + length_encoder_reset(&coder->match_len_encoder, + 1U << options->pb, coder->fast_mode); + + length_encoder_reset(&coder->rep_len_encoder, + 1U << options->pb, coder->fast_mode); + + // Price counts are incremented every time appropriate probabilities + // are changed. price counts are set to zero when the price tables + // are updated, which is done when the appropriate price counts have + // big enough value, and lzma_mf.read_ahead == 0 which happens at + // least every OPTS (a few thousand) possible price count increments. + // + // By resetting price counts to UINT32_MAX / 2, we make sure that the + // price tables will be initialized before they will be used (since + // the value is definitely big enough), and that it is OK to increment + // price counts without risk of integer overflow (since UINT32_MAX / 2 + // is small enough). The current code doesn't increment price counts + // before initializing price tables, but it maybe done in future if + // we add support for saving the state between LZMA2 chunks. + coder->match_price_count = UINT32_MAX / 2; + coder->align_price_count = UINT32_MAX / 2; + + coder->opts_end_index = 0; + coder->opts_current_index = 0; + + return LZMA_OK; +} + + +extern lzma_ret +lzma_lzma_encoder_create(void **coder_ptr, const lzma_allocator *allocator, + lzma_vli id, const lzma_options_lzma *options, + lzma_lz_options *lz_options) +{ + assert(id == LZMA_FILTER_LZMA1 || id == LZMA_FILTER_LZMA1EXT + || id == LZMA_FILTER_LZMA2); + + // Allocate lzma_lzma1_encoder if it wasn't already allocated. + if (*coder_ptr == NULL) { + *coder_ptr = lzma_alloc(sizeof(lzma_lzma1_encoder), allocator); + if (*coder_ptr == NULL) + return LZMA_MEM_ERROR; + } + + lzma_lzma1_encoder *coder = *coder_ptr; + + // Set compression mode. Note that we haven't validated the options + // yet. Invalid options will get rejected by lzma_lzma_encoder_reset() + // call at the end of this function. + switch (options->mode) { + case LZMA_MODE_FAST: + coder->fast_mode = true; + break; + + case LZMA_MODE_NORMAL: { + coder->fast_mode = false; + + // Set dist_table_size. + // Round the dictionary size up to next 2^n. + // + // Currently the maximum encoder dictionary size + // is 1.5 GiB due to lz_encoder.c and here we need + // to be below 2 GiB to make the rounded up value + // fit in an uint32_t and avoid an infite while-loop + // (and undefined behavior due to a too large shift). + // So do the same check as in LZ encoder, + // limiting to 1.5 GiB. + if (options->dict_size > (UINT32_C(1) << 30) + + (UINT32_C(1) << 29)) + return LZMA_OPTIONS_ERROR; + + uint32_t log_size = 0; + while ((UINT32_C(1) << log_size) < options->dict_size) + ++log_size; + + coder->dist_table_size = log_size * 2; + + // Length encoders' price table size + const uint32_t nice_len = my_max( + mf_get_hash_bytes(options->mf), + options->nice_len); + + coder->match_len_encoder.table_size + = nice_len + 1 - MATCH_LEN_MIN; + coder->rep_len_encoder.table_size + = nice_len + 1 - MATCH_LEN_MIN; + break; + } + + default: + return LZMA_OPTIONS_ERROR; + } + + // We don't need to write the first byte as literal if there is + // a non-empty preset dictionary. encode_init() wouldn't even work + // if there is a non-empty preset dictionary, because encode_init() + // assumes that position is zero and previous byte is also zero. + coder->is_initialized = options->preset_dict != NULL + && options->preset_dict_size > 0; + coder->is_flushed = false; + coder->uncomp_size = 0; + coder->uncomp_size_ptr = NULL; + + // Output size limitting is disabled by default. + coder->out_limit = 0; + + // Determine if end marker is wanted: + // - It is never used with LZMA2. + // - It is always used with LZMA_FILTER_LZMA1 (unless + // lzma_lzma_set_out_limit() is called later). + // - LZMA_FILTER_LZMA1EXT has a flag for it in the options. + coder->use_eopm = (id == LZMA_FILTER_LZMA1); + if (id == LZMA_FILTER_LZMA1EXT) { + // Check if unsupported flags are present. + if (options->ext_flags & ~LZMA_LZMA1EXT_ALLOW_EOPM) + return LZMA_OPTIONS_ERROR; + + coder->use_eopm = (options->ext_flags + & LZMA_LZMA1EXT_ALLOW_EOPM) != 0; + + // TODO? As long as there are no filters that change the size + // of the data, it is enough to look at lzma_stream.total_in + // after encoding has been finished to know the uncompressed + // size of the LZMA1 stream. But in the future there could be + // filters that change the size of the data and then total_in + // doesn't work as the LZMA1 stream size might be different + // due to another filter in the chain. The problem is simple + // to solve: Add another flag to ext_flags and then set + // coder->uncomp_size_ptr to the address stored in + // lzma_options_lzma.reserved_ptr2 (or _ptr1). + } + + set_lz_options(lz_options, options); + + return lzma_lzma_encoder_reset(coder, options); +} + + +static lzma_ret +lzma_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator, + lzma_vli id, const void *options, lzma_lz_options *lz_options) +{ + lz->code = &lzma_encode; + lz->set_out_limit = &lzma_lzma_set_out_limit; + return lzma_lzma_encoder_create( + &lz->coder, allocator, id, options, lz_options); +} + + +extern lzma_ret +lzma_lzma_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return lzma_lz_encoder_init( + next, allocator, filters, &lzma_encoder_init); +} + + +extern uint64_t +lzma_lzma_encoder_memusage(const void *options) +{ + if (!is_options_valid(options)) + return UINT64_MAX; + + lzma_lz_options lz_options; + set_lz_options(&lz_options, options); + + const uint64_t lz_memusage = lzma_lz_encoder_memusage(&lz_options); + if (lz_memusage == UINT64_MAX) + return UINT64_MAX; + + return (uint64_t)(sizeof(lzma_lzma1_encoder)) + lz_memusage; +} + + +extern bool +lzma_lzma_lclppb_encode(const lzma_options_lzma *options, uint8_t *byte) +{ + if (!is_lclppb_valid(options)) + return true; + + *byte = (options->pb * 5 + options->lp) * 9 + options->lc; + assert(*byte <= (4 * 5 + 4) * 9 + 8); + + return false; +} + + +#ifdef HAVE_ENCODER_LZMA1 +extern lzma_ret +lzma_lzma_props_encode(const void *options, uint8_t *out) +{ + if (options == NULL) + return LZMA_PROG_ERROR; + + const lzma_options_lzma *const opt = options; + + if (lzma_lzma_lclppb_encode(opt, out)) + return LZMA_PROG_ERROR; + + write32le(out + 1, opt->dict_size); + + return LZMA_OK; +} +#endif + + +extern LZMA_API(lzma_bool) +lzma_mode_is_supported(lzma_mode mode) +{ + return mode == LZMA_MODE_FAST || mode == LZMA_MODE_NORMAL; +} diff --git a/src/liblzma/lzma/lzma_encoder.h b/src/liblzma/lzma/lzma_encoder.h new file mode 100644 index 0000000..84d8c91 --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder.h @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder.h +/// \brief LZMA encoder API +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA_ENCODER_H +#define LZMA_LZMA_ENCODER_H + +#include "common.h" + + +typedef struct lzma_lzma1_encoder_s lzma_lzma1_encoder; + + +extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern uint64_t lzma_lzma_encoder_memusage(const void *options); + +extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out); + + +/// Encodes lc/lp/pb into one byte. Returns false on success and true on error. +extern bool lzma_lzma_lclppb_encode( + const lzma_options_lzma *options, uint8_t *byte); + + +#ifdef LZMA_LZ_ENCODER_H + +/// Initializes raw LZMA encoder; this is used by LZMA2. +extern lzma_ret lzma_lzma_encoder_create( + void **coder_ptr, const lzma_allocator *allocator, + lzma_vli id, const lzma_options_lzma *options, + lzma_lz_options *lz_options); + + +/// Resets an already initialized LZMA encoder; this is used by LZMA2. +extern lzma_ret lzma_lzma_encoder_reset( + lzma_lzma1_encoder *coder, const lzma_options_lzma *options); + + +extern lzma_ret lzma_lzma_encode(lzma_lzma1_encoder *restrict coder, + lzma_mf *restrict mf, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, + uint32_t read_limit); + +#endif + +#endif diff --git a/src/liblzma/lzma/lzma_encoder_optimum_fast.c b/src/liblzma/lzma/lzma_encoder_optimum_fast.c new file mode 100644 index 0000000..6c53d2b --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder_optimum_fast.c @@ -0,0 +1,170 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder_optimum_fast.c +// +// Author: Igor Pavlov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma_encoder_private.h" +#include "memcmplen.h" + + +#define change_pair(small_dist, big_dist) \ + (((big_dist) >> 7) > (small_dist)) + + +extern void +lzma_lzma_optimum_fast(lzma_lzma1_encoder *restrict coder, + lzma_mf *restrict mf, + uint32_t *restrict back_res, uint32_t *restrict len_res) +{ + const uint32_t nice_len = mf->nice_len; + + uint32_t len_main; + uint32_t matches_count; + if (mf->read_ahead == 0) { + len_main = mf_find(mf, &matches_count, coder->matches); + } else { + assert(mf->read_ahead == 1); + len_main = coder->longest_match_length; + matches_count = coder->matches_count; + } + + const uint8_t *buf = mf_ptr(mf) - 1; + const uint32_t buf_avail = my_min(mf_avail(mf) + 1, MATCH_LEN_MAX); + + if (buf_avail < 2) { + // There's not enough input left to encode a match. + *back_res = UINT32_MAX; + *len_res = 1; + return; + } + + // Look for repeated matches; scan the previous four match distances + uint32_t rep_len = 0; + uint32_t rep_index = 0; + + for (uint32_t i = 0; i < REPS; ++i) { + // Pointer to the beginning of the match candidate + const uint8_t *const buf_back = buf - coder->reps[i] - 1; + + // If the first two bytes (2 == MATCH_LEN_MIN) do not match, + // this rep is not useful. + if (not_equal_16(buf, buf_back)) + continue; + + // The first two bytes matched. + // Calculate the length of the match. + const uint32_t len = lzma_memcmplen( + buf, buf_back, 2, buf_avail); + + // If we have found a repeated match that is at least + // nice_len long, return it immediately. + if (len >= nice_len) { + *back_res = i; + *len_res = len; + mf_skip(mf, len - 1); + return; + } + + if (len > rep_len) { + rep_index = i; + rep_len = len; + } + } + + // We didn't find a long enough repeated match. Encode it as a normal + // match if the match length is at least nice_len. + if (len_main >= nice_len) { + *back_res = coder->matches[matches_count - 1].dist + REPS; + *len_res = len_main; + mf_skip(mf, len_main - 1); + return; + } + + uint32_t back_main = 0; + if (len_main >= 2) { + back_main = coder->matches[matches_count - 1].dist; + + while (matches_count > 1 && len_main == + coder->matches[matches_count - 2].len + 1) { + if (!change_pair(coder->matches[ + matches_count - 2].dist, + back_main)) + break; + + --matches_count; + len_main = coder->matches[matches_count - 1].len; + back_main = coder->matches[matches_count - 1].dist; + } + + if (len_main == 2 && back_main >= 0x80) + len_main = 1; + } + + if (rep_len >= 2) { + if (rep_len + 1 >= len_main + || (rep_len + 2 >= len_main + && back_main > (UINT32_C(1) << 9)) + || (rep_len + 3 >= len_main + && back_main > (UINT32_C(1) << 15))) { + *back_res = rep_index; + *len_res = rep_len; + mf_skip(mf, rep_len - 1); + return; + } + } + + if (len_main < 2 || buf_avail <= 2) { + *back_res = UINT32_MAX; + *len_res = 1; + return; + } + + // Get the matches for the next byte. If we find a better match, + // the current byte is encoded as a literal. + coder->longest_match_length = mf_find(mf, + &coder->matches_count, coder->matches); + + if (coder->longest_match_length >= 2) { + const uint32_t new_dist = coder->matches[ + coder->matches_count - 1].dist; + + if ((coder->longest_match_length >= len_main + && new_dist < back_main) + || (coder->longest_match_length == len_main + 1 + && !change_pair(back_main, new_dist)) + || (coder->longest_match_length > len_main + 1) + || (coder->longest_match_length + 1 >= len_main + && len_main >= 3 + && change_pair(new_dist, back_main))) { + *back_res = UINT32_MAX; + *len_res = 1; + return; + } + } + + // In contrast to LZMA SDK, dictionary could not have been moved + // between mf_find() calls, thus it is safe to just increment + // the old buf pointer instead of recalculating it with mf_ptr(). + ++buf; + + const uint32_t limit = my_max(2, len_main - 1); + + for (uint32_t i = 0; i < REPS; ++i) { + if (memcmp(buf, buf - coder->reps[i] - 1, limit) == 0) { + *back_res = UINT32_MAX; + *len_res = 1; + return; + } + } + + *back_res = back_main + REPS; + *len_res = len_main; + mf_skip(mf, len_main - 2); + return; +} diff --git a/src/liblzma/lzma/lzma_encoder_optimum_normal.c b/src/liblzma/lzma/lzma_encoder_optimum_normal.c new file mode 100644 index 0000000..101c8d4 --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder_optimum_normal.c @@ -0,0 +1,859 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder_optimum_normal.c +// +// Author: Igor Pavlov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "lzma_encoder_private.h" +#include "fastpos.h" +#include "memcmplen.h" + + +//////////// +// Prices // +//////////// + +static uint32_t +get_literal_price(const lzma_lzma1_encoder *const coder, const uint32_t pos, + const uint32_t prev_byte, const bool match_mode, + uint32_t match_byte, uint32_t symbol) +{ + const probability *const subcoder = literal_subcoder(coder->literal, + coder->literal_context_bits, coder->literal_pos_mask, + pos, prev_byte); + + uint32_t price = 0; + + if (!match_mode) { + price = rc_bittree_price(subcoder, 8, symbol); + } else { + uint32_t offset = 0x100; + symbol += UINT32_C(1) << 8; + + do { + match_byte <<= 1; + + const uint32_t match_bit = match_byte & offset; + const uint32_t subcoder_index + = offset + match_bit + (symbol >> 8); + const uint32_t bit = (symbol >> 7) & 1; + price += rc_bit_price(subcoder[subcoder_index], bit); + + symbol <<= 1; + offset &= ~(match_byte ^ symbol); + + } while (symbol < (UINT32_C(1) << 16)); + } + + return price; +} + + +static inline uint32_t +get_len_price(const lzma_length_encoder *const lencoder, + const uint32_t len, const uint32_t pos_state) +{ + // NOTE: Unlike the other price tables, length prices are updated + // in lzma_encoder.c + return lencoder->prices[pos_state][len - MATCH_LEN_MIN]; +} + + +static inline uint32_t +get_short_rep_price(const lzma_lzma1_encoder *const coder, + const lzma_lzma_state state, const uint32_t pos_state) +{ + return rc_bit_0_price(coder->is_rep0[state]) + + rc_bit_0_price(coder->is_rep0_long[state][pos_state]); +} + + +static inline uint32_t +get_pure_rep_price(const lzma_lzma1_encoder *const coder, const uint32_t rep_index, + const lzma_lzma_state state, uint32_t pos_state) +{ + uint32_t price; + + if (rep_index == 0) { + price = rc_bit_0_price(coder->is_rep0[state]); + price += rc_bit_1_price(coder->is_rep0_long[state][pos_state]); + } else { + price = rc_bit_1_price(coder->is_rep0[state]); + + if (rep_index == 1) { + price += rc_bit_0_price(coder->is_rep1[state]); + } else { + price += rc_bit_1_price(coder->is_rep1[state]); + price += rc_bit_price(coder->is_rep2[state], + rep_index - 2); + } + } + + return price; +} + + +static inline uint32_t +get_rep_price(const lzma_lzma1_encoder *const coder, const uint32_t rep_index, + const uint32_t len, const lzma_lzma_state state, + const uint32_t pos_state) +{ + return get_len_price(&coder->rep_len_encoder, len, pos_state) + + get_pure_rep_price(coder, rep_index, state, pos_state); +} + + +static inline uint32_t +get_dist_len_price(const lzma_lzma1_encoder *const coder, const uint32_t dist, + const uint32_t len, const uint32_t pos_state) +{ + const uint32_t dist_state = get_dist_state(len); + uint32_t price; + + if (dist < FULL_DISTANCES) { + price = coder->dist_prices[dist_state][dist]; + } else { + const uint32_t dist_slot = get_dist_slot_2(dist); + price = coder->dist_slot_prices[dist_state][dist_slot] + + coder->align_prices[dist & ALIGN_MASK]; + } + + price += get_len_price(&coder->match_len_encoder, len, pos_state); + + return price; +} + + +static void +fill_dist_prices(lzma_lzma1_encoder *coder) +{ + for (uint32_t dist_state = 0; dist_state < DIST_STATES; ++dist_state) { + + uint32_t *const dist_slot_prices + = coder->dist_slot_prices[dist_state]; + + // Price to encode the dist_slot. + for (uint32_t dist_slot = 0; + dist_slot < coder->dist_table_size; ++dist_slot) + dist_slot_prices[dist_slot] = rc_bittree_price( + coder->dist_slot[dist_state], + DIST_SLOT_BITS, dist_slot); + + // For matches with distance >= FULL_DISTANCES, add the price + // of the direct bits part of the match distance. (Align bits + // are handled by fill_align_prices()). + for (uint32_t dist_slot = DIST_MODEL_END; + dist_slot < coder->dist_table_size; + ++dist_slot) + dist_slot_prices[dist_slot] += rc_direct_price( + ((dist_slot >> 1) - 1) - ALIGN_BITS); + + // Distances in the range [0, 3] are fully encoded with + // dist_slot, so they are used for coder->dist_prices + // as is. + for (uint32_t i = 0; i < DIST_MODEL_START; ++i) + coder->dist_prices[dist_state][i] + = dist_slot_prices[i]; + } + + // Distances in the range [4, 127] depend on dist_slot and + // dist_special. We do this in a loop separate from the above + // loop to avoid redundant calls to get_dist_slot(). + for (uint32_t i = DIST_MODEL_START; i < FULL_DISTANCES; ++i) { + const uint32_t dist_slot = get_dist_slot(i); + const uint32_t footer_bits = ((dist_slot >> 1) - 1); + const uint32_t base = (2 | (dist_slot & 1)) << footer_bits; + const uint32_t price = rc_bittree_reverse_price( + coder->dist_special + base - dist_slot - 1, + footer_bits, i - base); + + for (uint32_t dist_state = 0; dist_state < DIST_STATES; + ++dist_state) + coder->dist_prices[dist_state][i] + = price + coder->dist_slot_prices[ + dist_state][dist_slot]; + } + + coder->match_price_count = 0; + return; +} + + +static void +fill_align_prices(lzma_lzma1_encoder *coder) +{ + for (uint32_t i = 0; i < ALIGN_SIZE; ++i) + coder->align_prices[i] = rc_bittree_reverse_price( + coder->dist_align, ALIGN_BITS, i); + + coder->align_price_count = 0; + return; +} + + +///////////// +// Optimal // +///////////// + +static inline void +make_literal(lzma_optimal *optimal) +{ + optimal->back_prev = UINT32_MAX; + optimal->prev_1_is_literal = false; +} + + +static inline void +make_short_rep(lzma_optimal *optimal) +{ + optimal->back_prev = 0; + optimal->prev_1_is_literal = false; +} + + +#define is_short_rep(optimal) \ + ((optimal).back_prev == 0) + + +static void +backward(lzma_lzma1_encoder *restrict coder, uint32_t *restrict len_res, + uint32_t *restrict back_res, uint32_t cur) +{ + coder->opts_end_index = cur; + + uint32_t pos_mem = coder->opts[cur].pos_prev; + uint32_t back_mem = coder->opts[cur].back_prev; + + do { + if (coder->opts[cur].prev_1_is_literal) { + make_literal(&coder->opts[pos_mem]); + coder->opts[pos_mem].pos_prev = pos_mem - 1; + + if (coder->opts[cur].prev_2) { + coder->opts[pos_mem - 1].prev_1_is_literal + = false; + coder->opts[pos_mem - 1].pos_prev + = coder->opts[cur].pos_prev_2; + coder->opts[pos_mem - 1].back_prev + = coder->opts[cur].back_prev_2; + } + } + + const uint32_t pos_prev = pos_mem; + const uint32_t back_cur = back_mem; + + back_mem = coder->opts[pos_prev].back_prev; + pos_mem = coder->opts[pos_prev].pos_prev; + + coder->opts[pos_prev].back_prev = back_cur; + coder->opts[pos_prev].pos_prev = cur; + cur = pos_prev; + + } while (cur != 0); + + coder->opts_current_index = coder->opts[0].pos_prev; + *len_res = coder->opts[0].pos_prev; + *back_res = coder->opts[0].back_prev; + + return; +} + + +////////// +// Main // +////////// + +static inline uint32_t +helper1(lzma_lzma1_encoder *restrict coder, lzma_mf *restrict mf, + uint32_t *restrict back_res, uint32_t *restrict len_res, + uint32_t position) +{ + const uint32_t nice_len = mf->nice_len; + + uint32_t len_main; + uint32_t matches_count; + + if (mf->read_ahead == 0) { + len_main = mf_find(mf, &matches_count, coder->matches); + } else { + assert(mf->read_ahead == 1); + len_main = coder->longest_match_length; + matches_count = coder->matches_count; + } + + const uint32_t buf_avail = my_min(mf_avail(mf) + 1, MATCH_LEN_MAX); + if (buf_avail < 2) { + *back_res = UINT32_MAX; + *len_res = 1; + return UINT32_MAX; + } + + const uint8_t *const buf = mf_ptr(mf) - 1; + + uint32_t rep_lens[REPS]; + uint32_t rep_max_index = 0; + + for (uint32_t i = 0; i < REPS; ++i) { + const uint8_t *const buf_back = buf - coder->reps[i] - 1; + + if (not_equal_16(buf, buf_back)) { + rep_lens[i] = 0; + continue; + } + + rep_lens[i] = lzma_memcmplen(buf, buf_back, 2, buf_avail); + + if (rep_lens[i] > rep_lens[rep_max_index]) + rep_max_index = i; + } + + if (rep_lens[rep_max_index] >= nice_len) { + *back_res = rep_max_index; + *len_res = rep_lens[rep_max_index]; + mf_skip(mf, *len_res - 1); + return UINT32_MAX; + } + + + if (len_main >= nice_len) { + *back_res = coder->matches[matches_count - 1].dist + REPS; + *len_res = len_main; + mf_skip(mf, len_main - 1); + return UINT32_MAX; + } + + const uint8_t current_byte = *buf; + const uint8_t match_byte = *(buf - coder->reps[0] - 1); + + if (len_main < 2 && current_byte != match_byte + && rep_lens[rep_max_index] < 2) { + *back_res = UINT32_MAX; + *len_res = 1; + return UINT32_MAX; + } + + coder->opts[0].state = coder->state; + + const uint32_t pos_state = position & coder->pos_mask; + + coder->opts[1].price = rc_bit_0_price( + coder->is_match[coder->state][pos_state]) + + get_literal_price(coder, position, buf[-1], + !is_literal_state(coder->state), + match_byte, current_byte); + + make_literal(&coder->opts[1]); + + const uint32_t match_price = rc_bit_1_price( + coder->is_match[coder->state][pos_state]); + const uint32_t rep_match_price = match_price + + rc_bit_1_price(coder->is_rep[coder->state]); + + if (match_byte == current_byte) { + const uint32_t short_rep_price = rep_match_price + + get_short_rep_price( + coder, coder->state, pos_state); + + if (short_rep_price < coder->opts[1].price) { + coder->opts[1].price = short_rep_price; + make_short_rep(&coder->opts[1]); + } + } + + const uint32_t len_end = my_max(len_main, rep_lens[rep_max_index]); + + if (len_end < 2) { + *back_res = coder->opts[1].back_prev; + *len_res = 1; + return UINT32_MAX; + } + + coder->opts[1].pos_prev = 0; + + for (uint32_t i = 0; i < REPS; ++i) + coder->opts[0].backs[i] = coder->reps[i]; + + uint32_t len = len_end; + do { + coder->opts[len].price = RC_INFINITY_PRICE; + } while (--len >= 2); + + + for (uint32_t i = 0; i < REPS; ++i) { + uint32_t rep_len = rep_lens[i]; + if (rep_len < 2) + continue; + + const uint32_t price = rep_match_price + get_pure_rep_price( + coder, i, coder->state, pos_state); + + do { + const uint32_t cur_and_len_price = price + + get_len_price( + &coder->rep_len_encoder, + rep_len, pos_state); + + if (cur_and_len_price < coder->opts[rep_len].price) { + coder->opts[rep_len].price = cur_and_len_price; + coder->opts[rep_len].pos_prev = 0; + coder->opts[rep_len].back_prev = i; + coder->opts[rep_len].prev_1_is_literal = false; + } + } while (--rep_len >= 2); + } + + + const uint32_t normal_match_price = match_price + + rc_bit_0_price(coder->is_rep[coder->state]); + + len = rep_lens[0] >= 2 ? rep_lens[0] + 1 : 2; + if (len <= len_main) { + uint32_t i = 0; + while (len > coder->matches[i].len) + ++i; + + for(; ; ++len) { + const uint32_t dist = coder->matches[i].dist; + const uint32_t cur_and_len_price = normal_match_price + + get_dist_len_price(coder, + dist, len, pos_state); + + if (cur_and_len_price < coder->opts[len].price) { + coder->opts[len].price = cur_and_len_price; + coder->opts[len].pos_prev = 0; + coder->opts[len].back_prev = dist + REPS; + coder->opts[len].prev_1_is_literal = false; + } + + if (len == coder->matches[i].len) + if (++i == matches_count) + break; + } + } + + return len_end; +} + + +static inline uint32_t +helper2(lzma_lzma1_encoder *coder, uint32_t *reps, const uint8_t *buf, + uint32_t len_end, uint32_t position, const uint32_t cur, + const uint32_t nice_len, const uint32_t buf_avail_full) +{ + uint32_t matches_count = coder->matches_count; + uint32_t new_len = coder->longest_match_length; + uint32_t pos_prev = coder->opts[cur].pos_prev; + lzma_lzma_state state; + + if (coder->opts[cur].prev_1_is_literal) { + --pos_prev; + + if (coder->opts[cur].prev_2) { + state = coder->opts[coder->opts[cur].pos_prev_2].state; + + if (coder->opts[cur].back_prev_2 < REPS) + update_long_rep(state); + else + update_match(state); + + } else { + state = coder->opts[pos_prev].state; + } + + update_literal(state); + + } else { + state = coder->opts[pos_prev].state; + } + + if (pos_prev == cur - 1) { + if (is_short_rep(coder->opts[cur])) + update_short_rep(state); + else + update_literal(state); + } else { + uint32_t pos; + if (coder->opts[cur].prev_1_is_literal + && coder->opts[cur].prev_2) { + pos_prev = coder->opts[cur].pos_prev_2; + pos = coder->opts[cur].back_prev_2; + update_long_rep(state); + } else { + pos = coder->opts[cur].back_prev; + if (pos < REPS) + update_long_rep(state); + else + update_match(state); + } + + if (pos < REPS) { + reps[0] = coder->opts[pos_prev].backs[pos]; + + uint32_t i; + for (i = 1; i <= pos; ++i) + reps[i] = coder->opts[pos_prev].backs[i - 1]; + + for (; i < REPS; ++i) + reps[i] = coder->opts[pos_prev].backs[i]; + + } else { + reps[0] = pos - REPS; + + for (uint32_t i = 1; i < REPS; ++i) + reps[i] = coder->opts[pos_prev].backs[i - 1]; + } + } + + coder->opts[cur].state = state; + + for (uint32_t i = 0; i < REPS; ++i) + coder->opts[cur].backs[i] = reps[i]; + + const uint32_t cur_price = coder->opts[cur].price; + + const uint8_t current_byte = *buf; + const uint8_t match_byte = *(buf - reps[0] - 1); + + const uint32_t pos_state = position & coder->pos_mask; + + const uint32_t cur_and_1_price = cur_price + + rc_bit_0_price(coder->is_match[state][pos_state]) + + get_literal_price(coder, position, buf[-1], + !is_literal_state(state), match_byte, current_byte); + + bool next_is_literal = false; + + if (cur_and_1_price < coder->opts[cur + 1].price) { + coder->opts[cur + 1].price = cur_and_1_price; + coder->opts[cur + 1].pos_prev = cur; + make_literal(&coder->opts[cur + 1]); + next_is_literal = true; + } + + const uint32_t match_price = cur_price + + rc_bit_1_price(coder->is_match[state][pos_state]); + const uint32_t rep_match_price = match_price + + rc_bit_1_price(coder->is_rep[state]); + + if (match_byte == current_byte + && !(coder->opts[cur + 1].pos_prev < cur + && coder->opts[cur + 1].back_prev == 0)) { + + const uint32_t short_rep_price = rep_match_price + + get_short_rep_price(coder, state, pos_state); + + if (short_rep_price <= coder->opts[cur + 1].price) { + coder->opts[cur + 1].price = short_rep_price; + coder->opts[cur + 1].pos_prev = cur; + make_short_rep(&coder->opts[cur + 1]); + next_is_literal = true; + } + } + + if (buf_avail_full < 2) + return len_end; + + const uint32_t buf_avail = my_min(buf_avail_full, nice_len); + + if (!next_is_literal && match_byte != current_byte) { // speed optimization + // try literal + rep0 + const uint8_t *const buf_back = buf - reps[0] - 1; + const uint32_t limit = my_min(buf_avail_full, nice_len + 1); + + const uint32_t len_test = lzma_memcmplen(buf, buf_back, 1, limit) - 1; + + if (len_test >= 2) { + lzma_lzma_state state_2 = state; + update_literal(state_2); + + const uint32_t pos_state_next = (position + 1) & coder->pos_mask; + const uint32_t next_rep_match_price = cur_and_1_price + + rc_bit_1_price(coder->is_match[state_2][pos_state_next]) + + rc_bit_1_price(coder->is_rep[state_2]); + + //for (; len_test >= 2; --len_test) { + const uint32_t offset = cur + 1 + len_test; + + while (len_end < offset) + coder->opts[++len_end].price = RC_INFINITY_PRICE; + + const uint32_t cur_and_len_price = next_rep_match_price + + get_rep_price(coder, 0, len_test, + state_2, pos_state_next); + + if (cur_and_len_price < coder->opts[offset].price) { + coder->opts[offset].price = cur_and_len_price; + coder->opts[offset].pos_prev = cur + 1; + coder->opts[offset].back_prev = 0; + coder->opts[offset].prev_1_is_literal = true; + coder->opts[offset].prev_2 = false; + } + //} + } + } + + + uint32_t start_len = 2; // speed optimization + + for (uint32_t rep_index = 0; rep_index < REPS; ++rep_index) { + const uint8_t *const buf_back = buf - reps[rep_index] - 1; + if (not_equal_16(buf, buf_back)) + continue; + + uint32_t len_test = lzma_memcmplen(buf, buf_back, 2, buf_avail); + + while (len_end < cur + len_test) + coder->opts[++len_end].price = RC_INFINITY_PRICE; + + const uint32_t len_test_temp = len_test; + const uint32_t price = rep_match_price + get_pure_rep_price( + coder, rep_index, state, pos_state); + + do { + const uint32_t cur_and_len_price = price + + get_len_price(&coder->rep_len_encoder, + len_test, pos_state); + + if (cur_and_len_price < coder->opts[cur + len_test].price) { + coder->opts[cur + len_test].price = cur_and_len_price; + coder->opts[cur + len_test].pos_prev = cur; + coder->opts[cur + len_test].back_prev = rep_index; + coder->opts[cur + len_test].prev_1_is_literal = false; + } + } while (--len_test >= 2); + + len_test = len_test_temp; + + if (rep_index == 0) + start_len = len_test + 1; + + + uint32_t len_test_2 = len_test + 1; + const uint32_t limit = my_min(buf_avail_full, + len_test_2 + nice_len); + // NOTE: len_test_2 may be greater than limit so the call to + // lzma_memcmplen() must be done conditionally. + if (len_test_2 < limit) + len_test_2 = lzma_memcmplen(buf, buf_back, len_test_2, limit); + + len_test_2 -= len_test + 1; + + if (len_test_2 >= 2) { + lzma_lzma_state state_2 = state; + update_long_rep(state_2); + + uint32_t pos_state_next = (position + len_test) & coder->pos_mask; + + const uint32_t cur_and_len_literal_price = price + + get_len_price(&coder->rep_len_encoder, + len_test, pos_state) + + rc_bit_0_price(coder->is_match[state_2][pos_state_next]) + + get_literal_price(coder, position + len_test, + buf[len_test - 1], true, + buf_back[len_test], buf[len_test]); + + update_literal(state_2); + + pos_state_next = (position + len_test + 1) & coder->pos_mask; + + const uint32_t next_rep_match_price = cur_and_len_literal_price + + rc_bit_1_price(coder->is_match[state_2][pos_state_next]) + + rc_bit_1_price(coder->is_rep[state_2]); + + //for(; len_test_2 >= 2; len_test_2--) { + const uint32_t offset = cur + len_test + 1 + len_test_2; + + while (len_end < offset) + coder->opts[++len_end].price = RC_INFINITY_PRICE; + + const uint32_t cur_and_len_price = next_rep_match_price + + get_rep_price(coder, 0, len_test_2, + state_2, pos_state_next); + + if (cur_and_len_price < coder->opts[offset].price) { + coder->opts[offset].price = cur_and_len_price; + coder->opts[offset].pos_prev = cur + len_test + 1; + coder->opts[offset].back_prev = 0; + coder->opts[offset].prev_1_is_literal = true; + coder->opts[offset].prev_2 = true; + coder->opts[offset].pos_prev_2 = cur; + coder->opts[offset].back_prev_2 = rep_index; + } + //} + } + } + + + //for (uint32_t len_test = 2; len_test <= new_len; ++len_test) + if (new_len > buf_avail) { + new_len = buf_avail; + + matches_count = 0; + while (new_len > coder->matches[matches_count].len) + ++matches_count; + + coder->matches[matches_count++].len = new_len; + } + + + if (new_len >= start_len) { + const uint32_t normal_match_price = match_price + + rc_bit_0_price(coder->is_rep[state]); + + while (len_end < cur + new_len) + coder->opts[++len_end].price = RC_INFINITY_PRICE; + + uint32_t i = 0; + while (start_len > coder->matches[i].len) + ++i; + + for (uint32_t len_test = start_len; ; ++len_test) { + const uint32_t cur_back = coder->matches[i].dist; + uint32_t cur_and_len_price = normal_match_price + + get_dist_len_price(coder, + cur_back, len_test, pos_state); + + if (cur_and_len_price < coder->opts[cur + len_test].price) { + coder->opts[cur + len_test].price = cur_and_len_price; + coder->opts[cur + len_test].pos_prev = cur; + coder->opts[cur + len_test].back_prev + = cur_back + REPS; + coder->opts[cur + len_test].prev_1_is_literal = false; + } + + if (len_test == coder->matches[i].len) { + // Try Match + Literal + Rep0 + const uint8_t *const buf_back = buf - cur_back - 1; + uint32_t len_test_2 = len_test + 1; + const uint32_t limit = my_min(buf_avail_full, + len_test_2 + nice_len); + + // NOTE: len_test_2 may be greater than limit + // so the call to lzma_memcmplen() must be + // done conditionally. + if (len_test_2 < limit) + len_test_2 = lzma_memcmplen(buf, buf_back, + len_test_2, limit); + + len_test_2 -= len_test + 1; + + if (len_test_2 >= 2) { + lzma_lzma_state state_2 = state; + update_match(state_2); + uint32_t pos_state_next + = (position + len_test) & coder->pos_mask; + + const uint32_t cur_and_len_literal_price = cur_and_len_price + + rc_bit_0_price( + coder->is_match[state_2][pos_state_next]) + + get_literal_price(coder, + position + len_test, + buf[len_test - 1], + true, + buf_back[len_test], + buf[len_test]); + + update_literal(state_2); + pos_state_next = (pos_state_next + 1) & coder->pos_mask; + + const uint32_t next_rep_match_price + = cur_and_len_literal_price + + rc_bit_1_price( + coder->is_match[state_2][pos_state_next]) + + rc_bit_1_price(coder->is_rep[state_2]); + + // for(; len_test_2 >= 2; --len_test_2) { + const uint32_t offset = cur + len_test + 1 + len_test_2; + + while (len_end < offset) + coder->opts[++len_end].price = RC_INFINITY_PRICE; + + cur_and_len_price = next_rep_match_price + + get_rep_price(coder, 0, len_test_2, + state_2, pos_state_next); + + if (cur_and_len_price < coder->opts[offset].price) { + coder->opts[offset].price = cur_and_len_price; + coder->opts[offset].pos_prev = cur + len_test + 1; + coder->opts[offset].back_prev = 0; + coder->opts[offset].prev_1_is_literal = true; + coder->opts[offset].prev_2 = true; + coder->opts[offset].pos_prev_2 = cur; + coder->opts[offset].back_prev_2 + = cur_back + REPS; + } + //} + } + + if (++i == matches_count) + break; + } + } + } + + return len_end; +} + + +extern void +lzma_lzma_optimum_normal(lzma_lzma1_encoder *restrict coder, + lzma_mf *restrict mf, + uint32_t *restrict back_res, uint32_t *restrict len_res, + uint32_t position) +{ + // If we have symbols pending, return the next pending symbol. + if (coder->opts_end_index != coder->opts_current_index) { + assert(mf->read_ahead > 0); + *len_res = coder->opts[coder->opts_current_index].pos_prev + - coder->opts_current_index; + *back_res = coder->opts[coder->opts_current_index].back_prev; + coder->opts_current_index = coder->opts[ + coder->opts_current_index].pos_prev; + return; + } + + // Update the price tables. In LZMA SDK <= 4.60 (and possibly later) + // this was done in both initialization function and in the main loop. + // In liblzma they were moved into this single place. + if (mf->read_ahead == 0) { + if (coder->match_price_count >= (1 << 7)) + fill_dist_prices(coder); + + if (coder->align_price_count >= ALIGN_SIZE) + fill_align_prices(coder); + } + + // TODO: This needs quite a bit of cleaning still. But splitting + // the original function into two pieces makes it at least a little + // more readable, since those two parts don't share many variables. + + uint32_t len_end = helper1(coder, mf, back_res, len_res, position); + if (len_end == UINT32_MAX) + return; + + uint32_t reps[REPS]; + memcpy(reps, coder->reps, sizeof(reps)); + + uint32_t cur; + for (cur = 1; cur < len_end; ++cur) { + assert(cur < OPTS); + + coder->longest_match_length = mf_find( + mf, &coder->matches_count, coder->matches); + + if (coder->longest_match_length >= mf->nice_len) + break; + + len_end = helper2(coder, reps, mf_ptr(mf) - 1, len_end, + position + cur, cur, mf->nice_len, + my_min(mf_avail(mf) + 1, OPTS - 1 - cur)); + } + + backward(coder, len_res, back_res, cur); + return; +} diff --git a/src/liblzma/lzma/lzma_encoder_presets.c b/src/liblzma/lzma/lzma_encoder_presets.c new file mode 100644 index 0000000..711df02 --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder_presets.c @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder_presets.c +/// \brief Encoder presets +/// \note xz needs this even when only decoding is enabled. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "common.h" + + +extern LZMA_API(lzma_bool) +lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset) +{ + const uint32_t level = preset & LZMA_PRESET_LEVEL_MASK; + const uint32_t flags = preset & ~LZMA_PRESET_LEVEL_MASK; + const uint32_t supported_flags = LZMA_PRESET_EXTREME; + + if (level > 9 || (flags & ~supported_flags)) + return true; + + options->preset_dict = NULL; + options->preset_dict_size = 0; + + options->lc = LZMA_LC_DEFAULT; + options->lp = LZMA_LP_DEFAULT; + options->pb = LZMA_PB_DEFAULT; + + static const uint8_t dict_pow2[] + = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }; + options->dict_size = UINT32_C(1) << dict_pow2[level]; + + if (level <= 3) { + options->mode = LZMA_MODE_FAST; + options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; + options->nice_len = level <= 1 ? 128 : 273; + static const uint8_t depths[] = { 4, 8, 24, 48 }; + options->depth = depths[level]; + } else { + options->mode = LZMA_MODE_NORMAL; + options->mf = LZMA_MF_BT4; + options->nice_len = level == 4 ? 16 : level == 5 ? 32 : 64; + options->depth = 0; + } + + if (flags & LZMA_PRESET_EXTREME) { + options->mode = LZMA_MODE_NORMAL; + options->mf = LZMA_MF_BT4; + if (level == 3 || level == 5) { + options->nice_len = 192; + options->depth = 0; + } else { + options->nice_len = 273; + options->depth = 512; + } + } + + return false; +} diff --git a/src/liblzma/lzma/lzma_encoder_private.h b/src/liblzma/lzma/lzma_encoder_private.h new file mode 100644 index 0000000..b228c57 --- /dev/null +++ b/src/liblzma/lzma/lzma_encoder_private.h @@ -0,0 +1,162 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file lzma_encoder_private.h +/// \brief Private definitions for LZMA encoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_LZMA_ENCODER_PRIVATE_H +#define LZMA_LZMA_ENCODER_PRIVATE_H + +#include "lz_encoder.h" +#include "range_encoder.h" +#include "lzma_common.h" +#include "lzma_encoder.h" + + +// Macro to compare if the first two bytes in two buffers differ. This is +// needed in lzma_lzma_optimum_*() to test if the match is at least +// MATCH_LEN_MIN bytes. Unaligned access gives tiny gain so there's no +// reason to not use it when it is supported. +#ifdef TUKLIB_FAST_UNALIGNED_ACCESS +# define not_equal_16(a, b) (read16ne(a) != read16ne(b)) +#else +# define not_equal_16(a, b) \ + ((a)[0] != (b)[0] || (a)[1] != (b)[1]) +#endif + + +// Optimal - Number of entries in the optimum array. +#define OPTS (1 << 12) + + +typedef struct { + probability choice; + probability choice2; + probability low[POS_STATES_MAX][LEN_LOW_SYMBOLS]; + probability mid[POS_STATES_MAX][LEN_MID_SYMBOLS]; + probability high[LEN_HIGH_SYMBOLS]; + + uint32_t prices[POS_STATES_MAX][LEN_SYMBOLS]; + uint32_t table_size; + uint32_t counters[POS_STATES_MAX]; + +} lzma_length_encoder; + + +typedef struct { + lzma_lzma_state state; + + bool prev_1_is_literal; + bool prev_2; + + uint32_t pos_prev_2; + uint32_t back_prev_2; + + uint32_t price; + uint32_t pos_prev; // pos_next; + uint32_t back_prev; + + uint32_t backs[REPS]; + +} lzma_optimal; + + +struct lzma_lzma1_encoder_s { + /// Range encoder + lzma_range_encoder rc; + + /// Uncompressed size (doesn't include possible preset dictionary) + uint64_t uncomp_size; + + /// If non-zero, produce at most this much output. + /// Some input may then be missing from the output. + uint64_t out_limit; + + /// If the above out_limit is non-zero, *uncomp_size_ptr is set to + /// the amount of uncompressed data that we were able to fit + /// in the output buffer. + uint64_t *uncomp_size_ptr; + + /// State + lzma_lzma_state state; + + /// The four most recent match distances + uint32_t reps[REPS]; + + /// Array of match candidates + lzma_match matches[MATCH_LEN_MAX + 1]; + + /// Number of match candidates in matches[] + uint32_t matches_count; + + /// Variable to hold the length of the longest match between calls + /// to lzma_lzma_optimum_*(). + uint32_t longest_match_length; + + /// True if using getoptimumfast + bool fast_mode; + + /// True if the encoder has been initialized by encoding the first + /// byte as a literal. + bool is_initialized; + + /// True if the range encoder has been flushed, but not all bytes + /// have been written to the output buffer yet. + bool is_flushed; + + /// True if end of payload marker will be written. + bool use_eopm; + + uint32_t pos_mask; ///< (1 << pos_bits) - 1 + uint32_t literal_context_bits; + uint32_t literal_pos_mask; + + // These are the same as in lzma_decoder.c. See comments there. + probability literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE]; + probability is_match[STATES][POS_STATES_MAX]; + probability is_rep[STATES]; + probability is_rep0[STATES]; + probability is_rep1[STATES]; + probability is_rep2[STATES]; + probability is_rep0_long[STATES][POS_STATES_MAX]; + probability dist_slot[DIST_STATES][DIST_SLOTS]; + probability dist_special[FULL_DISTANCES - DIST_MODEL_END]; + probability dist_align[ALIGN_SIZE]; + + // These are the same as in lzma_decoder.c except that the encoders + // include also price tables. + lzma_length_encoder match_len_encoder; + lzma_length_encoder rep_len_encoder; + + // Price tables + uint32_t dist_slot_prices[DIST_STATES][DIST_SLOTS]; + uint32_t dist_prices[DIST_STATES][FULL_DISTANCES]; + uint32_t dist_table_size; + uint32_t match_price_count; + + uint32_t align_prices[ALIGN_SIZE]; + uint32_t align_price_count; + + // Optimal + uint32_t opts_end_index; + uint32_t opts_current_index; + lzma_optimal opts[OPTS]; +}; + + +extern void lzma_lzma_optimum_fast( + lzma_lzma1_encoder *restrict coder, lzma_mf *restrict mf, + uint32_t *restrict back_res, uint32_t *restrict len_res); + +extern void lzma_lzma_optimum_normal(lzma_lzma1_encoder *restrict coder, + lzma_mf *restrict mf, uint32_t *restrict back_res, + uint32_t *restrict len_res, uint32_t position); + +#endif diff --git a/src/liblzma/rangecoder/price.h b/src/liblzma/rangecoder/price.h new file mode 100644 index 0000000..8ae02ca --- /dev/null +++ b/src/liblzma/rangecoder/price.h @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file price.h +/// \brief Probability price calculation +// +// Author: Igor Pavlov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_PRICE_H +#define LZMA_PRICE_H + + +#define RC_MOVE_REDUCING_BITS 4 +#define RC_BIT_PRICE_SHIFT_BITS 4 +#define RC_PRICE_TABLE_SIZE (RC_BIT_MODEL_TOTAL >> RC_MOVE_REDUCING_BITS) + +#define RC_INFINITY_PRICE (UINT32_C(1) << 30) + + +/// Lookup table for the inline functions defined in this file. +extern const uint8_t lzma_rc_prices[RC_PRICE_TABLE_SIZE]; + + +static inline uint32_t +rc_bit_price(const probability prob, const uint32_t bit) +{ + return lzma_rc_prices[(prob ^ ((UINT32_C(0) - bit) + & (RC_BIT_MODEL_TOTAL - 1))) >> RC_MOVE_REDUCING_BITS]; +} + + +static inline uint32_t +rc_bit_0_price(const probability prob) +{ + return lzma_rc_prices[prob >> RC_MOVE_REDUCING_BITS]; +} + + +static inline uint32_t +rc_bit_1_price(const probability prob) +{ + return lzma_rc_prices[(prob ^ (RC_BIT_MODEL_TOTAL - 1)) + >> RC_MOVE_REDUCING_BITS]; +} + + +static inline uint32_t +rc_bittree_price(const probability *const probs, + const uint32_t bit_levels, uint32_t symbol) +{ + uint32_t price = 0; + symbol += UINT32_C(1) << bit_levels; + + do { + const uint32_t bit = symbol & 1; + symbol >>= 1; + price += rc_bit_price(probs[symbol], bit); + } while (symbol != 1); + + return price; +} + + +static inline uint32_t +rc_bittree_reverse_price(const probability *const probs, + uint32_t bit_levels, uint32_t symbol) +{ + uint32_t price = 0; + uint32_t model_index = 1; + + do { + const uint32_t bit = symbol & 1; + symbol >>= 1; + price += rc_bit_price(probs[model_index], bit); + model_index = (model_index << 1) + bit; + } while (--bit_levels != 0); + + return price; +} + + +static inline uint32_t +rc_direct_price(const uint32_t bits) +{ + return bits << RC_BIT_PRICE_SHIFT_BITS; +} + +#endif diff --git a/src/liblzma/rangecoder/price_table.c b/src/liblzma/rangecoder/price_table.c new file mode 100644 index 0000000..ac64bf6 --- /dev/null +++ b/src/liblzma/rangecoder/price_table.c @@ -0,0 +1,22 @@ +/* This file has been automatically generated by price_tablegen.c. */ + +#include "range_encoder.h" + +const uint8_t lzma_rc_prices[RC_PRICE_TABLE_SIZE] = { + 128, 103, 91, 84, 78, 73, 69, 66, + 63, 61, 58, 56, 54, 52, 51, 49, + 48, 46, 45, 44, 43, 42, 41, 40, + 39, 38, 37, 36, 35, 34, 34, 33, + 32, 31, 31, 30, 29, 29, 28, 28, + 27, 26, 26, 25, 25, 24, 24, 23, + 23, 22, 22, 22, 21, 21, 20, 20, + 19, 19, 19, 18, 18, 17, 17, 17, + 16, 16, 16, 15, 15, 15, 14, 14, + 14, 13, 13, 13, 12, 12, 12, 11, + 11, 11, 11, 10, 10, 10, 10, 9, + 9, 9, 9, 8, 8, 8, 8, 7, + 7, 7, 7, 6, 6, 6, 6, 5, + 5, 5, 5, 5, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 2, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 1 +}; diff --git a/src/liblzma/rangecoder/price_tablegen.c b/src/liblzma/rangecoder/price_tablegen.c new file mode 100644 index 0000000..bf08ce3 --- /dev/null +++ b/src/liblzma/rangecoder/price_tablegen.c @@ -0,0 +1,87 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file price_tablegen.c +/// \brief Probability price table generator +/// +/// Compiling: gcc -std=c99 -o price_tablegen price_tablegen.c +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "range_common.h" +#include "price.h" + + +static uint32_t rc_prices[RC_PRICE_TABLE_SIZE]; + + +static void +init_price_table(void) +{ + for (uint32_t i = (UINT32_C(1) << RC_MOVE_REDUCING_BITS) / 2; + i < RC_BIT_MODEL_TOTAL; + i += (UINT32_C(1) << RC_MOVE_REDUCING_BITS)) { + const uint32_t cycles_bits = RC_BIT_PRICE_SHIFT_BITS; + uint32_t w = i; + uint32_t bit_count = 0; + + for (uint32_t j = 0; j < cycles_bits; ++j) { + w *= w; + bit_count <<= 1; + + while (w >= (UINT32_C(1) << 16)) { + w >>= 1; + ++bit_count; + } + } + + rc_prices[i >> RC_MOVE_REDUCING_BITS] + = (RC_BIT_MODEL_TOTAL_BITS << cycles_bits) + - 15 - bit_count; + } + + return; +} + + +static void +print_price_table(void) +{ + printf("/* This file has been automatically generated by " + "price_tablegen.c. */\n\n" + "#include \"range_encoder.h\"\n\n" + "const uint8_t lzma_rc_prices[" + "RC_PRICE_TABLE_SIZE] = {"); + + const size_t array_size = sizeof(lzma_rc_prices) + / sizeof(lzma_rc_prices[0]); + for (size_t i = 0; i < array_size; ++i) { + if (i % 8 == 0) + printf("\n\t"); + + printf("%4" PRIu32, rc_prices[i]); + + if (i != array_size - 1) + printf(","); + } + + printf("\n};\n"); + + return; +} + + +int +main(void) +{ + init_price_table(); + print_price_table(); + return 0; +} diff --git a/src/liblzma/rangecoder/range_common.h b/src/liblzma/rangecoder/range_common.h new file mode 100644 index 0000000..2c74dc1 --- /dev/null +++ b/src/liblzma/rangecoder/range_common.h @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file range_common.h +/// \brief Common things for range encoder and decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_RANGE_COMMON_H +#define LZMA_RANGE_COMMON_H + +#include "common.h" + + +/////////////// +// Constants // +/////////////// + +#define RC_SHIFT_BITS 8 +#define RC_TOP_BITS 24 +#define RC_TOP_VALUE (UINT32_C(1) << RC_TOP_BITS) +#define RC_BIT_MODEL_TOTAL_BITS 11 +#define RC_BIT_MODEL_TOTAL (UINT32_C(1) << RC_BIT_MODEL_TOTAL_BITS) +#define RC_MOVE_BITS 5 + + +//////////// +// Macros // +//////////// + +// Resets the probability so that both 0 and 1 have probability of 50 % +#define bit_reset(prob) \ + prob = RC_BIT_MODEL_TOTAL >> 1 + +// This does the same for a complete bit tree. +// (A tree represented as an array.) +#define bittree_reset(probs, bit_levels) \ + for (uint32_t bt_i = 0; bt_i < (1 << (bit_levels)); ++bt_i) \ + bit_reset((probs)[bt_i]) + + +////////////////////// +// Type definitions // +////////////////////// + +/// \brief Type of probabilities used with range coder +/// +/// This needs to be at least 12-bit integer, so uint16_t is a logical choice. +/// However, on some architecture and compiler combinations, a bigger type +/// may give better speed, because the probability variables are accessed +/// a lot. On the other hand, bigger probability type increases cache +/// footprint, since there are 2 to 14 thousand probability variables in +/// LZMA (assuming the limit of lc + lp <= 4; with lc + lp <= 12 there +/// would be about 1.5 million variables). +/// +/// With malicious files, the initialization speed of the LZMA decoder can +/// become important. In that case, smaller probability variables mean that +/// there is less bytes to write to RAM, which makes initialization faster. +/// With big probability type, the initialization can become so slow that it +/// can be a problem e.g. for email servers doing virus scanning. +/// +/// I will be sticking to uint16_t unless some specific architectures +/// are *much* faster (20-50 %) with uint32_t. +typedef uint16_t probability; + +#endif diff --git a/src/liblzma/rangecoder/range_decoder.h b/src/liblzma/rangecoder/range_decoder.h new file mode 100644 index 0000000..e0b051f --- /dev/null +++ b/src/liblzma/rangecoder/range_decoder.h @@ -0,0 +1,185 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file range_decoder.h +/// \brief Range Decoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_RANGE_DECODER_H +#define LZMA_RANGE_DECODER_H + +#include "range_common.h" + + +typedef struct { + uint32_t range; + uint32_t code; + uint32_t init_bytes_left; +} lzma_range_decoder; + + +/// Reads the first five bytes to initialize the range decoder. +static inline lzma_ret +rc_read_init(lzma_range_decoder *rc, const uint8_t *restrict in, + size_t *restrict in_pos, size_t in_size) +{ + while (rc->init_bytes_left > 0) { + if (*in_pos == in_size) + return LZMA_OK; + + // The first byte is always 0x00. It could have been omitted + // in LZMA2 but it wasn't, so one byte is wasted in every + // LZMA2 chunk. + if (rc->init_bytes_left == 5 && in[*in_pos] != 0x00) + return LZMA_DATA_ERROR; + + rc->code = (rc->code << 8) | in[*in_pos]; + ++*in_pos; + --rc->init_bytes_left; + } + + return LZMA_STREAM_END; +} + + +/// Makes local copies of range decoder and *in_pos variables. Doing this +/// improves speed significantly. The range decoder macros expect also +/// variables `in' and `in_size' to be defined. +#define rc_to_local(range_decoder, in_pos) \ + lzma_range_decoder rc = range_decoder; \ + size_t rc_in_pos = (in_pos); \ + uint32_t rc_bound + + +/// Stores the local copes back to the range decoder structure. +#define rc_from_local(range_decoder, in_pos) \ +do { \ + range_decoder = rc; \ + in_pos = rc_in_pos; \ +} while (0) + + +/// Resets the range decoder structure. +#define rc_reset(range_decoder) \ +do { \ + (range_decoder).range = UINT32_MAX; \ + (range_decoder).code = 0; \ + (range_decoder).init_bytes_left = 5; \ +} while (0) + + +/// When decoding has been properly finished, rc.code is always zero unless +/// the input stream is corrupt. So checking this can catch some corrupt +/// files especially if they don't have any other integrity check. +#define rc_is_finished(range_decoder) \ + ((range_decoder).code == 0) + + +/// Read the next input byte if needed. If more input is needed but there is +/// no more input available, "goto out" is used to jump out of the main +/// decoder loop. +#define rc_normalize(seq) \ +do { \ + if (rc.range < RC_TOP_VALUE) { \ + if (unlikely(rc_in_pos == in_size)) { \ + coder->sequence = seq; \ + goto out; \ + } \ + rc.range <<= RC_SHIFT_BITS; \ + rc.code = (rc.code << RC_SHIFT_BITS) | in[rc_in_pos++]; \ + } \ +} while (0) + + +/// Start decoding a bit. This must be used together with rc_update_0() +/// and rc_update_1(): +/// +/// rc_if_0(prob, seq) { +/// rc_update_0(prob); +/// // Do something +/// } else { +/// rc_update_1(prob); +/// // Do something else +/// } +/// +#define rc_if_0(prob, seq) \ + rc_normalize(seq); \ + rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob); \ + if (rc.code < rc_bound) + + +/// Update the range decoder state and the used probability variable to +/// match a decoded bit of 0. +#define rc_update_0(prob) \ +do { \ + rc.range = rc_bound; \ + prob += (RC_BIT_MODEL_TOTAL - (prob)) >> RC_MOVE_BITS; \ +} while (0) + + +/// Update the range decoder state and the used probability variable to +/// match a decoded bit of 1. +#define rc_update_1(prob) \ +do { \ + rc.range -= rc_bound; \ + rc.code -= rc_bound; \ + prob -= (prob) >> RC_MOVE_BITS; \ +} while (0) + + +/// Decodes one bit and runs action0 or action1 depending on the decoded bit. +/// This macro is used as the last step in bittree reverse decoders since +/// those don't use "symbol" for anything else than indexing the probability +/// arrays. +#define rc_bit_last(prob, action0, action1, seq) \ +do { \ + rc_if_0(prob, seq) { \ + rc_update_0(prob); \ + action0; \ + } else { \ + rc_update_1(prob); \ + action1; \ + } \ +} while (0) + + +/// Decodes one bit, updates "symbol", and runs action0 or action1 depending +/// on the decoded bit. +#define rc_bit(prob, action0, action1, seq) \ + rc_bit_last(prob, \ + symbol <<= 1; action0, \ + symbol = (symbol << 1) + 1; action1, \ + seq); + + +/// Like rc_bit() but add "case seq:" as a prefix. This makes the unrolled +/// loops more readable because the code isn't littered with "case" +/// statements. On the other hand this also makes it less readable, since +/// spotting the places where the decoder loop may be restarted is less +/// obvious. +#define rc_bit_case(prob, action0, action1, seq) \ + case seq: rc_bit(prob, action0, action1, seq) + + +/// Decode a bit without using a probability. +#define rc_direct(dest, seq) \ +do { \ + rc_normalize(seq); \ + rc.range >>= 1; \ + rc.code -= rc.range; \ + rc_bound = UINT32_C(0) - (rc.code >> 31); \ + rc.code += rc.range & rc_bound; \ + dest = (dest << 1) + (rc_bound + 1); \ +} while (0) + + +// NOTE: No macros are provided for bittree decoding. It seems to be simpler +// to just write them open in the code. + +#endif diff --git a/src/liblzma/rangecoder/range_encoder.h b/src/liblzma/rangecoder/range_encoder.h new file mode 100644 index 0000000..d794eab --- /dev/null +++ b/src/liblzma/rangecoder/range_encoder.h @@ -0,0 +1,350 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file range_encoder.h +/// \brief Range Encoder +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_RANGE_ENCODER_H +#define LZMA_RANGE_ENCODER_H + +#include "range_common.h" +#include "price.h" + + +/// Maximum number of symbols that can be put pending into lzma_range_encoder +/// structure between calls to lzma_rc_encode(). For LZMA, 48+5 is enough +/// (match with big distance and length followed by range encoder flush). +#define RC_SYMBOLS_MAX 53 + + +typedef struct { + uint64_t low; + uint64_t cache_size; + uint32_t range; + uint8_t cache; + + /// Number of bytes written out by rc_encode() -> rc_shift_low() + uint64_t out_total; + + /// Number of symbols in the tables + size_t count; + + /// rc_encode()'s position in the tables + size_t pos; + + /// Symbols to encode + enum { + RC_BIT_0, + RC_BIT_1, + RC_DIRECT_0, + RC_DIRECT_1, + RC_FLUSH, + } symbols[RC_SYMBOLS_MAX]; + + /// Probabilities associated with RC_BIT_0 or RC_BIT_1 + probability *probs[RC_SYMBOLS_MAX]; + +} lzma_range_encoder; + + +static inline void +rc_reset(lzma_range_encoder *rc) +{ + rc->low = 0; + rc->cache_size = 1; + rc->range = UINT32_MAX; + rc->cache = 0; + rc->out_total = 0; + rc->count = 0; + rc->pos = 0; +} + + +static inline void +rc_forget(lzma_range_encoder *rc) +{ + // This must not be called when rc_encode() is partially done. + assert(rc->pos == 0); + rc->count = 0; +} + + +static inline void +rc_bit(lzma_range_encoder *rc, probability *prob, uint32_t bit) +{ + rc->symbols[rc->count] = bit; + rc->probs[rc->count] = prob; + ++rc->count; +} + + +static inline void +rc_bittree(lzma_range_encoder *rc, probability *probs, + uint32_t bit_count, uint32_t symbol) +{ + uint32_t model_index = 1; + + do { + const uint32_t bit = (symbol >> --bit_count) & 1; + rc_bit(rc, &probs[model_index], bit); + model_index = (model_index << 1) + bit; + } while (bit_count != 0); +} + + +static inline void +rc_bittree_reverse(lzma_range_encoder *rc, probability *probs, + uint32_t bit_count, uint32_t symbol) +{ + uint32_t model_index = 1; + + do { + const uint32_t bit = symbol & 1; + symbol >>= 1; + rc_bit(rc, &probs[model_index], bit); + model_index = (model_index << 1) + bit; + } while (--bit_count != 0); +} + + +static inline void +rc_direct(lzma_range_encoder *rc, + uint32_t value, uint32_t bit_count) +{ + do { + rc->symbols[rc->count++] + = RC_DIRECT_0 + ((value >> --bit_count) & 1); + } while (bit_count != 0); +} + + +static inline void +rc_flush(lzma_range_encoder *rc) +{ + for (size_t i = 0; i < 5; ++i) + rc->symbols[rc->count++] = RC_FLUSH; +} + + +static inline bool +rc_shift_low(lzma_range_encoder *rc, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + if ((uint32_t)(rc->low) < (uint32_t)(0xFF000000) + || (uint32_t)(rc->low >> 32) != 0) { + do { + if (*out_pos == out_size) + return true; + + out[*out_pos] = rc->cache + (uint8_t)(rc->low >> 32); + ++*out_pos; + ++rc->out_total; + rc->cache = 0xFF; + + } while (--rc->cache_size != 0); + + rc->cache = (rc->low >> 24) & 0xFF; + } + + ++rc->cache_size; + rc->low = (rc->low & 0x00FFFFFF) << RC_SHIFT_BITS; + + return false; +} + + +// NOTE: The last two arguments are uint64_t instead of size_t because in +// the dummy version these refer to the size of the whole range-encoded +// output stream, not just to the currently available output buffer space. +static inline bool +rc_shift_low_dummy(uint64_t *low, uint64_t *cache_size, uint8_t *cache, + uint64_t *out_pos, uint64_t out_size) +{ + if ((uint32_t)(*low) < (uint32_t)(0xFF000000) + || (uint32_t)(*low >> 32) != 0) { + do { + if (*out_pos == out_size) + return true; + + ++*out_pos; + *cache = 0xFF; + + } while (--*cache_size != 0); + + *cache = (*low >> 24) & 0xFF; + } + + ++*cache_size; + *low = (*low & 0x00FFFFFF) << RC_SHIFT_BITS; + + return false; +} + + +static inline bool +rc_encode(lzma_range_encoder *rc, + uint8_t *out, size_t *out_pos, size_t out_size) +{ + assert(rc->count <= RC_SYMBOLS_MAX); + + while (rc->pos < rc->count) { + // Normalize + if (rc->range < RC_TOP_VALUE) { + if (rc_shift_low(rc, out, out_pos, out_size)) + return true; + + rc->range <<= RC_SHIFT_BITS; + } + + // Encode a bit + switch (rc->symbols[rc->pos]) { + case RC_BIT_0: { + probability prob = *rc->probs[rc->pos]; + rc->range = (rc->range >> RC_BIT_MODEL_TOTAL_BITS) + * prob; + prob += (RC_BIT_MODEL_TOTAL - prob) >> RC_MOVE_BITS; + *rc->probs[rc->pos] = prob; + break; + } + + case RC_BIT_1: { + probability prob = *rc->probs[rc->pos]; + const uint32_t bound = prob * (rc->range + >> RC_BIT_MODEL_TOTAL_BITS); + rc->low += bound; + rc->range -= bound; + prob -= prob >> RC_MOVE_BITS; + *rc->probs[rc->pos] = prob; + break; + } + + case RC_DIRECT_0: + rc->range >>= 1; + break; + + case RC_DIRECT_1: + rc->range >>= 1; + rc->low += rc->range; + break; + + case RC_FLUSH: + // Prevent further normalizations. + rc->range = UINT32_MAX; + + // Flush the last five bytes (see rc_flush()). + do { + if (rc_shift_low(rc, out, out_pos, out_size)) + return true; + } while (++rc->pos < rc->count); + + // Reset the range encoder so we are ready to continue + // encoding if we weren't finishing the stream. + rc_reset(rc); + return false; + + default: + assert(0); + break; + } + + ++rc->pos; + } + + rc->count = 0; + rc->pos = 0; + + return false; +} + + +static inline bool +rc_encode_dummy(const lzma_range_encoder *rc, uint64_t out_limit) +{ + assert(rc->count <= RC_SYMBOLS_MAX); + + uint64_t low = rc->low; + uint64_t cache_size = rc->cache_size; + uint32_t range = rc->range; + uint8_t cache = rc->cache; + uint64_t out_pos = rc->out_total; + + size_t pos = rc->pos; + + while (true) { + // Normalize + if (range < RC_TOP_VALUE) { + if (rc_shift_low_dummy(&low, &cache_size, &cache, + &out_pos, out_limit)) + return true; + + range <<= RC_SHIFT_BITS; + } + + // This check is here because the normalization above must + // be done before flushing the last bytes. + if (pos == rc->count) + break; + + // Encode a bit + switch (rc->symbols[pos]) { + case RC_BIT_0: { + probability prob = *rc->probs[pos]; + range = (range >> RC_BIT_MODEL_TOTAL_BITS) + * prob; + break; + } + + case RC_BIT_1: { + probability prob = *rc->probs[pos]; + const uint32_t bound = prob * (range + >> RC_BIT_MODEL_TOTAL_BITS); + low += bound; + range -= bound; + break; + } + + case RC_DIRECT_0: + range >>= 1; + break; + + case RC_DIRECT_1: + range >>= 1; + low += range; + break; + + case RC_FLUSH: + default: + assert(0); + break; + } + + ++pos; + } + + // Flush the last bytes. This isn't in rc->symbols[] so we do + // it after the above loop to take into account the size of + // the flushing that will be done at the end of the stream. + for (pos = 0; pos < 5; ++pos) { + if (rc_shift_low_dummy(&low, &cache_size, + &cache, &out_pos, out_limit)) + return true; + } + + return false; +} + + +static inline uint64_t +rc_pending(const lzma_range_encoder *rc) +{ + return rc->cache_size + 5 - 1; +} + +#endif diff --git a/src/liblzma/simple/arm.c b/src/liblzma/simple/arm.c new file mode 100644 index 0000000..6e53970 --- /dev/null +++ b/src/liblzma/simple/arm.c @@ -0,0 +1,75 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file arm.c +/// \brief Filter for ARM binaries +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +arm_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + size_t i; + for (i = 0; i + 4 <= size; i += 4) { + if (buffer[i + 3] == 0xEB) { + uint32_t src = ((uint32_t)(buffer[i + 2]) << 16) + | ((uint32_t)(buffer[i + 1]) << 8) + | (uint32_t)(buffer[i + 0]); + src <<= 2; + + uint32_t dest; + if (is_encoder) + dest = now_pos + (uint32_t)(i) + 8 + src; + else + dest = src - (now_pos + (uint32_t)(i) + 8); + + dest >>= 2; + buffer[i + 2] = (dest >> 16); + buffer[i + 1] = (dest >> 8); + buffer[i + 0] = dest; + } + } + + return i; +} + + +static lzma_ret +arm_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &arm_code, 0, 4, 4, is_encoder); +} + + +#ifdef HAVE_ENCODER_ARM +extern lzma_ret +lzma_simple_arm_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return arm_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_ARM +extern lzma_ret +lzma_simple_arm_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return arm_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/arm64.c b/src/liblzma/simple/arm64.c new file mode 100644 index 0000000..0fe0824 --- /dev/null +++ b/src/liblzma/simple/arm64.c @@ -0,0 +1,137 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file arm64.c +/// \brief Filter for ARM64 binaries +/// +/// This converts ARM64 relative addresses in the BL and ADRP immediates +/// to absolute values to increase redundancy of ARM64 code. +/// +/// Converting B or ADR instructions was also tested but it's not useful. +/// A majority of the jumps for the B instruction are very small (+/- 0xFF). +/// These are typical for loops and if-statements. Encoding them to their +/// absolute address reduces redundancy since many of the small relative +/// jump values are repeated, but very few of the absolute addresses are. +// +// Authors: Lasse Collin +// Jia Tan +// Igor Pavlov +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +arm64_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + size_t i; + + // Clang 14.0.6 on x86-64 makes this four times bigger and 40 % slower + // with auto-vectorization that is enabled by default with -O2. + // Such vectorization bloat happens with -O2 when targeting ARM64 too + // but performance hasn't been tested. +#ifdef __clang__ +# pragma clang loop vectorize(disable) +#endif + for (i = 0; i + 4 <= size; i += 4) { + uint32_t pc = (uint32_t)(now_pos + i); + uint32_t instr = read32le(buffer + i); + + if ((instr >> 26) == 0x25) { + // BL instruction: + // The full 26-bit immediate is converted. + // The range is +/-128 MiB. + // + // Using the full range is helps quite a lot with + // big executables. Smaller range would reduce false + // positives in non-code sections of the input though + // so this is a compromise that slightly favors big + // files. With the full range only six bits of the 32 + // need to match to trigger a conversion. + const uint32_t src = instr; + instr = 0x94000000; + + pc >>= 2; + if (!is_encoder) + pc = 0U - pc; + + instr |= (src + pc) & 0x03FFFFFF; + write32le(buffer + i, instr); + + } else if ((instr & 0x9F000000) == 0x90000000) { + // ADRP instruction: + // Only values in the range +/-512 MiB are converted. + // + // Using less than the full +/-4 GiB range reduces + // false positives on non-code sections of the input + // while being excellent for executables up to 512 MiB. + // The positive effect of ADRP conversion is smaller + // than that of BL but it also doesn't hurt so much in + // non-code sections of input because, with +/-512 MiB + // range, nine bits of 32 need to match to trigger a + // conversion (two 10-bit match choices = 9 bits). + const uint32_t src = ((instr >> 29) & 3) + | ((instr >> 3) & 0x001FFFFC); + + // With the addition only one branch is needed to + // check the +/- range. This is usually false when + // processing ARM64 code so branch prediction will + // handle it well in terms of performance. + // + //if ((src & 0x001E0000) != 0 + // && (src & 0x001E0000) != 0x001E0000) + if ((src + 0x00020000) & 0x001C0000) + continue; + + instr &= 0x9000001F; + + pc >>= 12; + if (!is_encoder) + pc = 0U - pc; + + const uint32_t dest = src + pc; + instr |= (dest & 3) << 29; + instr |= (dest & 0x0003FFFC) << 3; + instr |= (0U - (dest & 0x00020000)) & 0x00E00000; + write32le(buffer + i, instr); + } + } + + return i; +} + + +static lzma_ret +arm64_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &arm64_code, 0, 4, 4, is_encoder); +} + + +#ifdef HAVE_ENCODER_ARM64 +extern lzma_ret +lzma_simple_arm64_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return arm64_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_ARM64 +extern lzma_ret +lzma_simple_arm64_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return arm64_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/armthumb.c b/src/liblzma/simple/armthumb.c new file mode 100644 index 0000000..25d8dbd --- /dev/null +++ b/src/liblzma/simple/armthumb.c @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file armthumb.c +/// \brief Filter for ARM-Thumb binaries +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +armthumb_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + size_t i; + for (i = 0; i + 4 <= size; i += 2) { + if ((buffer[i + 1] & 0xF8) == 0xF0 + && (buffer[i + 3] & 0xF8) == 0xF8) { + uint32_t src = (((uint32_t)(buffer[i + 1]) & 7) << 19) + | ((uint32_t)(buffer[i + 0]) << 11) + | (((uint32_t)(buffer[i + 3]) & 7) << 8) + | (uint32_t)(buffer[i + 2]); + + src <<= 1; + + uint32_t dest; + if (is_encoder) + dest = now_pos + (uint32_t)(i) + 4 + src; + else + dest = src - (now_pos + (uint32_t)(i) + 4); + + dest >>= 1; + buffer[i + 1] = 0xF0 | ((dest >> 19) & 0x7); + buffer[i + 0] = (dest >> 11); + buffer[i + 3] = 0xF8 | ((dest >> 8) & 0x7); + buffer[i + 2] = (dest); + i += 2; + } + } + + return i; +} + + +static lzma_ret +armthumb_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &armthumb_code, 0, 4, 2, is_encoder); +} + + +#ifdef HAVE_ENCODER_ARMTHUMB +extern lzma_ret +lzma_simple_armthumb_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return armthumb_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_ARMTHUMB +extern lzma_ret +lzma_simple_armthumb_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return armthumb_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/ia64.c b/src/liblzma/simple/ia64.c new file mode 100644 index 0000000..692b0a2 --- /dev/null +++ b/src/liblzma/simple/ia64.c @@ -0,0 +1,116 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file ia64.c +/// \brief Filter for IA64 (Itanium) binaries +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +ia64_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + static const uint32_t BRANCH_TABLE[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 6, 6, 0, 0, 7, 7, + 4, 4, 0, 0, 4, 4, 0, 0 + }; + + size_t i; + for (i = 0; i + 16 <= size; i += 16) { + const uint32_t instr_template = buffer[i] & 0x1F; + const uint32_t mask = BRANCH_TABLE[instr_template]; + uint32_t bit_pos = 5; + + for (size_t slot = 0; slot < 3; ++slot, bit_pos += 41) { + if (((mask >> slot) & 1) == 0) + continue; + + const size_t byte_pos = (bit_pos >> 3); + const uint32_t bit_res = bit_pos & 0x7; + uint64_t instruction = 0; + + for (size_t j = 0; j < 6; ++j) + instruction += (uint64_t)( + buffer[i + j + byte_pos]) + << (8 * j); + + uint64_t inst_norm = instruction >> bit_res; + + if (((inst_norm >> 37) & 0xF) == 0x5 + && ((inst_norm >> 9) & 0x7) == 0 + /* && (inst_norm & 0x3F)== 0 */ + ) { + uint32_t src = (uint32_t)( + (inst_norm >> 13) & 0xFFFFF); + src |= ((inst_norm >> 36) & 1) << 20; + + src <<= 4; + + uint32_t dest; + if (is_encoder) + dest = now_pos + (uint32_t)(i) + src; + else + dest = src - (now_pos + (uint32_t)(i)); + + dest >>= 4; + + inst_norm &= ~((uint64_t)(0x8FFFFF) << 13); + inst_norm |= (uint64_t)(dest & 0xFFFFF) << 13; + inst_norm |= (uint64_t)(dest & 0x100000) + << (36 - 20); + + instruction &= (1U << bit_res) - 1; + instruction |= (inst_norm << bit_res); + + for (size_t j = 0; j < 6; j++) + buffer[i + j + byte_pos] = (uint8_t)( + instruction + >> (8 * j)); + } + } + } + + return i; +} + + +static lzma_ret +ia64_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &ia64_code, 0, 16, 16, is_encoder); +} + + +#ifdef HAVE_ENCODER_IA64 +extern lzma_ret +lzma_simple_ia64_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return ia64_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_IA64 +extern lzma_ret +lzma_simple_ia64_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return ia64_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/powerpc.c b/src/liblzma/simple/powerpc.c new file mode 100644 index 0000000..3a340fd --- /dev/null +++ b/src/liblzma/simple/powerpc.c @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file powerpc.c +/// \brief Filter for PowerPC (big endian) binaries +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +powerpc_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + size_t i; + for (i = 0; i + 4 <= size; i += 4) { + // PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link) + if ((buffer[i] >> 2) == 0x12 + && ((buffer[i + 3] & 3) == 1)) { + + const uint32_t src + = (((uint32_t)(buffer[i + 0]) & 3) << 24) + | ((uint32_t)(buffer[i + 1]) << 16) + | ((uint32_t)(buffer[i + 2]) << 8) + | ((uint32_t)(buffer[i + 3]) & ~UINT32_C(3)); + + uint32_t dest; + if (is_encoder) + dest = now_pos + (uint32_t)(i) + src; + else + dest = src - (now_pos + (uint32_t)(i)); + + buffer[i + 0] = 0x48 | ((dest >> 24) & 0x03); + buffer[i + 1] = (dest >> 16); + buffer[i + 2] = (dest >> 8); + buffer[i + 3] &= 0x03; + buffer[i + 3] |= dest; + } + } + + return i; +} + + +static lzma_ret +powerpc_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &powerpc_code, 0, 4, 4, is_encoder); +} + + +#ifdef HAVE_ENCODER_POWERPC +extern lzma_ret +lzma_simple_powerpc_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return powerpc_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_POWERPC +extern lzma_ret +lzma_simple_powerpc_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return powerpc_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/simple_coder.c b/src/liblzma/simple/simple_coder.c new file mode 100644 index 0000000..4f499be --- /dev/null +++ b/src/liblzma/simple/simple_coder.c @@ -0,0 +1,290 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_coder.c +/// \brief Wrapper for simple filters +/// +/// Simple filters don't change the size of the data i.e. number of bytes +/// in equals the number of bytes out. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +/// Copied or encodes/decodes more data to out[]. +static lzma_ret +copy_or_code(lzma_simple_coder *coder, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + assert(!coder->end_was_reached); + + if (coder->next.code == NULL) { + lzma_bufcpy(in, in_pos, in_size, out, out_pos, out_size); + + // Check if end of stream was reached. + if (coder->is_encoder && action == LZMA_FINISH + && *in_pos == in_size) + coder->end_was_reached = true; + + } else { + // Call the next coder in the chain to provide us some data. + const lzma_ret ret = coder->next.code( + coder->next.coder, allocator, + in, in_pos, in_size, + out, out_pos, out_size, action); + + if (ret == LZMA_STREAM_END) { + assert(!coder->is_encoder + || action == LZMA_FINISH); + coder->end_was_reached = true; + + } else if (ret != LZMA_OK) { + return ret; + } + } + + return LZMA_OK; +} + + +static size_t +call_filter(lzma_simple_coder *coder, uint8_t *buffer, size_t size) +{ + const size_t filtered = coder->filter(coder->simple, + coder->now_pos, coder->is_encoder, + buffer, size); + coder->now_pos += filtered; + return filtered; +} + + +static lzma_ret +simple_code(void *coder_ptr, const lzma_allocator *allocator, + const uint8_t *restrict in, size_t *restrict in_pos, + size_t in_size, uint8_t *restrict out, + size_t *restrict out_pos, size_t out_size, lzma_action action) +{ + lzma_simple_coder *coder = coder_ptr; + + // TODO: Add partial support for LZMA_SYNC_FLUSH. We can support it + // in cases when the filter is able to filter everything. With most + // simple filters it can be done at offset that is a multiple of 2, + // 4, or 16. With x86 filter, it needs good luck, and thus cannot + // be made to work predictably. + if (action == LZMA_SYNC_FLUSH) + return LZMA_OPTIONS_ERROR; + + // Flush already filtered data from coder->buffer[] to out[]. + if (coder->pos < coder->filtered) { + lzma_bufcpy(coder->buffer, &coder->pos, coder->filtered, + out, out_pos, out_size); + + // If we couldn't flush all the filtered data, return to + // application immediately. + if (coder->pos < coder->filtered) + return LZMA_OK; + + if (coder->end_was_reached) { + assert(coder->filtered == coder->size); + return LZMA_STREAM_END; + } + } + + // If we get here, there is no filtered data left in the buffer. + coder->filtered = 0; + + assert(!coder->end_was_reached); + + // If there is more output space left than there is unfiltered data + // in coder->buffer[], flush coder->buffer[] to out[], and copy/code + // more data to out[] hopefully filling it completely. Then filter + // the data in out[]. This step is where most of the data gets + // filtered if the buffer sizes used by the application are reasonable. + const size_t out_avail = out_size - *out_pos; + const size_t buf_avail = coder->size - coder->pos; + if (out_avail > buf_avail || buf_avail == 0) { + // Store the old position so that we know from which byte + // to start filtering. + const size_t out_start = *out_pos; + + // Flush data from coder->buffer[] to out[], but don't reset + // coder->pos and coder->size yet. This way the coder can be + // restarted if the next filter in the chain returns e.g. + // LZMA_MEM_ERROR. + // + // Do the memcpy() conditionally because out can be NULL + // (in which case buf_avail is always 0). Calling memcpy() + // with a null-pointer is undefined even if the third + // argument is 0. + if (buf_avail > 0) + memcpy(out + *out_pos, coder->buffer + coder->pos, + buf_avail); + + *out_pos += buf_avail; + + // Copy/Encode/Decode more data to out[]. + { + const lzma_ret ret = copy_or_code(coder, allocator, + in, in_pos, in_size, + out, out_pos, out_size, action); + assert(ret != LZMA_STREAM_END); + if (ret != LZMA_OK) + return ret; + } + + // Filter out[]. + const size_t size = *out_pos - out_start; + const size_t filtered = call_filter( + coder, out + out_start, size); + + const size_t unfiltered = size - filtered; + assert(unfiltered <= coder->allocated / 2); + + // Now we can update coder->pos and coder->size, because + // the next coder in the chain (if any) was successful. + coder->pos = 0; + coder->size = unfiltered; + + if (coder->end_was_reached) { + // The last byte has been copied to out[] already. + // They are left as is. + coder->size = 0; + + } else if (unfiltered > 0) { + // There is unfiltered data left in out[]. Copy it to + // coder->buffer[] and rewind *out_pos appropriately. + *out_pos -= unfiltered; + memcpy(coder->buffer, out + *out_pos, unfiltered); + } + } else if (coder->pos > 0) { + memmove(coder->buffer, coder->buffer + coder->pos, buf_avail); + coder->size -= coder->pos; + coder->pos = 0; + } + + assert(coder->pos == 0); + + // If coder->buffer[] isn't empty, try to fill it by copying/decoding + // more data. Then filter coder->buffer[] and copy the successfully + // filtered data to out[]. It is probable, that some filtered and + // unfiltered data will be left to coder->buffer[]. + if (coder->size > 0) { + { + const lzma_ret ret = copy_or_code(coder, allocator, + in, in_pos, in_size, + coder->buffer, &coder->size, + coder->allocated, action); + assert(ret != LZMA_STREAM_END); + if (ret != LZMA_OK) + return ret; + } + + coder->filtered = call_filter( + coder, coder->buffer, coder->size); + + // Everything is considered to be filtered if coder->buffer[] + // contains the last bytes of the data. + if (coder->end_was_reached) + coder->filtered = coder->size; + + // Flush as much as possible. + lzma_bufcpy(coder->buffer, &coder->pos, coder->filtered, + out, out_pos, out_size); + } + + // Check if we got everything done. + if (coder->end_was_reached && coder->pos == coder->size) + return LZMA_STREAM_END; + + return LZMA_OK; +} + + +static void +simple_coder_end(void *coder_ptr, const lzma_allocator *allocator) +{ + lzma_simple_coder *coder = coder_ptr; + lzma_next_end(&coder->next, allocator); + lzma_free(coder->simple, allocator); + lzma_free(coder, allocator); + return; +} + + +static lzma_ret +simple_coder_update(void *coder_ptr, const lzma_allocator *allocator, + const lzma_filter *filters_null lzma_attribute((__unused__)), + const lzma_filter *reversed_filters) +{ + lzma_simple_coder *coder = coder_ptr; + + // No update support, just call the next filter in the chain. + return lzma_next_filter_update( + &coder->next, allocator, reversed_filters + 1); +} + + +extern lzma_ret +lzma_simple_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, + size_t (*filter)(void *simple, uint32_t now_pos, + bool is_encoder, uint8_t *buffer, size_t size), + size_t simple_size, size_t unfiltered_max, + uint32_t alignment, bool is_encoder) +{ + // Allocate memory for the lzma_simple_coder structure if needed. + lzma_simple_coder *coder = next->coder; + if (coder == NULL) { + // Here we allocate space also for the temporary buffer. We + // need twice the size of unfiltered_max, because then it + // is always possible to filter at least unfiltered_max bytes + // more data in coder->buffer[] if it can be filled completely. + coder = lzma_alloc(sizeof(lzma_simple_coder) + + 2 * unfiltered_max, allocator); + if (coder == NULL) + return LZMA_MEM_ERROR; + + next->coder = coder; + next->code = &simple_code; + next->end = &simple_coder_end; + next->update = &simple_coder_update; + + coder->next = LZMA_NEXT_CODER_INIT; + coder->filter = filter; + coder->allocated = 2 * unfiltered_max; + + // Allocate memory for filter-specific data structure. + if (simple_size > 0) { + coder->simple = lzma_alloc(simple_size, allocator); + if (coder->simple == NULL) + return LZMA_MEM_ERROR; + } else { + coder->simple = NULL; + } + } + + if (filters[0].options != NULL) { + const lzma_options_bcj *simple = filters[0].options; + coder->now_pos = simple->start_offset; + if (coder->now_pos & (alignment - 1)) + return LZMA_OPTIONS_ERROR; + } else { + coder->now_pos = 0; + } + + // Reset variables. + coder->is_encoder = is_encoder; + coder->end_was_reached = false; + coder->pos = 0; + coder->filtered = 0; + coder->size = 0; + + return lzma_next_filter_init(&coder->next, allocator, filters + 1); +} diff --git a/src/liblzma/simple/simple_coder.h b/src/liblzma/simple/simple_coder.h new file mode 100644 index 0000000..668a509 --- /dev/null +++ b/src/liblzma/simple/simple_coder.h @@ -0,0 +1,81 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_coder.h +/// \brief Wrapper for simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SIMPLE_CODER_H +#define LZMA_SIMPLE_CODER_H + +#include "common.h" + + +extern lzma_ret lzma_simple_x86_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_x86_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_powerpc_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_powerpc_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_ia64_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_ia64_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_arm_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_arm_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_armthumb_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_armthumb_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_arm64_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_arm64_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + + +extern lzma_ret lzma_simple_sparc_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +extern lzma_ret lzma_simple_sparc_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters); + +#endif diff --git a/src/liblzma/simple/simple_decoder.c b/src/liblzma/simple/simple_decoder.c new file mode 100644 index 0000000..dc4d241 --- /dev/null +++ b/src/liblzma/simple/simple_decoder.c @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_decoder.c +/// \brief Properties decoder for simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_decoder.h" + + +extern lzma_ret +lzma_simple_props_decode(void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size) +{ + if (props_size == 0) + return LZMA_OK; + + if (props_size != 4) + return LZMA_OPTIONS_ERROR; + + lzma_options_bcj *opt = lzma_alloc( + sizeof(lzma_options_bcj), allocator); + if (opt == NULL) + return LZMA_MEM_ERROR; + + opt->start_offset = read32le(props); + + // Don't leave an options structure allocated if start_offset is zero. + if (opt->start_offset == 0) + lzma_free(opt, allocator); + else + *options = opt; + + return LZMA_OK; +} diff --git a/src/liblzma/simple/simple_decoder.h b/src/liblzma/simple/simple_decoder.h new file mode 100644 index 0000000..bed8d37 --- /dev/null +++ b/src/liblzma/simple/simple_decoder.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_decoder.h +/// \brief Properties decoder for simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SIMPLE_DECODER_H +#define LZMA_SIMPLE_DECODER_H + +#include "simple_coder.h" + +extern lzma_ret lzma_simple_props_decode( + void **options, const lzma_allocator *allocator, + const uint8_t *props, size_t props_size); + +#endif diff --git a/src/liblzma/simple/simple_encoder.c b/src/liblzma/simple/simple_encoder.c new file mode 100644 index 0000000..d2cc03e --- /dev/null +++ b/src/liblzma/simple/simple_encoder.c @@ -0,0 +1,38 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_encoder.c +/// \brief Properties encoder for simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_encoder.h" + + +extern lzma_ret +lzma_simple_props_size(uint32_t *size, const void *options) +{ + const lzma_options_bcj *const opt = options; + *size = (opt == NULL || opt->start_offset == 0) ? 0 : 4; + return LZMA_OK; +} + + +extern lzma_ret +lzma_simple_props_encode(const void *options, uint8_t *out) +{ + const lzma_options_bcj *const opt = options; + + // The default start offset is zero, so we don't need to store any + // options unless the start offset is non-zero. + if (opt == NULL || opt->start_offset == 0) + return LZMA_OK; + + write32le(out, opt->start_offset); + + return LZMA_OK; +} diff --git a/src/liblzma/simple/simple_encoder.h b/src/liblzma/simple/simple_encoder.h new file mode 100644 index 0000000..1cee482 --- /dev/null +++ b/src/liblzma/simple/simple_encoder.h @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_encoder.c +/// \brief Properties encoder for simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SIMPLE_ENCODER_H +#define LZMA_SIMPLE_ENCODER_H + +#include "simple_coder.h" + + +extern lzma_ret lzma_simple_props_size(uint32_t *size, const void *options); + +extern lzma_ret lzma_simple_props_encode(const void *options, uint8_t *out); + +#endif diff --git a/src/liblzma/simple/simple_private.h b/src/liblzma/simple/simple_private.h new file mode 100644 index 0000000..9d2c0fd --- /dev/null +++ b/src/liblzma/simple/simple_private.h @@ -0,0 +1,74 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file simple_private.h +/// \brief Private definitions for so called simple filters +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_SIMPLE_PRIVATE_H +#define LZMA_SIMPLE_PRIVATE_H + +#include "simple_coder.h" + + +typedef struct { + /// Next filter in the chain + lzma_next_coder next; + + /// True if the next coder in the chain has returned LZMA_STREAM_END. + bool end_was_reached; + + /// True if filter() should encode the data; false to decode. + /// Currently all simple filters use the same function for encoding + /// and decoding, because the difference between encoders and decoders + /// is very small. + bool is_encoder; + + /// Pointer to filter-specific function, which does + /// the actual filtering. + size_t (*filter)(void *simple, uint32_t now_pos, + bool is_encoder, uint8_t *buffer, size_t size); + + /// Pointer to filter-specific data, or NULL if filter doesn't need + /// any extra data. + void *simple; + + /// The lowest 32 bits of the current position in the data. Most + /// filters need this to do conversions between absolute and relative + /// addresses. + uint32_t now_pos; + + /// Size of the memory allocated for the buffer. + size_t allocated; + + /// Flushing position in the temporary buffer. buffer[pos] is the + /// next byte to be copied to out[]. + size_t pos; + + /// buffer[filtered] is the first unfiltered byte. When pos is smaller + /// than filtered, there is unflushed filtered data in the buffer. + size_t filtered; + + /// Total number of bytes (both filtered and unfiltered) currently + /// in the temporary buffer. + size_t size; + + /// Temporary buffer + uint8_t buffer[]; +} lzma_simple_coder; + + +extern lzma_ret lzma_simple_coder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters, + size_t (*filter)(void *simple, uint32_t now_pos, + bool is_encoder, uint8_t *buffer, size_t size), + size_t simple_size, size_t unfiltered_max, + uint32_t alignment, bool is_encoder); + +#endif diff --git a/src/liblzma/simple/sparc.c b/src/liblzma/simple/sparc.c new file mode 100644 index 0000000..bad8492 --- /dev/null +++ b/src/liblzma/simple/sparc.c @@ -0,0 +1,87 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file sparc.c +/// \brief Filter for SPARC binaries +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +static size_t +sparc_code(void *simple lzma_attribute((__unused__)), + uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + size_t i; + for (i = 0; i + 4 <= size; i += 4) { + + if ((buffer[i] == 0x40 && (buffer[i + 1] & 0xC0) == 0x00) + || (buffer[i] == 0x7F + && (buffer[i + 1] & 0xC0) == 0xC0)) { + + uint32_t src = ((uint32_t)buffer[i + 0] << 24) + | ((uint32_t)buffer[i + 1] << 16) + | ((uint32_t)buffer[i + 2] << 8) + | ((uint32_t)buffer[i + 3]); + + src <<= 2; + + uint32_t dest; + if (is_encoder) + dest = now_pos + (uint32_t)(i) + src; + else + dest = src - (now_pos + (uint32_t)(i)); + + dest >>= 2; + + dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) + | (dest & 0x3FFFFF) + | 0x40000000; + + buffer[i + 0] = (uint8_t)(dest >> 24); + buffer[i + 1] = (uint8_t)(dest >> 16); + buffer[i + 2] = (uint8_t)(dest >> 8); + buffer[i + 3] = (uint8_t)(dest); + } + } + + return i; +} + + +static lzma_ret +sparc_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + return lzma_simple_coder_init(next, allocator, filters, + &sparc_code, 0, 4, 4, is_encoder); +} + + +#ifdef HAVE_ENCODER_SPARC +extern lzma_ret +lzma_simple_sparc_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return sparc_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_SPARC +extern lzma_ret +lzma_simple_sparc_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return sparc_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/simple/x86.c b/src/liblzma/simple/x86.c new file mode 100644 index 0000000..232b295 --- /dev/null +++ b/src/liblzma/simple/x86.c @@ -0,0 +1,163 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file x86.c +/// \brief Filter for x86 binaries (BCJ filter) +/// +// Authors: Igor Pavlov +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "simple_private.h" + + +#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF) + + +typedef struct { + uint32_t prev_mask; + uint32_t prev_pos; +} lzma_simple_x86; + + +static size_t +x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder, + uint8_t *buffer, size_t size) +{ + static const bool MASK_TO_ALLOWED_STATUS[8] + = { true, true, true, false, true, false, false, false }; + + static const uint32_t MASK_TO_BIT_NUMBER[8] + = { 0, 1, 2, 2, 3, 3, 3, 3 }; + + lzma_simple_x86 *simple = simple_ptr; + uint32_t prev_mask = simple->prev_mask; + uint32_t prev_pos = simple->prev_pos; + + if (size < 5) + return 0; + + if (now_pos - prev_pos > 5) + prev_pos = now_pos - 5; + + const size_t limit = size - 5; + size_t buffer_pos = 0; + + while (buffer_pos <= limit) { + uint8_t b = buffer[buffer_pos]; + if (b != 0xE8 && b != 0xE9) { + ++buffer_pos; + continue; + } + + const uint32_t offset = now_pos + (uint32_t)(buffer_pos) + - prev_pos; + prev_pos = now_pos + (uint32_t)(buffer_pos); + + if (offset > 5) { + prev_mask = 0; + } else { + for (uint32_t i = 0; i < offset; ++i) { + prev_mask &= 0x77; + prev_mask <<= 1; + } + } + + b = buffer[buffer_pos + 4]; + + if (Test86MSByte(b) + && MASK_TO_ALLOWED_STATUS[(prev_mask >> 1) & 0x7] + && (prev_mask >> 1) < 0x10) { + + uint32_t src = ((uint32_t)(b) << 24) + | ((uint32_t)(buffer[buffer_pos + 3]) << 16) + | ((uint32_t)(buffer[buffer_pos + 2]) << 8) + | (buffer[buffer_pos + 1]); + + uint32_t dest; + while (true) { + if (is_encoder) + dest = src + (now_pos + (uint32_t)( + buffer_pos) + 5); + else + dest = src - (now_pos + (uint32_t)( + buffer_pos) + 5); + + if (prev_mask == 0) + break; + + const uint32_t i = MASK_TO_BIT_NUMBER[ + prev_mask >> 1]; + + b = (uint8_t)(dest >> (24 - i * 8)); + + if (!Test86MSByte(b)) + break; + + src = dest ^ ((1U << (32 - i * 8)) - 1); + } + + buffer[buffer_pos + 4] + = (uint8_t)(~(((dest >> 24) & 1) - 1)); + buffer[buffer_pos + 3] = (uint8_t)(dest >> 16); + buffer[buffer_pos + 2] = (uint8_t)(dest >> 8); + buffer[buffer_pos + 1] = (uint8_t)(dest); + buffer_pos += 5; + prev_mask = 0; + + } else { + ++buffer_pos; + prev_mask |= 1; + if (Test86MSByte(b)) + prev_mask |= 0x10; + } + } + + simple->prev_mask = prev_mask; + simple->prev_pos = prev_pos; + + return buffer_pos; +} + + +static lzma_ret +x86_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, + const lzma_filter_info *filters, bool is_encoder) +{ + const lzma_ret ret = lzma_simple_coder_init(next, allocator, filters, + &x86_code, sizeof(lzma_simple_x86), 5, 1, is_encoder); + + if (ret == LZMA_OK) { + lzma_simple_coder *coder = next->coder; + lzma_simple_x86 *simple = coder->simple; + simple->prev_mask = 0; + simple->prev_pos = (uint32_t)(-5); + } + + return ret; +} + + +#ifdef HAVE_ENCODER_X86 +extern lzma_ret +lzma_simple_x86_encoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return x86_coder_init(next, allocator, filters, true); +} +#endif + + +#ifdef HAVE_DECODER_X86 +extern lzma_ret +lzma_simple_x86_decoder_init(lzma_next_coder *next, + const lzma_allocator *allocator, + const lzma_filter_info *filters) +{ + return x86_coder_init(next, allocator, filters, false); +} +#endif diff --git a/src/liblzma/validate_map.sh b/src/liblzma/validate_map.sh new file mode 100644 index 0000000..2bf6f8b --- /dev/null +++ b/src/liblzma/validate_map.sh @@ -0,0 +1,165 @@ +#!/bin/sh + +############################################################################### +# +# Check liblzma_*.map for certain types of errors. +# +# liblzma_generic.map is for FreeBSD and Solaris and possibly others +# except GNU/Linux. +# +# liblzma_linux.map is for GNU/Linux only. This and the matching extra code +# in the .c files make liblzma >= 5.2.7 compatible with binaries that were +# linked against ill-patched liblzma in RHEL/CentOS 7. By providing the +# compatibility in official XZ Utils release will hopefully prevent people +# from further copying the broken patch to other places when they want +# compatibility with binaries linked on RHEL/CentOS 7. The long version +# of the story: +# +# RHEL/CentOS 7 shipped with 5.1.2alpha, including the threaded +# encoder that is behind #ifdef LZMA_UNSTABLE in the API headers. +# In 5.1.2alpha these symbols are under XZ_5.1.2alpha in liblzma.map. +# API/ABI compatibility tracking isn't done between development +# releases so newer releases didn't have XZ_5.1.2alpha anymore. +# +# Later RHEL/CentOS 7 updated xz to 5.2.2 but they wanted to keep +# the exported symbols compatible with 5.1.2alpha. After checking +# the ABI changes it turned out that >= 5.2.0 ABI is backward +# compatible with the threaded encoder functions from 5.1.2alpha +# (but not vice versa as fixes and extensions to these functions +# were made between 5.1.2alpha and 5.2.0). +# +# In RHEL/CentOS 7, XZ Utils 5.2.2 was patched with +# xz-5.2.2-compat-libs.patch to modify liblzma.map: +# +# - XZ_5.1.2alpha was added with lzma_stream_encoder_mt and +# lzma_stream_encoder_mt_memusage. This matched XZ Utils 5.1.2alpha. +# +# - XZ_5.2 was replaced with XZ_5.2.2. It is clear that this was +# an error; the intention was to keep using XZ_5.2 (XZ_5.2.2 +# has never been used in XZ Utils). So XZ_5.2.2 lists all +# symbols that were listed under XZ_5.2 before the patch. +# lzma_stream_encoder_mt and _mt_memusage are included too so +# they are listed both here and under XZ_5.1.2alpha. +# +# The patch didn't add any __asm__(".symver ...") lines to the .c +# files. Thus the resulting liblzma.so exports the threaded encoder +# functions under XZ_5.1.2alpha only. Listing the two functions +# also under XZ_5.2.2 in liblzma.map has no effect without +# matching .symver lines. +# +# The lack of XZ_5.2 in RHEL/CentOS 7 means that binaries linked +# against unpatched XZ Utils 5.2.x won't run on RHEL/CentOS 7. +# This is unfortunate but this alone isn't too bad as the problem +# is contained within RHEL/CentOS 7 and doesn't affect users +# of other distributions. It could also be fixed internally in +# RHEL/CentOS 7. +# +# The second problem is more serious: In XZ Utils 5.2.2 the API +# headers don't have #ifdef LZMA_UNSTABLE for obvious reasons. +# This is true in RHEL/CentOS 7 version too. Thus now programs +# using new APIs can be compiled without an extra #define. However, +# the programs end up depending on symbol version XZ_5.1.2alpha +# (and possibly also XZ_5.2.2) instead of XZ_5.2 as they would +# with an unpatched XZ Utils 5.2.2. This means that such binaries +# won't run on other distributions shipping XZ Utils >= 5.2.0 as +# they don't provide XZ_5.1.2alpha or XZ_5.2.2; they only provide +# XZ_5.2 (and XZ_5.0). (This includes RHEL/CentOS 8 as the patch +# luckily isn't included there anymore with XZ Utils 5.2.4.) +# +# Binaries built by RHEL/CentOS 7 users get distributed and then +# people wonder why they don't run on some other distribution. +# Seems that people have found out about the patch and been copying +# it to some build scripts, seemingly curing the symptoms but +# actually spreading the illness further and outside RHEL/CentOS 7. +# Adding compatibility in an official XZ Utils release should work +# as a vaccine against this ill patch and stop it from spreading. +# The vaccine is kept GNU/Linux-only as other OSes should be immune +# (hopefully it hasn't spread via some build script to other OSes). +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +LC_ALL=C +export LC_ALL + +STATUS=0 + +cd "$(dirname "$0")" + +# Get the list of symbols that aren't defined in liblzma_generic.map. +SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \ + api/lzma/*.h \ + | sort \ + | grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma_generic.map)") + +# Check that there are no old alpha or beta versions listed. +VER=$(cd ../.. && sh build-aux/version.sh) +NAMES= +case $VER in + *alpha | *beta) + NAMES=$(sed -n 's/^.*XZ_\([^ ]*\)\(alpha\|beta\) .*$/\1\2/p' \ + liblzma_generic.map | grep -Fv "$VER") + ;; +esac + +# Check for duplicate lines. It can catch missing dependencies. +DUPS=$(sort liblzma_generic.map | sed '/^$/d;/^global:$/d' | uniq -d) + +# Check that liblzma_linux.map is in sync with liblzma_generic.map. +# The RHEL/CentOS 7 compatibility symbols are in a fixed location +# so it makes it easy to remove them for comparison with liblzma_generic.map. +# +# NOTE: Putting XZ_5.2 before the compatibility symbols XZ_5.1.2alpha +# and XZ_5.2.2 in liblzma_linux.map is important: If liblzma_linux.map is +# incorrectly used without #define HAVE_SYMBOL_VERSIONS_LINUX, only the first +# occurrence of each function name will be used from liblzma_linux.map; +# the rest are ignored by the linker. Thus having XZ_5.2 before the +# compatibility symbols means that @@XZ_5.2 will be used for the symbols +# listed under XZ_5.2 {...} and the same function names later in +# the file under XZ_5.1.2alpha {...} and XZ_5.2.2 {...} will be +# ignored (@XZ_5.1.2alpha or @XZ_5.2.2 won't be added at all when +# the #define HAVE_SYMBOL_VERSIONS_LINUX isn't used). +IN_SYNC= +if ! sed '109,123d' liblzma_linux.map \ + | cmp -s - liblzma_generic.map; then + IN_SYNC=no +fi + +# Print error messages if needed. +if test -n "$SYMS$NAMES$DUPS$IN_SYNC"; then + echo + echo 'validate_map.sh found problems from liblzma_*.map:' + echo + + if test -n "$SYMS"; then + echo 'liblzma_generic.map lacks the following symbols:' + echo "$SYMS" + echo + fi + + if test -n "$NAMES"; then + echo 'Obsolete alpha or beta version names:' + echo "$NAMES" + echo + fi + + if test -n "$DUPS"; then + echo 'Duplicate lines:' + echo "$DUPS" + echo + fi + + if test -n "$IN_SYNC"; then + echo "liblzma_generic.map and liblzma_linux.map aren't in sync" + echo + fi + + STATUS=1 +fi + +# Exit status is 1 if problems were found, 0 otherwise. +exit "$STATUS" diff --git a/tests/bcj_test.c b/tests/bcj_test.c new file mode 100644 index 0000000..05de38a --- /dev/null +++ b/tests/bcj_test.c @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file bcj_test.c +/// \brief Source code of compress_prepared_bcj_* +/// +/// This is a simple program that should make the compiler to generate +/// PC-relative branches, jumps, and calls. The compiled files can then +/// be used to test the branch conversion filters. Note that this program +/// itself does nothing useful. +/// +/// Compiling: gcc -std=c99 -fPIC -c bcj_test.c +/// Don't optimize or strip. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +extern int jump(int a, int b); + + +extern int +call(int a, int b) +{ + if (a < b) + a = jump(a, b); + + return a; +} + + +extern int +jump(int a, int b) +{ + // The loop generates conditional jump backwards. + while (1) { + if (a < b) { + a *= 2; + a += 3 * b; + break; + } else { + // Put enough code here to prevent JMP SHORT on x86. + a += b; + a /= 2; + b += b % 5; + a -= b / 3; + b = 2 * b + a - 1; + a *= b + a + 1; + b += a - 1; + a += b * 2 - a / 5; + } + } + + return a; +} + + +int +main(int argc, char **argv) +{ + int a = call(argc, argc + 1); + return a == 0; +} diff --git a/tests/compress_prepared_bcj_sparc b/tests/compress_prepared_bcj_sparc new file mode 100644 index 0000000..86ea7dd Binary files /dev/null and b/tests/compress_prepared_bcj_sparc differ diff --git a/tests/compress_prepared_bcj_x86 b/tests/compress_prepared_bcj_x86 new file mode 100644 index 0000000..bcc546f Binary files /dev/null and b/tests/compress_prepared_bcj_x86 differ diff --git a/tests/create_compress_files.c b/tests/create_compress_files.c new file mode 100644 index 0000000..76aa3e3 --- /dev/null +++ b/tests/create_compress_files.c @@ -0,0 +1,163 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file create_compress_files.c +/// \brief Creates bunch of test files to be compressed +/// +/// Using a test file generator program saves space in the source code +/// package considerably. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include + + +// If a command-line argument was given, only create the file if its +// name was specified on the command line. If no args were given then +// all files are created. +// +// Avoid re-creating the test files every time the tests are run. +#define maybe_create_test(argc, argv, name) \ +do { \ + if ((argc < 2 || strcmp(argv[1], "compress_generated_" #name) == 0) \ + && !file_exists("compress_generated_" #name)) { \ + FILE *file = file_create("compress_generated_" #name); \ + write_ ## name(file); \ + file_finish(file, "compress_generated_" #name); \ + } \ +} while (0) + + +static bool +file_exists(const char *filename) +{ + // Trying to be somewhat portable by avoiding stat(). + FILE *file = fopen(filename, "rb"); + bool ret; + + if (file != NULL) { + fclose(file); + ret = true; + } else { + ret = false; + } + + return ret; +} + + +static FILE * +file_create(const char *filename) +{ + FILE *file = fopen(filename, "wb"); + + if (file == NULL) { + perror(filename); + exit(EXIT_FAILURE); + } + + return file; +} + + +static void +file_finish(FILE *file, const char *filename) +{ + const bool ferror_fail = ferror(file); + const bool fclose_fail = fclose(file); + + if (ferror_fail || fclose_fail) { + perror(filename); + exit(EXIT_FAILURE); + } +} + + +// File that repeats "abc\n" a few thousand times. This is targeted +// especially at Subblock filter's run-length encoder. +static void +write_abc(FILE *file) +{ + for (size_t i = 0; i < 12345; ++i) + if (fwrite("abc\n", 4, 1, file) != 1) + exit(EXIT_FAILURE); +} + + +// File that doesn't compress. We always use the same random seed to +// generate identical files on all systems. +static void +write_random(FILE *file) +{ + uint32_t n = 5; + + for (size_t i = 0; i < 123456; ++i) { + n = 101771 * n + 71777; + + putc((uint8_t)(n), file); + putc((uint8_t)(n >> 8), file); + putc((uint8_t)(n >> 16), file); + putc((uint8_t)(n >> 24), file); + } +} + + +// Text file +static void +write_text(FILE *file) +{ + static const char *lorem[] = { + "Lorem", "ipsum", "dolor", "sit", "amet,", "consectetur", + "adipisicing", "elit,", "sed", "do", "eiusmod", "tempor", + "incididunt", "ut", "labore", "et", "dolore", "magna", + "aliqua.", "Ut", "enim", "ad", "minim", "veniam,", "quis", + "nostrud", "exercitation", "ullamco", "laboris", "nisi", + "ut", "aliquip", "ex", "ea", "commodo", "consequat.", + "Duis", "aute", "irure", "dolor", "in", "reprehenderit", + "in", "voluptate", "velit", "esse", "cillum", "dolore", + "eu", "fugiat", "nulla", "pariatur.", "Excepteur", "sint", + "occaecat", "cupidatat", "non", "proident,", "sunt", "in", + "culpa", "qui", "officia", "deserunt", "mollit", "anim", + "id", "est", "laborum." + }; + + // Let the first paragraph be the original text. + for (size_t w = 0; w < ARRAY_SIZE(lorem); ++w) { + fprintf(file, "%s ", lorem[w]); + + if (w % 7 == 6) + fprintf(file, "\n"); + } + + // The rest shall be (hopefully) meaningless combinations of + // the same words. + uint32_t n = 29; + + for (size_t p = 0; p < 500; ++p) { + fprintf(file, "\n\n"); + + for (size_t w = 0; w < ARRAY_SIZE(lorem); ++w) { + n = 101771 * n + 71777; + + fprintf(file, "%s ", lorem[n % ARRAY_SIZE(lorem)]); + + if (w % 7 == 6) + fprintf(file, "\n"); + } + } +} + + +int +main(int argc, char **argv) +{ + maybe_create_test(argc, argv, abc); + maybe_create_test(argc, argv, random); + maybe_create_test(argc, argv, text); + return EXIT_SUCCESS; +} diff --git a/tests/files/README b/tests/files/README new file mode 100644 index 0000000..119cac4 --- /dev/null +++ b/tests/files/README @@ -0,0 +1,409 @@ + +.xz and .lzma Test Files +------------------------ + +0. Introduction + + This directory contains bunch of files to test handling of .xz, + .lzma (LZMA_Alone), and .lz (lzip) files in decoder implementations. + Many of the files have been created by hand with a hex editor, thus + there is no better "source code" than the files themselves. All the + test files and this README have been put into the public domain. + + +1. File Types + + Good files (good-*) must decode successfully without requiring + a lot of CPU time or RAM. + + Unsupported files (unsupported-*) are good files, but headers + indicate features not supported by the current file format + specification. + + Bad files (bad-*) must cause the decoder to give an error. Like + with the good files, these files must not require a lot of CPU + time or RAM before they get detected to be broken. + + +2. Descriptions of Individual .xz Files + +2.1. Good Files + + good-0-empty.xz has one Stream with no Blocks. + + good-0pad-empty.xz has one Stream with no Blocks followed by + four-byte Stream Padding. + + good-0cat-empty.xz has two zero-Block Streams concatenated without + Stream Padding. + + good-0catpad-empty.xz has two zero-Block Streams concatenated with + four-byte Stream Padding between the Streams. + + good-1-check-none.xz has one Stream with one Block with two + uncompressed LZMA2 chunks and no integrity check. + + good-1-check-crc32.xz has one Stream with one Block with two + uncompressed LZMA2 chunks and CRC32 check. + + good-1-check-crc64.xz is like good-1-check-crc32.xz but with CRC64. + + good-1-check-sha256.xz is like good-1-check-crc32.xz but with + SHA256. + + good-2-lzma2.xz has one Stream with two Blocks with one uncompressed + LZMA2 chunk in each Block. + + good-1-block_header-1.xz has both Compressed Size and Uncompressed + Size in the Block Header. This has also four extra bytes of Header + Padding. + + good-1-block_header-2.xz has known Compressed Size. + + good-1-block_header-3.xz has known Uncompressed Size. + + good-1-delta-lzma2.tiff.xz is an image file that compresses + better with Delta+LZMA2 than with plain LZMA2. + + good-1-x86-lzma2.xz uses the x86 filter (BCJ) and LZMA2. The + uncompressed file is compress_prepared_bcj_x86 found from the tests + directory. + + good-1-sparc-lzma2.xz uses the SPARC filter and LZMA2. The + uncompressed file is compress_prepared_bcj_sparc found from the tests + directory. + + good-1-arm64-lzma2-1.xz uses the ARM64 filter and LZMA2. The + uncompressed data is constructed so that it tests integer + wrap around and sign extension. + + good-1-arm64-lzma2-2.xz is like good-1-arm64-lzma2-1.xz but with + non-zero start offset. XZ Embedded doesn't support this file. + + good-1-lzma2-1.xz has two LZMA2 chunks, of which the second sets + new properties. + + good-1-lzma2-2.xz has two LZMA2 chunks, of which the second resets + the state without specifying new properties. + + good-1-lzma2-3.xz has two LZMA2 chunks, of which the first is + uncompressed and the second is LZMA. The first chunk resets dictionary + and the second sets new properties. + + good-1-lzma2-4.xz has three LZMA2 chunks: First is LZMA, second is + uncompressed with dictionary reset, and third is LZMA with new + properties but without dictionary reset. + + good-1-lzma2-5.xz has an empty LZMA2 stream with only the end of + payload marker. XZ Utils 5.0.1 and older incorrectly see this file + as corrupt. + + good-1-3delta-lzma2.xz has three Delta filters and LZMA2. + + good-1-empty-bcj-lzma2.xz has an empty Block that uses PowerPC BCJ + and LZMA2. liblzma from XZ Utils 5.0.1 and older may incorrectly + return LZMA_BUF_ERROR in some cases. See commit message + d8db706acb8316f9861abd432cfbe001dd6d0c5c for the details. + + +2.2. Unsupported Files + + unsupported-check.xz uses Check ID 0x02 which isn't supported by + the current version of the file format. It is implementation-defined + how this file handled (it may reject it, or decode it possibly with + a warning). + + unsupported-block_header.xz has a non-null byte in Header Padding, + which may indicate presence of a new unsupported field. + + unsupported-filter_flags-1.xz has unsupported Filter ID 0x7F. + + unsupported-filter_flags-2.xz specifies only Delta filter in the + List of Filter Flags, but Delta isn't allowed as the last filter in + the chain. It could be a little more correct to detect this file as + corrupt instead of unsupported, but saying it is unsupported is + simpler in case of liblzma. + + unsupported-filter_flags-3.xz specifies two LZMA2 filters in the + List of Filter Flags. LZMA2 is allowed only as the last filter in the + chain. It could be a little more correct to detect this file as + corrupt instead of unsupported, but saying it is unsupported is + simpler in case of liblzma. + + +2.3. Bad Files + + bad-0pad-empty.xz has one Stream with no Blocks followed by + five-byte Stream Padding. Stream Padding must be a multiple of four + bytes, thus this file is corrupt. + + bad-0catpad-empty.xz has two zero-Block Streams concatenated with + five-byte Stream Padding between the Streams. + + bad-0cat-alone.xz is good-0-empty.xz concatenated with an empty + LZMA_Alone file. + + bad-0cat-header_magic.xz is good-0cat-empty.xz but with one byte + wrong in the Header Magic Bytes field of the second Stream. liblzma + gives LZMA_DATA_ERROR for this. (LZMA_FORMAT_ERROR is used only if + the first Stream of a file has invalid Header Magic Bytes.) + + bad-0-header_magic.xz is good-0-empty.xz but with one byte wrong + in the Header Magic Bytes field. liblzma gives LZMA_FORMAT_ERROR for + this. + + bad-0-footer_magic.xz is good-0-empty.xz but with one byte wrong + in the Footer Magic Bytes field. liblzma gives LZMA_DATA_ERROR for + this. + + bad-0-empty-truncated.xz is good-0-empty.xz without the last byte + of the file. + + bad-0-nonempty_index.xz has no Blocks but Index claims that there is + one Block. + + bad-0-backward_size.xz has wrong Backward Size in Stream Footer. + + bad-1-stream_flags-1.xz has different Stream Flags in Stream Header + and Stream Footer. + + bad-1-stream_flags-2.xz has wrong CRC32 in Stream Header. + + bad-1-stream_flags-3.xz has wrong CRC32 in Stream Footer. + + bad-1-vli-1.xz has two-byte variable-length integer in the + Uncompressed Size field in Block Header while one-byte would be enough + for that value. It's important that the file gets rejected due to too + big integer encoding instead of due to Uncompressed Size not matching + the value stored in the Block Header. That is, the decoder must not + try to decode the Compressed Data field. + + bad-1-vli-2.xz has ten-byte variable-length integer as Uncompressed + Size in Block Header. It's important that the file gets rejected due + to too big integer encoding instead of due to Uncompressed Size not + matching the value stored in the Block Header. That is, the decoder + must not try to decode the Compressed Data field. + + bad-1-block_header-1.xz has Block Header that ends in the middle of + the Filter Flags field. + + bad-1-block_header-2.xz has Block Header that has Compressed Size and + Uncompressed Size but no List of Filter Flags field. + + bad-1-block_header-3.xz has wrong CRC32 in Block Header. + + bad-1-block_header-4.xz has too big Compressed Size in Block Header + (2^63 - 1 bytes while maximum is a little less, because the whole + Block must stay smaller than 2^63). It's important that the file + gets rejected due to invalid Compressed Size value; the decoder + must not try decoding the Compressed Data field. + + bad-1-block_header-5.xz has zero as Compressed Size in Block Header. + + bad-1-block_header-6.xz has corrupt Block Header which may crash + xz -lvv in XZ Utils 5.0.3 and earlier. It was fixed in the commit + c0297445064951807803457dca1611b3c47e7f0f. + + bad-2-index-1.xz has wrong Unpadded Sizes in Index. + + bad-2-index-2.xz has wrong Uncompressed Sizes in Index. + + bad-2-index-3.xz has non-null byte in Index Padding. + + bad-2-index-4.xz wrong CRC32 in Index. + + bad-2-index-5.xz has zero as Unpadded Size. It is important that the + file gets rejected specifically due to Unpadded Size having an invalid + value. + + bad-3-index-uncomp-overflow.xz has Index whose Uncompressed Size + fields have huge values whose sum exceeds the maximum allowed size + of 2^63 - 1 bytes. In this file the sum is exactly 2^64. + lzma_index_append() in liblzma <= 5.2.6 lacks the integer overflow + check for the uncompressed size and thus doesn't catch the error + when decoding the Index field in this file. This makes "xz -l" + not detect the error and will display 0 as the uncompressed size. + Note that regular decompression isn't affected by this bug because + it uses lzma_index_hash_append() instead. + + bad-2-compressed_data_padding.xz has non-null byte in the padding of + the Compressed Data field of the first Block. + + bad-1-check-crc32.xz has wrong Check (CRC32). + + bad-1-check-crc32-2.xz has Compressed Size and Uncompressed Size in + Block Header but wrong Check (CRC32) in the actual data. This file + differs by one byte from good-1-block_header-1.xz: the last byte of + the Check field is wrong. This file is useful for testing error + detection in the threaded decoder when a worker thread is configured + to pass input one byte at a time to the Block decoder. + + bad-1-check-crc64.xz has wrong Check (CRC64). + + bad-1-check-sha256.xz has wrong Check (SHA-256). + + bad-1-lzma2-1.xz has LZMA2 stream whose first chunk (uncompressed) + doesn't reset the dictionary. + + bad-1-lzma2-2.xz has two LZMA2 chunks, of which the second chunk + indicates dictionary reset, but the LZMA compressed data tries to + repeat data from the previous chunk. + + bad-1-lzma2-3.xz sets new invalid properties (lc=8, lp=0, pb=0) in + the middle of Block. + + bad-1-lzma2-4.xz has two LZMA2 chunks, of which the first is + uncompressed and the second is LZMA. The first chunk resets dictionary + as it should, but the second chunk tries to reset state without + specifying properties for LZMA. + + bad-1-lzma2-5.xz is like bad-1-lzma2-4.xz but doesn't try to reset + anything in the header of the second chunk. + + bad-1-lzma2-6.xz has reserved LZMA2 control byte value (0x03). + + bad-1-lzma2-7.xz has EOPM at LZMA level. + + bad-1-lzma2-8.xz is like good-1-lzma2-4.xz but doesn't set new + properties in the third LZMA2 chunk. + + bad-1-lzma2-9.xz has LZMA2 stream that is truncated at the end of + a LZMA2 chunk (no end marker). The uncompressed size of the partial + LZMA2 stream exceeds the value stored in the Block Header. + + bad-1-lzma2-10.xz has LZMA2 stream that, from point of view of a + LZMA2 decoder, extends past the end of Block (and even the end of + the file). Uncompressed Size in Block Header is bigger than the + invalid LZMA2 stream may produce (even if a decoder reads until + the end of the file). The Check type is None to nullify certain + simple size-based sanity checks in a Block decoder. + + bad-1-lzma2-11.xz has LZMA2 stream that lacks the end of + payload marker. When Compressed Size bytes have been decoded, + Uncompressed Size bytes of output will have been produced but + the LZMA2 decoder doesn't indicate end of stream. + + +3. Descriptions of Individual .lzma Files + +3.1. Good Files + + good-unknown_size-with_eopm.lzma has unknown size in the header + and end of payload marker at the end. + + good-known_size-without_eopm.lzma has a known size in the header + and no end of payload marker at the end. + + good-known_size-with_eopm.lzma has a known size in the header + and end of payload marker at the end. XZ Utils 5.2.5 and older + will give an error at the end of the file after producing the + correct uncompressed output. + + +3.2. Bad Files + + bad-unknown_size-without_eopm.lzma has unknown size in the header + but no end of payload marker at the end. This file might be seen + by a decoder as if it were truncated. + + bad-too_big_size-with_eopm.lzma has too big uncompressed size in + the header and the end of payload marker will be detected before + the specified number of bytes have been decoded. + + bad-too_small_size-without_eopm-1.lzma has too small uncompressed + size in the header. The decoder will look for end of payload marker + but instead find a literal that would produce more output. + + bad-too_small_size-without_eopm-2.lzma is like -1 above but instead + of a literal the problem occurs with a short repeated match. + + bad-too_small_size-without_eopm-3.lzma is like -1 above but instead + of a literal the problem occurs in the middle of a match. + + +4. Descriptions of Individual .lz (lzip) Files + +4.1. Good Files + + good-1-v0.lz contains a single version 0 member. lzip 1.17 and + *older* can decompress this; support for version 0 was removed + in lzip 1.18. + + good-1-v0-trailing-1.lz is like good-1-v0.lz but contains + trailing data that the decompressor must ignore. + + good-1-v1.lz contains a single version 1 member. lzip 1.3 and + newer can decompress this. + + good-1-v1-trailing-1.lz is like good-1-v1.lz but contains + trailing data that the decompressor must ignore. + + good-1-v1-trailing-2.lz is like good-1-v1.lz but contains + trailing data whose first three bytes match the .lz magic bytes. + With lzip >= 1.20 this file results in an error unless one uses + the command line option --loose-trailing. lzip 1.3 to 1.19 decode + this file successfully by default. XZ Utils uses the old behavior + because it allows lzma_code() to stop at the first byte of the + trailing data as long as the first byte isn't 0x4C (L in US-ASCII); + otherwise the first 1-3 bytes that equal to the magic bytes are + consumed and lost in lzma_code(), and this is visible in xz too: + + $ ( xz -dc ; cat ) < good-1-v1-trailing-2.lz + Hello + World! + Trailing garbage + + $ ( xz -dc --single-stream ; cat ) < good-1-v1-trailing-2.lz + Hello + World! + LZITrailing garbage + + good-2-v0-v1.lz contains two members of which the first is + version 0 and the second version 1. lzip versions 1.3 to 1.17 + (inclusive) can decompress this. + + good-2-v1-v0.lz contains two members of which the first is + version 1 and the second version 0. lzip versions 1.3 to 1.17 + (inclusive) can decompress this. + + good-2-v1-v1.lz contains two version 1 members. lzip versions 1.3 + and newer can decompress this. + + +4.2. Unsupported Files + + unsupported-1-v234.lz is like good-1-v1.lz except the version + field has been set to 234 (0xEA) which, as of writing, isn't + defined or supported by any .lz implementation. + + +4.3. Bad Files + + bad-1-v1-magic-1.lz is like good-1-v1.lz but the first magic byte + is wrong. + + bad-1-v1-magic-2.lz is like good-1-v1.lz but the last (fourth) + magic byte is wrong. + + bad-1-v1-dict-1.lz has too low value in the dictionary size field. + + bad-1-v1-dict-2.lz has too high value in the dictionary size field. + + bad-1-v1-crc32.lz has wrong CRC32 value. + + bad-1-v0-uncomp-size.lz is version 0 format with incorrect value + in the uncompressed size field. + + bad-1-v1-uncomp-size.lz is version 1 format with incorrect value + in the uncompressed size field. + + bad-1-v1-member-size.lz has incorrect value in the member size + field. + + bad-1-v1-trailing-magic.lz has the four .lz magic bytes as trailing + data. This should be detected as a truncated file and thus result + in an error. That is, the last four bytes of the file should not be + ignored as trailing garbage. lzip >= 1.18 matches this behavior + while older versions ignore the last four bytes and don't indicate + an error. + diff --git a/tests/files/bad-0-backward_size.xz b/tests/files/bad-0-backward_size.xz new file mode 100644 index 0000000..2b46fa9 Binary files /dev/null and b/tests/files/bad-0-backward_size.xz differ diff --git a/tests/files/bad-0-empty-truncated.xz b/tests/files/bad-0-empty-truncated.xz new file mode 100644 index 0000000..f879af8 Binary files /dev/null and b/tests/files/bad-0-empty-truncated.xz differ diff --git a/tests/files/bad-0-footer_magic.xz b/tests/files/bad-0-footer_magic.xz new file mode 100644 index 0000000..5d9e389 Binary files /dev/null and b/tests/files/bad-0-footer_magic.xz differ diff --git a/tests/files/bad-0-header_magic.xz b/tests/files/bad-0-header_magic.xz new file mode 100644 index 0000000..5984a45 Binary files /dev/null and b/tests/files/bad-0-header_magic.xz differ diff --git a/tests/files/bad-0-nonempty_index.xz b/tests/files/bad-0-nonempty_index.xz new file mode 100644 index 0000000..ed6e81f Binary files /dev/null and b/tests/files/bad-0-nonempty_index.xz differ diff --git a/tests/files/bad-0cat-alone.xz b/tests/files/bad-0cat-alone.xz new file mode 100644 index 0000000..a915a3a Binary files /dev/null and b/tests/files/bad-0cat-alone.xz differ diff --git a/tests/files/bad-0cat-header_magic.xz b/tests/files/bad-0cat-header_magic.xz new file mode 100644 index 0000000..426bf2d Binary files /dev/null and b/tests/files/bad-0cat-header_magic.xz differ diff --git a/tests/files/bad-0catpad-empty.xz b/tests/files/bad-0catpad-empty.xz new file mode 100644 index 0000000..97c1330 Binary files /dev/null and b/tests/files/bad-0catpad-empty.xz differ diff --git a/tests/files/bad-0pad-empty.xz b/tests/files/bad-0pad-empty.xz new file mode 100644 index 0000000..45e00b7 Binary files /dev/null and b/tests/files/bad-0pad-empty.xz differ diff --git a/tests/files/bad-1-block_header-1.xz b/tests/files/bad-1-block_header-1.xz new file mode 100644 index 0000000..d991536 Binary files /dev/null and b/tests/files/bad-1-block_header-1.xz differ diff --git a/tests/files/bad-1-block_header-2.xz b/tests/files/bad-1-block_header-2.xz new file mode 100644 index 0000000..ae42ecf Binary files /dev/null and b/tests/files/bad-1-block_header-2.xz differ diff --git a/tests/files/bad-1-block_header-3.xz b/tests/files/bad-1-block_header-3.xz new file mode 100644 index 0000000..606cbd2 Binary files /dev/null and b/tests/files/bad-1-block_header-3.xz differ diff --git a/tests/files/bad-1-block_header-4.xz b/tests/files/bad-1-block_header-4.xz new file mode 100644 index 0000000..e72dfbf Binary files /dev/null and b/tests/files/bad-1-block_header-4.xz differ diff --git a/tests/files/bad-1-block_header-5.xz b/tests/files/bad-1-block_header-5.xz new file mode 100644 index 0000000..9652112 Binary files /dev/null and b/tests/files/bad-1-block_header-5.xz differ diff --git a/tests/files/bad-1-block_header-6.xz b/tests/files/bad-1-block_header-6.xz new file mode 100644 index 0000000..ecf0ff0 Binary files /dev/null and b/tests/files/bad-1-block_header-6.xz differ diff --git a/tests/files/bad-1-check-crc32-2.xz b/tests/files/bad-1-check-crc32-2.xz new file mode 100644 index 0000000..95731ae Binary files /dev/null and b/tests/files/bad-1-check-crc32-2.xz differ diff --git a/tests/files/bad-1-check-crc32.xz b/tests/files/bad-1-check-crc32.xz new file mode 100644 index 0000000..1ebe131 Binary files /dev/null and b/tests/files/bad-1-check-crc32.xz differ diff --git a/tests/files/bad-1-check-crc64.xz b/tests/files/bad-1-check-crc64.xz new file mode 100644 index 0000000..cdb7709 Binary files /dev/null and b/tests/files/bad-1-check-crc64.xz differ diff --git a/tests/files/bad-1-check-sha256.xz b/tests/files/bad-1-check-sha256.xz new file mode 100644 index 0000000..def7bff Binary files /dev/null and b/tests/files/bad-1-check-sha256.xz differ diff --git a/tests/files/bad-1-lzma2-1.xz b/tests/files/bad-1-lzma2-1.xz new file mode 100644 index 0000000..640f592 Binary files /dev/null and b/tests/files/bad-1-lzma2-1.xz differ diff --git a/tests/files/bad-1-lzma2-10.xz b/tests/files/bad-1-lzma2-10.xz new file mode 100644 index 0000000..246515e Binary files /dev/null and b/tests/files/bad-1-lzma2-10.xz differ diff --git a/tests/files/bad-1-lzma2-11.xz b/tests/files/bad-1-lzma2-11.xz new file mode 100644 index 0000000..ce857b6 Binary files /dev/null and b/tests/files/bad-1-lzma2-11.xz differ diff --git a/tests/files/bad-1-lzma2-2.xz b/tests/files/bad-1-lzma2-2.xz new file mode 100644 index 0000000..69ab07d Binary files /dev/null and b/tests/files/bad-1-lzma2-2.xz differ diff --git a/tests/files/bad-1-lzma2-3.xz b/tests/files/bad-1-lzma2-3.xz new file mode 100644 index 0000000..66f48c5 Binary files /dev/null and b/tests/files/bad-1-lzma2-3.xz differ diff --git a/tests/files/bad-1-lzma2-4.xz b/tests/files/bad-1-lzma2-4.xz new file mode 100644 index 0000000..ac97041 Binary files /dev/null and b/tests/files/bad-1-lzma2-4.xz differ diff --git a/tests/files/bad-1-lzma2-5.xz b/tests/files/bad-1-lzma2-5.xz new file mode 100644 index 0000000..700464d Binary files /dev/null and b/tests/files/bad-1-lzma2-5.xz differ diff --git a/tests/files/bad-1-lzma2-6.xz b/tests/files/bad-1-lzma2-6.xz new file mode 100644 index 0000000..2bda0c4 Binary files /dev/null and b/tests/files/bad-1-lzma2-6.xz differ diff --git a/tests/files/bad-1-lzma2-7.xz b/tests/files/bad-1-lzma2-7.xz new file mode 100644 index 0000000..8cc711c Binary files /dev/null and b/tests/files/bad-1-lzma2-7.xz differ diff --git a/tests/files/bad-1-lzma2-8.xz b/tests/files/bad-1-lzma2-8.xz new file mode 100644 index 0000000..f21a71b Binary files /dev/null and b/tests/files/bad-1-lzma2-8.xz differ diff --git a/tests/files/bad-1-lzma2-9.xz b/tests/files/bad-1-lzma2-9.xz new file mode 100644 index 0000000..0553905 Binary files /dev/null and b/tests/files/bad-1-lzma2-9.xz differ diff --git a/tests/files/bad-1-stream_flags-1.xz b/tests/files/bad-1-stream_flags-1.xz new file mode 100644 index 0000000..6511773 Binary files /dev/null and b/tests/files/bad-1-stream_flags-1.xz differ diff --git a/tests/files/bad-1-stream_flags-2.xz b/tests/files/bad-1-stream_flags-2.xz new file mode 100644 index 0000000..0c66b36 Binary files /dev/null and b/tests/files/bad-1-stream_flags-2.xz differ diff --git a/tests/files/bad-1-stream_flags-3.xz b/tests/files/bad-1-stream_flags-3.xz new file mode 100644 index 0000000..a9b1f98 Binary files /dev/null and b/tests/files/bad-1-stream_flags-3.xz differ diff --git a/tests/files/bad-1-v0-uncomp-size.lz b/tests/files/bad-1-v0-uncomp-size.lz new file mode 100644 index 0000000..6bf4c6c Binary files /dev/null and b/tests/files/bad-1-v0-uncomp-size.lz differ diff --git a/tests/files/bad-1-v1-crc32.lz b/tests/files/bad-1-v1-crc32.lz new file mode 100644 index 0000000..3387618 Binary files /dev/null and b/tests/files/bad-1-v1-crc32.lz differ diff --git a/tests/files/bad-1-v1-dict-1.lz b/tests/files/bad-1-v1-dict-1.lz new file mode 100644 index 0000000..20768d5 Binary files /dev/null and b/tests/files/bad-1-v1-dict-1.lz differ diff --git a/tests/files/bad-1-v1-dict-2.lz b/tests/files/bad-1-v1-dict-2.lz new file mode 100644 index 0000000..1f22e6d Binary files /dev/null and b/tests/files/bad-1-v1-dict-2.lz differ diff --git a/tests/files/bad-1-v1-magic-1.lz b/tests/files/bad-1-v1-magic-1.lz new file mode 100644 index 0000000..b5e374d Binary files /dev/null and b/tests/files/bad-1-v1-magic-1.lz differ diff --git a/tests/files/bad-1-v1-magic-2.lz b/tests/files/bad-1-v1-magic-2.lz new file mode 100644 index 0000000..f5d5b97 Binary files /dev/null and b/tests/files/bad-1-v1-magic-2.lz differ diff --git a/tests/files/bad-1-v1-member-size.lz b/tests/files/bad-1-v1-member-size.lz new file mode 100644 index 0000000..fd8636a Binary files /dev/null and b/tests/files/bad-1-v1-member-size.lz differ diff --git a/tests/files/bad-1-v1-trailing-magic.lz b/tests/files/bad-1-v1-trailing-magic.lz new file mode 100644 index 0000000..f7926c5 Binary files /dev/null and b/tests/files/bad-1-v1-trailing-magic.lz differ diff --git a/tests/files/bad-1-v1-uncomp-size.lz b/tests/files/bad-1-v1-uncomp-size.lz new file mode 100644 index 0000000..c89a283 Binary files /dev/null and b/tests/files/bad-1-v1-uncomp-size.lz differ diff --git a/tests/files/bad-1-vli-1.xz b/tests/files/bad-1-vli-1.xz new file mode 100644 index 0000000..6514ab1 Binary files /dev/null and b/tests/files/bad-1-vli-1.xz differ diff --git a/tests/files/bad-1-vli-2.xz b/tests/files/bad-1-vli-2.xz new file mode 100644 index 0000000..c16941b Binary files /dev/null and b/tests/files/bad-1-vli-2.xz differ diff --git a/tests/files/bad-2-compressed_data_padding.xz b/tests/files/bad-2-compressed_data_padding.xz new file mode 100644 index 0000000..382d047 Binary files /dev/null and b/tests/files/bad-2-compressed_data_padding.xz differ diff --git a/tests/files/bad-2-index-1.xz b/tests/files/bad-2-index-1.xz new file mode 100644 index 0000000..f51ed21 Binary files /dev/null and b/tests/files/bad-2-index-1.xz differ diff --git a/tests/files/bad-2-index-2.xz b/tests/files/bad-2-index-2.xz new file mode 100644 index 0000000..d7d00ff Binary files /dev/null and b/tests/files/bad-2-index-2.xz differ diff --git a/tests/files/bad-2-index-3.xz b/tests/files/bad-2-index-3.xz new file mode 100644 index 0000000..62428b8 Binary files /dev/null and b/tests/files/bad-2-index-3.xz differ diff --git a/tests/files/bad-2-index-4.xz b/tests/files/bad-2-index-4.xz new file mode 100644 index 0000000..9cf2df6 Binary files /dev/null and b/tests/files/bad-2-index-4.xz differ diff --git a/tests/files/bad-2-index-5.xz b/tests/files/bad-2-index-5.xz new file mode 100644 index 0000000..0a79270 Binary files /dev/null and b/tests/files/bad-2-index-5.xz differ diff --git a/tests/files/bad-3-index-uncomp-overflow.xz b/tests/files/bad-3-index-uncomp-overflow.xz new file mode 100644 index 0000000..e1440ec Binary files /dev/null and b/tests/files/bad-3-index-uncomp-overflow.xz differ diff --git a/tests/files/bad-too_big_size-with_eopm.lzma b/tests/files/bad-too_big_size-with_eopm.lzma new file mode 100644 index 0000000..b7cd3b0 Binary files /dev/null and b/tests/files/bad-too_big_size-with_eopm.lzma differ diff --git a/tests/files/bad-too_small_size-without_eopm-1.lzma b/tests/files/bad-too_small_size-without_eopm-1.lzma new file mode 100644 index 0000000..cc2805c Binary files /dev/null and b/tests/files/bad-too_small_size-without_eopm-1.lzma differ diff --git a/tests/files/bad-too_small_size-without_eopm-2.lzma b/tests/files/bad-too_small_size-without_eopm-2.lzma new file mode 100644 index 0000000..e37cab1 Binary files /dev/null and b/tests/files/bad-too_small_size-without_eopm-2.lzma differ diff --git a/tests/files/bad-too_small_size-without_eopm-3.lzma b/tests/files/bad-too_small_size-without_eopm-3.lzma new file mode 100644 index 0000000..67a1af3 Binary files /dev/null and b/tests/files/bad-too_small_size-without_eopm-3.lzma differ diff --git a/tests/files/bad-unknown_size-without_eopm.lzma b/tests/files/bad-unknown_size-without_eopm.lzma new file mode 100644 index 0000000..b3d7a52 Binary files /dev/null and b/tests/files/bad-unknown_size-without_eopm.lzma differ diff --git a/tests/files/good-0-empty.xz b/tests/files/good-0-empty.xz new file mode 100644 index 0000000..83b95e0 Binary files /dev/null and b/tests/files/good-0-empty.xz differ diff --git a/tests/files/good-0cat-empty.xz b/tests/files/good-0cat-empty.xz new file mode 100644 index 0000000..e6fc314 Binary files /dev/null and b/tests/files/good-0cat-empty.xz differ diff --git a/tests/files/good-0catpad-empty.xz b/tests/files/good-0catpad-empty.xz new file mode 100644 index 0000000..4f86b7d Binary files /dev/null and b/tests/files/good-0catpad-empty.xz differ diff --git a/tests/files/good-0pad-empty.xz b/tests/files/good-0pad-empty.xz new file mode 100644 index 0000000..c51e3a6 Binary files /dev/null and b/tests/files/good-0pad-empty.xz differ diff --git a/tests/files/good-1-3delta-lzma2.xz b/tests/files/good-1-3delta-lzma2.xz new file mode 100644 index 0000000..a0be1d0 Binary files /dev/null and b/tests/files/good-1-3delta-lzma2.xz differ diff --git a/tests/files/good-1-arm64-lzma2-1.xz b/tests/files/good-1-arm64-lzma2-1.xz new file mode 100644 index 0000000..78169f1 Binary files /dev/null and b/tests/files/good-1-arm64-lzma2-1.xz differ diff --git a/tests/files/good-1-arm64-lzma2-2.xz b/tests/files/good-1-arm64-lzma2-2.xz new file mode 100644 index 0000000..e0302fe Binary files /dev/null and b/tests/files/good-1-arm64-lzma2-2.xz differ diff --git a/tests/files/good-1-block_header-1.xz b/tests/files/good-1-block_header-1.xz new file mode 100644 index 0000000..fea5ad2 Binary files /dev/null and b/tests/files/good-1-block_header-1.xz differ diff --git a/tests/files/good-1-block_header-2.xz b/tests/files/good-1-block_header-2.xz new file mode 100644 index 0000000..6b5dcb3 Binary files /dev/null and b/tests/files/good-1-block_header-2.xz differ diff --git a/tests/files/good-1-block_header-3.xz b/tests/files/good-1-block_header-3.xz new file mode 100644 index 0000000..1565312 Binary files /dev/null and b/tests/files/good-1-block_header-3.xz differ diff --git a/tests/files/good-1-check-crc32.xz b/tests/files/good-1-check-crc32.xz new file mode 100644 index 0000000..6c89593 Binary files /dev/null and b/tests/files/good-1-check-crc32.xz differ diff --git a/tests/files/good-1-check-crc64.xz b/tests/files/good-1-check-crc64.xz new file mode 100644 index 0000000..5a9915d Binary files /dev/null and b/tests/files/good-1-check-crc64.xz differ diff --git a/tests/files/good-1-check-none.xz b/tests/files/good-1-check-none.xz new file mode 100644 index 0000000..1e85faf Binary files /dev/null and b/tests/files/good-1-check-none.xz differ diff --git a/tests/files/good-1-check-sha256.xz b/tests/files/good-1-check-sha256.xz new file mode 100644 index 0000000..fdc556b Binary files /dev/null and b/tests/files/good-1-check-sha256.xz differ diff --git a/tests/files/good-1-delta-lzma2.tiff.xz b/tests/files/good-1-delta-lzma2.tiff.xz new file mode 100644 index 0000000..1f033bc Binary files /dev/null and b/tests/files/good-1-delta-lzma2.tiff.xz differ diff --git a/tests/files/good-1-empty-bcj-lzma2.xz b/tests/files/good-1-empty-bcj-lzma2.xz new file mode 100644 index 0000000..94016d8 Binary files /dev/null and b/tests/files/good-1-empty-bcj-lzma2.xz differ diff --git a/tests/files/good-1-lzma2-1.xz b/tests/files/good-1-lzma2-1.xz new file mode 100644 index 0000000..d8d6489 Binary files /dev/null and b/tests/files/good-1-lzma2-1.xz differ diff --git a/tests/files/good-1-lzma2-2.xz b/tests/files/good-1-lzma2-2.xz new file mode 100644 index 0000000..7e8cdf1 Binary files /dev/null and b/tests/files/good-1-lzma2-2.xz differ diff --git a/tests/files/good-1-lzma2-3.xz b/tests/files/good-1-lzma2-3.xz new file mode 100644 index 0000000..c4c72be Binary files /dev/null and b/tests/files/good-1-lzma2-3.xz differ diff --git a/tests/files/good-1-lzma2-4.xz b/tests/files/good-1-lzma2-4.xz new file mode 100644 index 0000000..e0d623a Binary files /dev/null and b/tests/files/good-1-lzma2-4.xz differ diff --git a/tests/files/good-1-lzma2-5.xz b/tests/files/good-1-lzma2-5.xz new file mode 100644 index 0000000..339d1c3 Binary files /dev/null and b/tests/files/good-1-lzma2-5.xz differ diff --git a/tests/files/good-1-sparc-lzma2.xz b/tests/files/good-1-sparc-lzma2.xz new file mode 100644 index 0000000..4532bc6 Binary files /dev/null and b/tests/files/good-1-sparc-lzma2.xz differ diff --git a/tests/files/good-1-v0-trailing-1.lz b/tests/files/good-1-v0-trailing-1.lz new file mode 100644 index 0000000..91f2b64 Binary files /dev/null and b/tests/files/good-1-v0-trailing-1.lz differ diff --git a/tests/files/good-1-v0.lz b/tests/files/good-1-v0.lz new file mode 100644 index 0000000..99e3f27 Binary files /dev/null and b/tests/files/good-1-v0.lz differ diff --git a/tests/files/good-1-v1-trailing-1.lz b/tests/files/good-1-v1-trailing-1.lz new file mode 100644 index 0000000..198e65c Binary files /dev/null and b/tests/files/good-1-v1-trailing-1.lz differ diff --git a/tests/files/good-1-v1-trailing-2.lz b/tests/files/good-1-v1-trailing-2.lz new file mode 100644 index 0000000..9a028fa Binary files /dev/null and b/tests/files/good-1-v1-trailing-2.lz differ diff --git a/tests/files/good-1-v1.lz b/tests/files/good-1-v1.lz new file mode 100644 index 0000000..4c9565c Binary files /dev/null and b/tests/files/good-1-v1.lz differ diff --git a/tests/files/good-1-x86-lzma2.xz b/tests/files/good-1-x86-lzma2.xz new file mode 100644 index 0000000..8053917 Binary files /dev/null and b/tests/files/good-1-x86-lzma2.xz differ diff --git a/tests/files/good-2-lzma2.xz b/tests/files/good-2-lzma2.xz new file mode 100644 index 0000000..bed5085 Binary files /dev/null and b/tests/files/good-2-lzma2.xz differ diff --git a/tests/files/good-2-v0-v1.lz b/tests/files/good-2-v0-v1.lz new file mode 100644 index 0000000..dc3165a Binary files /dev/null and b/tests/files/good-2-v0-v1.lz differ diff --git a/tests/files/good-2-v1-v0.lz b/tests/files/good-2-v1-v0.lz new file mode 100644 index 0000000..a999582 Binary files /dev/null and b/tests/files/good-2-v1-v0.lz differ diff --git a/tests/files/good-2-v1-v1.lz b/tests/files/good-2-v1-v1.lz new file mode 100644 index 0000000..5381891 Binary files /dev/null and b/tests/files/good-2-v1-v1.lz differ diff --git a/tests/files/good-known_size-with_eopm.lzma b/tests/files/good-known_size-with_eopm.lzma new file mode 100644 index 0000000..1b45307 Binary files /dev/null and b/tests/files/good-known_size-with_eopm.lzma differ diff --git a/tests/files/good-known_size-without_eopm.lzma b/tests/files/good-known_size-without_eopm.lzma new file mode 100644 index 0000000..83623fd Binary files /dev/null and b/tests/files/good-known_size-without_eopm.lzma differ diff --git a/tests/files/good-unknown_size-with_eopm.lzma b/tests/files/good-unknown_size-with_eopm.lzma new file mode 100644 index 0000000..0f4ff82 Binary files /dev/null and b/tests/files/good-unknown_size-with_eopm.lzma differ diff --git a/tests/files/unsupported-1-v234.lz b/tests/files/unsupported-1-v234.lz new file mode 100644 index 0000000..e571b0f Binary files /dev/null and b/tests/files/unsupported-1-v234.lz differ diff --git a/tests/files/unsupported-block_header.xz b/tests/files/unsupported-block_header.xz new file mode 100644 index 0000000..3830442 Binary files /dev/null and b/tests/files/unsupported-block_header.xz differ diff --git a/tests/files/unsupported-check.xz b/tests/files/unsupported-check.xz new file mode 100644 index 0000000..c28355e Binary files /dev/null and b/tests/files/unsupported-check.xz differ diff --git a/tests/files/unsupported-filter_flags-1.xz b/tests/files/unsupported-filter_flags-1.xz new file mode 100644 index 0000000..48b9373 Binary files /dev/null and b/tests/files/unsupported-filter_flags-1.xz differ diff --git a/tests/files/unsupported-filter_flags-2.xz b/tests/files/unsupported-filter_flags-2.xz new file mode 100644 index 0000000..c283359 Binary files /dev/null and b/tests/files/unsupported-filter_flags-2.xz differ diff --git a/tests/files/unsupported-filter_flags-3.xz b/tests/files/unsupported-filter_flags-3.xz new file mode 100644 index 0000000..2608498 Binary files /dev/null and b/tests/files/unsupported-filter_flags-3.xz differ diff --git a/tests/ossfuzz/config/fuzz.dict b/tests/ossfuzz/config/fuzz.dict new file mode 100644 index 0000000..932d67c --- /dev/null +++ b/tests/ossfuzz/config/fuzz.dict @@ -0,0 +1,2 @@ +"\xFD7zXZ\x00" +"YZ" diff --git a/tests/ossfuzz/config/fuzz.options b/tests/ossfuzz/config/fuzz.options new file mode 100644 index 0000000..d59dfc1 --- /dev/null +++ b/tests/ossfuzz/config/fuzz.options @@ -0,0 +1,2 @@ +[libfuzzer] +dict = fuzz.dict diff --git a/tests/ossfuzz/fuzz.c b/tests/ossfuzz/fuzz.c new file mode 100644 index 0000000..6d89930 --- /dev/null +++ b/tests/ossfuzz/fuzz.c @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file fuzz.c +/// \brief Fuzz test program for liblzma +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "lzma.h" + + +// Output buffer for decompressed data. This is write only; nothing cares +// about the actual data written here. +static uint8_t outbuf[4096]; + + +extern int +LLVMFuzzerTestOneInput(const uint8_t *inbuf, size_t inbuf_size) +{ + // Some header values can make liblzma allocate a lot of RAM + // (up to about 4 GiB with liblzma 5.2.x). We set a limit here to + // prevent extreme allocations when fuzzing. + const uint64_t memlimit = 300 << 20; // 300 MiB + + // Initialize a .xz decoder using the above memory usage limit. + // Enable support for concatenated .xz files which is used when + // decompressing regular .xz files (instead of data embedded inside + // some other file format). Integrity checks on the uncompressed + // data are ignored to make fuzzing more effective (incorrect check + // values won't prevent the decoder from processing more input). + // + // The flag LZMA_IGNORE_CHECK doesn't disable verification of header + // CRC32 values. Those checks are disabled when liblzma is built + // with the #define FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION. + lzma_stream strm = LZMA_STREAM_INIT; + lzma_ret ret = lzma_stream_decoder(&strm, memlimit, + LZMA_CONCATENATED | LZMA_IGNORE_CHECK); + if (ret != LZMA_OK) { + // This should never happen unless the system has + // no free memory or address space to allow the small + // allocations that the initialization requires. + fprintf(stderr, "lzma_stream_decoder() failed (%d)\n", ret); + abort(); + } + + // Give the whole input buffer at once to liblzma. + // Output buffer isn't initialized as liblzma only writes to it. + strm.next_in = inbuf; + strm.avail_in = inbuf_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + while ((ret = lzma_code(&strm, LZMA_FINISH)) == LZMA_OK) { + if (strm.avail_out == 0) { + // outbuf became full. We don't care about the + // uncompressed data there, so we simply reuse + // the outbuf and overwrite the old data. + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + } + } + + // LZMA_PROG_ERROR should never happen as long as the code calling + // the liblzma functions is correct. Thus LZMA_PROG_ERROR is a sign + // of a bug in either this function or in liblzma. + if (ret == LZMA_PROG_ERROR) { + fprintf(stderr, "lzma_code() returned LZMA_PROG_ERROR\n"); + abort(); + } + + // Free the allocated memory. + lzma_end(&strm); + + return 0; +} diff --git a/tests/test_bcj_exact_size.c b/tests/test_bcj_exact_size.c new file mode 100644 index 0000000..551166c --- /dev/null +++ b/tests/test_bcj_exact_size.c @@ -0,0 +1,124 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_bcj_exact_size.c +/// \brief Tests BCJ decoding when the output size is known +/// +/// These tests fail with XZ Utils 5.0.3 and earlier. +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + + +static void +test_exact_size(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + if (!lzma_filter_encoder_is_supported(LZMA_FILTER_POWERPC) + || !lzma_filter_decoder_is_supported( + LZMA_FILTER_POWERPC)) + assert_skip("PowerPC BCJ encoder and/or decoder " + "is disabled"); + + // Something to be compressed + const uint8_t in[16] = "0123456789ABCDEF"; + + // in[] after compression + uint8_t compressed[1024]; + size_t compressed_size = 0; + + // Output buffer for decompressing compressed[] + uint8_t out[sizeof(in)]; + + // Compress with PowerPC BCJ and LZMA2. PowerPC BCJ is used because + // it has fixed 4-byte alignment which makes triggering the potential + // bug easy. + lzma_options_lzma opt_lzma2; + assert_false(lzma_lzma_preset(&opt_lzma2, 0)); + + lzma_filter filters[3] = { + { .id = LZMA_FILTER_POWERPC, .options = NULL }, + { .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 }, + { .id = LZMA_VLI_UNKNOWN, .options = NULL }, + }; + + assert_lzma_ret(lzma_stream_buffer_encode( + filters, LZMA_CHECK_CRC32, NULL, + in, sizeof(in), + compressed, &compressed_size, sizeof(compressed)), + LZMA_OK); + + // Decompress so that we won't give more output space than + // the Stream will need. + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_stream_decoder(&strm, 10 << 20, 0), LZMA_OK); + + strm.next_in = compressed; + strm.next_out = out; + + while (true) { + if (strm.total_in < compressed_size) + strm.avail_in = 1; + + const lzma_ret ret = lzma_code(&strm, LZMA_RUN); + if (ret == LZMA_STREAM_END) { + assert_uint_eq(strm.total_in, compressed_size); + assert_uint_eq(strm.total_out, sizeof(in)); + lzma_end(&strm); + return; + } + + assert_lzma_ret(ret, LZMA_OK); + + if (strm.total_out < sizeof(in)) + strm.avail_out = 1; + } +#endif +} + + +static void +test_empty_block(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + if (!lzma_filter_decoder_is_supported(LZMA_FILTER_POWERPC)) + assert_skip("PowerPC BCJ decoder is disabled"); + + // An empty file with one Block using PowerPC BCJ and LZMA2. + size_t in_size; + uint8_t *empty_bcj_lzma2 = tuktest_file_from_srcdir( + "files/good-1-empty-bcj-lzma2.xz", &in_size); + + // Decompress without giving any output space. + uint64_t memlimit = 1 << 20; + uint8_t out[1]; + size_t in_pos = 0; + size_t out_pos = 0; + assert_lzma_ret(lzma_stream_buffer_decode(&memlimit, 0, NULL, + empty_bcj_lzma2, &in_pos, in_size, out, &out_pos, 0), + LZMA_OK); + assert_uint_eq(in_pos, in_size); + assert_uint_eq(out_pos, 0); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + + tuktest_run(test_exact_size); + tuktest_run(test_empty_block); + + return tuktest_end(); +} diff --git a/tests/test_block_header.c b/tests/test_block_header.c new file mode 100644 index 0000000..747925b --- /dev/null +++ b/tests/test_block_header.c @@ -0,0 +1,514 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_block_header.c +/// \brief Tests Block Header coders +// +// Authors: Lasse Collin +// Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + + +static lzma_options_lzma opt_lzma; + + +#ifdef HAVE_ENCODERS +static lzma_filter filters_none[1] = { + { + .id = LZMA_VLI_UNKNOWN, + }, +}; + + +static lzma_filter filters_one[2] = { + { + .id = LZMA_FILTER_LZMA2, + .options = &opt_lzma, + }, { + .id = LZMA_VLI_UNKNOWN, + } +}; + + +// These filters are only used in test_lzma_block_header_decode() +// which only runs if encoders and decoders are configured. +#ifdef HAVE_DECODERS +static lzma_filter filters_four[5] = { + { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_LZMA2, + .options = &opt_lzma, + }, { + .id = LZMA_VLI_UNKNOWN, + } +}; +#endif + + +static lzma_filter filters_five[6] = { + { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_X86, + .options = NULL, + }, { + .id = LZMA_FILTER_LZMA2, + .options = &opt_lzma, + }, { + .id = LZMA_VLI_UNKNOWN, + } +}; +#endif + + +static void +test_lzma_block_header_size(void) +{ +#ifndef HAVE_ENCODERS + assert_skip("Encoder support disabled"); +#else + if (!lzma_filter_encoder_is_supported(LZMA_FILTER_X86)) + assert_skip("x86 BCJ encoder is disabled"); + + lzma_block block = { + .version = 0, + .filters = filters_one, + .compressed_size = LZMA_VLI_UNKNOWN, + .uncompressed_size = LZMA_VLI_UNKNOWN, + .check = LZMA_CHECK_CRC32 + }; + + // Test that all initial options are valid + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); + + // Test invalid version number + for (uint32_t i = 2; i < 20; i++) { + block.version = i; + assert_lzma_ret(lzma_block_header_size(&block), + LZMA_OPTIONS_ERROR); + } + + block.version = 1; + + // Test invalid compressed size + block.compressed_size = 0; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + + block.compressed_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + block.compressed_size = LZMA_VLI_UNKNOWN; + + // Test invalid uncompressed size + block.uncompressed_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + block.uncompressed_size = LZMA_VLI_MAX; + + // Test invalid filters + block.filters = NULL; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + + block.filters = filters_none; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + + block.filters = filters_five; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_PROG_ERROR); + + block.filters = filters_one; + + // Test setting compressed_size to something valid + block.compressed_size = 4096; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); + + // Test setting uncompressed_size to something valid + block.uncompressed_size = 4096; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); + + // This should pass, but header_size will be an invalid value + // because the total block size will not be able to fit in a valid + // lzma_vli. This way a temporary value can be used to reserve + // space for the header and later the actual value can be set. + block.compressed_size = LZMA_VLI_MAX; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); + + // Use an invalid value for a filter option. This should still pass + // because the size of the LZMA2 properties is known by liblzma + // without reading any of the options so it doesn't validate them. + lzma_options_lzma bad_ops; + assert_false(lzma_lzma_preset(&bad_ops, 1)); + bad_ops.pb = 0x1000; + + lzma_filter bad_filters[2] = { + { + .id = LZMA_FILTER_LZMA2, + .options = &bad_ops + }, + { + .id = LZMA_VLI_UNKNOWN, + .options = NULL + } + }; + + block.filters = bad_filters; + + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); + + // Use an invalid block option. The check type isn't stored in + // the Block Header and so _header_size ignores it. + block.check = 0x1000; + block.ignore_check = false; + + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_uint(block.header_size, >=, LZMA_BLOCK_HEADER_SIZE_MIN); + assert_uint(block.header_size, <=, LZMA_BLOCK_HEADER_SIZE_MAX); + assert_uint_eq(block.header_size % 4, 0); +#endif +} + + +static void +test_lzma_block_header_encode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + + if (!lzma_filter_encoder_is_supported(LZMA_FILTER_X86) + || !lzma_filter_decoder_is_supported(LZMA_FILTER_X86)) + assert_skip("x86 BCJ encoder and/or decoder " + "is disabled"); + + lzma_block block = { + .version = 1, + .filters = filters_one, + .compressed_size = LZMA_VLI_UNKNOWN, + .uncompressed_size = LZMA_VLI_UNKNOWN, + .check = LZMA_CHECK_CRC32, + }; + + // Ensure all block options are valid before changes are tested + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + + uint8_t out[LZMA_BLOCK_HEADER_SIZE_MAX]; + + // Test invalid block version + for (uint32_t i = 2; i < 20; i++) { + block.version = i; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + } + + block.version = 1; + + // Test invalid header size (< min, > max, % 4 != 0) + block.header_size = LZMA_BLOCK_HEADER_SIZE_MIN - 4; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.header_size = LZMA_BLOCK_HEADER_SIZE_MIN + 2; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.header_size = LZMA_BLOCK_HEADER_SIZE_MAX + 4; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + + // Test invalid compressed_size + block.compressed_size = 0; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.compressed_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + + // This test passes test_lzma_block_header_size, but should + // fail here because there is not enough space to encode the + // proper block size because the total size is too big to fit + // in an lzma_vli + block.compressed_size = LZMA_VLI_MAX; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.compressed_size = LZMA_VLI_UNKNOWN; + + // Test invalid uncompressed size + block.uncompressed_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.uncompressed_size = LZMA_VLI_UNKNOWN; + + // Test invalid block check + block.check = 0x1000; + block.ignore_check = false; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + block.check = LZMA_CHECK_CRC32; + + // Test invalid filters + block.filters = NULL; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + + block.filters = filters_none; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + + block.filters = filters_five; + block.header_size = LZMA_BLOCK_HEADER_SIZE_MAX - 4; + assert_lzma_ret(lzma_block_header_encode(&block, out), + LZMA_PROG_ERROR); + + // Test valid encoding and verify bytes of block header. + // More complicated tests for encoding headers are included + // in test_lzma_block_header_decode. + block.filters = filters_one; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_lzma_ret(lzma_block_header_encode(&block, out), LZMA_OK); + + // First read block header size from out and verify + // that it == (encoded size + 1) * 4 + uint32_t header_size = (out[0] + 1U) * 4; + assert_uint_eq(header_size, block.header_size); + + // Next read block flags + uint8_t flags = out[1]; + + // Should have number of filters = 1 + assert_uint_eq((flags & 0x3) + 1, 1); + + // Bits 2-7 must be empty not set + assert_uint_eq(flags & (0xFF - 0x3), 0); + + // Verify filter flags + // Decode Filter ID + lzma_vli filter_id = 0; + size_t pos = 2; + assert_lzma_ret(lzma_vli_decode(&filter_id, NULL, out, + &pos, header_size), LZMA_OK); + assert_uint_eq(filter_id, filters_one[0].id); + + // Decode Size of Properties + lzma_vli prop_size = 0; + assert_lzma_ret(lzma_vli_decode(&prop_size, NULL, out, + &pos, header_size), LZMA_OK); + + // LZMA2 has 1 byte prop size + assert_uint_eq(prop_size, 1); + uint8_t expected_filter_props = 0; + assert_lzma_ret(lzma_properties_encode(filters_one, + &expected_filter_props), LZMA_OK); + assert_uint_eq(out[pos], expected_filter_props); + pos++; + + // Check null-padding + for (size_t i = pos; i < header_size - 4; i++) + assert_uint_eq(out[i], 0); + + // Check CRC32 + assert_uint_eq(read32le(&out[header_size - 4]), lzma_crc32(out, + header_size - 4, 0)); +#endif +} + + +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +// Helper function to compare two lzma_block structures field by field +static void +compare_blocks(lzma_block *block_expected, lzma_block *block_actual) +{ + assert_uint_eq(block_actual->version, block_expected->version); + assert_uint_eq(block_actual->compressed_size, + block_expected->compressed_size); + assert_uint_eq(block_actual->uncompressed_size, + block_expected->uncompressed_size); + assert_uint_eq(block_actual->check, block_expected->check); + assert_uint_eq(block_actual->header_size, block_expected->header_size); + + // Compare filter IDs + assert_true(block_expected->filters && block_actual->filters); + lzma_filter expected_filter = block_expected->filters[0]; + uint32_t filter_count = 0; + while (expected_filter.id != LZMA_VLI_UNKNOWN) { + assert_uint_eq(block_actual->filters[filter_count].id, + expected_filter.id); + expected_filter = block_expected->filters[++filter_count]; + } + + assert_uint_eq(block_actual->filters[filter_count].id, + LZMA_VLI_UNKNOWN); +} +#endif + + +static void +test_lzma_block_header_decode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + if (!lzma_filter_encoder_is_supported(LZMA_FILTER_X86) + || !lzma_filter_decoder_is_supported(LZMA_FILTER_X86)) + assert_skip("x86 BCJ encoder and/or decoder " + "is disabled"); + + lzma_block block = { + .filters = filters_one, + .compressed_size = LZMA_VLI_UNKNOWN, + .uncompressed_size = LZMA_VLI_UNKNOWN, + .check = LZMA_CHECK_CRC32, + .version = 0 + }; + + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + + // Encode block header with simple options + uint8_t out[LZMA_BLOCK_HEADER_SIZE_MAX]; + assert_lzma_ret(lzma_block_header_encode(&block, out), LZMA_OK); + + // Decode block header and check that the options match + lzma_filter decoded_filters[LZMA_FILTERS_MAX + 1]; + lzma_block decoded_block = { + .version = 0, + .filters = decoded_filters, + .check = LZMA_CHECK_CRC32 + }; + decoded_block.header_size = lzma_block_header_size_decode(out[0]); + + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OK); + compare_blocks(&block, &decoded_block); + + // Reset output buffer and decoded_block + memzero(out, LZMA_BLOCK_HEADER_SIZE_MAX); + memzero(&decoded_block, sizeof(lzma_block)); + decoded_block.filters = decoded_filters; + decoded_block.check = LZMA_CHECK_CRC32; + + // Test with compressed size set + block.compressed_size = 4096; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_lzma_ret(lzma_block_header_encode(&block, out), LZMA_OK); + decoded_block.header_size = lzma_block_header_size_decode(out[0]); + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OK); + compare_blocks(&block, &decoded_block); + + memzero(out, LZMA_BLOCK_HEADER_SIZE_MAX); + memzero(&decoded_block, sizeof(lzma_block)); + decoded_block.filters = decoded_filters; + decoded_block.check = LZMA_CHECK_CRC32; + + // Test with uncompressed size set + block.uncompressed_size = 4096; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_lzma_ret(lzma_block_header_encode(&block, out), LZMA_OK); + decoded_block.header_size = lzma_block_header_size_decode(out[0]); + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OK); + compare_blocks(&block, &decoded_block); + + memzero(out, LZMA_BLOCK_HEADER_SIZE_MAX); + memzero(&decoded_block, sizeof(lzma_block)); + decoded_block.filters = decoded_filters; + decoded_block.check = LZMA_CHECK_CRC32; + + // Test with multiple filters + block.filters = filters_four; + assert_lzma_ret(lzma_block_header_size(&block), LZMA_OK); + assert_lzma_ret(lzma_block_header_encode(&block, out), LZMA_OK); + decoded_block.header_size = lzma_block_header_size_decode(out[0]); + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OK); + compare_blocks(&block, &decoded_block); + + memzero(&decoded_block, sizeof(lzma_block)); + decoded_block.filters = decoded_filters; + decoded_block.check = LZMA_CHECK_CRC32; + decoded_block.header_size = lzma_block_header_size_decode(out[0]); + + // Test with too high version. The decoder will set it to a version + // that it supports. + decoded_block.version = 2; + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OK); + assert_uint_eq(decoded_block.version, 1); + + // Test bad check type + decoded_block.check = LZMA_CHECK_ID_MAX + 1; + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_PROG_ERROR); + decoded_block.check = LZMA_CHECK_CRC32; + + // Test bad check value + out[decoded_block.header_size - 1] -= 10; + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_DATA_ERROR); + out[decoded_block.header_size - 1] += 10; + + // Test non-NULL padding + out[decoded_block.header_size - 5] = 1; + + // Recompute CRC32 + write32le(&out[decoded_block.header_size - 4], lzma_crc32(out, + decoded_block.header_size - 4, 0)); + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OPTIONS_ERROR); + + // Test unsupported flags + out[1] = 0xFF; + + // Recompute CRC32 + write32le(&out[decoded_block.header_size - 4], lzma_crc32(out, + decoded_block.header_size - 4, 0)); + assert_lzma_ret(lzma_block_header_decode(&decoded_block, NULL, out), + LZMA_OPTIONS_ERROR); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + + if (lzma_lzma_preset(&opt_lzma, 1)) + tuktest_error("lzma_lzma_preset() failed"); + + tuktest_run(test_lzma_block_header_size); + tuktest_run(test_lzma_block_header_encode); + tuktest_run(test_lzma_block_header_decode); + + return tuktest_end(); +} diff --git a/tests/test_check.c b/tests/test_check.c new file mode 100644 index 0000000..bc52f40 --- /dev/null +++ b/tests/test_check.c @@ -0,0 +1,390 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_check.c +/// \brief Tests integrity checks +// +// Authors: Lasse Collin +// Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" +#include "mythread.h" + + +// These must be specified as numbers so that the test works on EBCDIC +// systems too. +// static const uint8_t test_string[9] = "123456789"; +// static const uint8_t test_unaligned[12] = "xxx123456789"; +static const uint8_t test_string[9] = { 49, 50, 51, 52, 53, 54, 55, 56, 57 }; +static const uint8_t test_unaligned[12] + = { 120, 120, 120, 49, 50, 51, 52, 53, 54, 55, 56, 57 }; + +// 2 MB is more than enough for the tests. Actually a tiny value would +// work because we don't actually decompress the files, we only test +// decoding of the Stream Header fields. +#define TEST_CHECK_MEMLIMIT (2U << 20) + +static size_t no_check_size; +static uint8_t *no_check_xz_data; + +static size_t unsupported_check_size; +static uint8_t *unsupported_check_xz_data; + +#ifdef HAVE_CHECK_CRC32 +static size_t crc32_size; +static uint8_t *crc32_xz_data; +#endif + +#ifdef HAVE_CHECK_CRC64 +static size_t crc64_size; +static uint8_t *crc64_xz_data; +#endif + +#ifdef HAVE_CHECK_SHA256 +static size_t sha256_size; +static uint8_t *sha256_xz_data; +#endif + + +#ifdef HAVE_CHECK_CRC64 +static const uint8_t * +get_random256(uint32_t *seed) +{ + static uint8_t buf[256]; + + for (size_t i = 0; i < sizeof(buf); ++i) { + *seed = *seed * 1103515245 + 12345; + buf[i] = (uint8_t)(*seed >> 22); + } + + return buf; +} +#endif + + +static void +test_lzma_crc32(void) +{ + // CRC32 is always enabled. + assert_true(lzma_check_is_supported(LZMA_CHECK_CRC32)); + + const uint32_t test_vector = 0xCBF43926; + + // Test 1 + assert_uint_eq(lzma_crc32(test_string, sizeof(test_string), 0), + test_vector); + + // Test 2 + assert_uint_eq(lzma_crc32(test_unaligned + 3, sizeof(test_string), 0), + test_vector); + + // Test 3 + uint32_t crc = 0; + for (size_t i = 0; i < sizeof(test_string); ++i) + crc = lzma_crc32(test_string + i, 1, crc); + assert_uint_eq(crc, test_vector); +} + + +static void +test_lzma_crc64(void) +{ + // CRC64 can be disabled. + if (!lzma_check_is_supported(LZMA_CHECK_CRC64)) + assert_skip("CRC64 support is disabled"); + + // If CRC64 is disabled then lzma_crc64() will be missing. + // Using an ifdef here avoids a linker error. +#ifdef HAVE_CHECK_CRC64 + const uint64_t test_vector = 0x995DC9BBDF1939FA; + + // Test 1 + assert_uint_eq(lzma_crc64(test_string, sizeof(test_string), 0), + test_vector); + + // Test 2 + assert_uint_eq(lzma_crc64(test_unaligned + 3, sizeof(test_string), 0), + test_vector); + + // Test 3 + uint64_t crc = 0; + for (size_t i = 0; i < sizeof(test_string); ++i) + crc = lzma_crc64(test_string + i, 1, crc); + assert_uint_eq(crc, test_vector); + + // Test 4: The CLMUL implementation works on 16-byte chunks. + // Test combination of different start and end alignments + // and also short buffer lengths where special handling is needed. + uint32_t seed = 29; + crc = 0x96E30D5184B7FA2C; // Random initial value + for (size_t start = 0; start < 32; ++start) + for (size_t size = 1; size < 256 - 32; ++size) + crc = lzma_crc64(get_random256(&seed), size, crc); + + assert_uint_eq(crc, 0x23AB787177231C9F); +#endif +} + + +static void +test_lzma_supported_checks(void) +{ + static const int expected_check_ids[] = { + LZMA_CHECK_NONE, +#ifdef HAVE_CHECK_CRC32 + LZMA_CHECK_CRC32, +#endif +#ifdef HAVE_CHECK_CRC64 + LZMA_CHECK_CRC64, +#endif +#ifdef HAVE_CHECK_SHA256 + LZMA_CHECK_SHA256, +#endif + }; + + for (int i = 0; i <= LZMA_CHECK_ID_MAX + 1; i++) { + bool matched = false; + for (unsigned int j = 0; j < ARRAY_SIZE(expected_check_ids); + j++) { + if (expected_check_ids[j] == i) { + matched = true; + break; + } + } + + if (matched) + assert_true(lzma_check_is_supported(i)); + else + assert_false(lzma_check_is_supported(i)); + } +} + + +static void +test_lzma_check_size(void) +{ + // Expected check sizes taken from src/liblzma/api/lzma/check.h + static const uint32_t expected_check_sizes[] = { + 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, + 32, 32, 32, 64, 64, 64 + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(expected_check_sizes); i++) + assert_uint_eq(expected_check_sizes[i], lzma_check_size(i)); + + assert_uint_eq(lzma_check_size(LZMA_CHECK_ID_MAX + 1), UINT32_MAX); +} + + +// Test the single threaded decoder for lzma_get_check +static void +test_lzma_get_check_st(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + const uint32_t flags = LZMA_TELL_ANY_CHECK | + LZMA_TELL_UNSUPPORTED_CHECK | + LZMA_TELL_NO_CHECK; + + uint8_t outbuf[128]; + lzma_stream strm = LZMA_STREAM_INIT; + + // Test a file with no integrity check: + assert_lzma_ret(lzma_stream_decoder(&strm, TEST_CHECK_MEMLIMIT, + flags), LZMA_OK); + strm.next_in = no_check_xz_data; + strm.avail_in = no_check_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_NO_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_NONE); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); + + // Test a file with an unsupported integrity check type: + assert_lzma_ret(lzma_stream_decoder(&strm, TEST_CHECK_MEMLIMIT, + flags), LZMA_OK); + strm.next_in = unsupported_check_xz_data; + strm.avail_in = unsupported_check_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_UNSUPPORTED_CHECK); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); + + // Test a file with CRC32 as the integrity check: +#ifdef HAVE_CHECK_CRC32 + assert_lzma_ret(lzma_stream_decoder(&strm, TEST_CHECK_MEMLIMIT, + flags), LZMA_OK); + strm.next_in = crc32_xz_data; + strm.avail_in = crc32_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_CRC32); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + // Test a file with CRC64 as the integrity check: +#ifdef HAVE_CHECK_CRC64 + assert_lzma_ret(lzma_stream_decoder(&strm, TEST_CHECK_MEMLIMIT, + flags), LZMA_OK); + strm.next_in = crc64_xz_data; + strm.avail_in = crc64_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_CRC64); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + // Test a file with SHA-256 as the integrity check: +#ifdef HAVE_CHECK_SHA256 + assert_lzma_ret(lzma_stream_decoder(&strm, TEST_CHECK_MEMLIMIT, + flags), LZMA_OK); + strm.next_in = sha256_xz_data; + strm.avail_in = sha256_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_SHA256); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + lzma_end(&strm); +#endif +} + + +static void +test_lzma_get_check_mt(void) +{ +#ifndef MYTHREAD_ENABLED + assert_skip("Threading support disabled"); +#elif !defined(HAVE_DECODERS) + assert_skip("Decoder support disabled"); +#else + const uint32_t flags = LZMA_TELL_ANY_CHECK | + LZMA_TELL_UNSUPPORTED_CHECK | + LZMA_TELL_NO_CHECK; + + const lzma_mt options = { + .flags = flags, + .threads = 2, + .timeout = 0, + .memlimit_threading = TEST_CHECK_MEMLIMIT, + .memlimit_stop = TEST_CHECK_MEMLIMIT + }; + + uint8_t outbuf[128]; + lzma_stream strm = LZMA_STREAM_INIT; + + // Test a file with no integrity check: + assert_lzma_ret(lzma_stream_decoder_mt(&strm, &options), LZMA_OK); + strm.next_in = no_check_xz_data; + strm.avail_in = no_check_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_NO_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_NONE); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); + + // Test a file with an unsupported integrity check type: + assert_lzma_ret(lzma_stream_decoder_mt(&strm, &options), LZMA_OK); + strm.next_in = unsupported_check_xz_data; + strm.avail_in = unsupported_check_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_UNSUPPORTED_CHECK); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); + + // Test a file with CRC32 as the integrity check: +#ifdef HAVE_CHECK_CRC32 + assert_lzma_ret(lzma_stream_decoder_mt(&strm, &options), LZMA_OK); + strm.next_in = crc32_xz_data; + strm.avail_in = crc32_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_CRC32); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + // Test a file with CRC64 as the integrity check: +#ifdef HAVE_CHECK_CRC64 + assert_lzma_ret(lzma_stream_decoder_mt(&strm, &options), LZMA_OK); + strm.next_in = crc64_xz_data; + strm.avail_in = crc64_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_CRC64); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + // Test a file with SHA-256 as the integrity check: +#ifdef HAVE_CHECK_SHA256 + assert_lzma_ret(lzma_stream_decoder_mt(&strm,&options), LZMA_OK); + strm.next_in = sha256_xz_data; + strm.avail_in = sha256_size; + strm.next_out = outbuf; + strm.avail_out = sizeof(outbuf); + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_GET_CHECK); + assert_lzma_check(lzma_get_check(&strm), LZMA_CHECK_SHA256); + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), LZMA_STREAM_END); +#endif + + lzma_end(&strm); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + + no_check_xz_data = tuktest_file_from_srcdir( + "files/good-1-check-none.xz", &no_check_size); + + unsupported_check_xz_data = tuktest_file_from_srcdir( + "files/unsupported-check.xz", + &unsupported_check_size); + +#ifdef HAVE_CHECK_CRC32 + crc32_xz_data = tuktest_file_from_srcdir( + "files/good-1-check-crc32.xz", &crc32_size); +#endif + +#ifdef HAVE_CHECK_CRC64 + crc64_xz_data = tuktest_file_from_srcdir( + "files/good-1-check-crc64.xz", &crc64_size); +#endif + +#ifdef HAVE_CHECK_SHA256 + sha256_xz_data = tuktest_file_from_srcdir( + "files/good-1-check-sha256.xz", &sha256_size); +#endif + + tuktest_run(test_lzma_crc32); + tuktest_run(test_lzma_crc64); + tuktest_run(test_lzma_supported_checks); + tuktest_run(test_lzma_check_size); + tuktest_run(test_lzma_get_check_st); + tuktest_run(test_lzma_get_check_mt); + + return tuktest_end(); +} diff --git a/tests/test_compress.sh b/tests/test_compress.sh new file mode 100644 index 0000000..61d20ce --- /dev/null +++ b/tests/test_compress.sh @@ -0,0 +1,149 @@ +#!/bin/sh + +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# If xz wasn't built, this test is skipped. +if test -x ../src/xz/xz ; then + : +else + exit 77 +fi + +# If compression or decompression support is missing, this test is skipped. +# This isn't perfect as if only some compressors or decompressors are disabled +# then this script can still fail because for now this doesn't check the +# availability of each filter. +if grep 'define HAVE_ENCODERS' ../config.h > /dev/null \ + && grep 'define HAVE_DECODERS' ../config.h > /dev/null ; then + : +else + echo "Compression or decompression support is disabled, skipping this test." + exit 77 +fi + +# Find out if our shell supports functions. +eval 'unset foo ; foo() { return 42; } ; foo' +if test $? != 42 ; then + echo "/bin/sh doesn't support functions, skipping this test." + exit 77 +fi + +test_xz() { + if $XZ -c "$@" "$FILE" > "$TMP_COMP"; then + : + else + echo "Compressing failed: $* $FILE" + exit 1 + fi + + if $XZ -cd "$TMP_COMP" > "$TMP_UNCOMP" ; then + : + else + echo "Decompressing failed: $* $FILE" + exit 1 + fi + + if cmp "$TMP_UNCOMP" "$FILE" ; then + : + else + echo "Decompressed file does not match" \ + "the original: $* $FILE" + exit 1 + fi + + if test -n "$XZDEC" ; then + if $XZDEC "$TMP_COMP" > "$TMP_UNCOMP" ; then + : + else + echo "Decompressing failed: $* $FILE" + exit 1 + fi + + if cmp "$TMP_UNCOMP" "$FILE" ; then + : + else + echo "Decompressed file does not match" \ + "the original: $* $FILE" + exit 1 + fi + fi +} + +XZ="../src/xz/xz --memlimit-compress=48MiB --memlimit-decompress=5MiB \ + --no-adjust --threads=1 --check=crc32" +grep "define HAVE_CHECK_CRC64" ../config.h > /dev/null \ + && XZ="$XZ --check=crc64" +XZDEC="../src/xzdec/xzdec" # No memory usage limiter available +test -x ../src/xzdec/xzdec || XZDEC= + +# Create the required input file if needed. +# +# Derive temporary filenames for compressed and uncompressed outputs +# from the input filename. This is needed when multiple tests are +# run in parallel. +FILE=$1 +TMP_COMP="tmp_comp_$FILE" +TMP_UNCOMP="tmp_uncomp_$FILE" + +case $FILE in + # compress_generated files will be created in the build directory + # in the /tests/ sub-directory. + compress_generated_*) + if ./create_compress_files "$FILE" ; then + : + else + rm -f "$FILE" + echo "Failed to create the file '$FILE'." + exit 1 + fi + ;; + # compress_prepared files exist in the source directory since they + # do not need to be copied or regenerated. + compress_prepared_*) + FILE="$srcdir/$FILE" + ;; + '') + echo "No test file was specified." + exit 1 + ;; +esac + +# Remove temporary now (in case they are something weird), and on exit. +rm -f "$TMP_COMP" "$TMP_UNCOMP" +trap 'rm -f "$TMP_COMP" "$TMP_UNCOMP"' 0 + +# Compress and decompress the file with various filter configurations. +# +# Don't test with empty arguments; it breaks some ancient +# proprietary /bin/sh versions due to $@ used in test_xz(). +test_xz -1 +test_xz -2 +test_xz -3 +test_xz -4 + +test_filter() +{ + grep "define HAVE_ENCODER_$1" ../config.h > /dev/null || return + grep "define HAVE_DECODER_$1" ../config.h > /dev/null || return + shift + test_xz "$@" --lzma2=dict=64KiB,nice=32,mode=fast +} + +test_filter DELTA --delta=dist=1 +test_filter DELTA --delta=dist=4 +test_filter DELTA --delta=dist=256 +test_filter X86 --x86 +test_filter POWERPC --power +test_filter IA64 --ia64 +test_filter ARM --arm +test_filter ARMTHUMB --armthumb +test_filter SPARC --sparc + +exit 0 diff --git a/tests/test_compress_generated_abc b/tests/test_compress_generated_abc new file mode 100644 index 0000000..43c6951 --- /dev/null +++ b/tests/test_compress_generated_abc @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$srcdir/test_compress.sh" compress_generated_abc diff --git a/tests/test_compress_generated_random b/tests/test_compress_generated_random new file mode 100644 index 0000000..e47555d --- /dev/null +++ b/tests/test_compress_generated_random @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$srcdir/test_compress.sh" compress_generated_random diff --git a/tests/test_compress_generated_text b/tests/test_compress_generated_text new file mode 100644 index 0000000..412ae0e --- /dev/null +++ b/tests/test_compress_generated_text @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$srcdir/test_compress.sh" compress_generated_text diff --git a/tests/test_compress_prepared_bcj_sparc b/tests/test_compress_prepared_bcj_sparc new file mode 100644 index 0000000..deb76ef --- /dev/null +++ b/tests/test_compress_prepared_bcj_sparc @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$srcdir/test_compress.sh" compress_prepared_bcj_sparc diff --git a/tests/test_compress_prepared_bcj_x86 b/tests/test_compress_prepared_bcj_x86 new file mode 100644 index 0000000..3452d7f --- /dev/null +++ b/tests/test_compress_prepared_bcj_x86 @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$srcdir/test_compress.sh" compress_prepared_bcj_x86 diff --git a/tests/test_files.sh b/tests/test_files.sh new file mode 100644 index 0000000..64d7308 --- /dev/null +++ b/tests/test_files.sh @@ -0,0 +1,197 @@ +#!/bin/sh + +############################################################################### +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# If both xz and xzdec were not build, skip this test. +XZ=../src/xz/xz +XZDEC=../src/xzdec/xzdec +test -x "$XZ" || XZ= +test -x "$XZDEC" || XZDEC= +if test -z "$XZ$XZDEC"; then + echo "xz and xzdec were not built, skipping this test." + exit 77 +fi + +# If decompression support is missing, this test is skipped. +# This isn't perfect as if only some decompressors are disabled +# then some good files might not decompress and the test fails +# for a (kind of) wrong reason. +if grep 'define HAVE_DECODERS' ../config.h > /dev/null ; then + : +else + echo "Decompression support is disabled, skipping this test." + exit 77 +fi + +# If a feature was disabled at build time, make it possible to skip +# some of the test files. Use exit status 77 if any files were skipped. +EXIT_STATUS=0 +have_feature() +{ + grep "define HAVE_$1" ../config.h > /dev/null && return 0 + printf '%s: Skipping because HAVE_%s is not enabled\n' "$2" "$1" + EXIT_STATUS=77 + return 1 +} + + +####### +# .xz # +####### + +# If these integrity check types were disabled at build time, +# allow the tests to pass still. +NO_WARN= +grep 'define HAVE_CHECK_CRC64' ../config.h > /dev/null || NO_WARN=-qQ +grep 'define HAVE_CHECK_SHA256' ../config.h > /dev/null || NO_WARN=-qQ + +for I in "$srcdir"/files/good-*.xz +do + # If features were disabled at build time, keep this still working. + case $I in + */good-1-*delta-lzma2*.xz) + have_feature DECODER_DELTA "$I" || continue + ;; + esac + case $I in + */good-1-empty-bcj-lzma2.xz) + have_feature DECODER_POWERPC "$I" || continue + ;; + esac + case $I in + */good-1-sparc-lzma2.xz) + have_feature DECODER_SPARC "$I" || continue + ;; + esac + case $I in + */good-1-x86-lzma2.xz) + have_feature DECODER_X86 "$I" || continue + ;; + esac + case $I in + */good-1-arm64-lzma2-*.xz) + have_feature DECODER_ARM64 "$I" || continue + ;; + esac + + if test -z "$XZ" || "$XZ" $NO_WARN -dc "$I" > /dev/null; then + : + else + echo "Good file failed: $I" + exit 1 + fi + + if test -z "$XZDEC" || "$XZDEC" $NO_WARN "$I" > /dev/null; then + : + else + echo "Good file failed: $I" + exit 1 + fi +done + +for I in "$srcdir"/files/bad-*.xz +do + if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then + echo "Bad file succeeded: $I" + exit 1 + fi + + # xzdec doesn't warn about unsupported check so skip this if any of + # the check types were disabled at built time (NO_WARN isn't empty). + if test -n "$XZDEC" && test -z "$NO_WARN" \ + && "$XZDEC" "$I" > /dev/null 2>&1; then + echo "Bad file succeeded: $I" + exit 1 + fi +done + +# Testing for the lzma_index_append() bug in <= 5.2.6 needs "xz -l": +I="$srcdir/files/bad-3-index-uncomp-overflow.xz" +if test -n "$XZ" && "$XZ" -l "$I" > /dev/null 2>&1; then + echo "Bad file succeeded with xz -l: $I" + exit 1 +fi + +for I in "$srcdir"/files/unsupported-*.xz +do + # Test these only with xz as unsupported-check.xz will exit + # successfully with xzdec because it doesn't warn about + # unsupported check type. + if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then + echo "Unsupported file succeeded: $I" + exit 1 + fi +done + +# Test that this passes with --no-warn (-Q). +I="$srcdir/files/unsupported-check.xz" +if test -z "$XZ" || "$XZ" -dcqQ "$I" > /dev/null; then + : +else + echo "Unsupported file failed with xz -Q: $I" + exit 1 +fi + +if test -z "$XZDEC" || "$XZDEC" -qQ "$I" > /dev/null; then + : +else + echo "Unsupported file failed with xzdec -Q: $I" + exit 1 +fi + + +######### +# .lzma # +######### + +for I in "$srcdir"/files/good-*.lzma +do + if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null; then + : + else + echo "Good file failed: $I" + exit 1 + fi +done + +for I in "$srcdir"/files/bad-*.lzma +do + if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then + echo "Bad file succeeded: $I" + exit 1 + fi +done + + +####### +# .lz # +####### + +if grep 'define HAVE_LZIP_DECODER' ../config.h > /dev/null ; then + for I in "$srcdir"/files/good-*.lz + do + if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null; then + : + else + echo "Good file failed: $I" + exit 1 + fi + done + + for I in "$srcdir"/files/bad-*.lz "$srcdir"/files/unsupported-*.lz + do + if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then + echo "Bad file succeeded: $I" + exit 1 + fi + done +fi + +exit "$EXIT_STATUS" diff --git a/tests/test_filter_flags.c b/tests/test_filter_flags.c new file mode 100644 index 0000000..5cfccea --- /dev/null +++ b/tests/test_filter_flags.c @@ -0,0 +1,527 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_filter_flags.c +/// \brief Tests Filter Flags coders +// +// Authors: Jia Tan +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + +// FIXME: This is from src/liblzma/common/common.h but it cannot be +// included here. This constant is needed in only a few files, perhaps +// move it to some other internal header or create a new one? +#define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62) + + +#if defined(HAVE_ENCODERS) +// No tests are run without encoders, so init the global filters +// only when the encoders are enabled. +static lzma_filter lzma1_filter = { LZMA_FILTER_LZMA1, NULL }; +static lzma_filter lzma2_filter = { LZMA_FILTER_LZMA2, NULL }; +static lzma_filter delta_filter = { LZMA_FILTER_DELTA, NULL }; + +static lzma_filter bcj_filters_encoders[] = { +#ifdef HAVE_ENCODER_X86 + { LZMA_FILTER_X86, NULL }, +#endif +#ifdef HAVE_ENCODER_POWERPC + { LZMA_FILTER_POWERPC, NULL }, +#endif +#ifdef HAVE_ENCODER_IA64 + { LZMA_FILTER_IA64, NULL }, +#endif +#ifdef HAVE_ENCODER_ARM + { LZMA_FILTER_ARM, NULL }, +#endif +#ifdef HAVE_ENCODER_ARM64 + { LZMA_FILTER_ARM64, NULL }, +#endif +#ifdef HAVE_ENCODER_ARMTHUMB + { LZMA_FILTER_ARMTHUMB, NULL }, +#endif +#ifdef HAVE_ENCODER_SPARC + { LZMA_FILTER_SPARC, NULL }, +#endif +}; + +// HAVE_ENCODERS ifdef not termianted here because decoders are +// only used if encoders are, but encoders can still be used +// even if decoders are not. + +#ifdef HAVE_DECODERS +static lzma_filter bcj_filters_decoders[] = { +#ifdef HAVE_DECODER_X86 + { LZMA_FILTER_X86, NULL }, +#endif +#ifdef HAVE_DECODER_POWERPC + { LZMA_FILTER_POWERPC, NULL }, +#endif +#ifdef HAVE_DECODER_IA64 + { LZMA_FILTER_IA64, NULL }, +#endif +#ifdef HAVE_DECODER_ARM + { LZMA_FILTER_ARM, NULL }, +#endif +#ifdef HAVE_DECODER_ARM64 + { LZMA_FILTER_ARM64, NULL }, +#endif +#ifdef HAVE_DECODER_ARMTHUMB + { LZMA_FILTER_ARMTHUMB, NULL }, +#endif +#ifdef HAVE_DECODER_SPARC + { LZMA_FILTER_SPARC, NULL }, +#endif +}; +#endif +#endif + + +static void +test_lzma_filter_flags_size(void) +{ +#ifndef HAVE_ENCODERS + assert_skip("Encoder support disabled"); +#else + // For each supported filter, test that the size can be calculated + // and that the size calculated is reasonable. A reasonable size + // must be greater than 0, but less than the maximum size for the + // block header. + uint32_t size = 0; + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA1)) { + assert_lzma_ret(lzma_filter_flags_size(&size, + &lzma1_filter), LZMA_PROG_ERROR); + } + + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2)) { + assert_lzma_ret(lzma_filter_flags_size(&size, + &lzma2_filter), LZMA_OK); + assert_true(size != 0 && size < LZMA_BLOCK_HEADER_SIZE_MAX); + } + + // Do not use macro ARRAY_SIZE() in the for loop condition directly. + // If the BCJ filters are not configured and built, then ARRAY_SIZE() + // will return 0 and cause a warning because the for loop will never + // execute since any unsigned number cannot be < 0 (-Werror=type-limits). + const uint32_t bcj_array_size = ARRAY_SIZE(bcj_filters_encoders); + for (uint32_t i = 0; i < bcj_array_size; i++) { + assert_lzma_ret(lzma_filter_flags_size(&size, + &bcj_filters_encoders[i]), LZMA_OK); + assert_true(size != 0 && size < LZMA_BLOCK_HEADER_SIZE_MAX); + } + + if (lzma_filter_encoder_is_supported(LZMA_FILTER_DELTA)) { + assert_lzma_ret(lzma_filter_flags_size(&size, + &delta_filter), LZMA_OK); + assert_true(size != 0 && size < LZMA_BLOCK_HEADER_SIZE_MAX); + } + + // Test invalid Filter IDs + lzma_filter bad_filter = { 2, NULL }; + + assert_lzma_ret(lzma_filter_flags_size(&size, &bad_filter), + LZMA_OPTIONS_ERROR); + bad_filter.id = LZMA_VLI_MAX; + assert_lzma_ret(lzma_filter_flags_size(&size, &bad_filter), + LZMA_PROG_ERROR); + bad_filter.id = LZMA_FILTER_RESERVED_START; + assert_lzma_ret(lzma_filter_flags_size(&size, &bad_filter), + LZMA_PROG_ERROR); +#endif +} + + +// Helper function for test_lzma_filter_flags_encode. +// The should_encode parameter represents if the encoding operation +// is expected to fail. +// Avoid data -> encode -> decode -> compare to data. +// Instead create expected encoding and compare to result from +// lzma_filter_flags_encode. +// Filter Flags in .xz are encoded as: +// |Filter ID (VLI)|Size of Properties (VLI)|Filter Properties| +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +static void +verify_filter_flags_encode(lzma_filter *filter, bool should_encode) +{ + uint32_t size = 0; + + // First calculate the size of Filter Flags to know how much + // memory to allocate to hold the encoded Filter Flags + assert_lzma_ret(lzma_filter_flags_size(&size, filter), LZMA_OK); + uint8_t *encoded_out = tuktest_malloc(size * sizeof(uint8_t)); + size_t out_pos = 0; + if (!should_encode) { + assert_false(lzma_filter_flags_encode(filter, encoded_out, + &out_pos, size) == LZMA_OK); + return; + } + + // Next encode the Filter Flags for the provided filter + assert_lzma_ret(lzma_filter_flags_encode(filter, encoded_out, + &out_pos, size), LZMA_OK); + assert_uint_eq(size, out_pos); + + // Next decode the VLI for the Filter ID and verify it matches + // the expected Filter ID + size_t filter_id_vli_size = 0; + lzma_vli filter_id = 0; + assert_lzma_ret(lzma_vli_decode(&filter_id, NULL, encoded_out, + &filter_id_vli_size, size), LZMA_OK); + assert_uint_eq(filter->id, filter_id); + + // Next decode the Size of Properites and ensure it equals + // the expected size. + // Expected size should be: + // total filter flag length - size of filter id VLI + size of + // property size VLI + // Not verifying the contents of Filter Properties since + // that belongs in a different test + size_t size_of_properties_vli_size = 0; + lzma_vli size_of_properties = 0; + assert_lzma_ret(lzma_vli_decode(&size_of_properties, NULL, + encoded_out + filter_id_vli_size, + &size_of_properties_vli_size, size), LZMA_OK); + assert_uint_eq(size - (size_of_properties_vli_size + + filter_id_vli_size), size_of_properties); +} +#endif + + +static void +test_lzma_filter_flags_encode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + // No test for LZMA1 since the .xz format does not support LZMA1 + // and so the flags cannot be encoded for that filter + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2)) { + // Test with NULL options that should fail + lzma_options_lzma *options = lzma2_filter.options; + lzma2_filter.options = NULL; + verify_filter_flags_encode(&lzma2_filter, false); + + // Place options back in the filter, and test should pass + lzma2_filter.options = options; + verify_filter_flags_encode(&lzma2_filter, true); + } + + // NOTE: Many BCJ filters require that start_offset is a multiple + // of some power of two. The Filter Flags encoder and decoder don't + // completely validate the options and thus 257 passes the tests + // with all BCJ filters. It would be caught when initializing + // a filter chain encoder or decoder. + lzma_options_bcj bcj_options = { + .start_offset = 257 + }; + + const uint32_t bcj_array_size = ARRAY_SIZE(bcj_filters_encoders); + for (uint32_t i = 0; i < bcj_array_size; i++) { + // NULL options should pass for bcj filters + verify_filter_flags_encode(&bcj_filters_encoders[i], true); + lzma_filter bcj_with_options = { + bcj_filters_encoders[i].id, &bcj_options }; + verify_filter_flags_encode(&bcj_with_options, true); + } + + if (lzma_filter_encoder_is_supported(LZMA_FILTER_DELTA)) { + lzma_options_delta delta_opts_below_min = { + .type = LZMA_DELTA_TYPE_BYTE, + .dist = LZMA_DELTA_DIST_MIN - 1 + }; + + lzma_options_delta delta_opts_above_max = { + .type = LZMA_DELTA_TYPE_BYTE, + .dist = LZMA_DELTA_DIST_MAX + 1 + }; + + verify_filter_flags_encode(&delta_filter, true); + + lzma_filter delta_filter_bad_options = { + LZMA_FILTER_DELTA, &delta_opts_below_min }; + + // Next test error case using minimum - 1 delta distance + verify_filter_flags_encode(&delta_filter_bad_options, false); + + // Next test error case using maximum + 1 delta distance + delta_filter_bad_options.options = &delta_opts_above_max; + verify_filter_flags_encode(&delta_filter_bad_options, false); + + // Next test NULL case + delta_filter_bad_options.options = NULL; + verify_filter_flags_encode(&delta_filter_bad_options, false); + } + + // Test expected failing cases + lzma_filter bad_filter = { LZMA_FILTER_RESERVED_START, NULL }; + size_t out_pos = 0; + size_t out_size = LZMA_BLOCK_HEADER_SIZE_MAX; + uint8_t out[LZMA_BLOCK_HEADER_SIZE_MAX]; + + + // Filter ID outside of valid range + assert_lzma_ret(lzma_filter_flags_encode(&bad_filter, out, &out_pos, + out_size), LZMA_PROG_ERROR); + out_pos = 0; + bad_filter.id = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_filter_flags_encode(&bad_filter, out, &out_pos, + out_size), LZMA_PROG_ERROR); + out_pos = 0; + + // Invalid Filter ID + bad_filter.id = 2; + assert_lzma_ret(lzma_filter_flags_encode(&bad_filter, out, &out_pos, + out_size), LZMA_OPTIONS_ERROR); + out_pos = 0; + + // Out size too small + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2)) { + uint32_t bad_size = 0; + + // First test with 0 output size + assert_lzma_ret(lzma_filter_flags_encode( + &lzma2_filter, out, &out_pos, 0), + LZMA_PROG_ERROR); + + // Next calculate the size needed to encode and + // use less than that + assert_lzma_ret(lzma_filter_flags_size(&bad_size, + &lzma2_filter), LZMA_OK); + + assert_lzma_ret(lzma_filter_flags_encode( + &lzma2_filter, out, &out_pos, + bad_size - 1), LZMA_PROG_ERROR); + out_pos = 0; + } + + // Invalid options + if (lzma_filter_encoder_is_supported(LZMA_FILTER_DELTA)) { + bad_filter.id = LZMA_FILTER_DELTA; + + // First test with NULL options + assert_lzma_ret(lzma_filter_flags_encode(&bad_filter, out, + &out_pos, out_size), LZMA_PROG_ERROR); + out_pos = 0; + + // Next test with invalid options + lzma_options_delta bad_options = { + .dist = LZMA_DELTA_DIST_MAX + 1, + .type = LZMA_DELTA_TYPE_BYTE + }; + bad_filter.options = &bad_options; + + assert_lzma_ret(lzma_filter_flags_encode(&bad_filter, out, + &out_pos, out_size), LZMA_PROG_ERROR); + } +#endif +} + + +// Helper function for test_lzma_filter_flags_decode. +// Encodes the filter_in without using lzma_filter_flags_encode. +// Leaves the specific assertions of filter_out options to the caller +// because it is agnostic to the type of options used in the call +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +static void +verify_filter_flags_decode(lzma_filter *filter_in, lzma_filter *filter_out) +{ + uint32_t total_size = 0; + + assert_lzma_ret(lzma_filter_flags_size(&total_size, filter_in), + LZMA_OK); + assert_uint(total_size, >, 0); + uint8_t *filter_flag_buffer = tuktest_malloc(total_size); + + uint32_t properties_size = 0; + size_t out_pos = 0; + size_t in_pos = 0; + assert_lzma_ret(lzma_properties_size(&properties_size, filter_in), + LZMA_OK); + assert_lzma_ret(lzma_vli_encode(filter_in->id, NULL, + filter_flag_buffer, &out_pos, total_size), LZMA_OK); + assert_lzma_ret(lzma_vli_encode(properties_size, NULL, + filter_flag_buffer, &out_pos, total_size), + LZMA_OK); + assert_lzma_ret(lzma_properties_encode(filter_in, + filter_flag_buffer + out_pos), LZMA_OK); + assert_lzma_ret(lzma_filter_flags_decode(filter_out, NULL, + filter_flag_buffer, &in_pos, total_size), + LZMA_OK); + assert_uint_eq(filter_in->id, filter_out->id); +} +#endif + + +static void +test_lzma_filter_flags_decode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + // For each filter, only run the decoder test if both the encoder + // and decoder are enabled. This is because verify_filter_flags_decode + // uses lzma_filter_flags_size which requires the encoder. + if (lzma_filter_decoder_is_supported(LZMA_FILTER_LZMA2) && + lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2)) { + lzma_filter lzma2_decoded = { LZMA_FILTER_LZMA2, NULL }; + + verify_filter_flags_decode(&lzma2_filter, &lzma2_decoded); + + lzma_options_lzma *expected = lzma2_filter.options; + lzma_options_lzma *decoded = lzma2_decoded.options; + + // Only the dictionary size is encoded and decoded + // so only compare those + assert_uint_eq(decoded->dict_size, expected->dict_size); + + // The decoded options must be freed by the caller + free(decoded); + } + + const uint32_t bcj_array_size = ARRAY_SIZE(bcj_filters_decoders); + for (uint32_t i = 0; i < bcj_array_size; i++) { + if (lzma_filter_encoder_is_supported( + bcj_filters_decoders[i].id)) { + lzma_filter bcj_decoded = { + bcj_filters_decoders[i].id, NULL }; + + lzma_filter bcj_encoded = { + bcj_filters_decoders[i].id, NULL }; + + // First test without options + verify_filter_flags_decode(&bcj_encoded, + &bcj_decoded); + assert_true(bcj_decoded.options == NULL); + + // Next test with offset + lzma_options_bcj options = { + .start_offset = 257 + }; + + bcj_encoded.options = &options; + verify_filter_flags_decode(&bcj_encoded, + &bcj_decoded); + lzma_options_bcj *decoded_opts = bcj_decoded.options; + assert_uint_eq(decoded_opts->start_offset, + options.start_offset); + free(decoded_opts); + } + } + + if (lzma_filter_decoder_is_supported(LZMA_FILTER_DELTA) && + lzma_filter_encoder_is_supported(LZMA_FILTER_DELTA)) { + lzma_filter delta_decoded = { LZMA_FILTER_DELTA, NULL }; + + verify_filter_flags_decode(&delta_filter, &delta_decoded); + lzma_options_delta *expected = delta_filter.options; + lzma_options_delta *decoded = delta_decoded.options; + assert_uint_eq(expected->dist, decoded->dist); + assert_uint_eq(expected->type, decoded->type); + + free(decoded); + } + + // Test expected failing cases + uint8_t bad_encoded_filter[LZMA_BLOCK_HEADER_SIZE_MAX]; + lzma_filter bad_filter; + + // Filter ID outside of valid range + lzma_vli bad_filter_id = LZMA_FILTER_RESERVED_START; + size_t bad_encoded_out_pos = 0; + size_t in_pos = 0; + + assert_lzma_ret(lzma_vli_encode(bad_filter_id, NULL, + bad_encoded_filter, &bad_encoded_out_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_OK); + + assert_lzma_ret(lzma_filter_flags_decode(&bad_filter, NULL, + bad_encoded_filter, &in_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_DATA_ERROR); + + bad_encoded_out_pos = 0; + in_pos = 0; + + // Invalid Filter ID + bad_filter_id = 2; + bad_encoded_out_pos = 0; + in_pos = 0; + + assert_lzma_ret(lzma_vli_encode(bad_filter_id, NULL, + bad_encoded_filter, &bad_encoded_out_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_OK); + + // Next encode Size of Properties with the value of 0 + assert_lzma_ret(lzma_vli_encode(0, NULL, + bad_encoded_filter, &bad_encoded_out_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_OK); + + // Decode should fail on bad Filter ID + assert_lzma_ret(lzma_filter_flags_decode(&bad_filter, NULL, + bad_encoded_filter, &in_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_OPTIONS_ERROR); + bad_encoded_out_pos = 0; + in_pos = 0; + + // Outsize too small + // Encode the LZMA2 filter normally, but then set + // the out size when decoding as too small + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2) && + lzma_filter_decoder_is_supported(LZMA_FILTER_LZMA2)) { + uint32_t filter_flag_size = 0; + assert_lzma_ret(lzma_filter_flags_size(&filter_flag_size, + &lzma2_filter), LZMA_OK); + + assert_lzma_ret(lzma_filter_flags_encode(&lzma2_filter, + bad_encoded_filter, &bad_encoded_out_pos, + LZMA_BLOCK_HEADER_SIZE_MAX), LZMA_OK); + + assert_lzma_ret(lzma_filter_flags_decode(&bad_filter, NULL, + bad_encoded_filter, &in_pos, + filter_flag_size - 1), LZMA_DATA_ERROR); + } +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + +#ifdef HAVE_ENCODERS + // Only init filter options if encoder is supported because decoder + // tests requires encoder support, so the decoder tests will only + // run if for a given filter both the encoder and decoder are enabled. + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA1)) { + lzma_options_lzma *options = tuktest_malloc( + sizeof(lzma_options_lzma)); + lzma_lzma_preset(options, LZMA_PRESET_DEFAULT); + lzma1_filter.options = options; + } + + if (lzma_filter_encoder_is_supported(LZMA_FILTER_LZMA2)) { + lzma_options_lzma *options = tuktest_malloc( + sizeof(lzma_options_lzma)); + lzma_lzma_preset(options, LZMA_PRESET_DEFAULT); + lzma2_filter.options = options; + } + + if (lzma_filter_encoder_is_supported(LZMA_FILTER_DELTA)) { + lzma_options_delta *options = tuktest_malloc( + sizeof(lzma_options_delta)); + options->dist = LZMA_DELTA_DIST_MIN; + options->type = LZMA_DELTA_TYPE_BYTE; + delta_filter.options = options; + } +#endif + + tuktest_run(test_lzma_filter_flags_size); + tuktest_run(test_lzma_filter_flags_encode); + tuktest_run(test_lzma_filter_flags_decode); + return tuktest_end(); +} diff --git a/tests/test_hardware.c b/tests/test_hardware.c new file mode 100644 index 0000000..c72d9b2 --- /dev/null +++ b/tests/test_hardware.c @@ -0,0 +1,50 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_hardware.c +/// \brief Tests src/liblzma/api/lzma/hardware.h API functions +/// +/// Since the output values of these functions are hardware dependent, these +/// tests are trivial. They are simply used to detect errors and machines +/// that these function are not supported on. +// +// Author: Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" +#include "mythread.h" + + +static void +test_lzma_physmem(void) +{ + // NOTE: Use _skip instead of _fail because 0 can also mean that we + // don't know how to get this information on this operating system. + if (lzma_physmem() == 0) + assert_skip("Could not determine amount of physical memory"); +} + + +static void +test_lzma_cputhreads(void) +{ +#ifndef MYTHREAD_ENABLED + assert_skip("Threading support disabled"); +#else + if (lzma_cputhreads() == 0) + assert_skip("Could not determine cpu core count"); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + tuktest_run(test_lzma_physmem); + tuktest_run(test_lzma_cputhreads); + return tuktest_end(); +} diff --git a/tests/test_index.c b/tests/test_index.c new file mode 100644 index 0000000..31b958d --- /dev/null +++ b/tests/test_index.c @@ -0,0 +1,736 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_index.c +/// \brief Tests functions handling the lzma_index structure +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + +#define MEMLIMIT (LZMA_VLI_C(1) << 20) + +#define SMALL_COUNT 3 +#define BIG_COUNT 5555 + + +static lzma_index * +create_empty(void) +{ + lzma_index *i = lzma_index_init(NULL); + expect(i != NULL); + return i; +} + + +static lzma_index * +create_small(void) +{ + lzma_index *i = lzma_index_init(NULL); + expect(i != NULL); + expect(lzma_index_append(i, NULL, 101, 555) == LZMA_OK); + expect(lzma_index_append(i, NULL, 602, 777) == LZMA_OK); + expect(lzma_index_append(i, NULL, 804, 999) == LZMA_OK); + return i; +} + + +static lzma_index * +create_big(void) +{ + lzma_index *i = lzma_index_init(NULL); + expect(i != NULL); + + lzma_vli total_size = 0; + lzma_vli uncompressed_size = 0; + + // Add pseudo-random sizes (but always the same size values). + uint32_t n = 11; + for (size_t j = 0; j < BIG_COUNT; ++j) { + n = 7019 * n + 7607; + const uint32_t t = n * 3011; + expect(lzma_index_append(i, NULL, t, n) == LZMA_OK); + total_size += (t + 3) & ~LZMA_VLI_C(3); + uncompressed_size += n; + } + + expect(lzma_index_block_count(i) == BIG_COUNT); + expect(lzma_index_total_size(i) == total_size); + expect(lzma_index_uncompressed_size(i) == uncompressed_size); + expect(lzma_index_total_size(i) + lzma_index_size(i) + + 2 * LZMA_STREAM_HEADER_SIZE + == lzma_index_stream_size(i)); + + return i; +} + + +static bool +is_equal(const lzma_index *a, const lzma_index *b) +{ + // Compare only the Stream and Block sizes and offsets. + lzma_index_iter ra, rb; + lzma_index_iter_init(&ra, a); + lzma_index_iter_init(&rb, b); + + while (true) { + bool reta = lzma_index_iter_next(&ra, LZMA_INDEX_ITER_ANY); + bool retb = lzma_index_iter_next(&rb, LZMA_INDEX_ITER_ANY); + if (reta) + return !(reta ^ retb); + + if (ra.stream.number != rb.stream.number + || ra.stream.block_count + != rb.stream.block_count + || ra.stream.compressed_offset + != rb.stream.compressed_offset + || ra.stream.uncompressed_offset + != rb.stream.uncompressed_offset + || ra.stream.compressed_size + != rb.stream.compressed_size + || ra.stream.uncompressed_size + != rb.stream.uncompressed_size + || ra.stream.padding + != rb.stream.padding) + return false; + + if (ra.stream.block_count == 0) + continue; + + if (ra.block.number_in_file != rb.block.number_in_file + || ra.block.compressed_file_offset + != rb.block.compressed_file_offset + || ra.block.uncompressed_file_offset + != rb.block.uncompressed_file_offset + || ra.block.number_in_stream + != rb.block.number_in_stream + || ra.block.compressed_stream_offset + != rb.block.compressed_stream_offset + || ra.block.uncompressed_stream_offset + != rb.block.uncompressed_stream_offset + || ra.block.uncompressed_size + != rb.block.uncompressed_size + || ra.block.unpadded_size + != rb.block.unpadded_size + || ra.block.total_size + != rb.block.total_size) + return false; + } +} + + +static void +test_equal(void) +{ + lzma_index *a = create_empty(); + lzma_index *b = create_small(); + lzma_index *c = create_big(); + expect(a && b && c); + + expect(is_equal(a, a)); + expect(is_equal(b, b)); + expect(is_equal(c, c)); + + expect(!is_equal(a, b)); + expect(!is_equal(a, c)); + expect(!is_equal(b, c)); + + lzma_index_end(a, NULL); + lzma_index_end(b, NULL); + lzma_index_end(c, NULL); +} + + +static void +test_overflow(void) +{ + // Integer overflow tests + lzma_index *i = create_empty(); + + expect(lzma_index_append(i, NULL, LZMA_VLI_MAX - 5, 1234) + == LZMA_DATA_ERROR); + + // TODO + + lzma_index_end(i, NULL); +} + + +static void +test_copy(const lzma_index *i) +{ + lzma_index *d = lzma_index_dup(i, NULL); + expect(d != NULL); + expect(is_equal(i, d)); + lzma_index_end(d, NULL); +} + + +static void +test_read(lzma_index *i) +{ + lzma_index_iter r; + lzma_index_iter_init(&r, i); + + // Try twice so we see that rewinding works. + for (size_t j = 0; j < 2; ++j) { + lzma_vli total_size = 0; + lzma_vli uncompressed_size = 0; + lzma_vli stream_offset = LZMA_STREAM_HEADER_SIZE; + lzma_vli uncompressed_offset = 0; + uint32_t count = 0; + + while (!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)) { + ++count; + + total_size += r.block.total_size; + uncompressed_size += r.block.uncompressed_size; + + expect(r.block.compressed_file_offset + == stream_offset); + expect(r.block.uncompressed_file_offset + == uncompressed_offset); + + stream_offset += r.block.total_size; + uncompressed_offset += r.block.uncompressed_size; + } + + expect(lzma_index_total_size(i) == total_size); + expect(lzma_index_uncompressed_size(i) == uncompressed_size); + expect(lzma_index_block_count(i) == count); + + lzma_index_iter_rewind(&r); + } +} + + +static void +test_code(lzma_index *i) +{ +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) + const size_t alloc_size = 128 * 1024; + uint8_t *buf = malloc(alloc_size); + expect(buf != NULL); + + // Encode + lzma_stream strm = LZMA_STREAM_INIT; + expect(lzma_index_encoder(&strm, i) == LZMA_OK); + const lzma_vli index_size = lzma_index_size(i); + succeed(coder_loop(&strm, NULL, 0, buf, index_size, + LZMA_STREAM_END, LZMA_RUN)); + + // Decode + lzma_index *d; + expect(lzma_index_decoder(&strm, &d, MEMLIMIT) == LZMA_OK); + expect(d == NULL); + succeed(decoder_loop(&strm, buf, index_size)); + + expect(is_equal(i, d)); + + lzma_index_end(d, NULL); + lzma_end(&strm); + + // Decode with hashing + lzma_index_hash *h = lzma_index_hash_init(NULL, NULL); + expect(h != NULL); + lzma_index_iter r; + lzma_index_iter_init(&r, i); + while (!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)) + expect(lzma_index_hash_append(h, r.block.unpadded_size, + r.block.uncompressed_size) == LZMA_OK); + size_t pos = 0; + while (pos < index_size - 1) + expect(lzma_index_hash_decode(h, buf, &pos, pos + 1) + == LZMA_OK); + expect(lzma_index_hash_decode(h, buf, &pos, pos + 1) + == LZMA_STREAM_END); + + lzma_index_hash_end(h, NULL); + + // Encode buffer + size_t buf_pos = 1; + expect(lzma_index_buffer_encode(i, buf, &buf_pos, index_size) + == LZMA_BUF_ERROR); + expect(buf_pos == 1); + + succeed(lzma_index_buffer_encode(i, buf, &buf_pos, index_size + 1)); + expect(buf_pos == index_size + 1); + + // Decode buffer + buf_pos = 1; + uint64_t memlimit = MEMLIMIT; + expect(lzma_index_buffer_decode(&d, &memlimit, NULL, buf, &buf_pos, + index_size) == LZMA_DATA_ERROR); + expect(buf_pos == 1); + expect(d == NULL); + + succeed(lzma_index_buffer_decode(&d, &memlimit, NULL, buf, &buf_pos, + index_size + 1)); + expect(buf_pos == index_size + 1); + expect(is_equal(i, d)); + + lzma_index_end(d, NULL); + + free(buf); +#else + (void)i; +#endif +} + + +static void +test_many(lzma_index *i) +{ + test_copy(i); + test_read(i); + test_code(i); +} + + +static void +test_cat(void) +{ + lzma_index *a, *b, *c, *d, *e, *f; + lzma_index_iter r; + + // Empty Indexes + a = create_empty(); + b = create_empty(); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_block_count(a) == 0); + expect(lzma_index_stream_size(a) == 2 * LZMA_STREAM_HEADER_SIZE + 8); + expect(lzma_index_file_size(a) + == 2 * (2 * LZMA_STREAM_HEADER_SIZE + 8)); + lzma_index_iter_init(&r, a); + expect(lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)); + + b = create_empty(); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_block_count(a) == 0); + expect(lzma_index_stream_size(a) == 2 * LZMA_STREAM_HEADER_SIZE + 8); + expect(lzma_index_file_size(a) + == 3 * (2 * LZMA_STREAM_HEADER_SIZE + 8)); + + b = create_empty(); + c = create_empty(); + expect(lzma_index_stream_padding(b, 4) == LZMA_OK); + expect(lzma_index_cat(b, c, NULL) == LZMA_OK); + expect(lzma_index_block_count(b) == 0); + expect(lzma_index_stream_size(b) == 2 * LZMA_STREAM_HEADER_SIZE + 8); + expect(lzma_index_file_size(b) + == 2 * (2 * LZMA_STREAM_HEADER_SIZE + 8) + 4); + + expect(lzma_index_stream_padding(a, 8) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_block_count(a) == 0); + expect(lzma_index_stream_size(a) == 2 * LZMA_STREAM_HEADER_SIZE + 8); + expect(lzma_index_file_size(a) + == 5 * (2 * LZMA_STREAM_HEADER_SIZE + 8) + 4 + 8); + + expect(lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)); + lzma_index_iter_rewind(&r); + expect(lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)); + lzma_index_end(a, NULL); + + // Small Indexes + a = create_small(); + lzma_vli stream_size = lzma_index_stream_size(a); + lzma_index_iter_init(&r, a); + for (int i = SMALL_COUNT; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + b = create_small(); + expect(lzma_index_stream_padding(a, 4) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_file_size(a) == stream_size * 2 + 4); + expect(lzma_index_stream_size(a) > stream_size); + expect(lzma_index_stream_size(a) < stream_size * 2); + for (int i = SMALL_COUNT; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + lzma_index_iter_rewind(&r); + for (int i = SMALL_COUNT * 2; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + b = create_small(); + c = create_small(); + expect(lzma_index_stream_padding(b, 8) == LZMA_OK); + expect(lzma_index_cat(b, c, NULL) == LZMA_OK); + expect(lzma_index_stream_padding(a, 12) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_file_size(a) == stream_size * 4 + 4 + 8 + 12); + + expect(lzma_index_block_count(a) == SMALL_COUNT * 4); + for (int i = SMALL_COUNT * 2; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + lzma_index_iter_rewind(&r); + for (int i = SMALL_COUNT * 4; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + lzma_index_end(a, NULL); + + // Mix of empty and small + a = create_empty(); + b = create_small(); + expect(lzma_index_stream_padding(a, 4) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + lzma_index_iter_init(&r, a); + for (int i = SMALL_COUNT; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + lzma_index_end(a, NULL); + + // Big Indexes + a = create_big(); + stream_size = lzma_index_stream_size(a); + b = create_big(); + expect(lzma_index_stream_padding(a, 4) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_file_size(a) == stream_size * 2 + 4); + expect(lzma_index_stream_size(a) > stream_size); + expect(lzma_index_stream_size(a) < stream_size * 2); + + b = create_big(); + c = create_big(); + expect(lzma_index_stream_padding(b, 8) == LZMA_OK); + expect(lzma_index_cat(b, c, NULL) == LZMA_OK); + expect(lzma_index_stream_padding(a, 12) == LZMA_OK); + expect(lzma_index_cat(a, b, NULL) == LZMA_OK); + expect(lzma_index_file_size(a) == stream_size * 4 + 4 + 8 + 12); + + lzma_index_iter_init(&r, a); + for (int i = BIG_COUNT * 4; i >= 0; --i) + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK) + ^ (i == 0)); + + lzma_index_end(a, NULL); + + // Test for the bug fix 3d5a99ca373a4e86faf671226ca6487febb9eeac. + // lzma_index_checks would previously only return the checks + // for the last stream that was concatenated to the index. + d = create_small(); + e = create_small(); + f = create_small(); + + lzma_stream_flags crc32_flags = { + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = LZMA_CHECK_CRC32 + }; + expect(lzma_index_stream_flags(d, &crc32_flags) == LZMA_OK); + + lzma_stream_flags crc64_flags = { + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = LZMA_CHECK_CRC64 + }; + expect(lzma_index_stream_flags(e, &crc64_flags) == LZMA_OK); + + lzma_stream_flags sha256_flags = { + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = LZMA_CHECK_SHA256 + }; + expect(lzma_index_stream_flags(f, &sha256_flags) == LZMA_OK); + + expect(lzma_index_checks(d) == (1U << LZMA_CHECK_CRC32)); + expect(lzma_index_checks(e) == (1U << LZMA_CHECK_CRC64)); + expect(lzma_index_checks(f) == (1U << LZMA_CHECK_SHA256)); + + expect(lzma_index_cat(d, e, NULL) == LZMA_OK); + expect(lzma_index_checks(d) == ((1U << LZMA_CHECK_CRC32) | + (1U << LZMA_CHECK_CRC64))); + + expect(lzma_index_cat(d, f, NULL) == LZMA_OK); + expect(lzma_index_checks(d) == ((1U << LZMA_CHECK_CRC32) | + (1U << LZMA_CHECK_CRC64) | + (1U << LZMA_CHECK_SHA256))); + + lzma_index_end(d, NULL); + +} + + +static void +test_locate(void) +{ + lzma_index *i = lzma_index_init(NULL); + expect(i != NULL); + lzma_index_iter r; + lzma_index_iter_init(&r, i); + + // Cannot locate anything from an empty Index. + expect(lzma_index_iter_locate(&r, 0)); + expect(lzma_index_iter_locate(&r, 555)); + + // One empty Record: nothing is found since there's no uncompressed + // data. + expect(lzma_index_append(i, NULL, 16, 0) == LZMA_OK); + expect(lzma_index_iter_locate(&r, 0)); + + // Non-empty Record and we can find something. + expect(lzma_index_append(i, NULL, 32, 5) == LZMA_OK); + expect(!lzma_index_iter_locate(&r, 0)); + expect(r.block.total_size == 32); + expect(r.block.uncompressed_size == 5); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16); + expect(r.block.uncompressed_file_offset == 0); + + // Still cannot find anything past the end. + expect(lzma_index_iter_locate(&r, 5)); + + // Add the third Record. + expect(lzma_index_append(i, NULL, 40, 11) == LZMA_OK); + + expect(!lzma_index_iter_locate(&r, 0)); + expect(r.block.total_size == 32); + expect(r.block.uncompressed_size == 5); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16); + expect(r.block.uncompressed_file_offset == 0); + + expect(!lzma_index_iter_next(&r, LZMA_INDEX_ITER_BLOCK)); + expect(r.block.total_size == 40); + expect(r.block.uncompressed_size == 11); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16 + 32); + expect(r.block.uncompressed_file_offset == 5); + + expect(!lzma_index_iter_locate(&r, 2)); + expect(r.block.total_size == 32); + expect(r.block.uncompressed_size == 5); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16); + expect(r.block.uncompressed_file_offset == 0); + + expect(!lzma_index_iter_locate(&r, 5)); + expect(r.block.total_size == 40); + expect(r.block.uncompressed_size == 11); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16 + 32); + expect(r.block.uncompressed_file_offset == 5); + + expect(!lzma_index_iter_locate(&r, 5 + 11 - 1)); + expect(r.block.total_size == 40); + expect(r.block.uncompressed_size == 11); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 16 + 32); + expect(r.block.uncompressed_file_offset == 5); + + expect(lzma_index_iter_locate(&r, 5 + 11)); + expect(lzma_index_iter_locate(&r, 5 + 15)); + + // Large Index + lzma_index_end(i, NULL); + i = lzma_index_init(NULL); + expect(i != NULL); + lzma_index_iter_init(&r, i); + + for (size_t n = 4; n <= 4 * 5555; n += 4) + expect(lzma_index_append(i, NULL, n + 8, n) == LZMA_OK); + + expect(lzma_index_block_count(i) == 5555); + + // First Record + expect(!lzma_index_iter_locate(&r, 0)); + expect(r.block.total_size == 4 + 8); + expect(r.block.uncompressed_size == 4); + expect(r.block.compressed_file_offset == LZMA_STREAM_HEADER_SIZE); + expect(r.block.uncompressed_file_offset == 0); + + expect(!lzma_index_iter_locate(&r, 3)); + expect(r.block.total_size == 4 + 8); + expect(r.block.uncompressed_size == 4); + expect(r.block.compressed_file_offset == LZMA_STREAM_HEADER_SIZE); + expect(r.block.uncompressed_file_offset == 0); + + // Second Record + expect(!lzma_index_iter_locate(&r, 4)); + expect(r.block.total_size == 2 * 4 + 8); + expect(r.block.uncompressed_size == 2 * 4); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + 4 + 8); + expect(r.block.uncompressed_file_offset == 4); + + // Last Record + expect(!lzma_index_iter_locate( + &r, lzma_index_uncompressed_size(i) - 1)); + expect(r.block.total_size == 4 * 5555 + 8); + expect(r.block.uncompressed_size == 4 * 5555); + expect(r.block.compressed_file_offset == lzma_index_total_size(i) + + LZMA_STREAM_HEADER_SIZE - 4 * 5555 - 8); + expect(r.block.uncompressed_file_offset + == lzma_index_uncompressed_size(i) - 4 * 5555); + + // Allocation chunk boundaries. See INDEX_GROUP_SIZE in + // liblzma/common/index.c. + const size_t group_multiple = 256 * 4; + const size_t radius = 8; + const size_t start = group_multiple - radius; + lzma_vli ubase = 0; + lzma_vli tbase = 0; + size_t n; + for (n = 1; n < start; ++n) { + ubase += n * 4; + tbase += n * 4 + 8; + } + + while (n < start + 2 * radius) { + expect(!lzma_index_iter_locate(&r, ubase + n * 4)); + + expect(r.block.compressed_file_offset == tbase + n * 4 + 8 + + LZMA_STREAM_HEADER_SIZE); + expect(r.block.uncompressed_file_offset == ubase + n * 4); + + tbase += n * 4 + 8; + ubase += n * 4; + ++n; + + expect(r.block.total_size == n * 4 + 8); + expect(r.block.uncompressed_size == n * 4); + } + + // Do it also backwards. + while (n > start) { + expect(!lzma_index_iter_locate(&r, ubase + (n - 1) * 4)); + + expect(r.block.total_size == n * 4 + 8); + expect(r.block.uncompressed_size == n * 4); + + --n; + tbase -= n * 4 + 8; + ubase -= n * 4; + + expect(r.block.compressed_file_offset == tbase + n * 4 + 8 + + LZMA_STREAM_HEADER_SIZE); + expect(r.block.uncompressed_file_offset == ubase + n * 4); + } + + // Test locating in concatenated Index. + lzma_index_end(i, NULL); + i = lzma_index_init(NULL); + expect(i != NULL); + lzma_index_iter_init(&r, i); + for (n = 0; n < group_multiple; ++n) + expect(lzma_index_append(i, NULL, 8, 0) == LZMA_OK); + expect(lzma_index_append(i, NULL, 16, 1) == LZMA_OK); + expect(!lzma_index_iter_locate(&r, 0)); + expect(r.block.total_size == 16); + expect(r.block.uncompressed_size == 1); + expect(r.block.compressed_file_offset + == LZMA_STREAM_HEADER_SIZE + group_multiple * 8); + expect(r.block.uncompressed_file_offset == 0); + + lzma_index_end(i, NULL); +} + + +static void +test_corrupt(void) +{ +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) + const size_t alloc_size = 128 * 1024; + uint8_t *buf = malloc(alloc_size); + expect(buf != NULL); + lzma_stream strm = LZMA_STREAM_INIT; + + lzma_index *i = create_empty(); + expect(lzma_index_append(i, NULL, 0, 1) == LZMA_PROG_ERROR); + lzma_index_end(i, NULL); + + // Create a valid Index and corrupt it in different ways. + i = create_small(); + expect(lzma_index_encoder(&strm, i) == LZMA_OK); + succeed(coder_loop(&strm, NULL, 0, buf, 20, + LZMA_STREAM_END, LZMA_RUN)); + lzma_index_end(i, NULL); + + // Wrong Index Indicator + buf[0] ^= 1; + expect(lzma_index_decoder(&strm, &i, MEMLIMIT) == LZMA_OK); + succeed(decoder_loop_ret(&strm, buf, 1, LZMA_DATA_ERROR)); + buf[0] ^= 1; + + // Wrong Number of Records and thus CRC32 fails. + --buf[1]; + expect(lzma_index_decoder(&strm, &i, MEMLIMIT) == LZMA_OK); + succeed(decoder_loop_ret(&strm, buf, 10, LZMA_DATA_ERROR)); + ++buf[1]; + + // Padding not NULs + buf[15] ^= 1; + expect(lzma_index_decoder(&strm, &i, MEMLIMIT) == LZMA_OK); + succeed(decoder_loop_ret(&strm, buf, 16, LZMA_DATA_ERROR)); + + lzma_end(&strm); + free(buf); +#endif +} + + +// Allocator that succeeds for the first two allocation but fails the rest. +static void * +my_alloc(void *opaque, size_t a, size_t b) +{ + (void)opaque; + + static unsigned count = 0; + if (++count > 2) + return NULL; + + return malloc(a * b); +} + +static const lzma_allocator my_allocator = { &my_alloc, NULL, NULL }; + + +int +main(void) +{ + test_equal(); + + test_overflow(); + + lzma_index *i = create_empty(); + test_many(i); + lzma_index_end(i, NULL); + + i = create_small(); + test_many(i); + lzma_index_end(i, NULL); + + i = create_big(); + test_many(i); + lzma_index_end(i, NULL); + + test_cat(); + + test_locate(); + + test_corrupt(); + + // Test for the bug fix 21515d79d778b8730a434f151b07202d52a04611: + // liblzma: Fix lzma_index_dup() for empty Streams. + i = create_empty(); + expect(lzma_index_stream_padding(i, 4) == LZMA_OK); + test_copy(i); + lzma_index_end(i, NULL); + + // Test for the bug fix 3bf857edfef51374f6f3fffae3d817f57d3264a0: + // liblzma: Fix a memory leak in error path of lzma_index_dup(). + // Use Valgrind to see that there are no leaks. + i = create_small(); + expect(lzma_index_dup(i, &my_allocator) == NULL); + lzma_index_end(i, NULL); + + return 0; +} diff --git a/tests/test_index_hash.c b/tests/test_index_hash.c new file mode 100644 index 0000000..f3c6e8f --- /dev/null +++ b/tests/test_index_hash.c @@ -0,0 +1,386 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_index_hash.c +/// \brief Tests src/liblzma/common/index_hash.c API functions +/// +/// \note No test included for lzma_index_hash_end since it +/// would be trivial unless tested for memory leaks +/// with something like valgrind +// +// Author: Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + +// Needed for UNPADDED_SIZE_MIN and UNPADDED_SIZE_MAX macro definitions +// and index_size and vli_ceil4 helper functions +#include "common/index.h" + + +static void +test_lzma_index_hash_init(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + // First test with NULL index_hash. + // This should create a fresh index_hash. + lzma_index_hash *index_hash = lzma_index_hash_init(NULL, NULL); + assert_true(index_hash != NULL); + + // Next test with non-NULL index_hash. + lzma_index_hash *second_hash = lzma_index_hash_init(index_hash, NULL); + + // It should not create a new index_hash pointer. + // Instead it must just re-init the first index_hash. + assert_true(index_hash == second_hash); + + lzma_index_hash_end(index_hash, NULL); +#endif +} + + +static void +test_lzma_index_hash_append(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + // Test all invalid parameters + assert_lzma_ret(lzma_index_hash_append(NULL, 0, 0), + LZMA_PROG_ERROR); + + // Test NULL index_hash + assert_lzma_ret(lzma_index_hash_append(NULL, UNPADDED_SIZE_MIN, + LZMA_VLI_MAX), LZMA_PROG_ERROR); + + // Test with invalid Unpadded Size + lzma_index_hash *index_hash = lzma_index_hash_init(NULL, NULL); + assert_true(index_hash != NULL); + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN - 1, LZMA_VLI_MAX), + LZMA_PROG_ERROR); + + // Test with invalid Uncompressed Size + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN, LZMA_VLI_MAX + 1), + LZMA_PROG_ERROR); + + // First append a Record describing a small Block. + // This should succeed. + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN, 1), LZMA_OK); + + // Append another small Record. + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN, 1), LZMA_OK); + + // Append a Record that would cause the compressed size to grow + // too big + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MAX, 1), LZMA_DATA_ERROR); + + lzma_index_hash_end(index_hash, NULL); +#endif +} + + +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +// Fill an index_hash with unpadded and uncompressed VLIs +// by calling lzma_index_hash_append +static void +fill_index_hash(lzma_index_hash *index_hash, const lzma_vli *unpadded_sizes, + const lzma_vli *uncomp_sizes, uint32_t block_count) +{ + for (uint32_t i = 0; i < block_count; ++i) + assert_lzma_ret(lzma_index_hash_append(index_hash, + unpadded_sizes[i], uncomp_sizes[i]), LZMA_OK); +} + + +// Set the contents of buf to the expected Index based on the +// .xz specification. This needs the unpadded and uncompressed VLIs +// to correctly create the Index. +static void +generate_index(uint8_t *buf, const lzma_vli *unpadded_sizes, + const lzma_vli *uncomp_sizes, uint32_t block_count, + size_t index_max_size) +{ + size_t in_pos = 0; + size_t out_pos = 0; + + // First set Index Indicator + buf[out_pos++] = INDEX_INDICATOR; + + // Next write out Number of Records + assert_lzma_ret(lzma_vli_encode(block_count, &in_pos, buf, + &out_pos, index_max_size), LZMA_STREAM_END); + + // Next write out each Record. + // A Record consists of Unpadded Size and Uncompressed Size + // written next to each other as VLIs. + for (uint32_t i = 0; i < block_count; ++i) { + in_pos = 0; + assert_lzma_ret(lzma_vli_encode(unpadded_sizes[i], &in_pos, + buf, &out_pos, index_max_size), LZMA_STREAM_END); + in_pos = 0; + assert_lzma_ret(lzma_vli_encode(uncomp_sizes[i], &in_pos, + buf, &out_pos, index_max_size), LZMA_STREAM_END); + } + + // Add Index Padding + lzma_vli rounded_out_pos = vli_ceil4(out_pos); + memzero(buf + out_pos, rounded_out_pos - out_pos); + out_pos = rounded_out_pos; + + // Add the CRC32 + write32le(buf + out_pos, lzma_crc32(buf, out_pos, 0)); + out_pos += 4; + + assert_uint_eq(out_pos, index_max_size); +} +#endif + + +static void +test_lzma_index_hash_decode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + lzma_index_hash *index_hash = lzma_index_hash_init(NULL, NULL); + assert_true(index_hash != NULL); + + size_t in_pos = 0; + + // Six valid values for the Unpadded Size fields in an Index + const lzma_vli unpadded_sizes[6] = { + UNPADDED_SIZE_MIN, + 1000, + 4000, + 8000, + 16000, + 32000 + }; + + // Six valid values for the Uncompressed Size fields in an Index + const lzma_vli uncomp_sizes[6] = { + 1, + 500, + 8000, + 20, + 1, + 500 + }; + + // Add two Records to an index_hash + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 2); + + const lzma_vli size_two_records = lzma_index_hash_size(index_hash); + assert_uint(size_two_records, >, 0); + uint8_t *index_two_records = tuktest_malloc(size_two_records); + + generate_index(index_two_records, unpadded_sizes, uncomp_sizes, 2, + size_two_records); + + // First test for basic buffer size error + in_pos = size_two_records + 1; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_two_records, &in_pos, + size_two_records), LZMA_BUF_ERROR); + + // Next test for invalid Index Indicator + in_pos = 0; + index_two_records[0] ^= 1; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_two_records, &in_pos, + size_two_records), LZMA_DATA_ERROR); + index_two_records[0] ^= 1; + + // Next verify the index_hash as expected + in_pos = 0; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_two_records, &in_pos, + size_two_records), LZMA_STREAM_END); + + // Next test an index_hash with three Records + index_hash = lzma_index_hash_init(index_hash, NULL); + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 3); + + const lzma_vli size_three_records = lzma_index_hash_size( + index_hash); + assert_uint(size_three_records, >, 0); + uint8_t *index_three_records = tuktest_malloc(size_three_records); + + generate_index(index_three_records, unpadded_sizes, uncomp_sizes, + 3, size_three_records); + + in_pos = 0; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_three_records, &in_pos, + size_three_records), LZMA_STREAM_END); + + // Next test an index_hash with five Records + index_hash = lzma_index_hash_init(index_hash, NULL); + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 5); + + const lzma_vli size_five_records = lzma_index_hash_size( + index_hash); + assert_uint(size_five_records, >, 0); + uint8_t *index_five_records = tuktest_malloc(size_five_records); + + generate_index(index_five_records, unpadded_sizes, uncomp_sizes, 5, + size_five_records); + + // Instead of testing all input at once, give input + // one byte at a time + in_pos = 0; + for (lzma_vli i = 0; i < size_five_records - 1; ++i) { + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_five_records, &in_pos, in_pos + 1), + LZMA_OK); + } + + // Last byte should return LZMA_STREAM_END + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_five_records, &in_pos, + in_pos + 1), LZMA_STREAM_END); + + // Next test if the index_hash is given an incorrect Unpadded + // Size. Should detect and report LZMA_DATA_ERROR + index_hash = lzma_index_hash_init(index_hash, NULL); + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 5); + // The sixth Record will have an invalid Unpadded Size + assert_lzma_ret(lzma_index_hash_append(index_hash, + unpadded_sizes[5] + 1, + uncomp_sizes[5]), LZMA_OK); + + const lzma_vli size_six_records = lzma_index_hash_size( + index_hash); + + assert_uint(size_six_records, >, 0); + uint8_t *index_six_records = tuktest_malloc(size_six_records); + + generate_index(index_six_records, unpadded_sizes, uncomp_sizes, 6, + size_six_records); + in_pos = 0; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_six_records, &in_pos, + size_six_records), LZMA_DATA_ERROR); + + // Next test if the Index is corrupt (invalid CRC32). + // Should detect and report LZMA_DATA_ERROR + index_hash = lzma_index_hash_init(index_hash, NULL); + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 2); + + index_two_records[size_two_records - 1] ^= 1; + + in_pos = 0; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_two_records, &in_pos, + size_two_records), LZMA_DATA_ERROR); + + // Next test with Index and index_hash struct not matching + // a Record + index_hash = lzma_index_hash_init(index_hash, NULL); + fill_index_hash(index_hash, unpadded_sizes, uncomp_sizes, 2); + // Recalculate Index with invalid Unpadded Size + const lzma_vli unpadded_sizes_invalid[2] = { + unpadded_sizes[0], + unpadded_sizes[1] + 1 + }; + + generate_index(index_two_records, unpadded_sizes_invalid, + uncomp_sizes, 2, size_two_records); + + in_pos = 0; + assert_lzma_ret(lzma_index_hash_decode(index_hash, + index_two_records, &in_pos, + size_two_records), LZMA_DATA_ERROR); + + lzma_index_hash_end(index_hash, NULL); +#endif +} + + +static void +test_lzma_index_hash_size(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + lzma_index_hash *index_hash = lzma_index_hash_init(NULL, NULL); + assert_true(index_hash != NULL); + + // First test empty index_hash + // Expected size should be: + // Index Indicator - 1 byte + // Number of Records - 1 byte + // List of Records - 0 bytes + // Index Padding - 2 bytes + // CRC32 - 4 bytes + // Total - 8 bytes + assert_uint_eq(lzma_index_hash_size(index_hash), 8); + + // Append a Record describing a small Block to the index_hash + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN, 1), LZMA_OK); + + // Expected size should be: + // Index Indicator - 1 byte + // Number of Records - 1 byte + // List of Records - 2 bytes + // Index Padding - 0 bytes + // CRC32 - 4 bytes + // Total - 8 bytes + lzma_vli expected_size = 8; + assert_uint_eq(lzma_index_hash_size(index_hash), expected_size); + + // Append additional small Record + assert_lzma_ret(lzma_index_hash_append(index_hash, + UNPADDED_SIZE_MIN, 1), LZMA_OK); + + // Expected size should be: + // Index Indicator - 1 byte + // Number of Records - 1 byte + // List of Records - 4 bytes + // Index Padding - 2 bytes + // CRC32 - 4 bytes + // Total - 12 bytes + expected_size = 12; + assert_uint_eq(lzma_index_hash_size(index_hash), expected_size); + + // Append a larger Record to the index_hash (3 bytes for each VLI) + const lzma_vli three_byte_vli = 0x10000; + assert_lzma_ret(lzma_index_hash_append(index_hash, + three_byte_vli, three_byte_vli), LZMA_OK); + + // Expected size should be: + // Index Indicator - 1 byte + // Number of Records - 1 byte + // List of Records - 10 bytes + // Index Padding - 0 bytes + // CRC32 - 4 bytes + // Total - 16 bytes + expected_size = 16; + assert_uint_eq(lzma_index_hash_size(index_hash), expected_size); + + lzma_index_hash_end(index_hash, NULL); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + tuktest_run(test_lzma_index_hash_init); + tuktest_run(test_lzma_index_hash_append); + tuktest_run(test_lzma_index_hash_decode); + tuktest_run(test_lzma_index_hash_size); + return tuktest_end(); +} diff --git a/tests/test_lzip_decoder.c b/tests/test_lzip_decoder.c new file mode 100644 index 0000000..306de74 --- /dev/null +++ b/tests/test_lzip_decoder.c @@ -0,0 +1,475 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_lzip_decoder.c +/// \brief Tests decoding lzip data +// +// Author: Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + +#ifdef HAVE_LZIP_DECODER + +// Memlimit large enough to pass all of the test files +#define MEMLIMIT (1U << 20) +#define DECODE_CHUNK_SIZE 1024 + + +// The uncompressed data in the test files are short US-ASCII strings. +// The tests check if the decompressed output is what it is expected to be. +// Storing the strings here as text would break the tests on EBCDIC systems +// and storing the strings as an array of hex values is inconvenient, so +// store the CRC32 values of the expected data instead. +// +// CRC32 value of "Hello\nWorld\n" +static const uint32_t hello_world_crc = 0x15A2A343; + +// CRC32 value of "Trailing garbage\n" +static const uint32_t trailing_garbage_crc = 0x87081A60; + + +// Helper function to decode a good file with no flags and plenty high memlimit +static void +basic_lzip_decode(const char *src, const uint32_t expected_crc) { + size_t file_size; + uint8_t *data = tuktest_file_from_srcdir(src, &file_size); + uint32_t checksum = 0; + + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, 0), LZMA_OK); + + uint8_t *output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + + strm.next_in = data; + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + + // Feed 1 byte at a time to the decoder to look for any bugs + // when switching between decoding sequences + lzma_ret ret = LZMA_OK; + while (ret == LZMA_OK) { + strm.avail_in = 1; + ret = lzma_code(&strm, LZMA_RUN); + if (strm.avail_out == 0) { + checksum = lzma_crc32(output_buffer, + strm.next_out - output_buffer, + checksum); + // No need to free output_buffer because it will + // automatically be freed at the end of the test by + // tuktest. + output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + } + } + + assert_lzma_ret(ret, LZMA_STREAM_END); + assert_uint_eq(strm.total_in, file_size); + + checksum = lzma_crc32(output_buffer, strm.next_out - output_buffer, + checksum); + assert_uint_eq(checksum, expected_crc); + + lzma_end(&strm); +} + + +static void +test_options(void) +{ + // Test NULL stream + assert_lzma_ret(lzma_lzip_decoder(NULL, MEMLIMIT, 0), + LZMA_PROG_ERROR); + + // Test invalid flags + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, UINT32_MAX), + LZMA_OPTIONS_ERROR); + // Memlimit tests are done elsewhere +} + + +static void +test_v0_decode(void) { + // This tests if liblzma can decode lzip version 0 files. + // lzip 1.17 and older can decompress this, but lzip 1.18 + // and newer can no longer decode these files. + basic_lzip_decode("files/good-1-v0.lz", hello_world_crc); +} + + +static void +test_v1_decode(void) { + // This tests decoding a basic lzip v1 file + basic_lzip_decode("files/good-1-v1.lz", hello_world_crc); +} + + +// Helper function to decode a good file with trailing bytes after +// the lzip stream +static void +trailing_helper(const char *src, const uint32_t expected_data_checksum, + const uint32_t expected_trailing_checksum) { + size_t file_size; + uint32_t checksum = 0; + uint8_t *data = tuktest_file_from_srcdir(src, &file_size); + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + uint8_t *output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + + strm.next_in = data; + strm.next_out = output_buffer; + strm.avail_in = file_size; + strm.avail_out = DECODE_CHUNK_SIZE; + + lzma_ret ret = LZMA_OK; + while (ret == LZMA_OK) { + ret = lzma_code(&strm, LZMA_RUN); + if (strm.avail_out == 0) { + checksum = lzma_crc32(output_buffer, + strm.next_out - output_buffer, + checksum); + // No need to free output_buffer because it will + // automatically be freed at the end of the test by + // tuktest. + output_buffer = tuktest_malloc(DECODE_CHUNK_SIZE); + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + } + } + + assert_lzma_ret(ret, LZMA_STREAM_END); + assert_uint(strm.total_in, <, file_size); + + checksum = lzma_crc32(output_buffer, + strm.next_out - output_buffer, + checksum); + + assert_uint_eq(checksum, expected_data_checksum); + + // Trailing data should be readable from strm.next_in + checksum = lzma_crc32(strm.next_in, strm.avail_in, 0); + assert_uint_eq(checksum, expected_trailing_checksum); + + lzma_end(&strm); +} + + +// Helper function to decode a bad file and compare to returned error to +// what the caller expects +static void +decode_expect_error(const char *src, lzma_ret expected_error) +{ + lzma_stream strm = LZMA_STREAM_INIT; + size_t file_size; + uint8_t *data = tuktest_file_from_srcdir(src, &file_size); + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + uint8_t output_buffer[DECODE_CHUNK_SIZE]; + + strm.avail_in = file_size; + strm.next_in = data; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + lzma_ret ret = LZMA_OK; + + while (ret == LZMA_OK) { + // Discard output since we are only looking for errors + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + if (strm.avail_in == 0) + ret = lzma_code(&strm, LZMA_FINISH); + else + ret = lzma_code(&strm, LZMA_RUN); + } + + assert_lzma_ret(ret, expected_error); + lzma_end(&strm); +} + + +static void +test_v0_trailing(void) { + trailing_helper("files/good-1-v0-trailing-1.lz", hello_world_crc, + trailing_garbage_crc); +} + + +static void +test_v1_trailing(void) { + trailing_helper("files/good-1-v1-trailing-1.lz", hello_world_crc, + trailing_garbage_crc); + + // The second files/good-1-v1-trailing-2.lz will have the same + // expected output and trailing output as + // files/good-1-v1-trailing-1.lz, but this tests if the prefix + // to the trailing data contains lzip magic bytes. + // When this happens, the expected behavior is to silently ignore + // the magic byte prefix and consume it from the input file. + trailing_helper("files/good-1-v1-trailing-2.lz", hello_world_crc, + trailing_garbage_crc); + + // Expect LZMA_BUF error if a file ends with the lzip magic bytes + // but does not contain any data after + decode_expect_error("files/bad-1-v1-trailing-magic.lz", + LZMA_BUF_ERROR); +} + + +static void +test_concatentated(void) +{ + // First test a file with one v0 member and one v1 member + // The first member should contain "Hello\n" and + // the second member should contain "World!\n" + + lzma_stream strm = LZMA_STREAM_INIT; + size_t file_size; + uint8_t *v0_v1 = tuktest_file_from_srcdir("files/good-2-v0-v1.lz", + &file_size); + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + uint8_t output_buffer[DECODE_CHUNK_SIZE]; + + strm.avail_in = file_size; + strm.next_in = v0_v1; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + + assert_uint_eq(strm.total_in, file_size); + + uint32_t checksum = lzma_crc32(output_buffer, strm.total_out, 0); + assert_uint_eq(checksum, hello_world_crc); + + // The second file contains one v1 member and one v2 member + uint8_t *v1_v0 = tuktest_file_from_srcdir("files/good-2-v1-v0.lz", + &file_size); + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + strm.avail_in = file_size; + strm.next_in = v1_v0; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + + assert_uint_eq(strm.total_in, file_size); + checksum = lzma_crc32(output_buffer, strm.total_out, 0); + assert_uint_eq(checksum, hello_world_crc); + + // The third file contains 2 v1 members + uint8_t *v1_v1 = tuktest_file_from_srcdir("files/good-2-v1-v1.lz", + &file_size); + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + strm.avail_in = file_size; + strm.next_in = v1_v1; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + + assert_uint_eq(strm.total_in, file_size); + checksum = lzma_crc32(output_buffer, strm.total_out, 0); + assert_uint_eq(checksum, hello_world_crc); + + lzma_end(&strm); +} + + +static void +test_crc(void) { + // Test invalid checksum + lzma_stream strm = LZMA_STREAM_INIT; + size_t file_size; + uint8_t *data = tuktest_file_from_srcdir("files/bad-1-v1-crc32.lz", + &file_size); + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED), LZMA_OK); + + uint8_t output_buffer[DECODE_CHUNK_SIZE]; + + strm.avail_in = file_size; + strm.next_in = data; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_DATA_ERROR); + + // Test ignoring the checksum value - should decode successfully + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED | LZMA_IGNORE_CHECK), LZMA_OK); + + strm.avail_in = file_size; + strm.next_in = data; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + assert_uint_eq(strm.total_in, file_size); + + // Test tell check + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, + LZMA_CONCATENATED | LZMA_TELL_ANY_CHECK), LZMA_OK); + + strm.avail_in = file_size; + strm.next_in = data; + strm.avail_out = DECODE_CHUNK_SIZE; + strm.next_out = output_buffer; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_GET_CHECK); + assert_uint_eq(lzma_get_check(&strm), LZMA_CHECK_CRC32); + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_DATA_ERROR); + lzma_end(&strm); +} + + +static void +test_invalid_magic_bytes(void) { + uint8_t lzip_id_string[] = { 0x4C, 0x5A, 0x49, 0x50 }; + lzma_stream strm = LZMA_STREAM_INIT; + + for (uint32_t i = 0; i < ARRAY_SIZE(lzip_id_string); i++) { + // Corrupt magic bytes + lzip_id_string[i] ^= 1; + uint8_t output_buffer[DECODE_CHUNK_SIZE]; + + assert_lzma_ret(lzma_lzip_decoder(&strm, MEMLIMIT, 0), + LZMA_OK); + + strm.next_in = lzip_id_string; + strm.avail_in = sizeof(lzip_id_string); + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + + assert_lzma_ret(lzma_code(&strm, LZMA_RUN), + LZMA_FORMAT_ERROR); + + // Reset magic bytes + lzip_id_string[i] ^= 1; + } + + lzma_end(&strm); +} + + +static void +test_invalid_version(void) +{ + // The file contains a version number that is not 0 or 1, + // so it should cause an error + decode_expect_error("files/unsupported-1-v234.lz", + LZMA_OPTIONS_ERROR); +} + + +static void +test_invalid_dictionary_size(void) { + // First file has too small dictionary size field + decode_expect_error("files/bad-1-v1-dict-1.lz", LZMA_DATA_ERROR); + + // Second file has too large dictionary size field + decode_expect_error("files/bad-1-v1-dict-2.lz", LZMA_DATA_ERROR); +} + + +static void +test_invalid_uncomp_size(void) { + // Test invalid v0 lzip file uncomp size + decode_expect_error("files/bad-1-v0-uncomp-size.lz", + LZMA_DATA_ERROR); + + // Test invalid v1 lzip file uncomp size + decode_expect_error("files/bad-1-v1-uncomp-size.lz", + LZMA_DATA_ERROR); +} + + +static void +test_invalid_member_size(void) { + decode_expect_error("files/bad-1-v1-member-size.lz", + LZMA_DATA_ERROR); +} + + +static void +test_invalid_memlimit(void) { + // A very low memlimit should prevent decoding. + // Should be able to update the memlimit after failing + size_t file_size; + uint8_t *data = tuktest_file_from_srcdir("files/good-1-v1.lz", + &file_size); + + uint8_t output_buffer[DECODE_CHUNK_SIZE]; + + lzma_stream strm = LZMA_STREAM_INIT; + + assert_lzma_ret(lzma_lzip_decoder(&strm, 1, 0), LZMA_OK); + + strm.next_in = data; + strm.avail_in = file_size; + strm.next_out = output_buffer; + strm.avail_out = DECODE_CHUNK_SIZE; + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_MEMLIMIT_ERROR); + + // Up the memlimit so decoding can continue. + // First only increase by a small amount and expect an error + assert_lzma_ret(lzma_memlimit_set(&strm, 100), LZMA_MEMLIMIT_ERROR); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT), LZMA_OK); + + // Finish decoding + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + + assert_uint_eq(strm.total_in, file_size); + uint32_t checksum = lzma_crc32(output_buffer, strm.total_out, 0); + assert_uint_eq(checksum, hello_world_crc); + + lzma_end(&strm); +} +#endif + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + +#ifndef HAVE_LZIP_DECODER + tuktest_early_skip("lzip decoder disabled"); +#else + tuktest_run(test_options); + tuktest_run(test_v0_decode); + tuktest_run(test_v1_decode); + tuktest_run(test_v0_trailing); + tuktest_run(test_v1_trailing); + tuktest_run(test_concatentated); + tuktest_run(test_crc); + tuktest_run(test_invalid_magic_bytes); + tuktest_run(test_invalid_version); + tuktest_run(test_invalid_dictionary_size); + tuktest_run(test_invalid_uncomp_size); + tuktest_run(test_invalid_member_size); + tuktest_run(test_invalid_memlimit); + return tuktest_end(); +#endif + +} diff --git a/tests/test_memlimit.c b/tests/test_memlimit.c new file mode 100644 index 0000000..c45a44b --- /dev/null +++ b/tests/test_memlimit.c @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_memlimit.c +/// \brief Tests memory usage limit in decoders +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" +#include "mythread.h" + + +#define MEMLIMIT_TOO_LOW 1234U +#define MEMLIMIT_HIGH_ENOUGH (2U << 20) + + +static uint8_t *in; +static size_t in_size; + +#ifdef HAVE_DECODERS +static uint8_t out[8192]; +#endif + + +static void +test_memlimit_stream_decoder(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_stream_decoder(&strm, MEMLIMIT_TOO_LOW, 0), + LZMA_OK); + + strm.next_in = in; + strm.avail_in = in_size; + strm.next_out = out; + strm.avail_out = sizeof(out); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_MEMLIMIT_ERROR); + + assert_uint_eq(lzma_memlimit_get(&strm), MEMLIMIT_TOO_LOW); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_TOO_LOW + 1), + LZMA_MEMLIMIT_ERROR); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_HIGH_ENOUGH), + LZMA_OK); + + // This fails before commit 660739f99ab211edec4071de98889fb32ed04e98 + // (liblzma <= 5.2.6, liblzma <= 5.3.3alpha). It was fixed in 5.2.7. + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + + lzma_end(&strm); +#endif +} + + +static void +test_memlimit_stream_decoder_mt(void) +{ +#ifndef MYTHREAD_ENABLED + assert_skip("Threading support disabled"); +#elif !defined(HAVE_DECODERS) + assert_skip("Decoder support disabled"); +#else + lzma_stream strm = LZMA_STREAM_INIT; + lzma_mt mt = { + .flags = 0, + .threads = 1, + .timeout = 0, + .memlimit_threading = 0, + .memlimit_stop = MEMLIMIT_TOO_LOW, + }; + + assert_lzma_ret(lzma_stream_decoder_mt(&strm, &mt), LZMA_OK); + + strm.next_in = in; + strm.avail_in = in_size; + strm.next_out = out; + strm.avail_out = sizeof(out); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_MEMLIMIT_ERROR); + + assert_uint_eq(lzma_memlimit_get(&strm), MEMLIMIT_TOO_LOW); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_TOO_LOW + 1), + LZMA_MEMLIMIT_ERROR); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_HIGH_ENOUGH), + LZMA_OK); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + lzma_end(&strm); +#endif +} + + +static void +test_memlimit_alone_decoder(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + size_t alone_size; + uint8_t *alone_buf = tuktest_file_from_srcdir( + "files/good-unknown_size-with_eopm.lzma", &alone_size); + + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_alone_decoder(&strm, MEMLIMIT_TOO_LOW), LZMA_OK); + + strm.next_in = alone_buf; + strm.avail_in = alone_size; + strm.next_out = out; + strm.avail_out = sizeof(out); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_MEMLIMIT_ERROR); + + assert_uint_eq(lzma_memlimit_get(&strm), MEMLIMIT_TOO_LOW); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_TOO_LOW + 1), + LZMA_MEMLIMIT_ERROR); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_HIGH_ENOUGH), + LZMA_OK); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + lzma_end(&strm); +#endif +} + + +static void +test_memlimit_auto_decoder(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + lzma_stream strm = LZMA_STREAM_INIT; + assert_lzma_ret(lzma_auto_decoder(&strm, MEMLIMIT_TOO_LOW, 0), + LZMA_OK); + + strm.next_in = in; + strm.avail_in = in_size; + strm.next_out = out; + strm.avail_out = sizeof(out); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_MEMLIMIT_ERROR); + + assert_uint_eq(lzma_memlimit_get(&strm), MEMLIMIT_TOO_LOW); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_TOO_LOW + 1), + LZMA_MEMLIMIT_ERROR); + assert_lzma_ret(lzma_memlimit_set(&strm, MEMLIMIT_HIGH_ENOUGH), + LZMA_OK); + + assert_lzma_ret(lzma_code(&strm, LZMA_FINISH), LZMA_STREAM_END); + lzma_end(&strm); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + + in = tuktest_file_from_srcdir("files/good-1-check-crc32.xz", &in_size); + + tuktest_run(test_memlimit_stream_decoder); + tuktest_run(test_memlimit_stream_decoder_mt); + tuktest_run(test_memlimit_alone_decoder); + tuktest_run(test_memlimit_auto_decoder); + + return tuktest_end(); +} diff --git a/tests/test_scripts.sh b/tests/test_scripts.sh new file mode 100644 index 0000000..ee82361 --- /dev/null +++ b/tests/test_scripts.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +############################################################################### +# +# Author: Jonathan Nieder +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################### + +# If scripts weren't built, this test is skipped. +XZ=../src/xz/xz +XZDIFF=../src/scripts/xzdiff +XZGREP=../src/scripts/xzgrep + +for i in XZ XZDIFF XZGREP; do + eval test -x "\$$i" && continue + exit 77 +done + +# If decompression support is missing, this test is skipped. +# Installing the scripts in this case is a bit silly but they +# could still be used with other decompression tools so configure +# doesn't automatically disable scripts if decoders are disabled. +if grep 'define HAVE_DECODERS' ../config.h > /dev/null ; then + : +else + echo "Decompression support is disabled, skipping this test." + exit 77 +fi + +PATH=`pwd`/../src/xz:$PATH +export PATH + +test -z "$srcdir" && srcdir=. +preimage=$srcdir/files/good-1-check-crc32.xz +samepostimage=$srcdir/files/good-1-check-crc64.xz +otherpostimage=$srcdir/files/good-1-lzma2-1.xz + +"$XZDIFF" "$preimage" "$samepostimage" >/dev/null +status=$? +if test "$status" != 0 ; then + echo "xzdiff with no changes exited with status $status != 0" + exit 1 +fi + +"$XZDIFF" "$preimage" "$otherpostimage" >/dev/null +status=$? +if test "$status" != 1 ; then + echo "xzdiff with changes exited with status $status != 1" + exit 1 +fi + +"$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1 +status=$? +if test "$status" != 2 ; then + echo "xzdiff with missing operand exited with status $status != 2" + exit 1 +fi + +# The exit status must be 0 when a match was found at least from one file, +# and 1 when no match was found in any file. +cp "$srcdir/files/good-1-lzma2-1.xz" xzgrep_test_1.xz +cp "$srcdir/files/good-2-lzma2.xz" xzgrep_test_2.xz +for pattern in el Hello NOMATCH; do + for opts in "" "-l" "-h" "-H"; do + echo "=> xzgrep $opts $pattern <=" + "$XZGREP" $opts $pattern xzgrep_test_1.xz xzgrep_test_2.xz + echo retval $? + done +done > xzgrep_test_output 2>&1 + +if cmp -s "$srcdir/xzgrep_expected_output" xzgrep_test_output ; then + : +else + echo "unexpected output from xzgrep" + exit 1 +fi + +exit 0 diff --git a/tests/test_stream_flags.c b/tests/test_stream_flags.c new file mode 100644 index 0000000..b8ec546 --- /dev/null +++ b/tests/test_stream_flags.c @@ -0,0 +1,479 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_stream_flags.c +/// \brief Tests Stream Header and Stream Footer coders +// +// Authors: Jia Tan +// Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + + +// Size of the Stream Flags field +// (taken from src/liblzma/common/stream_flags_common.h) +#define XZ_STREAM_FLAGS_SIZE 2 + +#ifdef HAVE_ENCODERS +// Header and footer magic bytes for .xz file format +// (taken from src/liblzma/common/stream_flags_common.c) +static const uint8_t xz_header_magic[6] + = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 }; +static const uint8_t xz_footer_magic[2] = { 0x59, 0x5A }; +#endif + + +#ifdef HAVE_ENCODERS +static void +stream_header_encode_helper(lzma_check check) +{ + lzma_stream_flags flags = { + .version = 0, + .check = check, + }; + + uint8_t header[LZMA_STREAM_HEADER_SIZE]; + + // Encode Stream Header + assert_lzma_ret(lzma_stream_header_encode(&flags, header), LZMA_OK); + + // Stream Header must start with Header Magic Bytes + const uint32_t magic_size = sizeof(xz_header_magic); + assert_array_eq(header, xz_header_magic, magic_size); + + // Next must come Stream Flags + const uint8_t *encoded_stream_flags = header + magic_size; + + // First byte is always null-byte. + // Second byte must have the Check ID in the lowest four bits + // and the highest four bits zero. + const uint8_t expected_stream_flags[] = { 0, check }; + assert_array_eq(encoded_stream_flags, expected_stream_flags, + XZ_STREAM_FLAGS_SIZE); + + // Last part is the CRC32 of the Stream Flags + const uint8_t *crc_ptr = encoded_stream_flags + XZ_STREAM_FLAGS_SIZE; + const uint32_t expected_crc = lzma_crc32(expected_stream_flags, + XZ_STREAM_FLAGS_SIZE, 0); + assert_uint_eq(read32le(crc_ptr), expected_crc); +} +#endif + + +static void +test_lzma_stream_header_encode(void) +{ +#ifndef HAVE_ENCODERS + assert_skip("Encoder support disabled"); +#else + for (int i = 0; i < LZMA_CHECK_ID_MAX; i++) + stream_header_encode_helper(i); + + lzma_stream_flags flags = { + .version = 0, + .check = LZMA_CHECK_CRC32 + }; + + uint8_t header[LZMA_STREAM_HEADER_SIZE]; + + // Should fail if version > 0 + flags.version = 1; + assert_lzma_ret(lzma_stream_header_encode(&flags, header), + LZMA_OPTIONS_ERROR); + flags.version = 0; + + // Should fail if Check ID is invalid + flags.check = LZMA_CHECK_ID_MAX + 1; + assert_lzma_ret(lzma_stream_header_encode(&flags, header), + LZMA_PROG_ERROR); + flags.check = LZMA_CHECK_CRC32; + + // Should pass even if Backward Size is invalid + // because Stream Header doesn't have that field. + flags.backward_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_stream_header_encode(&flags, header), LZMA_OK); +#endif +} + + +#if defined(HAVE_ENCODERS) +static void +stream_footer_encode_helper(lzma_check check) +{ + lzma_stream_flags flags = { + .version = 0, + .check = check, + .backward_size = LZMA_BACKWARD_SIZE_MIN, + }; + + uint8_t footer[LZMA_STREAM_HEADER_SIZE]; + + // Encode Stream Footer + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), LZMA_OK); + + // Stream Footer must start with CRC32 + const uint32_t crc = read32le(footer); + const uint32_t expected_crc = lzma_crc32(footer + sizeof(uint32_t), + LZMA_STREAM_HEADER_SIZE - (sizeof(uint32_t) + + sizeof(xz_footer_magic)), 0); + assert_uint_eq(crc, expected_crc); + + // Next the Backward Size + const uint32_t backwards_size = read32le(footer + sizeof(uint32_t)); + const uint32_t expected_backwards_size = flags.backward_size / 4 - 1; + assert_uint_eq(backwards_size, expected_backwards_size); + + // Next the Stream Flags + const uint8_t *stream_flags = footer + sizeof(uint32_t) * 2; + + // First byte must be null + assert_uint_eq(stream_flags[0], 0); + + // Second byte must have the Check ID in the lowest four bits + // and the highest four bits zero. + assert_uint_eq(stream_flags[1], check); + + // And ends with Footer Magic Bytes + const uint8_t *expected_footer_magic = stream_flags + + XZ_STREAM_FLAGS_SIZE; + assert_array_eq(expected_footer_magic, xz_footer_magic, + sizeof(xz_footer_magic)); +} +#endif + + +static void +test_lzma_stream_footer_encode(void) +{ +#ifndef HAVE_ENCODERS + assert_skip("Encoder support disabled"); +#else + for (int i = 0; i < LZMA_CHECK_ID_MAX; i++) + stream_footer_encode_helper(i); + + lzma_stream_flags flags = { + .version = 0, + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = LZMA_CHECK_CRC32 + }; + + uint8_t footer[LZMA_STREAM_HEADER_SIZE]; + + // Should fail if version > 0 + flags.version = 1; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), + LZMA_OPTIONS_ERROR); + flags.version = 0; + + // Should fail if Check ID is invalid + flags.check = LZMA_CHECK_ID_MAX + 1; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), + LZMA_PROG_ERROR); + + // Should fail if Backward Size is invalid + flags.backward_size -= 1; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), + LZMA_PROG_ERROR); + flags.backward_size += 2; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), + LZMA_PROG_ERROR); + flags.backward_size = LZMA_BACKWARD_SIZE_MAX + 4; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), + LZMA_PROG_ERROR); +#endif +} + + +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +static void +stream_header_decode_helper(lzma_check check) +{ + lzma_stream_flags flags = { + .version = 0, + .check = check + }; + + uint8_t header[LZMA_STREAM_HEADER_SIZE]; + + assert_lzma_ret(lzma_stream_header_encode(&flags, header), LZMA_OK); + + lzma_stream_flags dest_flags; + assert_lzma_ret(lzma_stream_header_decode(&dest_flags, header), + LZMA_OK); + + // Version should be 0 + assert_uint_eq(dest_flags.version, 0); + + // Backward Size should be LZMA_VLI_UNKNOWN + assert_uint_eq(dest_flags.backward_size, LZMA_VLI_UNKNOWN); + + // Check ID must equal the argument given to this function. + assert_uint_eq(dest_flags.check, check); +} +#endif + + +static void +test_lzma_stream_header_decode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + for (int i = 0; i < LZMA_CHECK_ID_MAX; i++) + stream_header_decode_helper(i); + + lzma_stream_flags flags = { + .version = 0, + .check = LZMA_CHECK_CRC32 + }; + + uint8_t header[LZMA_STREAM_HEADER_SIZE]; + lzma_stream_flags dest; + + // First encode known flags to header buffer + assert_lzma_ret(lzma_stream_header_encode(&flags, header), LZMA_OK); + + // Should fail if magic bytes do not match + header[0] ^= 1; + assert_lzma_ret(lzma_stream_header_decode(&dest, header), + LZMA_FORMAT_ERROR); + header[0] ^= 1; + + // Should fail if a reserved bit is set + uint8_t *stream_flags = header + sizeof(xz_header_magic); + stream_flags[0] = 1; + + // Need to adjust CRC32 after making a change since the CRC32 + // is verified before decoding the Stream Flags field. + uint8_t *crc32_ptr = header + sizeof(xz_header_magic) + + XZ_STREAM_FLAGS_SIZE; + const uint32_t crc_orig = read32le(crc32_ptr); + uint32_t new_crc32 = lzma_crc32( + stream_flags, XZ_STREAM_FLAGS_SIZE, 0); + write32le(crc32_ptr, new_crc32); + assert_lzma_ret(lzma_stream_header_decode(&dest, header), + LZMA_OPTIONS_ERROR); + stream_flags[0] = 0; + write32le(crc32_ptr, crc_orig); + + // Should fail if upper bits of check ID are set + stream_flags[1] |= 0xF0; + new_crc32 = lzma_crc32(stream_flags, XZ_STREAM_FLAGS_SIZE, 0); + write32le(crc32_ptr, new_crc32); + assert_lzma_ret(lzma_stream_header_decode(&dest, header), + LZMA_OPTIONS_ERROR); + stream_flags[1] = flags.check; + write32le(crc32_ptr, crc_orig); + + // Should fail if CRC32 does not match. + // First, alter a byte in the Stream Flags. + stream_flags[0] = 1; + assert_lzma_ret(lzma_stream_header_decode(&dest, header), + LZMA_DATA_ERROR); + stream_flags[0] = 0; + + // Next, change the CRC32. + *crc32_ptr ^= 1; + assert_lzma_ret(lzma_stream_header_decode(&dest, header), + LZMA_DATA_ERROR); +#endif +} + + +#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS) +static void +stream_footer_decode_helper(lzma_check check) +{ + lzma_stream_flags flags = { + .version = 0, + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = check, + }; + + uint8_t footer[LZMA_STREAM_HEADER_SIZE]; + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), LZMA_OK); + + lzma_stream_flags dest_flags; + assert_lzma_ret(lzma_stream_footer_decode(&dest_flags, footer), + LZMA_OK); + + // Version should be 0. + assert_uint_eq(dest_flags.version, 0); + + // Backward Size should equal the value from the flags. + assert_uint_eq(dest_flags.backward_size, flags.backward_size); + + // Check ID must equal argument given to this function. + assert_uint_eq(dest_flags.check, check); +} +#endif + + +static void +test_lzma_stream_footer_decode(void) +{ +#if !defined(HAVE_ENCODERS) || !defined(HAVE_DECODERS) + assert_skip("Encoder or decoder support disabled"); +#else + for (int i = 0; i < LZMA_CHECK_ID_MAX; i++) + stream_footer_decode_helper(i); + + lzma_stream_flags flags = { + .version = 0, + .check = LZMA_CHECK_CRC32, + .backward_size = LZMA_BACKWARD_SIZE_MIN + }; + + uint8_t footer[LZMA_STREAM_HEADER_SIZE]; + lzma_stream_flags dest; + + // First encode known flags to the footer buffer + assert_lzma_ret(lzma_stream_footer_encode(&flags, footer), LZMA_OK); + + // Should fail if magic bytes do not match + footer[LZMA_STREAM_HEADER_SIZE - 1] ^= 1; + assert_lzma_ret(lzma_stream_footer_decode(&dest, footer), + LZMA_FORMAT_ERROR); + footer[LZMA_STREAM_HEADER_SIZE - 1] ^= 1; + + // Should fail if a reserved bit is set. + // In the Stream Footer, the Stream Flags follow the CRC32 (4 bytes) + // and the Backward Size (4 bytes) + uint8_t *stream_flags = footer + sizeof(uint32_t) * 2; + stream_flags[0] = 1; + + // Need to adjust the CRC32 so it will not fail that check instead + uint8_t *crc32_ptr = footer; + const uint32_t crc_orig = read32le(crc32_ptr); + uint8_t *backward_size = footer + sizeof(uint32_t); + uint32_t new_crc32 = lzma_crc32(backward_size, sizeof(uint32_t) + + XZ_STREAM_FLAGS_SIZE, 0); + write32le(crc32_ptr, new_crc32); + assert_lzma_ret(lzma_stream_footer_decode(&dest, footer), + LZMA_OPTIONS_ERROR); + stream_flags[0] = 0; + write32le(crc32_ptr, crc_orig); + + // Should fail if upper bits of check ID are set + stream_flags[1] |= 0xF0; + new_crc32 = lzma_crc32(backward_size, sizeof(uint32_t) + + XZ_STREAM_FLAGS_SIZE, 0); + write32le(crc32_ptr, new_crc32); + assert_lzma_ret(lzma_stream_footer_decode(&dest, footer), + LZMA_OPTIONS_ERROR); + stream_flags[1] = flags.check; + write32le(crc32_ptr, crc_orig); + + // Should fail if CRC32 does not match. + // First, alter a byte in the Stream Flags. + stream_flags[0] = 1; + assert_lzma_ret(lzma_stream_footer_decode(&dest, footer), + LZMA_DATA_ERROR); + stream_flags[0] = 0; + + // Next, change the CRC32 + *crc32_ptr ^= 1; + assert_lzma_ret(lzma_stream_footer_decode(&dest, footer), + LZMA_DATA_ERROR); +#endif +} + + +static void +test_lzma_stream_flags_compare(void) +{ + lzma_stream_flags first = { + .version = 0, + .backward_size = LZMA_BACKWARD_SIZE_MIN, + .check = LZMA_CHECK_CRC32, + }; + + lzma_stream_flags second = first; + + // First test should pass + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), LZMA_OK); + + // Altering either version should cause an error + first.version = 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_OPTIONS_ERROR); + second.version = 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_OPTIONS_ERROR); + first.version = 0; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_OPTIONS_ERROR); + second.version = 0; + + // Check types must be under the maximum + first.check = LZMA_CHECK_ID_MAX + 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + second.check = LZMA_CHECK_ID_MAX + 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + first.check = LZMA_CHECK_CRC32; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + second.check = LZMA_CHECK_CRC32; + + // Check types must be equal + for (uint32_t i = 0; i < LZMA_CHECK_ID_MAX; i++) { + first.check = i; + if (i == second.check) + assert_lzma_ret(lzma_stream_flags_compare(&first, + &second), LZMA_OK); + else + assert_lzma_ret(lzma_stream_flags_compare(&first, + &second), LZMA_DATA_ERROR); + } + first.check = LZMA_CHECK_CRC32; + + // Backward Size comparison is skipped if either are LZMA_VLI_UNKNOWN + first.backward_size = LZMA_VLI_UNKNOWN; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), LZMA_OK); + second.backward_size = LZMA_VLI_MAX + 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), LZMA_OK); + second.backward_size = LZMA_BACKWARD_SIZE_MIN; + + // Backward Sizes need to be valid + first.backward_size = LZMA_VLI_MAX + 4; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + second.backward_size = LZMA_VLI_MAX + 4; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + first.backward_size = LZMA_BACKWARD_SIZE_MIN; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); + second.backward_size = LZMA_BACKWARD_SIZE_MIN; + + // Backward Sizes must be equal + second.backward_size = first.backward_size + 4; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_DATA_ERROR); + + // Should fail if Backward Sizes are > LZMA_BACKWARD_SIZE_MAX + // even though they are equal + first.backward_size = LZMA_BACKWARD_SIZE_MAX + 1; + second.backward_size = LZMA_BACKWARD_SIZE_MAX + 1; + assert_lzma_ret(lzma_stream_flags_compare(&first, &second), + LZMA_PROG_ERROR); +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + tuktest_run(test_lzma_stream_header_encode); + tuktest_run(test_lzma_stream_footer_encode); + tuktest_run(test_lzma_stream_header_decode); + tuktest_run(test_lzma_stream_footer_decode); + tuktest_run(test_lzma_stream_flags_compare); + return tuktest_end(); +} diff --git a/tests/test_vli.c b/tests/test_vli.c new file mode 100644 index 0000000..793dcf2 --- /dev/null +++ b/tests/test_vli.c @@ -0,0 +1,322 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file test_vli.c +/// \brief Tests liblzma vli functions +// +// Author: Jia Tan +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "tests.h" + + +// Pre-encoded VLI values for testing +// VLI can have between 1 and 9 bytes when encoded +// They are encoded little endian where all but the last +// byte must have the leading 1 bit set +static const uint8_t one_byte[1] = {0x25}; +static const lzma_vli one_byte_value = 37; + +static const uint8_t two_bytes[2] = {0x80, 0x56}; +static const lzma_vli two_byte_value = 11008; + +static const uint8_t three_bytes[3] = {0x99, 0x92, 0x20}; +static const lzma_vli three_byte_value = 526617; + +static const uint8_t four_bytes[4] = {0x97, 0x83, 0x94, 0x47}; +static const lzma_vli four_byte_value = 149225879; + +static const uint8_t five_bytes[5] = {0xA6, 0x92, 0x88, 0x89, 0x32}; +static const lzma_vli five_byte_value = 13440780582; + +static const uint8_t six_bytes[6] = {0xA9, 0x84, 0x99, 0x82, 0x94, 0x12}; +static const lzma_vli six_byte_value = 623848604201; + +static const uint8_t seven_bytes[7] = {0x90, 0x80, 0x90, 0x80, 0x90, 0x80, + 0x79}; +static const lzma_vli seven_byte_value = 532167923073040; + +static const uint8_t eight_bytes[8] = {0x91, 0x87, 0xF2, 0xB2, 0xC2, 0xD2, + 0x93, 0x63}; +static const lzma_vli eight_byte_value = 55818443594433425; + +static const uint8_t nine_bytes[9] = {0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, + 0xE1, 0xF1, 0x1}; +static const lzma_vli nine_byte_value = 136100349976529025; + + +static void +test_lzma_vli_size(void) +{ + // First test invalid VLI values (should return 0) + // VLI UNKNOWN is an invalid VLI + assert_uint_eq(lzma_vli_size(LZMA_VLI_UNKNOWN), 0); + // Loop over a few VLI values just over the maximum + for (uint64_t i = LZMA_VLI_MAX + 1; i < LZMA_VLI_MAX + 10; i++) + assert_uint_eq(lzma_vli_size(i), 0); + + // Number should increment every seven set bits + lzma_vli vli = 1; + for (uint32_t i = 1; i < LZMA_VLI_BYTES_MAX; i++, vli <<= 7) { + // Test the base value and a few others around it + assert_uint_eq(lzma_vli_size(vli), i); + assert_uint_eq(lzma_vli_size(vli * 2), i); + assert_uint_eq(lzma_vli_size(vli + 10), i); + assert_uint_eq(lzma_vli_size(vli * 3 + 39), i); + } +} + + +#ifdef HAVE_ENCODERS +// Helper function for test_lzma_vli_encode +// Encodes an input VLI and compares against a pre-computed value +static void +encode_single_call_mode(lzma_vli input, const uint8_t *expected, + uint32_t expected_len) +{ + uint8_t out[LZMA_VLI_BYTES_MAX]; + size_t out_pos = 0; + assert_lzma_ret(lzma_vli_encode(input, NULL, out, &out_pos, + expected_len), LZMA_OK); + assert_uint_eq(out_pos, expected_len); + assert_array_eq(out, expected, expected_len); +} + + +// Helper function for test_lzma_vli_encode +// Encodes an input VLI one byte at a time with the multi call +// method. Then compares agaist a pre-computed value +static void +encode_multi_call_mode(lzma_vli input, const uint8_t *expected, + uint32_t expected_len) +{ + uint8_t out[LZMA_VLI_BYTES_MAX]; + size_t out_pos = 0; + size_t vli_pos = 0; + + for (uint32_t i = 1; i < expected_len; i++) { + assert_lzma_ret(lzma_vli_encode(input, &vli_pos, out, + &out_pos, i), LZMA_OK); + assert_uint_eq(out_pos, i); + assert_uint_eq(vli_pos, i); + } + assert_lzma_ret(lzma_vli_encode(input, &vli_pos, out, &out_pos, + expected_len), LZMA_STREAM_END); + assert_uint_eq(out_pos, expected_len); + assert_uint_eq(vli_pos, expected_len); + assert_array_eq(out, expected, expected_len); +} +#endif + + +static void +test_lzma_vli_encode(void) +{ +#ifndef HAVE_ENCODERS + assert_skip("Encoder support disabled"); +#else + size_t vli_pos = 0; + uint8_t out[LZMA_VLI_BYTES_MAX]; + uint8_t zeros[LZMA_VLI_BYTES_MAX]; + memzero(out, LZMA_VLI_BYTES_MAX); + memzero(zeros, LZMA_VLI_BYTES_MAX); + size_t out_pos = 0; + + // First test invalid input parameters + // VLI invalid + assert_lzma_ret(lzma_vli_encode(LZMA_VLI_UNKNOWN, &vli_pos, out, + &out_pos, sizeof(out)), LZMA_PROG_ERROR); + // Failure should not change params + assert_uint_eq(vli_pos, 0); + assert_uint_eq(out_pos, 0); + assert_array_eq(out, zeros, LZMA_VLI_BYTES_MAX); + + assert_lzma_ret(lzma_vli_encode(LZMA_VLI_MAX + 1, &vli_pos, out, + &out_pos, sizeof(out)), LZMA_PROG_ERROR); + assert_uint_eq(vli_pos, 0); + assert_uint_eq(out_pos, 0); + assert_array_eq(out, zeros, LZMA_VLI_BYTES_MAX); + + // 0 output size + assert_lzma_ret(lzma_vli_encode(one_byte_value, &vli_pos, out, + &out_pos, 0), LZMA_BUF_ERROR); + assert_uint_eq(vli_pos, 0); + assert_uint_eq(out_pos, 0); + assert_array_eq(out, zeros, LZMA_VLI_BYTES_MAX); + + // Size of VLI does not fit in buffer + size_t phony_out_pos = 3; + assert_lzma_ret(lzma_vli_encode(one_byte_value, NULL, out, + &phony_out_pos, 2), LZMA_PROG_ERROR); + + assert_lzma_ret(lzma_vli_encode(LZMA_VLI_MAX / 2, NULL, out, + &out_pos, 2), LZMA_PROG_ERROR); + + // Test single-call mode (using vli_pos as NULL) + encode_single_call_mode(one_byte_value, one_byte, + sizeof(one_byte)); + encode_single_call_mode(two_byte_value, two_bytes, + sizeof(two_bytes)); + encode_single_call_mode(three_byte_value, three_bytes, + sizeof(three_bytes)); + encode_single_call_mode(four_byte_value, four_bytes, + sizeof(four_bytes)); + encode_single_call_mode(five_byte_value, five_bytes, + sizeof(five_bytes)); + encode_single_call_mode(six_byte_value, six_bytes, + sizeof(six_bytes)); + encode_single_call_mode(seven_byte_value, seven_bytes, + sizeof(seven_bytes)); + encode_single_call_mode(eight_byte_value, eight_bytes, + sizeof(eight_bytes)); + encode_single_call_mode(nine_byte_value, nine_bytes, + sizeof(nine_bytes)); + + // Test multi-call mode + encode_multi_call_mode(one_byte_value, one_byte, + sizeof(one_byte)); + encode_multi_call_mode(two_byte_value, two_bytes, + sizeof(two_bytes)); + encode_multi_call_mode(three_byte_value, three_bytes, + sizeof(three_bytes)); + encode_multi_call_mode(four_byte_value, four_bytes, + sizeof(four_bytes)); + encode_multi_call_mode(five_byte_value, five_bytes, + sizeof(five_bytes)); + encode_multi_call_mode(six_byte_value, six_bytes, + sizeof(six_bytes)); + encode_multi_call_mode(seven_byte_value, seven_bytes, + sizeof(seven_bytes)); + encode_multi_call_mode(eight_byte_value, eight_bytes, + sizeof(eight_bytes)); + encode_multi_call_mode(nine_byte_value, nine_bytes, + sizeof(nine_bytes)); +#endif +} + + +#ifdef HAVE_DECODERS +static void +decode_single_call_mode(const uint8_t *input, uint32_t input_len, + lzma_vli expected) +{ + lzma_vli out = 0; + size_t in_pos = 0; + + assert_lzma_ret(lzma_vli_decode(&out, NULL, input, &in_pos, + input_len), LZMA_OK); + assert_uint_eq(in_pos, input_len); + assert_uint_eq(out, expected); +} + + +static void +decode_multi_call_mode(const uint8_t *input, uint32_t input_len, + lzma_vli expected) +{ + lzma_vli out = 0; + size_t in_pos = 0; + size_t vli_pos = 0; + + for (uint32_t i = 1; i < input_len; i++) { + assert_lzma_ret(lzma_vli_decode(&out, &vli_pos, input, + &in_pos, i), LZMA_OK); + assert_uint_eq(in_pos, i); + assert_uint_eq(vli_pos, i); + } + + assert_lzma_ret(lzma_vli_decode(&out, &vli_pos, input, &in_pos, + input_len), LZMA_STREAM_END); + assert_uint_eq(in_pos, input_len); + assert_uint_eq(vli_pos, input_len); + assert_uint_eq(out, expected); +} +#endif + + +static void +test_lzma_vli_decode(void) +{ +#ifndef HAVE_DECODERS + assert_skip("Decoder support disabled"); +#else + lzma_vli out = 0; + size_t in_pos = 0; + + // First test invalid input params + // 0 in_size + assert_lzma_ret(lzma_vli_decode(&out, NULL, one_byte, &in_pos, 0), + LZMA_DATA_ERROR); + assert_uint_eq(out, 0); + assert_uint_eq(in_pos, 0); + + // VLI encoded is invalid (last digit has leading 1 set) + uint8_t invalid_vli[3] = {0x80, 0x80, 0x80}; + assert_lzma_ret(lzma_vli_decode(&out, NULL, invalid_vli, &in_pos, + sizeof(invalid_vli)), LZMA_DATA_ERROR); + + // Bad vli_pos + size_t vli_pos = LZMA_VLI_BYTES_MAX; + assert_lzma_ret(lzma_vli_decode(&out, &vli_pos, invalid_vli, &in_pos, + sizeof(invalid_vli)), LZMA_PROG_ERROR); + + // Bad in_pos + in_pos = sizeof(invalid_vli); + assert_lzma_ret(lzma_vli_decode(&out, &in_pos, invalid_vli, &in_pos, + sizeof(invalid_vli)), LZMA_BUF_ERROR); + + // Test single call mode + decode_single_call_mode(one_byte, sizeof(one_byte), + one_byte_value); + decode_single_call_mode(two_bytes, sizeof(two_bytes), + two_byte_value); + decode_single_call_mode(three_bytes, sizeof(three_bytes), + three_byte_value); + decode_single_call_mode(four_bytes, sizeof(four_bytes), + four_byte_value); + decode_single_call_mode(five_bytes, sizeof(five_bytes), + five_byte_value); + decode_single_call_mode(six_bytes, sizeof(six_bytes), + six_byte_value); + decode_single_call_mode(seven_bytes, sizeof(seven_bytes), + seven_byte_value); + decode_single_call_mode(eight_bytes, sizeof(eight_bytes), + eight_byte_value); + decode_single_call_mode(nine_bytes, sizeof(nine_bytes), + nine_byte_value); + + // Test multi call mode + decode_multi_call_mode(one_byte, sizeof(one_byte), + one_byte_value); + decode_multi_call_mode(two_bytes, sizeof(two_bytes), + two_byte_value); + decode_multi_call_mode(three_bytes, sizeof(three_bytes), + three_byte_value); + decode_multi_call_mode(four_bytes, sizeof(four_bytes), + four_byte_value); + decode_multi_call_mode(five_bytes, sizeof(five_bytes), + five_byte_value); + decode_multi_call_mode(six_bytes, sizeof(six_bytes), + six_byte_value); + decode_multi_call_mode(seven_bytes, sizeof(seven_bytes), + seven_byte_value); + decode_multi_call_mode(eight_bytes, sizeof(eight_bytes), + eight_byte_value); + decode_multi_call_mode(nine_bytes, sizeof(nine_bytes), + nine_byte_value); +#endif +} + + +extern int +main(int argc, char **argv) +{ + tuktest_start(argc, argv); + tuktest_run(test_lzma_vli_size); + tuktest_run(test_lzma_vli_encode); + tuktest_run(test_lzma_vli_decode); + return tuktest_end(); +} diff --git a/tests/tests.h b/tests/tests.h new file mode 100644 index 0000000..4d6169b --- /dev/null +++ b/tests/tests.h @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tests.h +/// \brief Common definitions for test applications +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef LZMA_TESTS_H +#define LZMA_TESTS_H + +#include "sysdefs.h" +#include "tuklib_integer.h" +#include "lzma.h" +#include "tuktest.h" + + +#define memcrap(buf, size) memset(buf, 0xFD, size) + + +// TODO: Remove these three macros once all tests have been converted. +#define expect(test) ((test) ? 0 : (fprintf(stderr, "%s:%d: %s\n", \ + __FILE__, __LINE__, #test), abort(), 0)) + +#define succeed(test) expect(!(test)) + +#define fail(test) expect(test) + + +// This table and macro allow getting more readable error messages when +// comparing the lzma_ret enumeration values. +static const char enum_strings_lzma_ret[][24] = { + "LZMA_OK", + "LZMA_STREAM_END", + "LZMA_NO_CHECK", + "LZMA_UNSUPPORTED_CHECK", + "LZMA_GET_CHECK", + "LZMA_MEM_ERROR", + "LZMA_MEMLIMIT_ERROR", + "LZMA_FORMAT_ERROR", + "LZMA_OPTIONS_ERROR", + "LZMA_DATA_ERROR", + "LZMA_BUF_ERROR", + "LZMA_PROG_ERROR", + "LZMA_SEEK_NEEDED", +}; + +#define assert_lzma_ret(test_expr, ref_val) \ + assert_enum_eq(test_expr, ref_val, enum_strings_lzma_ret) + + +static const char enum_strings_lzma_check[][24] = { + "LZMA_CHECK_NONE", + "LZMA_CHECK_CRC32", + "LZMA_CHECK_UNKNOWN_2", + "LZMA_CHECK_UNKNOWN_3", + "LZMA_CHECK_CRC64", + "LZMA_CHECK_UNKNOWN_5", + "LZMA_CHECK_UNKNOWN_6", + "LZMA_CHECK_UNKNOWN_7", + "LZMA_CHECK_UNKNOWN_8", + "LZMA_CHECK_UNKNOWN_9", + "LZMA_CHECK_SHA256", + "LZMA_CHECK_UNKNOWN_11", + "LZMA_CHECK_UNKNOWN_12", + "LZMA_CHECK_UNKNOWN_13", + "LZMA_CHECK_UNKNOWN_14", + "LZMA_CHECK_UNKNOWN_15", +}; + +#define assert_lzma_check(test_expr, ref_val) \ + assert_enum_eq(test_expr, ref_val, enum_strings_lzma_check) + + +static inline bool +coder_loop(lzma_stream *strm, uint8_t *in, size_t in_size, + uint8_t *out, size_t out_size, + lzma_ret expected_ret, lzma_action finishing_action) +{ + size_t in_left = in_size; + size_t out_left = out_size > 0 ? out_size + 1 : 0; + lzma_action action = LZMA_RUN; + lzma_ret ret; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = NULL; + strm->avail_out = 0; + + while (true) { + if (in_left > 0) { + if (--in_left == 0) + action = finishing_action; + + strm->next_in = in++; + strm->avail_in = 1; + } + + if (out_left > 0) { + --out_left; + strm->next_out = out++; + strm->avail_out = 1; + } + + ret = lzma_code(strm, action); + if (ret != LZMA_OK) + break; + } + + bool error = false; + + if (ret != expected_ret) + error = true; + + if (strm->total_in != in_size || strm->total_out != out_size) + error = true; + + return error; +} + + +static inline bool +decoder_loop_ret(lzma_stream *strm, uint8_t *in, size_t in_size, + lzma_ret expected_ret) +{ + return coder_loop(strm, in, in_size, NULL, 0, expected_ret, LZMA_RUN); +} + + +static inline bool +decoder_loop(lzma_stream *strm, uint8_t *in, size_t in_size) +{ + return coder_loop(strm, in, in_size, NULL, 0, + LZMA_STREAM_END, LZMA_RUN); +} + +#endif diff --git a/tests/tuktest.h b/tests/tuktest.h new file mode 100644 index 0000000..508eace --- /dev/null +++ b/tests/tuktest.h @@ -0,0 +1,1053 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \file tuktest.h +/// \brief Helper macros for writing simple test programs +/// \version 2023-01-08 +/// +/// Some inspiration was taken from STest by Keith Nicholas. +/// +/// This is standard C99/C11 only and thus should be fairly portable +/// outside POSIX systems too. +/// +/// This supports putting multiple tests in a single test program +/// although it is perfectly fine to have only one test per program. +/// Each test can produce one of these results: +/// - Pass +/// - Fail +/// - Skip +/// - Hard error (the remaining tests, if any, are not run) +/// +/// By default this produces an exit status that is compatible with +/// Automake and Meson, and mostly compatible with CMake.[1] +/// If a test program contains multiple tests, only one exit code can +/// be returned. Of the following, the first match is used: +/// - 99 if any test returned a hard error +/// - stdlib.h's EXIT_FAILURE if at least one test failed +/// - 77 if at least one test was skipped or no tests were run at all +/// - stdlib.h's EXIT_SUCCESS (0 on POSIX); that is, if none of the above +/// are true then there was at least one test to run and none of them +/// failed, was skipped, or returned a hard error. +/// +/// A summary of tests being run and their results are printed to stdout. +/// If you want ANSI coloring for the output, #define TUKTEST_COLOR. +/// If you only want output when something goes wrong, #define TUKTEST_QUIET. +/// +/// The downside of the above mapping is that it cannot indicate if +/// some tests were skipped and some passed. If that is likely to +/// happen it may be better to split into multiple test programs (one +/// test per program) or use the TAP mode described below. +/// +/// By using #define TUKTEST_TAP before #including this file the +/// output will be Test Anything Protocol (TAP) version 12 compatible +/// and the exit status will always be EXIT_SUCCESS. This can be easily +/// used with Automake via its tap-driver.sh. Meson supports TAP natively. +/// TAP's todo-directive isn't supported for now, mostly because it's not +/// trivially convertible to the exit-status reporting method. +/// +/// If TUKTEST_TAP is used, TUKTEST_QUIET and TUKTEST_COLOR are ignored. +/// +/// The main() function may look like this (remember to include config.h +/// or such files too if needed!): +/// +/// #include "tuktest.h" +/// +/// int main(int argc, char **argv) +/// { +/// tuktest_start(argc, argv); +/// +/// if (!is_package_foo_available()) +/// tuktest_early_skip("Optional package foo is not available"); +/// +/// if (!do_common_initializations()) +/// tuktest_error("Error during common initializations"); +/// +/// tuktest_run(testfunc1); +/// tuktest_run(testfunc2); +/// +/// return tuktest_end(); +/// } +/// +/// Using exit(tuktest_end()) as a pair to tuktest_start() is OK too. +/// +/// Each test function called via tuktest_run() should be of type +/// "void testfunc1(void)". The test functions should use the +/// various assert_CONDITION() macros. The current test stops if +/// an assertion fails (this is implemented with setjmp/longjmp). +/// Execution continues from the next test unless the failure was +/// due to assert_error() (indicating a hard error) which makes +/// the program exit() without running any remaining tests. +/// +/// Search for "define assert" in this file to find the explanations +/// of the available assertion macros. +/// +/// IMPORTANT: +/// +/// - The assert_CONDITION() macros may only be used by code that is +/// called via tuktest_run()! This includes the function named in +/// the tuktest_run() call and functions called further from there. +/// (The assert_CONDITION() macros depend on setup code in tuktest_run() +/// and other use results in undefined behavior.) +/// +/// - tuktest_start(), tuktest_early_skip, tuktest_run(), and tuktest_end() +/// must not be used in the tests called via tuktest_run()! (tuktest_end() +/// is called more freely internally by this file but such use isn't part +/// of the API.) +/// +/// - tuktest_error(), tuktest_malloc(), tuktest_free(), +/// tuktest_file_from_srcdir(), and tuktest_file_from_builddir() +/// can be used everywhere after tuktest_start() has been called. +/// (In tests running under tuktest_run(), assert_error() can be used +/// instead of tuktest_error() when a hard error occurs.) +/// +/// - Everything else is for internal use only. +/// +/// Footnotes: +/// +/// [1] As of 2022-06-02: +/// See the Automake manual "info (automake)Scripts-based Testsuites" or: +/// https://www.gnu.org/software/automake/manual/automake.html#Scripts_002dbased-Testsuites +/// +/// Meson: https://mesonbuild.com/Unit-tests.html +/// +/// CMake handles passing and failing tests by default but treats hard +/// errors as regular fails. To CMake support skipped tests correctly, +/// one has to set the SKIP_RETURN_CODE property for each test: +/// +/// set_tests_properties(foo_test_name PROPERTIES SKIP_RETURN_CODE 77) +/// +/// See: +/// https://cmake.org/cmake/help/latest/command/set_tests_properties.html +/// https://cmake.org/cmake/help/latest/prop_test/SKIP_RETURN_CODE.html +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef TUKTEST_H +#define TUKTEST_H + +#include + +// On some (too) old systems inttypes.h doesn't exist or isn't good enough. +// Include it conditionally so that any portability tricks can be done before +// tuktest.h is included. On any modern system inttypes.h is fine as is. +#ifndef PRIu64 +# include +#endif + +#include +#include +#include +#include + + +#if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define TUKTEST_GNUC_REQ(major, minor) \ + ((__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)) \ + || __GNUC__ > (major)) +#else +# define TUKTEST_GNUC_REQ(major, minor) 0 +#endif + + +// This is silencing warnings about unused functions. Not all test programs +// need all functions from this header. +#if TUKTEST_GNUC_REQ(3, 0) +# define tuktest_maybe_unused __attribute__((__unused__)) +#else +# define tuktest_maybe_unused +#endif + +// We need printf("") so silence the warning about empty format string. +#if TUKTEST_GNUC_REQ(4, 2) +# pragma GCC diagnostic ignored "-Wformat-zero-length" +#endif + + +// Types and printf format macros to use in integer assertions and also for +// printing size_t values (C99's %zu isn't available on very old systems). +typedef int64_t tuktest_int; +typedef uint64_t tuktest_uint; +#define TUKTEST_PRId PRId64 +#define TUKTEST_PRIu PRIu64 +#define TUKTEST_PRIX PRIX64 + + +// When TAP mode isn't used, Automake-compatible exit statuses are used. +#define TUKTEST_EXIT_PASS EXIT_SUCCESS +#define TUKTEST_EXIT_FAIL EXIT_FAILURE +#define TUKTEST_EXIT_SKIP 77 +#define TUKTEST_EXIT_ERROR 99 + + +enum tuktest_result { + TUKTEST_PASS, + TUKTEST_FAIL, + TUKTEST_SKIP, + TUKTEST_ERROR, +}; + + +#ifdef TUKTEST_TAP +# undef TUKTEST_QUIET +# undef TUKTEST_COLOR +# undef TUKTEST_TAP +# define TUKTEST_TAP 1 +# define TUKTEST_STR_PASS "ok -" +# define TUKTEST_STR_FAIL "not ok -" +# define TUKTEST_STR_SKIP "ok - # SKIP" +# define TUKTEST_STR_ERROR "Bail out!" +#else +# define TUKTEST_TAP 0 +# ifdef TUKTEST_COLOR +# define TUKTEST_COLOR_PASS "\x1B[0;32m" +# define TUKTEST_COLOR_FAIL "\x1B[0;31m" +# define TUKTEST_COLOR_SKIP "\x1B[1;34m" +# define TUKTEST_COLOR_ERROR "\x1B[0;35m" +# define TUKTEST_COLOR_TOTAL "\x1B[1m" +# define TUKTEST_COLOR_OFF "\x1B[m" +# define TUKTEST_COLOR_IF(cond, color) ((cond) ? (color) : "" ) +# else +# define TUKTEST_COLOR_PASS "" +# define TUKTEST_COLOR_FAIL "" +# define TUKTEST_COLOR_SKIP "" +# define TUKTEST_COLOR_ERROR "" +# define TUKTEST_COLOR_TOTAL "" +# define TUKTEST_COLOR_OFF "" +# define TUKTEST_COLOR_IF(cond, color) "" +# endif +# define TUKTEST_COLOR_ADD(str, color) color str TUKTEST_COLOR_OFF +# define TUKTEST_STR_PASS \ + TUKTEST_COLOR_ADD("PASS:", TUKTEST_COLOR_PASS) +# define TUKTEST_STR_FAIL \ + TUKTEST_COLOR_ADD("FAIL:", TUKTEST_COLOR_FAIL) +# define TUKTEST_STR_SKIP \ + TUKTEST_COLOR_ADD("SKIP:", TUKTEST_COLOR_SKIP) +# define TUKTEST_STR_ERROR \ + TUKTEST_COLOR_ADD("ERROR:", TUKTEST_COLOR_ERROR) +#endif + +// NOTE: If TUKTEST_TAP is defined then TUKTEST_QUIET will get undefined above. +#ifndef TUKTEST_QUIET +# define TUKTEST_QUIET 0 +#else +# undef TUKTEST_QUIET +# define TUKTEST_QUIET 1 +#endif + + +// Counts of the passed, failed, skipped, and hard-errored tests. +// This is indexed with the enumeration constants from enum tuktest_result. +static unsigned tuktest_stats[4] = { 0, 0, 0, 0 }; + +// Copy of argc and argv from main(). These are set by tuktest_start(). +static int tuktest_argc = 0; +static char **tuktest_argv = NULL; + +// Name of the currently-running test. This exists because it's nice +// to print the main test function name even if the failing test-assertion +// fails in a function called by the main test function. +static const char *tuktest_name = NULL; + +// longjmp() target for when a test-assertion fails. +static jmp_buf tuktest_jmpenv; + + +// This declaration is needed for tuktest_malloc(). +static int tuktest_end(void); + + +// Internal helper for handling hard errors both inside and +// outside tuktest_run(). +#define tuktest_error_impl(filename, line, ...) \ +do { \ + tuktest_print_result_prefix(TUKTEST_ERROR, filename, line); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + ++tuktest_stats[TUKTEST_ERROR]; \ + exit(tuktest_end()); \ +} while (0) + + +// printf() is without checking its return value in many places. This function +// is called before exiting to check the status of stdout and catch errors. +static void +tuktest_catch_stdout_errors(void) +{ + if (ferror(stdout) || fclose(stdout)) { + fputs("Error while writing to stdout\n", stderr); + exit(TUKTEST_EXIT_ERROR); + } +} + + +// A simplified basename()-like function that is good enough for +// cleaning up __FILE__. This supports / and \ as path separator. +// If the path separator is wrong then the full path will be printed; +// it's a cosmetic problem only. +static const char * +tuktest_basename(const char *filename) +{ + for (const char *p = filename + strlen(filename); p > filename; --p) + if (*p == '/' || *p == '\\') + return p + 1; + + return filename; +} + + +// Internal helper that prints the prefix of the fail/skip/error message line. +static void +tuktest_print_result_prefix(enum tuktest_result result, + const char *filename, unsigned line) +{ + // This is never called with TUKTEST_PASS but I kept it here anyway. + const char *result_str + = result == TUKTEST_PASS ? TUKTEST_STR_PASS + : result == TUKTEST_FAIL ? TUKTEST_STR_FAIL + : result == TUKTEST_SKIP ? TUKTEST_STR_SKIP + : TUKTEST_STR_ERROR; + + const char *short_filename = tuktest_basename(filename); + + if (tuktest_name != NULL) + printf("%s %s [%s:%u] ", result_str, tuktest_name, + short_filename, line); + else + printf("%s [%s:%u] ", result_str, short_filename, line); +} + + +// An entry for linked list of memory allocations. +struct tuktest_malloc_record { + struct tuktest_malloc_record *next; + void *p; +}; + +// Linked list of per-test allocations. This is used when under tuktest_run(). +// These allocations are freed in tuktest_run() and, in case of a hard error, +// also in tuktest_end(). +static struct tuktest_malloc_record *tuktest_malloc_test = NULL; + +// Linked list of global allocations. This is used allocations are made +// outside tuktest_run(). These are freed in tuktest_end(). +static struct tuktest_malloc_record *tuktest_malloc_global = NULL; + + +/// A wrapper for malloc() that never return NULL and the allocated memory is +/// automatically freed at the end of tuktest_run() (if allocation was done +/// within a test) or early in tuktest_end() (if allocation was done outside +/// tuktest_run()). +/// +/// If allocation fails, a hard error is reported and this function won't +/// return. Possible other tests won't be run (this will call exit()). +#define tuktest_malloc(size) tuktest_malloc_impl(size, __FILE__, __LINE__) + +static void * +tuktest_malloc_impl(size_t size, const char *filename, unsigned line) +{ + void *p = malloc(size == 0 ? 1 : size); + struct tuktest_malloc_record *r = malloc(sizeof(*r)); + + if (p == NULL || r == NULL) { + free(r); + free(p); + + // Avoid %zu for portability to very old systems that still + // can compile C99 code. + tuktest_error_impl(filename, line, + "tuktest_malloc(%" TUKTEST_PRIu ") failed", + (tuktest_uint)size); + } + + r->p = p; + + if (tuktest_name == NULL) { + // We were called outside tuktest_run(). + r->next = tuktest_malloc_global; + tuktest_malloc_global = r; + } else { + // We were called under tuktest_run(). + r->next = tuktest_malloc_test; + tuktest_malloc_test = r; + } + + return p; +} + + +/// Frees memory allocated using tuktest_malloc(). Usually this isn't needed +/// as the memory is freed automatically. +/// +/// NULL is silently ignored. +/// +/// NOTE: Under tuktest_run() only memory allocated there can be freed. +/// That is, allocations done outside tuktest_run() can only be freed +/// outside tuktest_run(). +#define tuktest_free(ptr) tuktest_free_impl(ptr, __FILE__, __LINE__) + +static void +tuktest_free_impl(void *p, const char *filename, unsigned line) +{ + if (p == NULL) + return; + + struct tuktest_malloc_record **r = tuktest_name != NULL + ? &tuktest_malloc_test : &tuktest_malloc_global; + + while (*r != NULL) { + struct tuktest_malloc_record *tmp = *r; + + if (tmp->p == p) { + *r = tmp->next; + free(p); + free(tmp); + return; + } + + r = &tmp->next; + } + + tuktest_error_impl(filename, line, "tuktest_free: " + "Allocation matching the pointer was not found"); +} + + +// Frees all allocates in the given record list. The argument must be +// either &tuktest_malloc_test or &tuktest_malloc_global. +static void +tuktest_free_all(struct tuktest_malloc_record **r) +{ + while (*r != NULL) { + struct tuktest_malloc_record *tmp = *r; + *r = tmp->next; + free(tmp->p); + free(tmp); + } +} + + +/// Initialize the test framework. No other functions or macros +/// from this file may be called before calling this. +/// +/// If the arguments from main() aren't available, use 0 and NULL. +/// If these are set, then only a subset of tests can be run by +/// specifying their names on the command line. +#define tuktest_start(argc, argv) \ +do { \ + tuktest_argc = argc; \ + tuktest_argv = argv; \ + if (!TUKTEST_TAP && !TUKTEST_QUIET) \ + printf("=== %s ===\n", tuktest_basename(__FILE__)); \ +} while (0) + + +/// If it can be detected early that no tests can be run, this macro can +/// be called after tuktest_start() but before any tuktest_run() to print +/// a reason why the tests were skipped. Note that this macro calls exit(). +/// +/// Using "return tuktest_end();" in main() when no tests were run has +/// the same result as tuktest_early_skip() except that then no reason +/// for the skipping can be printed. +#define tuktest_early_skip(...) \ +do { \ + printf("%s [%s:%u] ", \ + TUKTEST_TAP ? "1..0 # SKIP" : TUKTEST_STR_SKIP, \ + tuktest_basename(__FILE__), __LINE__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + if (!TUKTEST_TAP && !TUKTEST_QUIET) \ + printf("=== END ===\n"); \ + tuktest_catch_stdout_errors(); \ + exit(TUKTEST_TAP ? EXIT_SUCCESS : TUKTEST_EXIT_SKIP); \ +} while (0) + + +/// Some test programs need to do initializations before or between +/// calls to tuktest_run(). If such initializations unexpectedly fail, +/// tuktest_error() can be used to report it as a hard error outside +/// test functions, for example, in main(). Then the remaining tests +/// won't be run (this macro calls exit()). +/// +/// Typically tuktest_error() would be used before any tuktest_run() +/// calls but it is also possible to use tuktest_error() after one or +/// more tests have been run with tuktest_run(). This is in contrast to +/// tuktest_early_skip() which must never be called after tuktest_run(). +/// +/// NOTE: tuktest_start() must have been called before tuktest_error(). +/// +/// NOTE: This macro can be called from test functions running under +/// tuktest_run() but assert_error() is somewhat preferred in that context. +#define tuktest_error(...) tuktest_error_impl(__FILE__, __LINE__, __VA_ARGS__) + + +/// At the end of main() one should have "return tuktest_end();" which +/// prints the stats or the TAP plan, and handles the exit status. +/// Using exit(tuktest_end()) is OK too. +/// +/// If the test program can detect early that all tests must be skipped, +/// then tuktest_early_skip() may be useful so that the reason why the +/// tests were skipped can be printed. +static int +tuktest_end(void) +{ + tuktest_free_all(&tuktest_malloc_test); + tuktest_free_all(&tuktest_malloc_global); + + unsigned total_tests = 0; + for (unsigned i = 0; i <= TUKTEST_ERROR; ++i) + total_tests += tuktest_stats[i]; + + if (tuktest_stats[TUKTEST_ERROR] == 0 && tuktest_argc > 1 + && (unsigned)(tuktest_argc - 1) > total_tests) { + printf(TUKTEST_STR_ERROR " Fewer tests were run than " + "specified on the command line. " + "Was a test name mistyped?\n"); + ++tuktest_stats[TUKTEST_ERROR]; + } + +#if TUKTEST_TAP + // Print the plan only if no "Bail out!" has occurred. + // Print the skip directive if no tests were run. + // We cannot know the reason for the skip here though + // (see tuktest_early_skip()). + if (tuktest_stats[TUKTEST_ERROR] == 0) + printf("1..%u%s\n", total_tests, + total_tests == 0 ? " # SKIP" : ""); + + tuktest_catch_stdout_errors(); + return EXIT_SUCCESS; +#else + if (!TUKTEST_QUIET) + printf("---\n" + "%s# TOTAL: %u" TUKTEST_COLOR_OFF "\n" + "%s# PASS: %u" TUKTEST_COLOR_OFF "\n" + "%s# SKIP: %u" TUKTEST_COLOR_OFF "\n" + "%s# FAIL: %u" TUKTEST_COLOR_OFF "\n" + "%s# ERROR: %u" TUKTEST_COLOR_OFF "\n" + "=== END ===\n", + TUKTEST_COLOR_TOTAL, + total_tests, + TUKTEST_COLOR_IF( + tuktest_stats[TUKTEST_PASS] > 0, + TUKTEST_COLOR_PASS), + tuktest_stats[TUKTEST_PASS], + TUKTEST_COLOR_IF( + tuktest_stats[TUKTEST_SKIP] > 0, + TUKTEST_COLOR_SKIP), + tuktest_stats[TUKTEST_SKIP], + TUKTEST_COLOR_IF( + tuktest_stats[TUKTEST_FAIL] > 0, + TUKTEST_COLOR_FAIL), + tuktest_stats[TUKTEST_FAIL], + TUKTEST_COLOR_IF( + tuktest_stats[TUKTEST_ERROR] > 0, + TUKTEST_COLOR_ERROR), + tuktest_stats[TUKTEST_ERROR]); + + tuktest_catch_stdout_errors(); + + if (tuktest_stats[TUKTEST_ERROR] > 0) + return TUKTEST_EXIT_ERROR; + + if (tuktest_stats[TUKTEST_FAIL] > 0) + return TUKTEST_EXIT_FAIL; + + if (tuktest_stats[TUKTEST_SKIP] > 0 || total_tests == 0) + return TUKTEST_EXIT_SKIP; + + return TUKTEST_EXIT_PASS; +#endif +} + + +/// Runs the specified test function. Requires that tuktest_start() +/// has already been called and that tuktest_end() has NOT been called yet. +#define tuktest_run(testfunc) \ + tuktest_run_test(&(testfunc), #testfunc) + +tuktest_maybe_unused +static void +tuktest_run_test(void (*testfunc)(void), const char *testfunc_str) +{ + // If any command line arguments were given, only the test functions + // named on the command line will be run. + if (tuktest_argc > 1) { + int i = 1; + while (strcmp(tuktest_argv[i], testfunc_str) != 0) + if (++i == tuktest_argc) + return; + } + + // This is set so that failed assertions can print the correct + // test name even when the assertion is in a helper function + // called by the test function. + tuktest_name = testfunc_str; + + // The way setjmp() may be called is very restrictive. + // A switch statement is one of the few conforming ways + // to get the value passed to longjmp(); doing something + // like "int x = setjmp(env)" is NOT allowed (undefined behavior). + switch (setjmp(tuktest_jmpenv)) { + case 0: + testfunc(); + ++tuktest_stats[TUKTEST_PASS]; + if (!TUKTEST_QUIET) + printf(TUKTEST_STR_PASS " %s\n", tuktest_name); + break; + + case TUKTEST_FAIL: + ++tuktest_stats[TUKTEST_FAIL]; + break; + + case TUKTEST_SKIP: + ++tuktest_stats[TUKTEST_SKIP]; + break; + + default: + ++tuktest_stats[TUKTEST_ERROR]; + exit(tuktest_end()); + } + + tuktest_free_all(&tuktest_malloc_test); + tuktest_name = NULL; +} + + +// Maximum allowed file size in tuktest_file_from_* macros and functions. +#ifndef TUKTEST_FILE_SIZE_MAX +# define TUKTEST_FILE_SIZE_MAX (64L << 20) +#endif + +/// Allocates memory and reads the specified file into a buffer. +/// If the environment variable srcdir is set, it will be prefixed +/// to the filename. Otherwise the filename is used as is (and so +/// the behavior is identical to tuktest_file_from_builddir() below). +/// +/// On success the a pointer to malloc'ed memory is returned. +/// The size of the allocation and the file is stored in *size. +/// +/// If anything goes wrong, a hard error is reported and this function +/// won't return. Possible other tests won't be run (this will call exit()). +/// +/// Empty files and files over TUKTEST_FILE_SIZE_MAX are rejected. +/// The assumption is that something is wrong in these cases. +/// +/// This function can be called either from outside the tests (like in main()) +/// or from tests run via tuktest_run(). Remember to free() the memory to +/// keep Valgrind happy. +#define tuktest_file_from_srcdir(filename, sizeptr) \ + tuktest_file_from_x(getenv("srcdir"), filename, sizeptr, \ + __FILE__, __LINE__) + +/// Like tuktest_file_from_srcdir except this reads from the current directory. +#define tuktest_file_from_builddir(filename, sizeptr) \ + tuktest_file_from_x(NULL, filename, sizeptr, __FILE__, __LINE__) + +// Internal helper for the macros above. +tuktest_maybe_unused +static void * +tuktest_file_from_x(const char *prefix, const char *filename, size_t *size, + const char *prog_filename, unsigned prog_line) +{ + // If needed: buffer for holding prefix + '/' + filename + '\0'. + char *alloc_name = NULL; + + // Buffer for the data read from the file. + void *buf = NULL; + + // File being read + FILE *f = NULL; + + // Error message to use under the "error:" label. + const char *error_msg = NULL; + + if (filename == NULL) { + error_msg = "Filename is NULL"; + filename = "(NULL)"; + goto error; + } + + if (filename[0] == '\0') { + error_msg = "Filename is an empty string"; + filename = "(empty string)"; + goto error; + } + + if (size == NULL) { + error_msg = "The size argument is NULL"; + goto error; + } + + // If a prefix was given, construct the full filename. + if (prefix != NULL && prefix[0] != '\0') { + const size_t prefix_len = strlen(prefix); + const size_t filename_len = strlen(filename); + + const size_t alloc_name_size + = prefix_len + 1 + filename_len + 1; + alloc_name = tuktest_malloc_impl(alloc_name_size, + prog_filename, prog_line); + + memcpy(alloc_name, prefix, prefix_len); + alloc_name[prefix_len] = '/'; + memcpy(alloc_name + prefix_len + 1, filename, filename_len); + alloc_name[prefix_len + 1 + filename_len] = '\0'; + + // Set filename to point to the new string. alloc_name + // can be freed unconditionally as it is NULL if a prefix + // wasn't specified. + filename = alloc_name; + } + + f = fopen(filename, "rb"); + if (f == NULL) { + error_msg = "Failed to open the file"; + goto error; + } + + // Get the size of the file and store it in *size. + // + // We assume that the file isn't big and even reject very big files. + // There is no need to use fseeko/ftello from POSIX to support + // large files. Using standard C functions is portable outside POSIX. + if (fseek(f, 0, SEEK_END) != 0) { + error_msg = "Seeking failed (fseek end)"; + goto error; + } + + const long end = ftell(f); + if (end < 0) { + error_msg = "Seeking failed (ftell)"; + goto error; + } + + if (end == 0) { + error_msg = "File is empty"; + goto error; + } + + if (end > TUKTEST_FILE_SIZE_MAX) { + error_msg = "File size exceeds TUKTEST_FILE_SIZE_MAX"; + goto error; + } + + *size = (size_t)end; + rewind(f); + + buf = tuktest_malloc_impl(*size, prog_filename, prog_line); + + const size_t amount = fread(buf, 1, *size, f); + if (ferror(f)) { + error_msg = "Read error"; + goto error; + } + + if (amount != *size) { + error_msg = "File is smaller than indicated by ftell()"; + goto error; + } + + const int fclose_ret = fclose(f); + f = NULL; + if (fclose_ret != 0) { + error_msg = "Error closing the file"; + goto error; + } + + tuktest_free(alloc_name); + return buf; + +error: + if (f != NULL) + (void)fclose(f); + + tuktest_error_impl(prog_filename, prog_line, + "tuktest_file_from_x: %s: %s\n", filename, error_msg); +} + + +// Internal helper for assert_fail, assert_skip, and assert_error. +#define tuktest_print_and_jump(result, ...) \ +do { \ + tuktest_print_result_prefix(result, __FILE__, __LINE__); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + longjmp(tuktest_jmpenv, result); \ +} while (0) + + +/// Unconditionally fails the test (non-zero exit status if not using TAP). +/// Execution will continue from the next test. +/// +/// A printf format string is supported. +/// If no extra message is wanted, use "" as the argument. +#define assert_fail(...) tuktest_print_and_jump(TUKTEST_FAIL, __VA_ARGS__) + + +/// Skips the test (exit status 77 if not using TAP). +/// Execution will continue from the next test. +/// +/// If you can detect early that no tests can be run, tuktest_early_skip() +/// might be a better way to skip the test(s). Especially in TAP mode this +/// makes a difference as with assert_skip() it will list a skipped specific +/// test name but with tuktest_early_skip() it will indicate that the whole +/// test program was skipped (with tuktest_early_skip() the TAP plan will +/// indicate zero tests). +/// +/// A printf format string is supported. +/// If no extra message is wanted, use "" as the argument. +#define assert_skip(...) tuktest_print_and_jump(TUKTEST_SKIP, __VA_ARGS__) + + +/// Hard error (exit status 99 if not using TAP). +/// The remaining tests in this program will not be run or reported. +/// +/// A printf format string is supported. +/// If no extra message is wanted, use "" as the argument. +#define assert_error(...) tuktest_print_and_jump(TUKTEST_ERROR, __VA_ARGS__) + + +/// Fails the test if the test expression doesn't evaluate to false. +#define assert_false(test_expr) \ +do { \ + if (test_expr) \ + assert_fail("assert_fail: '%s' is true but should be false", \ + #test_expr); \ +} while (0) + + +/// Fails the test if the test expression doesn't evaluate to true. +#define assert_true(test_expr) \ +do { \ + if (!(test_expr)) \ + assert_fail("assert_true: '%s' is false but should be true", \ + #test_expr); \ +} while (0) + + +/// Fails the test if comparing the signed integer expressions using the +/// specified comparison operator evaluates to false. For example, +/// assert_int(foobar(), >=, 0) fails the test if 'foobar() >= 0' isn't true. +/// For good error messages, the first argument should be the test expression +/// and the third argument the reference value (usually a constant). +/// +/// For equality (==) comparison there is a assert_int_eq() which +/// might be more convenient to use. +#define assert_int(test_expr, cmp_op, ref_value) \ +do { \ + const tuktest_int v_test_ = (test_expr); \ + const tuktest_int v_ref_ = (ref_value); \ + if (!(v_test_ cmp_op v_ref_)) \ + assert_fail("assert_int: '%s == %" TUKTEST_PRId \ + "' but expected '... %s %" TUKTEST_PRId "'", \ + #test_expr, v_test_, #cmp_op, v_ref_); \ +} while (0) + + +/// Like assert_int() but for unsigned integers. +/// +/// For equality (==) comparison there is a assert_uint_eq() which +/// might be more convenient to use. +#define assert_uint(test_expr, cmp_op, ref_value) \ +do { \ + const tuktest_uint v_test_ = (test_expr); \ + const tuktest_uint v_ref_ = (ref_value); \ + if (!(v_test_ cmp_op v_ref_)) \ + assert_fail("assert_uint: '%s == %" TUKTEST_PRIu \ + "' but expected '... %s %" TUKTEST_PRIu "'", \ + #test_expr, v_test_, #cmp_op, v_ref_); \ +} while (0) + + +/// Fails the test if test expression doesn't equal the expected +/// signed integer value. +#define assert_int_eq(test_expr, ref_value) \ + assert_int(test_expr, ==, ref_value) + + +/// Fails the test if test expression doesn't equal the expected +/// unsigned integer value. +#define assert_uint_eq(test_expr, ref_value) \ + assert_uint(test_expr, ==, ref_value) + + +/// Fails the test if the test expression doesn't equal the expected +/// enumeration value. This is like assert_int_eq() but the error message +/// shows the enumeration constant names instead of their numeric values +/// as long as the values are non-negative and not big. +/// +/// The third argument must be a table of string pointers. A pointer to +/// a pointer doesn't work because this determines the number of elements +/// in the array using sizeof. For example: +/// +/// const char *my_enum_names[] = { "MY_FOO", "MY_BAR", "MY_BAZ" }; +/// assert_enum_eq(some_func_returning_my_enum(), MY_BAR, my_enum_names); +/// +/// (If the reference value is out of bounds, both values are printed as +/// an integer. If only test expression is out of bounds, it is printed +/// as an integer and the reference as a string. Otherwise both are printed +/// as a string.) +#define assert_enum_eq(test_expr, ref_value, enum_strings) \ +do { \ + const tuktest_int v_test_ = (test_expr); \ + const tuktest_int v_ref_ = (ref_value); \ + if (v_test_ != v_ref_) { \ + const int array_len_ = (int)(sizeof(enum_strings) \ + / sizeof((enum_strings)[0])); \ + if (v_ref_ < 0 || v_ref_ >= array_len_) \ + assert_fail("assert_enum_eq: '%s == %" TUKTEST_PRId \ + "' but expected " \ + "'... == %" TUKTEST_PRId "'", \ + #test_expr, v_test_, v_ref_); \ + else if (v_test_ < 0 || v_test_ >= array_len_) \ + assert_fail("assert_enum_eq: '%s == %" TUKTEST_PRId \ + "' but expected '... == %s'", \ + #test_expr, v_test_, \ + (enum_strings)[v_ref_]); \ + else \ + assert_fail("assert_enum_eq: '%s == %s' " \ + "but expected '... = %s'", \ + #test_expr, (enum_strings)[v_test_], \ + (enum_strings)[v_ref_]); \ + } \ +} while (0) + + +/// Fails the test if the specified bit isn't set in the test expression. +#define assert_bit_set(test_expr, bit) \ +do { \ + const tuktest_uint v_test_ = (test_expr); \ + const unsigned v_bit_ = (bit); \ + const tuktest_uint v_mask_ = (tuktest_uint)1 << v_bit_; \ + if (!(v_test_ & v_mask_)) \ + assert_fail("assert_bit_set: '%s == 0x%" TUKTEST_PRIX \ + "' but bit %u (0x%" TUKTEST_PRIX ") " \ + "is not set", \ + #test_expr, v_test_, v_bit_, v_mask_); \ +} while (0) + + +/// Fails the test if the specified bit is set in the test expression. +#define assert_bit_not_set(test_expr, bit) \ +do { \ + const tuktest_uint v_test_ = (test_expr); \ + const unsigned v_bit_ = (bit); \ + const tuktest_uint v_mask_ = (tuktest_uint)1 << v_bit_; \ + if (v_test_ & v_mask_) \ + assert_fail("assert_bit_not_set: '%s == 0x%" TUKTEST_PRIX \ + "' but bit %u (0x%" TUKTEST_PRIX ") is set", \ + #test_expr, v_test_, v_bit_, v_mask_); \ +} while (0) + + +/// Fails the test if unless all bits that are set in the bitmask are also +/// set in the test expression. +#define assert_bitmask_set(test_expr, mask) \ +do { \ + const tuktest_uint v_mask_ = (mask); \ + const tuktest_uint v_test_ = (test_expr) & v_mask_; \ + if (v_test_ != v_mask_) \ + assert_fail("assert_bitmask_set: " \ + "'((%s) & 0x%" TUKTEST_PRIX ") == " \ + "0x%" TUKTEST_PRIX "' but expected " \ + "'... == 0x%" TUKTEST_PRIX "'", \ + #test_expr, v_mask_, v_test_, v_mask_); \ +} while (0) + + +/// Fails the test if any of the bits that are set in the bitmask are also +/// set in the test expression. +#define assert_bitmask_not_set(test_expr, mask) \ +do { \ + const tuktest_uint v_mask_ = (mask); \ + const tuktest_uint v_test_ = (test_expr) & v_mask_; \ + if (v_test_ != 0) \ + assert_fail("assert_bitmask_not_set: "\ + "'((%s) & 0x%" TUKTEST_PRIX ") == " \ + "0x%" TUKTEST_PRIX "' but expected " \ + "'... == 0'", \ + #test_expr, v_mask_, v_test_); \ +} while (0) + + +// Internal helper to add common code for string assertions. +#define tuktest_str_helper1(macro_name, test_expr, ref_value) \ + const char *v_test_ = (test_expr); \ + const char *v_ref_ = (ref_value); \ + if (v_test_ == NULL) \ + assert_fail(macro_name ": Test expression '%s' is NULL", \ + #test_expr); \ + if (v_ref_ == NULL) \ + assert_fail(macro_name ": Reference value '%s' is NULL", \ + #ref_value) + + +// Internal helper to add common code for string assertions and to check +// that the reference value isn't an empty string. +#define tuktest_str_helper2(macro_name, test_expr, ref_value) \ + tuktest_str_helper1(macro_name, test_expr, ref_value); \ + if (v_ref_[0] == '\0') \ + assert_fail(macro_name ": Reference value is an empty string") + + +/// Fails the test if the test expression evaluates to string that doesn't +/// equal to the expected string. +#define assert_str_eq(test_expr, ref_value) \ +do { \ + tuktest_str_helper1("assert_str_eq", test_expr, ref_value); \ + if (strcmp(v_ref_, v_test_) != 0) \ + assert_fail("assert_str_eq: '%s' evaluated to '%s' " \ + "but expected '%s'", \ + #test_expr, v_test_, v_ref_); \ +} while (0) + + +/// Fails the test if the test expression evaluates to a string that doesn't +/// contain the reference value as a substring. Also fails the test if +/// the reference value is an empty string. +#define assert_str_contains(test_expr, ref_value) \ +do { \ + tuktest_str_helper2("assert_str_contains", test_expr, ref_value); \ + if (strstr(v_test_, v_ref_) == NULL) \ + assert_fail("assert_str_contains: '%s' evaluated to '%s' " \ + "which doesn't contain '%s'", \ + #test_expr, v_test_, v_ref_); \ +} while (0) + + +/// Fails the test if the test expression evaluates to a string that +/// contains the reference value as a substring. Also fails the test if +/// the reference value is an empty string. +#define assert_str_doesnt_contain(test_expr, ref_value) \ +do { \ + tuktest_str_helper2("assert_str_doesnt_contain", \ + test_expr, ref_value); \ + if (strstr(v_test_, v_ref_) != NULL) \ + assert_fail("assert_str_doesnt_contain: " \ + "'%s' evaluated to '%s' which contains '%s'", \ + #test_expr, v_test_, v_ref_); \ +} while (0) + + +/// Fails the test if the first array_size elements of the test array +/// don't equal to correct_array. +/// +/// NOTE: This avoids %zu for portability to very old systems that still +/// can compile C99 code. +#define assert_array_eq(test_array, correct_array, array_size) \ +do { \ + for (size_t i_ = 0; i_ < (array_size); ++i_) \ + if ((test_array)[i_] != (correct_array)[i_]) \ + assert_fail("assert_array_eq: " \ + "%s[%" TUKTEST_PRIu "] != "\ + "%s[%" TUKTEST_PRIu "] " \ + "but should be equal", \ + #test_array, (tuktest_uint)i_, \ + #correct_array, (tuktest_uint)i_); \ +} while (0) + +#endif diff --git a/tests/xzgrep_expected_output b/tests/xzgrep_expected_output new file mode 100644 index 0000000..e531d93 --- /dev/null +++ b/tests/xzgrep_expected_output @@ -0,0 +1,39 @@ +=> xzgrep el <= +xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut +xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu +xzgrep_test_2.xz:Hello +retval 0 +=> xzgrep -l el <= +xzgrep_test_1.xz +xzgrep_test_2.xz +retval 0 +=> xzgrep -h el <= +elit, sed do eiusmod tempor incididunt ut +in voluptate velit esse cillum dolore eu +Hello +retval 0 +=> xzgrep -H el <= +xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut +xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu +xzgrep_test_2.xz:Hello +retval 0 +=> xzgrep Hello <= +xzgrep_test_2.xz:Hello +retval 0 +=> xzgrep -l Hello <= +xzgrep_test_2.xz +retval 0 +=> xzgrep -h Hello <= +Hello +retval 0 +=> xzgrep -H Hello <= +xzgrep_test_2.xz:Hello +retval 0 +=> xzgrep NOMATCH <= +retval 1 +=> xzgrep -l NOMATCH <= +retval 1 +=> xzgrep -h NOMATCH <= +retval 1 +=> xzgrep -H NOMATCH <= +retval 1