mirror of
https://github.com/PCSX2/xz.git
synced 2026-02-05 03:41:17 +01:00
Compare commits
140 Commits
v5.0
...
v5.1.2alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7ff218528 | ||
|
|
8f3c1d886f | ||
|
|
0d5fa05466 | ||
|
|
df11317985 | ||
|
|
bd9cc179e8 | ||
|
|
4a238dd9b2 | ||
|
|
88ccf47205 | ||
|
|
972179cdcd | ||
|
|
1403707fc6 | ||
|
|
eccd8017ff | ||
|
|
2e6754eac2 | ||
|
|
b3235a0b1a | ||
|
|
f1675f765f | ||
|
|
3a0c5378ab | ||
|
|
1bd2c2c553 | ||
|
|
905f0ab5b5 | ||
|
|
4bd1a3bd5f | ||
|
|
d2e836f2f3 | ||
|
|
c9a1615157 | ||
|
|
1530a74fd4 | ||
|
|
d8db706acb | ||
|
|
3f94b6d87f | ||
|
|
7769ea051d | ||
|
|
ec92110572 | ||
|
|
27d24eb0a9 | ||
|
|
ab25b82a91 | ||
|
|
d05d6d65c4 | ||
|
|
e077391982 | ||
|
|
fc39849c35 | ||
|
|
29fa0566d5 | ||
|
|
aac1b31ea4 | ||
|
|
df14a46013 | ||
|
|
03ed742a3a | ||
|
|
8c5b13ad59 | ||
|
|
c7376fc415 | ||
|
|
cff070aba6 | ||
|
|
41cafb2bf9 | ||
|
|
2dcea03712 | ||
|
|
7db6bdf4ab | ||
|
|
694952d545 | ||
|
|
418fe668b3 | ||
|
|
7081d82c37 | ||
|
|
232fe7cd70 | ||
|
|
74d2bae4d3 | ||
|
|
4ac4923f47 | ||
|
|
ab50ae3ef4 | ||
|
|
6b620a0f08 | ||
|
|
bd52cf150e | ||
|
|
5c5b225696 | ||
|
|
5b1e1f1074 | ||
|
|
e9ed88126e | ||
|
|
1c673e5681 | ||
|
|
324cde7a86 | ||
|
|
492c863455 | ||
|
|
fc4d443696 | ||
|
|
bd35d903a0 | ||
|
|
afbb244362 | ||
|
|
79bef85e05 | ||
|
|
c029744506 | ||
|
|
8bd91918ac | ||
|
|
fe00f95828 | ||
|
|
21b45b9bab | ||
|
|
48053e8a45 | ||
|
|
bba37df2c9 | ||
|
|
4161d76349 | ||
|
|
b94aa0c838 | ||
|
|
f004128678 | ||
|
|
f779516f42 | ||
|
|
830ba58777 | ||
|
|
ec7106309c | ||
|
|
4c6e146df9 | ||
|
|
7a480e4859 | ||
|
|
c29e6630c1 | ||
|
|
0b77c4a751 | ||
|
|
e4622df9ab | ||
|
|
9c1b05828a | ||
|
|
3de00cc75d | ||
|
|
bd5002f582 | ||
|
|
6ef4eabc0a | ||
|
|
9a4377be0d | ||
|
|
3e321a3acd | ||
|
|
d91a84b534 | ||
|
|
14e6ad8cfe | ||
|
|
70e750f597 | ||
|
|
24e0406c0f | ||
|
|
de678e0c92 | ||
|
|
25fe729532 | ||
|
|
91afb785a1 | ||
|
|
4a9905302a | ||
|
|
0badb0b1bd | ||
|
|
a7934c446a | ||
|
|
5eefc0086d | ||
|
|
d119927475 | ||
|
|
3b22fc2c87 | ||
|
|
71b9380145 | ||
|
|
ec7e3dbad7 | ||
|
|
cd3086ff44 | ||
|
|
fb64a49243 | ||
|
|
a34730cf6a | ||
|
|
9f0a806aef | ||
|
|
352ac82db5 | ||
|
|
9e807fe3fe | ||
|
|
ebd54dbd6e | ||
|
|
cd4fe97852 | ||
|
|
607f9f98ae | ||
|
|
fca396b374 | ||
|
|
b03f6cd3eb | ||
|
|
335fe260a8 | ||
|
|
9edd6ee895 | ||
|
|
411013ea45 | ||
|
|
b34c5ce4b2 | ||
|
|
db33117cc8 | ||
|
|
1039bfcfc0 | ||
|
|
1ef3cf44a8 | ||
|
|
bd432015d3 | ||
|
|
1688901321 | ||
|
|
85cdf7dd4e | ||
|
|
c3f4995586 | ||
|
|
0d21f49a80 | ||
|
|
40277998cb | ||
|
|
2118733045 | ||
|
|
c7210d9a3f | ||
|
|
4eb83e3204 | ||
|
|
923b22483b | ||
|
|
57597d42ca | ||
|
|
96f94bc925 | ||
|
|
8930c7ae3f | ||
|
|
940d5852c6 | ||
|
|
4ebe65f839 | ||
|
|
fc1d292dca | ||
|
|
6dd061adfd | ||
|
|
9d542ceebc | ||
|
|
4f2c69a4e3 | ||
|
|
adb89e68d4 | ||
|
|
7c24e0d1b8 | ||
|
|
b4d42f1a71 | ||
|
|
15ee6935ab | ||
|
|
8e355f7fdb | ||
|
|
974ebe6349 | ||
|
|
7c427ec38d |
6
AUTHORS
6
AUTHORS
@@ -16,11 +16,11 @@ Authors of XZ Utils
|
||||
|
||||
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 script and their man pages for
|
||||
Andrew Dudman helped adapting the scripts and their man pages for
|
||||
XZ Utils.
|
||||
|
||||
The GNU Autotools based build system contains files from many authors,
|
||||
which I'm not trying list here.
|
||||
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.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
@@ -10,7 +10,7 @@
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
@@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names:
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
||||
60
INSTALL
60
INSTALL
@@ -6,12 +6,14 @@ XZ Utils Installation
|
||||
1. Supported platforms
|
||||
1.1. Compilers
|
||||
1.2. Platform-specific notes
|
||||
1.2.1. IRIX
|
||||
1.2.2. MINIX 3
|
||||
1.2.3. OpenVMS
|
||||
1.2.4. Tru64
|
||||
1.2.5. Windows
|
||||
1.2.6. DOS
|
||||
1.2.1. AIX
|
||||
1.2.2. IRIX
|
||||
1.2.3. MINIX 3
|
||||
1.2.4. OpenVMS
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
1.2.6. Tru64
|
||||
1.2.7. Windows
|
||||
1.2.8. DOS
|
||||
1.3. Adding support for new platforms
|
||||
2. configure options
|
||||
2.1. Static vs. dynamic linking of liblzma
|
||||
@@ -62,23 +64,36 @@ XZ Utils Installation
|
||||
|
||||
1.2. Platform-specific notes
|
||||
|
||||
1.2.1. IRIX
|
||||
1.2.1. AIX
|
||||
|
||||
If you use IBM XL C compiler, pass CC=xlc_r to configure. If
|
||||
you use CC=xlc instead, you must disable threading support
|
||||
with --disable-threads (usually not recommended).
|
||||
|
||||
|
||||
1.2.2. IRIX
|
||||
|
||||
MIPSpro 7.4.4m has been reported to produce broken code if using
|
||||
the -O2 optimization flag ("make check" fails). Using -O1 should
|
||||
work.
|
||||
|
||||
A problem has been reported when using shared liblzma. Passing
|
||||
--disable-shared to configure works around this. Alternatively,
|
||||
putting "-64" to CFLAGS to build a 64-bit version might help too.
|
||||
|
||||
1.2.2. MINIX 3
|
||||
|
||||
1.2.3. MINIX 3
|
||||
|
||||
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
||||
which doesn't support C99. Install GCC to compile XZ Utils.
|
||||
|
||||
MINIX 3.1.8 (and possibly some other versions too) has bugs in
|
||||
/usr/include/stdint.h, which has to be patched before XZ Utils
|
||||
can be compiled correctly. See
|
||||
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
||||
to be patched before XZ Utils can be compiled correctly. See
|
||||
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
||||
|
||||
MINIX 3.2.0 and later use a different libc and aren't affected by
|
||||
the above bug.
|
||||
|
||||
XZ Utils doesn't have code to detect the amount of physical RAM and
|
||||
number of CPU cores on MINIX 3.
|
||||
|
||||
@@ -86,7 +101,7 @@ XZ Utils Installation
|
||||
may want to pass gl_cv_cc_visibility=no to configure).
|
||||
|
||||
|
||||
1.2.3. OpenVMS
|
||||
1.2.4. OpenVMS
|
||||
|
||||
XZ Utils can be built for OpenVMS, but the build system files
|
||||
are not included in the XZ Utils source package. The required
|
||||
@@ -96,14 +111,24 @@ XZ Utils Installation
|
||||
http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
|
||||
|
||||
|
||||
1.2.4. Tru64
|
||||
1.2.5. Solaris, OpenSolaris, and derivatives
|
||||
|
||||
The following linker error has been reported on some x86 systems:
|
||||
|
||||
ld: fatal: relocation error: R_386_GOTOFF: ...
|
||||
|
||||
This can be worked around by passing gl_cv_cc_visibility=no
|
||||
as an argument to the configure script.
|
||||
|
||||
|
||||
1.2.6. Tru64
|
||||
|
||||
If you try to use the native C compiler on Tru64 (passing CC=cc to
|
||||
configure), you may need the workaround mention in section 4.1 in
|
||||
this file (pass also ac_cv_prog_cc_c99= to configure).
|
||||
|
||||
|
||||
1.2.5. Windows
|
||||
1.2.7. Windows
|
||||
|
||||
Building XZ Utils on Windows is supported under MinGW + MSYS,
|
||||
MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to
|
||||
@@ -123,7 +148,7 @@ XZ Utils Installation
|
||||
windows/README-Windows.txt for details.
|
||||
|
||||
|
||||
1.2.6. DOS
|
||||
1.2.8. DOS
|
||||
|
||||
There is an experimental Makefile in the "dos" directory to build
|
||||
XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
|
||||
@@ -293,6 +318,11 @@ XZ Utils Installation
|
||||
single-threaded applications and want to avoid dependency
|
||||
on libpthread.
|
||||
|
||||
--enable-symbol-versions
|
||||
Use symbol versioning for liblzma. This is enabled by
|
||||
default on GNU/Linux, other GNU-based systems, and
|
||||
FreeBSD.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
run-time consistency checks. It makes the code slower, so
|
||||
|
||||
16
Makefile.am
16
Makefile.am
@@ -5,6 +5,9 @@
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
|
||||
GZIP_ENV = -9n
|
||||
|
||||
DIST_SUBDIRS = lib src po tests debug
|
||||
SUBDIRS =
|
||||
|
||||
@@ -29,8 +32,16 @@ dist_doc_DATA = \
|
||||
|
||||
examplesdir = $(docdir)/examples
|
||||
dist_examples_DATA = \
|
||||
doc/examples/xz_pipe_comp.c \
|
||||
doc/examples/xz_pipe_decomp.c
|
||||
doc/examples/00_README.txt \
|
||||
doc/examples/01_compress_easy.c \
|
||||
doc/examples/02_decompress.c \
|
||||
doc/examples/03_compress_custom.c \
|
||||
doc/examples/Makefile
|
||||
|
||||
examplesolddir = $(docdir)/examples_old
|
||||
dist_examplesold_DATA = \
|
||||
doc/examples_old/xz_pipe_comp.c \
|
||||
doc/examples_old/xz_pipe_decomp.c
|
||||
|
||||
EXTRA_DIST = \
|
||||
extra \
|
||||
@@ -84,6 +95,7 @@ dist-hook:
|
||||
|
||||
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
||||
mydist:
|
||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
VERSION=$(VERSION); \
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||
|
||||
175
NEWS
175
NEWS
@@ -1,6 +1,177 @@
|
||||
|
||||
XZ Utils User-Visible Changes
|
||||
=============================
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
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.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)
|
||||
|
||||
|
||||
54
README
54
README
@@ -5,7 +5,7 @@ XZ Utils
|
||||
0. Overview
|
||||
1. Documentation
|
||||
1.1. Overall documentation
|
||||
1.2. Documentation for command line tools
|
||||
1.2. Documentation for command-line tools
|
||||
1.3. Documentation for liblzma
|
||||
2. Version numbering
|
||||
3. Reporting bugs
|
||||
@@ -17,21 +17,21 @@ XZ Utils
|
||||
0. Overview
|
||||
-----------
|
||||
|
||||
XZ Utils provide a general-purpose data compression library and
|
||||
command line tools. The native file format is the .xz format, but
|
||||
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
|
||||
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 similar command line syntax than that of gzip.
|
||||
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, LZMA2 encoder uses
|
||||
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, LZMA2 encoder
|
||||
hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
|
||||
competes with bzip2 in compression speed, RAM usage, and compression
|
||||
ratio.
|
||||
|
||||
@@ -44,8 +44,8 @@ XZ Utils
|
||||
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 compression ratio. A filter chain may
|
||||
contain up to four filters, although usually only one two is used.
|
||||
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.
|
||||
|
||||
@@ -88,9 +88,9 @@ XZ Utils
|
||||
packages.
|
||||
|
||||
|
||||
1.2. Documentation for command line tools
|
||||
1.2. Documentation for command-line tools
|
||||
|
||||
The command line tools are documented as man pages. In source code
|
||||
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
|
||||
@@ -109,8 +109,8 @@ XZ Utils
|
||||
written yet.
|
||||
|
||||
For now, if you have never used liblzma, libbzip2, or zlib, I
|
||||
recommend learning *basics* of zlib API. Once you know that, it
|
||||
should be easier to learn liblzma.
|
||||
recommend learning the *basics* of the zlib API. Once you know that,
|
||||
it should be easier to learn liblzma.
|
||||
|
||||
http://zlib.net/manual.html
|
||||
http://zlib.net/zlib_how.html
|
||||
@@ -124,23 +124,27 @@ XZ Utils
|
||||
- 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 existing API or ABI. Even Y indicates
|
||||
stable release and odd Y indicates unstable (alpha or beta
|
||||
version).
|
||||
- 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 different meaning for stable and
|
||||
- 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.
|
||||
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
|
||||
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,
|
||||
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.
|
||||
|
||||
|
||||
@@ -176,7 +180,7 @@ XZ Utils
|
||||
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 an URL to the file(s) in the bug report.
|
||||
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"
|
||||
@@ -193,7 +197,7 @@ XZ Utils
|
||||
|
||||
The messages from the xz tool have been translated into a few
|
||||
languages. Before starting to translate into a new language, ask
|
||||
the author that someone else hasn't already started working on it.
|
||||
the author whether someone else hasn't already started working on it.
|
||||
|
||||
Test your translation. Testing includes comparing the translated
|
||||
output to the original English version by running the same commands
|
||||
@@ -214,7 +218,7 @@ XZ Utils
|
||||
Note especially the following:
|
||||
|
||||
- The output of --help and --long-help must look nice on
|
||||
a 80-column terminal. It's OK to add extra lines if needed.
|
||||
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,
|
||||
|
||||
18
THANKS
18
THANKS
@@ -10,18 +10,26 @@ has been important. :-) In alphabetical order:
|
||||
- Karl Berry
|
||||
- Anders F. Björklund
|
||||
- Emmanuel Blot
|
||||
- Martin Blumenstingl
|
||||
- Jakub Bogusz
|
||||
- Maarten Bosmans
|
||||
- Trent W. Buck
|
||||
- James Buren
|
||||
- David Burklund
|
||||
- Daniel Mealha Cabrita
|
||||
- Milo Casagrande
|
||||
- Marek Černocký
|
||||
- Chris Donawa
|
||||
- Andrew Dudman
|
||||
- Markus Duft
|
||||
- İsmail Dönmez
|
||||
- Robert Elz
|
||||
- Gilles Espinasse
|
||||
- Denis Excoffier
|
||||
- Michael Felt
|
||||
- Mike Frysinger
|
||||
- Bill Glessner
|
||||
- Jason Gorski
|
||||
- Juan Manuel Guerrero
|
||||
- Joachim Henke
|
||||
- Peter Ivanov
|
||||
@@ -34,15 +42,22 @@ has been important. :-) In alphabetical order:
|
||||
- Peter Lawler
|
||||
- Hin-Tak Leung
|
||||
- Andraž 'ruskie' Levstik
|
||||
- Cary Lewis
|
||||
- Wim Lewis
|
||||
- Lorenzo De Liso
|
||||
- Bela Lubkin
|
||||
- Gregory Margo
|
||||
- Jim Meyering
|
||||
- Arkadiusz Miskiewicz
|
||||
- Rafał Mużyło
|
||||
- Adrien Nader
|
||||
- Hongbo Ni
|
||||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
- Peter O'Gorman
|
||||
- Peter Pallinger
|
||||
- Igor Pavlov
|
||||
- Diego Elio Pettenò
|
||||
- Elbert Pol
|
||||
- Mikko Pouru
|
||||
- Robert Readman
|
||||
@@ -51,14 +66,17 @@ has been important. :-) In alphabetical order:
|
||||
- Christian von Roques
|
||||
- Jukka Salmi
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
- Christian Weisgerber
|
||||
- Bert Wesarg
|
||||
- Ralf Wildenhues
|
||||
|
||||
20
TODO
20
TODO
@@ -32,14 +32,27 @@ Known bugs
|
||||
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
|
||||
----------------
|
||||
|
||||
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
|
||||
Multithreaded compression:
|
||||
- Reduce memory usage of the current method.
|
||||
- Implement threaded match finders.
|
||||
- Implement pigz-style threading in LZMA2.
|
||||
|
||||
Multithreaded decompression
|
||||
|
||||
@@ -50,6 +63,11 @@ Missing features
|
||||
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.
|
||||
|
||||
122
configure.ac
122
configure.ac
@@ -229,7 +229,7 @@ fi
|
||||
|
||||
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
|
||||
|
||||
m4_foreach([NAME], [SUPPORTED_FILTERS],
|
||||
m4_foreach([NAME], [SUPPORTED_CHECKS],
|
||||
[enable_check_[]NAME=no
|
||||
])dnl
|
||||
|
||||
@@ -403,6 +403,33 @@ AC_ARG_ENABLE([scripts], [AC_HELP_STRING([--disable-scripts],
|
||||
AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
|
||||
|
||||
|
||||
#####################
|
||||
# Symbol versioning #
|
||||
#####################
|
||||
|
||||
AC_MSG_CHECKING([if library symbol versioning should be used])
|
||||
AC_ARG_ENABLE([symbol-versions], [AC_HELP_STRING([--enable-symbol-versions],
|
||||
[Use symbol versioning for liblzma. Enabled by default on
|
||||
GNU/Linux, other GNU-based systems, and FreeBSD.])],
|
||||
[], [enable_symbol_versions=auto])
|
||||
if test "x$enable_symbol_versions" = xauto; then
|
||||
case $host_os in
|
||||
# NOTE: Even if one omits -gnu on GNU/Linux (e.g.
|
||||
# i486-slackware-linux), configure will (via config.sub)
|
||||
# append -gnu (e.g. i486-slackware-linux-gnu), and this
|
||||
# test will work correctly.
|
||||
gnu* | *-gnu* | freebsd*)
|
||||
enable_symbol_versions=yes
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_symbol_versions])
|
||||
AM_CONDITIONAL([COND_SYMVERS], [test "x$enable_symbol_versions" = xyes])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Checks for programs.
|
||||
###############################################################################
|
||||
@@ -431,11 +458,24 @@ AC_USE_SYSTEM_EXTENSIONS
|
||||
if test "x$enable_threads" = xyes; then
|
||||
echo
|
||||
echo "Threading support:"
|
||||
ACX_PTHREAD
|
||||
AX_PTHREAD
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
CC="$PTHREAD_CC"
|
||||
|
||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX, but
|
||||
dnl it's tricky to get it right together with AC_PROG_CC_C99.
|
||||
dnl Thus, this is handled by telling the user in INSTALL to set
|
||||
dnl the correct CC manually.
|
||||
|
||||
# These are nice to have but not mandatory.
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
|
||||
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
fi
|
||||
AM_CONDITIONAL([COND_THREADS], [test "x$ax_pthread_ok" = xyes])
|
||||
|
||||
echo
|
||||
echo "Initializing Libtool:"
|
||||
@@ -517,12 +557,69 @@ gl_GETOPT
|
||||
# Find the best function to set timestamps.
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
|
||||
|
||||
# This is nice to have but not mandatory.
|
||||
AC_CHECK_FUNCS([posix_fadvise])
|
||||
|
||||
TUKLIB_PROGNAME
|
||||
TUKLIB_INTEGER
|
||||
TUKLIB_PHYSMEM
|
||||
TUKLIB_CPUCORES
|
||||
TUKLIB_MBSTR
|
||||
|
||||
# Check for system-provided SHA-256. At least the following is supported:
|
||||
#
|
||||
# OS Headers Library Type Function
|
||||
# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init
|
||||
# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init
|
||||
# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init
|
||||
# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init
|
||||
# MINIX 3 sys/types.h + minix/sha2.h libutil SHA256_CTX SHA256_Init
|
||||
# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init
|
||||
#
|
||||
# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead
|
||||
# of size_t.
|
||||
#
|
||||
# We don't check for e.g. OpenSSL or libgcrypt because we don't want
|
||||
# to introduce dependencies to other packages by default. Maybe such
|
||||
# libraries could be supported via additional configure options though.
|
||||
#
|
||||
if test "x$enable_check_sha256" = "xyes"; then
|
||||
# Test for Common Crypto before others, because Darwin has sha256.h
|
||||
# too and we don't want to use that, because on older versions it
|
||||
# uses OpenSSL functions, whose SHA256_Init is not guaranteed to
|
||||
# succeed.
|
||||
sha256_header_found=no
|
||||
AC_CHECK_HEADERS(
|
||||
[CommonCrypto/CommonDigest.h sha256.h sha2.h minix/sha2.h],
|
||||
[sha256_header_found=yes ; break])
|
||||
if test "x$sha256_header_found" = xyes; then
|
||||
AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], [], [],
|
||||
[[#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA256_H
|
||||
# include <sha256.h>
|
||||
#endif
|
||||
#ifdef HAVE_SHA2_H
|
||||
# include <sha2.h>
|
||||
#endif
|
||||
#ifdef HAVE_MINIX_SHA2_H
|
||||
# include <minix/sha2.h>
|
||||
#endif]])
|
||||
AC_SEARCH_LIBS([SHA256_Init], [md util])
|
||||
AC_SEARCH_LIBS([SHA256Init], [md])
|
||||
AC_CHECK_FUNCS([CC_SHA256_Init SHA256_Init SHA256Init],
|
||||
[break])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([COND_INTERNAL_SHA256],
|
||||
[test "x$ac_cv_func_SHA256_Init" != xyes \
|
||||
&& test "x$ac_cv_func_SHA256Init" != xyes \
|
||||
&& test "x$ac_cv_func_CC_SHA256_Init" != xyes])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# If using GCC, set some additional AM_CFLAGS:
|
||||
@@ -627,13 +724,13 @@ AC_CONFIG_FILES([
|
||||
src/xzdec/Makefile
|
||||
src/lzmainfo/Makefile
|
||||
src/scripts/Makefile
|
||||
src/scripts/xzdiff
|
||||
src/scripts/xzgrep
|
||||
src/scripts/xzmore
|
||||
src/scripts/xzless
|
||||
tests/Makefile
|
||||
debug/Makefile
|
||||
])
|
||||
AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff])
|
||||
AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep])
|
||||
AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore])
|
||||
AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -646,9 +743,8 @@ if test x$tuklib_cv_physmem_method = xunknown; then
|
||||
echo "or make a patch to add support for this operating system."
|
||||
fi
|
||||
|
||||
# Not threading yet so don't warn.
|
||||
#if test x$tuklib_cv_cpucores_method = xunknown; then
|
||||
# echo
|
||||
# echo "WARNING:"
|
||||
# echo "No supported method to detect the number of CPU cores."
|
||||
#fi
|
||||
if test x$tuklib_cv_cpucores_method = xunknown; then
|
||||
echo
|
||||
echo "WARNING:"
|
||||
echo "No supported method to detect the number of CPU cores."
|
||||
fi
|
||||
|
||||
27
doc/examples/00_README.txt
Normal file
27
doc/examples/00_README.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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)
|
||||
|
||||
297
doc/examples/01_compress_easy.c
Normal file
297
doc/examples/01_compress_easy.c
Normal file
@@ -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 <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
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 bufffer 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;
|
||||
}
|
||||
287
doc/examples/02_decompress.c
Normal file
287
doc/examples/02_decompress.c
Normal file
@@ -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 <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
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_CONATENATED 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;
|
||||
}
|
||||
193
doc/examples/03_compress_custom.c
Normal file
193
doc/examples/03_compress_custom.c
Normal file
@@ -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 <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <lzma.h>
|
||||
|
||||
|
||||
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/lzma.h (src/liblzma/api/lzma/lzma.h in the
|
||||
// source package or e.g. /usr/include/lzma/lzma.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/lzma.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;
|
||||
}
|
||||
23
doc/examples/Makefile
Normal file
23
doc/examples/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Author: Lasse Collin
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
#
|
||||
|
||||
CC = c99
|
||||
CFLAGS = -g
|
||||
LDFLAGS = -llzma
|
||||
|
||||
PROGS = \
|
||||
01_compress_easy \
|
||||
02_decompress \
|
||||
03_compress_custom
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
.c:
|
||||
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* xz_pipe_decomp.c
|
||||
* A simple example of pipe-only xz decompressor implementation.
|
||||
* version: 2010-07-12 - by Daniel Mealha Cabrita
|
||||
* version: 2012-06-14 - by Daniel Mealha Cabrita
|
||||
* Not copyrighted -- provided to the public domain.
|
||||
*
|
||||
* Compiling:
|
||||
@@ -101,6 +101,14 @@ int xz_decompress (FILE *in_file, FILE *out_file)
|
||||
} 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;
|
||||
}
|
||||
24
doc/faq.txt
24
doc/faq.txt
@@ -26,7 +26,7 @@ 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.
|
||||
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
|
||||
@@ -42,7 +42,7 @@ Q: Why is liblzma named liblzma if its primary file format is .xz?
|
||||
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 become popular before the
|
||||
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.
|
||||
|
||||
@@ -73,7 +73,7 @@ A: For now, no. Since XZ Utils supports the .lzma format, it's usually
|
||||
|
||||
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 time though, and would probably
|
||||
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.
|
||||
|
||||
@@ -84,7 +84,7 @@ Q: I have installed xz, but my tar doesn't recognize .tar.xz files.
|
||||
A: xz -dc foo.tar.xz | tar xf -
|
||||
|
||||
|
||||
Q: Can I recover parts of a broken .xz file (e.g. corrupted CD-R)?
|
||||
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
|
||||
@@ -94,7 +94,7 @@ A: It may be possible if the file consists of multiple blocks, which
|
||||
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 nature of software patents, it's not possible to
|
||||
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).
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ A: The .xz format is documented in xz-file-format.txt. It is a container
|
||||
filters.
|
||||
|
||||
Documenting LZMA and LZMA2 is planned, but for now, there is no other
|
||||
documentation that the source code. Before you begin, you should know
|
||||
the basics of LZ77 and range coding algorithms. LZMA is based on LZ77,
|
||||
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.
|
||||
|
||||
@@ -148,7 +148,7 @@ A: See the documentation in XZ Embedded. In short, something like
|
||||
|
||||
xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB
|
||||
|
||||
Adjust dictionary size to get a good compromise between
|
||||
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.
|
||||
@@ -184,10 +184,10 @@ A: It is planned and has been taken into account when designing
|
||||
The third method is pigz-style threading (I use that name, because
|
||||
pigz <http://www.zlib.net/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. It isn't
|
||||
significant with pigz, because Deflate uses only 32 KiB dictionary,
|
||||
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
|
||||
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.
|
||||
@@ -197,7 +197,7 @@ A: It is planned and has been taken into account when designing
|
||||
can cut the memory usage by 50 %.
|
||||
|
||||
It is possible that the single-threaded method will be modified to
|
||||
create files indentical to the pigz-style method. We'll see once
|
||||
create files identical to the pigz-style method. We'll see once
|
||||
pigz-style threading has been implemented in liblzma.
|
||||
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ History of LZMA Utils and XZ Utils
|
||||
|
||||
Tukaani distribution
|
||||
|
||||
In 2005, there was a small group working on Tukaani distribution, which
|
||||
was a Slackware fork. One of the project 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 compression ratio varied across
|
||||
packages, but this was what we got on average.
|
||||
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
|
||||
@@ -30,13 +30,13 @@ Tukaani distribution
|
||||
First steps of LZMA Utils
|
||||
|
||||
The first version of LZMA Utils (4.22.0) included a shell script called
|
||||
lzmash. It was wrapper that had gzip-like command line interface. It
|
||||
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 work with LZMA and
|
||||
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
|
||||
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.
|
||||
|
||||
@@ -48,33 +48,34 @@ 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
|
||||
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 little modifications. This tool replaced
|
||||
both the lzmash script and the LZMA_Alone command line tool in LZMA
|
||||
Utils.
|
||||
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 LZMA_Alone executable was simply named lzma like the new
|
||||
command line tool, but they had completely different command line
|
||||
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 API similar to zlib,
|
||||
although there were some significant differences, which made it
|
||||
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.
|
||||
The lzmadec command-line tool was converted to use liblzmadec.
|
||||
|
||||
Alexandre Sauvé helped converting build system to use GNU Autotools.
|
||||
This made is easier to test for certain less portable features needed
|
||||
by the new command line tool.
|
||||
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 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.
|
||||
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
|
||||
@@ -85,16 +86,16 @@ Second generation
|
||||
|
||||
File format problems
|
||||
|
||||
The file format used by LZMA_Alone was primitive. It was designed for
|
||||
embedded systems in mind, and thus provided only minimal set of
|
||||
features. The two biggest problems for non-embedded use were lack of
|
||||
magic bytes and integrity check.
|
||||
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 time would be more appropriate expression). It was mostly
|
||||
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.
|
||||
|
||||
@@ -102,7 +103,7 @@ File format problems
|
||||
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
|
||||
so long time, the old format got quite popular, and it was decided
|
||||
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
|
||||
@@ -125,13 +126,13 @@ 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 callback API to stateful API. Later, Igor Pavlov made
|
||||
C version of the LZMA encoder too; these ports from C++ to C were
|
||||
independent in LZMA SDK and LZMA Utils.
|
||||
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
|
||||
zlib-like API. liblzma supported both the old and new file format. The
|
||||
gzip-like lzma command line tool was rewritten to use liblzma.
|
||||
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
|
||||
@@ -139,7 +140,7 @@ Transition to XZ Utils
|
||||
caused unnecessary breakage in applications already using the early
|
||||
liblzma snapshots.
|
||||
|
||||
The xz command line tool can emulate the gzip-like lzma tool by
|
||||
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
|
||||
|
||||
@@ -40,7 +40,7 @@ The .lzma File Format
|
||||
|
||||
0.2. Changes
|
||||
|
||||
Last modified: 2009-05-01 11:15+0300
|
||||
Last modified: 2011-04-12 11:55+0300
|
||||
|
||||
|
||||
1. File Format
|
||||
@@ -161,6 +161,6 @@ The .lzma File Format
|
||||
XZ Utils - The next generation of LZMA Utils
|
||||
http://tukaani.org/xz/
|
||||
|
||||
The .xz file format - The successor of the the .lzma format
|
||||
The .xz file format - The successor of the .lzma format
|
||||
http://tukaani.org/xz/xz-file-format.txt
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
XZ Utils on DOS
|
||||
===============
|
||||
Building XZ Utils for DOS
|
||||
=========================
|
||||
|
||||
Introduction
|
||||
|
||||
@@ -77,12 +77,3 @@ Building
|
||||
are not built. Having e.g. xzdec.exe doesn't save much space compared
|
||||
to xz.exe, because the DJGPP runtime makes the .exe quite big anyway.
|
||||
|
||||
|
||||
Bugs
|
||||
|
||||
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
|
||||
|
||||
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
|
||||
when running under Windows XP Command Prompt (something goes wrong
|
||||
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.
|
||||
|
||||
@@ -16,7 +16,7 @@ CC = gcc
|
||||
STRIP = strip
|
||||
CPPFLAGS =
|
||||
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
|
||||
LDFLAGS =
|
||||
LDFLAGS = -lemu
|
||||
|
||||
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
|
||||
# because time.h uses GNU-style "extern inline".
|
||||
|
||||
123
dos/README.txt
Normal file
123
dos/README.txt
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
XZ Utils on DOS
|
||||
===============
|
||||
|
||||
DOS-specific filename handling
|
||||
|
||||
xz detects at runtime if long filename (LFN) support is
|
||||
available and will use it by default. It can be disabled by
|
||||
setting an environment variable:
|
||||
|
||||
set lfn=n
|
||||
|
||||
When xz is in LFN mode, it behaves pretty much the same as it
|
||||
does on other operating systems. Examples:
|
||||
|
||||
xz foo.tar -> foo.tar.xz
|
||||
xz -d foo.tar.xz -> foo.tar
|
||||
|
||||
xz -F lzma foo.tar -> foo.tar.lzma
|
||||
xz -d foo.tar.lzma -> foo.tar
|
||||
|
||||
When LFN support isn't available or it is disabled with LFN=n
|
||||
environment setting, xz works in short filename (SFN) mode. This
|
||||
affects filename suffix handling when compressing.
|
||||
|
||||
When compressing to the .xz format in SFN mode:
|
||||
|
||||
- Files without an extension get .xz just like on LFN systems.
|
||||
|
||||
- *.tar files become *.txz (shorthand for *.tar.xz). *.txz
|
||||
is recognized by xz on all supported operating systems.
|
||||
(Try to avoid confusing this with gzipped .txt files.)
|
||||
|
||||
- Files with 1-3 character extension have their extension modified
|
||||
so that the last character is a dash ("-"). If the extension
|
||||
is already three characters, the last character is lost. The
|
||||
resulting *.?- or *.??- filename is recognized in LFN mode, but
|
||||
it isn't recognized by xz on other operating systems.
|
||||
|
||||
Examples:
|
||||
|
||||
xz foo -> foo.xz | xz -d foo.xz -> foo
|
||||
xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar
|
||||
xz foo.c -> foo.c- | xz -d foo.c- -> foo.c
|
||||
xz read.me -> read.me- | xz -d read.me- -> read.me
|
||||
xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx !
|
||||
|
||||
Note that in the last example above, the third character of the
|
||||
filename extension is lost.
|
||||
|
||||
When compressing to the legacy .lzma format in SFN mode:
|
||||
|
||||
- *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz
|
||||
is recognized by xz on all supported operating systems.
|
||||
|
||||
- Other files become *.lzm. The original filename extension
|
||||
is lost. *.lzm is recognized also in LFN mode, but it is not
|
||||
recognized by xz on other operating systems.
|
||||
|
||||
Examples:
|
||||
|
||||
xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo
|
||||
xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar
|
||||
xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo !
|
||||
xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read !
|
||||
xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo !
|
||||
|
||||
When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to
|
||||
any file format:
|
||||
|
||||
- If the suffix begins with a dot, the filename extension is
|
||||
replaced with the new suffix. The original extension is lost.
|
||||
|
||||
- If the suffix doesn't begin with a dot and the filename has no
|
||||
extension and the filename given on the command line doesn't
|
||||
have a dot at the end, the custom suffix is appended just like
|
||||
on LFN systems.
|
||||
|
||||
- If the suffix doesn't begin with a dot and the filename has
|
||||
an extension (or an extension-less filename is given with a dot
|
||||
at the end), the last 1-3 characters of the filename extension
|
||||
may get overwritten to fit the given custom suffix.
|
||||
|
||||
Examples:
|
||||
|
||||
xz -S x foo -> foox | xz -dS x foox -> foo
|
||||
xz -S x foo. -> foo.x | xz -dS x foo.x -> foo
|
||||
xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo
|
||||
xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo
|
||||
xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo
|
||||
xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo !
|
||||
xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c
|
||||
xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c
|
||||
xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m !
|
||||
xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t !
|
||||
xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo !
|
||||
|
||||
When decompressing, the suffix handling in SFN mode is the same as
|
||||
in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are
|
||||
recognized also in LFN mode.
|
||||
|
||||
xz handles certain uncommon situations safely:
|
||||
|
||||
- If the generated output filename refers to the same file as
|
||||
the input file, xz detects this and refuses to compress or
|
||||
decompress the input file even if --force is used. This can
|
||||
happen when giving an overlong filename in SFN mode. E.g.
|
||||
"xz -S x foo.texinfo" would try to write to foo.tex which on
|
||||
SFN system is the same file as foo.texinfo.
|
||||
|
||||
- If the generated output filename is a special file like "con"
|
||||
or "prn", xz detects this and refuses to compress or decompress
|
||||
the input file even if --force is used.
|
||||
|
||||
|
||||
Bugs
|
||||
|
||||
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
|
||||
|
||||
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
|
||||
when running under Windows XP Command Prompt (something goes wrong
|
||||
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.
|
||||
|
||||
@@ -1,93 +1,94 @@
|
||||
##### http://autoconf-archive.cryp.to/acx_pthread.html
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads.
|
||||
# It sets the PTHREAD_LIBS output variable to the threads library and
|
||||
# linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||
# C compiler flags that are needed. (The user can also force certain
|
||||
# compiler flags/libs to be tested by setting these environment
|
||||
# variables.)
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise).
|
||||
# (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these
|
||||
# flags, but also link it with them as well. e.g. you should link
|
||||
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||
# $LIBS
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use
|
||||
# these variables in your default LIBS, CFLAGS, and CC:
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||
# default action will define HAVE_PTHREAD.
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or
|
||||
# if you have any other suggestions or comments. This macro was based
|
||||
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
||||
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
||||
# macros posted by Alejandro Forero Cuervo to the autoconf macro
|
||||
# repository. We are also grateful for the helpful feedback of
|
||||
# numerous users.
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# LAST MODIFICATION
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# 2007-07-29
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# COPYLEFT
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
#
|
||||
# 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 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
# 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 3 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.
|
||||
# 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, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright
|
||||
# owner gives unlimited permission to copy, distribute and modify the
|
||||
# configure scripts that are the output of Autoconf when processing
|
||||
# the Macro. You need not follow the terms of the GNU General Public
|
||||
# License when using or distributing such scripts, even though
|
||||
# portions of the text of the Macro appear in them. The GNU General
|
||||
# Public License (GPL) does govern all other use of the material that
|
||||
# constitutes the Autoconf Macro.
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the
|
||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
||||
# make and distribute a modified version of the Autoconf Macro, you
|
||||
# may extend this special exception to the GPL to apply to your
|
||||
# modified version as well.
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
#serial 18
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
@@ -102,9 +103,9 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
@@ -122,7 +123,7 @@ fi
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
@@ -144,8 +145,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
case ${host_os} in
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
@@ -155,12 +156,16 @@ case "${host_cpu}-${host_os}" in
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
@@ -172,12 +177,12 @@ for flag in $acx_pthread_flags; do
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
@@ -199,17 +204,23 @@ for flag in $acx_pthread_flags; do
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[acx_pthread_ok=yes])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
@@ -219,19 +230,21 @@ done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
@@ -241,24 +254,41 @@ if test "x$acx_pthread_ok" = xyes; then
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
case ${host_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
ax_cv_PTHREAD_PRIO_INHERIT, [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
@@ -268,12 +298,12 @@ AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
92
macosx/build.sh
Executable file
92
macosx/build.sh
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Author: Anders F Björklund <afb@users.sourceforge.net>
|
||||
#
|
||||
# This file has been put into the public domain.
|
||||
# You can do whatever you want with this file.
|
||||
###############################################################################
|
||||
|
||||
mkdir -p Root
|
||||
mkdir -p Resources
|
||||
|
||||
# Abort immediately if something goes wrong.
|
||||
set -e
|
||||
|
||||
# Clean up if it was already configured.
|
||||
[ -f Makefile ] && make distclean
|
||||
|
||||
# Build the regular fat program
|
||||
|
||||
CC="gcc-4.0" \
|
||||
CFLAGS="-O2 -g -arch ppc -arch ppc64 -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
|
||||
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec i686-apple-darwin8
|
||||
|
||||
make
|
||||
|
||||
make check
|
||||
|
||||
make DESTDIR=`pwd`/Root install
|
||||
|
||||
make distclean
|
||||
|
||||
# Build the size-optimized program
|
||||
|
||||
CC="gcc-4.0" \
|
||||
CFLAGS="-Os -g -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
|
||||
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads i686-apple-darwin8
|
||||
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
make -C src/xzdec DESTDIR=`pwd`/Root install
|
||||
|
||||
cp -a ../extra Root/usr/local/share/doc/xz
|
||||
|
||||
make distclean
|
||||
|
||||
# Strip debugging symbols and make relocatable
|
||||
|
||||
for bin in xz lzmainfo xzdec lzmadec; do
|
||||
strip -S Root/usr/local/bin/$bin
|
||||
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
|
||||
done
|
||||
|
||||
for lib in liblzma.5.dylib; do
|
||||
strip -S Root/usr/local/lib/$lib
|
||||
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
|
||||
done
|
||||
|
||||
strip -S Root/usr/local/lib/liblzma.a
|
||||
rm -f Root/usr/local/lib/liblzma.la
|
||||
|
||||
# Include pkg-config while making relocatable
|
||||
|
||||
sed -e 's|prefix=/usr/local|prefix=${pcfiledir}/../..|' < Root/usr/local/lib/pkgconfig/liblzma.pc > Root/liblzma.pc
|
||||
mv Root/liblzma.pc Root/usr/local/lib/pkgconfig/liblzma.pc
|
||||
|
||||
# Create tarball, but without the HFS+ attrib
|
||||
|
||||
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
|
||||
|
||||
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
|
||||
|
||||
# Include documentation files for package
|
||||
|
||||
cp -p ../README Resources/ReadMe.txt
|
||||
cp -p ../COPYING Resources/License.txt
|
||||
|
||||
# Make an Installer.app package
|
||||
|
||||
ID="org.tukaani.xz"
|
||||
VERSION=`cd ..; sh build-aux/version.sh`
|
||||
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
|
||||
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g 10.4 --verbose
|
||||
|
||||
# Put the package in a disk image
|
||||
|
||||
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
|
||||
hdiutil internet-enable -yes -quiet XZ.dmg
|
||||
|
||||
echo
|
||||
echo "Build completed successfully."
|
||||
echo
|
||||
@@ -1,3 +1,5 @@
|
||||
cs
|
||||
de
|
||||
fr
|
||||
it
|
||||
pl
|
||||
|
||||
282
po/de.po
282
po/de.po
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: XZ Utils 4.999.9beta\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2010-09-11 17:07+0200\n"
|
||||
"POT-Creation-Date: 2012-05-29 21:55+0200\n"
|
||||
"PO-Revision-Date: 2010-09-07 20:27+0200\n"
|
||||
"Last-Translator: <maan@systemlinux.org>\n"
|
||||
"Language-Team: German\n"
|
||||
@@ -15,63 +15,75 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/xz/args.c:333
|
||||
#: src/xz/args.c:338
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Unbekanntes file format"
|
||||
|
||||
#: src/xz/args.c:356 src/xz/args.c:364
|
||||
#: src/xz/args.c:361 src/xz/args.c:369
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: Integritäts-Check Typ nicht unterstützt"
|
||||
|
||||
#: src/xz/args.c:382
|
||||
#: src/xz/args.c:396
|
||||
msgid "Only one file can be specified with `--files' or `--files0'."
|
||||
msgstr ""
|
||||
"Nur ein file kann als Argument für --files oder --files0 angegeben werden."
|
||||
|
||||
#: src/xz/args.c:445
|
||||
#: src/xz/args.c:459
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "Die Umgebungsvariable %s enthält zu viele Argumente"
|
||||
|
||||
#: src/xz/coder.c:95
|
||||
#: src/xz/coder.c:105
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maximal vier Filter möglich"
|
||||
|
||||
#: src/xz/coder.c:108
|
||||
#: src/xz/coder.c:118
|
||||
msgid "Memory usage limit is too low for the given filter setup."
|
||||
msgstr ""
|
||||
"Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
|
||||
|
||||
#: src/xz/coder.c:129
|
||||
#: src/xz/coder.c:148
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Verwendung der Voreinstellung im raw Modus wird nicht empfohlen."
|
||||
|
||||
#: src/xz/coder.c:131
|
||||
#: src/xz/coder.c:150
|
||||
msgid "The exact options of the presets may vary between software versions."
|
||||
msgstr ""
|
||||
"Die genauen Optionen der Voreinstellung können zwischen Software Versionen "
|
||||
"variieren."
|
||||
|
||||
#: src/xz/coder.c:157
|
||||
#: src/xz/coder.c:176
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Das .lzma Format unterstützt nur den LZMA1 Filter"
|
||||
|
||||
#: src/xz/coder.c:165
|
||||
#: src/xz/coder.c:184
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 kann nicht mit dem .xz Format verwendet werden"
|
||||
|
||||
#: src/xz/coder.c:182
|
||||
#: src/xz/coder.c:203
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Benutze bis zu %<PRIu32> Threads."
|
||||
|
||||
#: src/xz/coder.c:216
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Optionen nicht unterstützt"
|
||||
|
||||
#: src/xz/coder.c:190
|
||||
#: src/xz/coder.c:224
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "Dekompression wird %s MiB Speicher brauchen."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
#: src/xz/coder.c:259
|
||||
msgid ""
|
||||
"Adjusted the number of threads from %s to %s to not exceed the memory usage "
|
||||
"limit of %s MiB"
|
||||
msgstr ""
|
||||
"Passte die Anzahl Threads von %s auf %s an um nicht das Speicher "
|
||||
"Nutzungslimit von %s MiB zu übersteigen"
|
||||
|
||||
#: src/xz/coder.c:313
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
|
||||
@@ -90,121 +102,121 @@ msgstr ""
|
||||
#. 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:137
|
||||
#: src/xz/file_io.c:136
|
||||
#, c-format
|
||||
msgid "%s: File seems to have been moved, not removing"
|
||||
msgstr ""
|
||||
"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
|
||||
|
||||
#: src/xz/file_io.c:144 src/xz/file_io.c:590
|
||||
#: src/xz/file_io.c:143 src/xz/file_io.c:635
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Kann nicht löschen: %s"
|
||||
|
||||
#: src/xz/file_io.c:169
|
||||
#: src/xz/file_io.c:168
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: Kann Datei Eigentümer nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:175
|
||||
#: src/xz/file_io.c:174
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Kann Datei Gruppe nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:194
|
||||
#: src/xz/file_io.c:193
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Kann Zugriffsrechte nicht setzen: %s"
|
||||
|
||||
#: src/xz/file_io.c:337 src/xz/file_io.c:420
|
||||
#: src/xz/file_io.c:340 src/xz/file_io.c:423
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Überspringe symbolischen Verweis"
|
||||
|
||||
#: src/xz/file_io.c:455
|
||||
#: src/xz/file_io.c:468
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Überspringe Verzeichnis"
|
||||
|
||||
#: src/xz/file_io.c:462
|
||||
#: src/xz/file_io.c:474
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Keine reguläre Datei, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:479
|
||||
#: src/xz/file_io.c:491
|
||||
#, c-format
|
||||
msgid "%s: File has setuid or setgid bit set, skipping"
|
||||
msgstr "%s: Datei hat das setuid oder setgid Bit gesetzt, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:486
|
||||
#: src/xz/file_io.c:498
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Datei hat sticky Bit gesetzt, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:493
|
||||
#: src/xz/file_io.c:505
|
||||
#, c-format
|
||||
msgid "%s: Input file has more than one hard link, skipping"
|
||||
msgstr "%s: Eingabedatei hat mehr als einen hard link, überspringe"
|
||||
|
||||
#: src/xz/file_io.c:714
|
||||
#: src/xz/file_io.c:761
|
||||
#, c-format
|
||||
msgid "Error restoring the O_APPEND flag to standard output: %s"
|
||||
msgstr ""
|
||||
"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
|
||||
|
||||
#: src/xz/file_io.c:726
|
||||
#: src/xz/file_io.c:773
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Fehler beim Schießen der Datei: %s"
|
||||
|
||||
#: src/xz/file_io.c:762 src/xz/file_io.c:946
|
||||
#: src/xz/file_io.c:809 src/xz/file_io.c:1008
|
||||
#, c-format
|
||||
msgid "%s: Seeking failed when trying to create a sparse file: %s"
|
||||
msgstr ""
|
||||
"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
|
||||
|
||||
#: src/xz/file_io.c:821
|
||||
#: src/xz/file_io.c:883
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Lesefehler: %s"
|
||||
|
||||
#: src/xz/file_io.c:844
|
||||
#: src/xz/file_io.c:906
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
|
||||
|
||||
#: src/xz/file_io.c:854
|
||||
#: src/xz/file_io.c:916
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Unerwartetes Ende der Datei"
|
||||
|
||||
#: src/xz/file_io.c:904
|
||||
#: src/xz/file_io.c:966
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Schreibfehler: %s"
|
||||
|
||||
#: src/xz/hardware.c:100
|
||||
#: src/xz/hardware.c:101
|
||||
msgid "Disabled"
|
||||
msgstr "Deaktiviert"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:119
|
||||
#: src/xz/hardware.c:120
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Gesamtmenge physikalischer Speicher (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:121
|
||||
#: src/xz/hardware.c:122
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Speicher Nutzungslimit für Kompression: "
|
||||
|
||||
#: src/xz/hardware.c:123
|
||||
#: src/xz/hardware.c:124
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Speicher Nutzungslimit für Dekompression: "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:62
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Kein"
|
||||
|
||||
@@ -212,61 +224,61 @@ msgstr "Kein"
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter.
|
||||
#: src/xz/list.c:69
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Unbek.2"
|
||||
|
||||
#: src/xz/list.c:70
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Unbek.3"
|
||||
|
||||
#: src/xz/list.c:72
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Unbek.5"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Unbek.6"
|
||||
|
||||
#: src/xz/list.c:74
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Unbek.7"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Unbek.8"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Unbek.9"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Unbek.11"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Unbek.12"
|
||||
|
||||
#: src/xz/list.c:80
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Unbek.13"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Unbek.14"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Unbek.15"
|
||||
|
||||
#: src/xz/list.c:126
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Datei ist leer"
|
||||
|
||||
#: src/xz/list.c:131
|
||||
#: src/xz/list.c:158
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s: Zu klein um ein gültiges .xz file zu sein"
|
||||
@@ -275,41 +287,41 @@ msgstr "%s: Zu klein um ein gültiges .xz file zu sein"
|
||||
#. 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:612
|
||||
#: src/xz/list.c:645
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname"
|
||||
|
||||
#: src/xz/list.c:652
|
||||
#: src/xz/list.c:685
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Ströme: %s\n"
|
||||
|
||||
#: src/xz/list.c:654
|
||||
#: src/xz/list.c:687
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Blöcke: %s\n"
|
||||
|
||||
#: src/xz/list.c:656
|
||||
#: src/xz/list.c:689
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Größe komprimiert: %s\n"
|
||||
|
||||
#: src/xz/list.c:659
|
||||
#: src/xz/list.c:692
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Größe unkomprimiert: %s\n"
|
||||
|
||||
#: src/xz/list.c:662
|
||||
#: src/xz/list.c:695
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Verhältnis: %s\n"
|
||||
|
||||
#: src/xz/list.c:664
|
||||
#: src/xz/list.c:697
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Check: %s\n"
|
||||
|
||||
#: src/xz/list.c:665
|
||||
#: src/xz/list.c:698
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Strom Auffüllung: %s\n"
|
||||
@@ -317,7 +329,7 @@ msgstr " Strom Auffüllung: %s\n"
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:693
|
||||
#: src/xz/list.c:726
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize "
|
||||
@@ -329,7 +341,7 @@ msgstr ""
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:748
|
||||
#: src/xz/list.c:781
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
@@ -347,53 +359,58 @@ msgstr ""
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:760
|
||||
#: src/xz/list.c:793
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter"
|
||||
|
||||
#: src/xz/list.c:838 src/xz/list.c:1007
|
||||
#: src/xz/list.c:871 src/xz/list.c:1046
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Benötigter Speicher: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:840 src/xz/list.c:1009
|
||||
#: src/xz/list.c:873 src/xz/list.c:1048
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Größe in Köpfen: %s\n"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "Yes"
|
||||
msgstr "Ja"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "No"
|
||||
msgstr "Nein"
|
||||
|
||||
#: src/xz/list.c:875 src/xz/list.c:1050
|
||||
#, c-format
|
||||
msgid " Minimum XZ Utils version: %s\n"
|
||||
msgstr " Kleinste 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:986
|
||||
#: src/xz/list.c:1025
|
||||
#, 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:999
|
||||
#: src/xz/list.c:1038
|
||||
msgid "Totals:"
|
||||
msgstr "Gesamt:"
|
||||
|
||||
#: src/xz/list.c:1000
|
||||
#: src/xz/list.c:1039
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Anzahl Dateien: %s\n"
|
||||
|
||||
#: src/xz/list.c:1072
|
||||
#: src/xz/list.c:1114
|
||||
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:1078
|
||||
#: src/xz/list.c:1120
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list unterstützt kein Lesen der Standardeingabe"
|
||||
|
||||
@@ -428,60 +445,74 @@ msgstr ""
|
||||
"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von "
|
||||
"der Standardeingabe gelesen werden"
|
||||
|
||||
#: src/xz/message.c:800 src/xz/message.c:844
|
||||
#. 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:733
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr ""
|
||||
|
||||
#: src/xz/message.c:796 src/xz/message.c:846
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Interner Fehler (Bug)"
|
||||
|
||||
#: src/xz/message.c:807
|
||||
#: src/xz/message.c:803
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Kann Signal Routine nicht setzen"
|
||||
|
||||
#: src/xz/message.c:816
|
||||
#: src/xz/message.c:812
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
|
||||
|
||||
#: src/xz/message.c:819
|
||||
#: src/xz/message.c:815
|
||||
msgid "Unsupported type of integrity check; not verifying file integrity"
|
||||
msgstr ""
|
||||
"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht "
|
||||
"überprüfen"
|
||||
|
||||
#: src/xz/message.c:826
|
||||
#: src/xz/message.c:822
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Speicher-Limit erreicht"
|
||||
|
||||
#: src/xz/message.c:829
|
||||
#: src/xz/message.c:825
|
||||
msgid "File format not recognized"
|
||||
msgstr "Datei Format nicht erkannt"
|
||||
|
||||
#: src/xz/message.c:832
|
||||
#: src/xz/message.c:828
|
||||
msgid "Unsupported options"
|
||||
msgstr "Optionen nicht unterstützt"
|
||||
|
||||
#: src/xz/message.c:835
|
||||
#: src/xz/message.c:831
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Komprimierte Daten sind korrupt"
|
||||
|
||||
#: src/xz/message.c:838
|
||||
#: src/xz/message.c:834
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Unerwartetes Eingabe Ende"
|
||||
|
||||
#: src/xz/message.c:886
|
||||
#: src/xz/message.c:867
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limiter is disabled."
|
||||
msgstr "%s MiB Speicher wird benötigt. Der Begrenzer ist deaktiviert."
|
||||
|
||||
#: src/xz/message.c:895
|
||||
#, c-format
|
||||
msgid "%s MiB of memory is required. The limit is %s."
|
||||
msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
|
||||
|
||||
#: src/xz/message.c:1053
|
||||
#: src/xz/message.c:1062
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Filter Kette: %s\n"
|
||||
|
||||
#: src/xz/message.c:1063
|
||||
#: src/xz/message.c:1072
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Versuchen Sie `%s --help' für mehr Informationen."
|
||||
|
||||
#: src/xz/message.c:1089
|
||||
#: src/xz/message.c:1098
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
@@ -492,18 +523,18 @@ msgstr ""
|
||||
"Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1096
|
||||
#: src/xz/message.c:1105
|
||||
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:1100
|
||||
#: src/xz/message.c:1109
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Operationsmodus:\n"
|
||||
|
||||
#: src/xz/message.c:1103
|
||||
#: src/xz/message.c:1112
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
@@ -515,7 +546,7 @@ msgstr ""
|
||||
" -t, --test überprüfe Datei Integrität\n"
|
||||
" -l, --list liste Datei Informationen"
|
||||
|
||||
#: src/xz/message.c:1109
|
||||
#: src/xz/message.c:1118
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
@@ -523,7 +554,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Operationsmodifikatoren:\n"
|
||||
|
||||
#: src/xz/message.c:1112
|
||||
#: src/xz/message.c:1121
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
@@ -535,7 +566,15 @@ msgstr ""
|
||||
" -c, --stdout schreibe nach Standard Output und lösche nicht die\n"
|
||||
" Eingabedateien"
|
||||
|
||||
#: src/xz/message.c:1118
|
||||
#: src/xz/message.c:1127
|
||||
msgid ""
|
||||
" --single-stream decompress only the first stream, and silently\n"
|
||||
" ignore possible remaining input data"
|
||||
msgstr ""
|
||||
" --single-stream dekomprimiere nur den ersten Datenstrom und ignoriere\n"
|
||||
" stillschweigend mögliche weitere Eingabedaten"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
@@ -554,7 +593,7 @@ msgstr ""
|
||||
" --files0=[DATEI] wie --files, aber benutze den Null Charakter als "
|
||||
"Trenner"
|
||||
|
||||
#: src/xz/message.c:1126
|
||||
#: src/xz/message.c:1139
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
@@ -562,7 +601,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Grundlegende Optionen für Dateiformat und Kompression:\n"
|
||||
|
||||
#: src/xz/message.c:1128
|
||||
#: src/xz/message.c:1141
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
@@ -578,7 +617,7 @@ msgstr ""
|
||||
"`crc32',\n"
|
||||
" `crc64' (Voreinstellung), oder `sha256'"
|
||||
|
||||
#: src/xz/message.c:1135
|
||||
#: src/xz/message.c:1148
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor "
|
||||
"*and*\n"
|
||||
@@ -591,7 +630,7 @@ msgstr ""
|
||||
"des\n"
|
||||
" Dekomprimierers, wenn Sie 7-9 benutzen!"
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
#: src/xz/message.c:1152
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU "
|
||||
"time;\n"
|
||||
@@ -602,7 +641,18 @@ msgstr ""
|
||||
" verhältnis zu verbessern. Das beeinflusst nicht den\n"
|
||||
" Speicherbedarf des Dekomprimierers."
|
||||
|
||||
#: src/xz/message.c:1144
|
||||
#: src/xz/message.c:1157
|
||||
msgid ""
|
||||
" --block-size=SIZE\n"
|
||||
" when compressing to the .xz format, start a new block\n"
|
||||
" after every SIZE Eingabe Bytes; 0=disabled (default)"
|
||||
msgstr ""
|
||||
" --block-size=SIZE\n"
|
||||
" beim Komprimieren ins .xz Format, starte einen neuen\n"
|
||||
" Block nach jeweils SIZE Eingabe Bytes; 0=deaktiviert\n"
|
||||
" (Grundeinstellung)"
|
||||
|
||||
#: src/xz/message.c:1161
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
@@ -619,7 +669,7 @@ msgstr ""
|
||||
"RAM,\n"
|
||||
" oder 0 für Grundeinstellungen."
|
||||
|
||||
#: src/xz/message.c:1151
|
||||
#: src/xz/message.c:1168
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage "
|
||||
"limit,\n"
|
||||
@@ -631,7 +681,7 @@ msgstr ""
|
||||
"statt\n"
|
||||
" die Einstellungen nach unten anzupassen."
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
#: src/xz/message.c:1174
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
@@ -639,7 +689,7 @@ msgstr ""
|
||||
"\n"
|
||||
" User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):"
|
||||
|
||||
#: src/xz/message.c:1166
|
||||
#: src/xz/message.c:1183
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
|
||||
@@ -683,7 +733,7 @@ msgstr ""
|
||||
" depth=NUM Maximale Suchtiefe; 0=automatisch\n"
|
||||
" (Voreinstellung)"
|
||||
|
||||
#: src/xz/message.c:1181
|
||||
#: src/xz/message.c:1198
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
@@ -706,7 +756,7 @@ msgstr ""
|
||||
" start=NUM Start-Offset für Konversion\n"
|
||||
" (Voreinstellung=0)"
|
||||
|
||||
#: src/xz/message.c:1193
|
||||
#: src/xz/message.c:1210
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
@@ -720,7 +770,7 @@ msgstr ""
|
||||
"voneinander\n"
|
||||
" subtrahiert werden (1-256; 1)"
|
||||
|
||||
#: src/xz/message.c:1201
|
||||
#: src/xz/message.c:1218
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
@@ -728,7 +778,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Andere Optionen:\n"
|
||||
|
||||
#: src/xz/message.c:1204
|
||||
#: src/xz/message.c:1221
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors "
|
||||
"too\n"
|
||||
@@ -740,25 +790,25 @@ msgstr ""
|
||||
"noch\n"
|
||||
" gesprächiger zu sein"
|
||||
|
||||
#: src/xz/message.c:1209
|
||||
#: src/xz/message.c:1226
|
||||
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:1211
|
||||
#: src/xz/message.c:1228
|
||||
msgid ""
|
||||
" --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr ""
|
||||
" --robot benutze Maschinen-lesbare Meldungen (nützlich für\n"
|
||||
" Skripte)"
|
||||
|
||||
#: src/xz/message.c:1214
|
||||
#: src/xz/message.c:1231
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently "
|
||||
"active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr " --info-memory zeige Speicherlimit an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1217
|
||||
#: src/xz/message.c:1234
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
@@ -767,7 +817,7 @@ msgstr ""
|
||||
" Optionen)\n"
|
||||
" -H, --long-help zeige diese lange Hilfe an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1221
|
||||
#: src/xz/message.c:1238
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
@@ -777,11 +827,11 @@ msgstr ""
|
||||
"fortgeschrittene\n"
|
||||
" Optionen an)"
|
||||
|
||||
#: src/xz/message.c:1226
|
||||
#: src/xz/message.c:1243
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version zeige Versionsnummer an und terminiere"
|
||||
|
||||
#: src/xz/message.c:1228
|
||||
#: src/xz/message.c:1245
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
@@ -794,7 +844,7 @@ msgstr ""
|
||||
#. 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:1234
|
||||
#: src/xz/message.c:1251
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
@@ -802,7 +852,7 @@ msgstr ""
|
||||
"Melde Übersetzungsfehler an <maan@systemlinux.org> (in englisch oder "
|
||||
"deutsch).\n"
|
||||
|
||||
#: src/xz/message.c:1236
|
||||
#: src/xz/message.c:1253
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "%s Homepage: <%s>\n"
|
||||
@@ -840,7 +890,7 @@ msgstr ""
|
||||
"Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht "
|
||||
"mindestens nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:79 src/xz/suffix.c:164
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
@@ -848,17 +898,17 @@ msgstr ""
|
||||
"%s: Mit --format=raw ist --sufix=.SUF notwendig, falls nicht nach stdout "
|
||||
"geschrieben wird"
|
||||
|
||||
#: src/xz/suffix.c:99
|
||||
#: src/xz/suffix.c:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Dateiname hat unbekannte Endung, überspringe"
|
||||
|
||||
#: src/xz/suffix.c:154
|
||||
#: src/xz/suffix.c:185
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Datei hat bereits `%s' Endung, überspringe"
|
||||
|
||||
#: src/xz/suffix.c:205
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Ungültige Datei Endung"
|
||||
|
||||
874
po/fr.po
Normal file
874
po/fr.po
Normal file
@@ -0,0 +1,874 @@
|
||||
# XZ Utils French Translation
|
||||
# This file is put in the public domain.
|
||||
# Adrien Nader <camaradetux@gmail.com>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz-utils\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2012-05-30 20:40+0200\n"
|
||||
"PO-Revision-Date: 2010-09-24 21;12+0200\n"
|
||||
"Last-Translator: Adrien Nader <camaradetux@gmail.com>\n"
|
||||
"Language-Team: None\n"
|
||||
"Language: fr\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"
|
||||
|
||||
#: src/xz/args.c:338
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s : Format de fichier inconnu"
|
||||
|
||||
#: src/xz/args.c:361 src/xz/args.c:369
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s : Type de vérification d'intégrité inconnu"
|
||||
|
||||
#: src/xz/args.c:396
|
||||
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:459
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "La variable d'environnement %s contient trop d'arguments"
|
||||
|
||||
#: src/xz/coder.c:105
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Le nombre maximal de filtres est quatre"
|
||||
|
||||
#: src/xz/coder.c:118
|
||||
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:148
|
||||
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:150
|
||||
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:176
|
||||
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:184
|
||||
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:203
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Jusqu'à %<PRIu32> threads seront utilisés."
|
||||
|
||||
#: src/xz/coder.c:216
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Enchaînement ou options de filtres non pris en charge"
|
||||
|
||||
#: src/xz/coder.c:224
|
||||
#, 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:259
|
||||
#, c-format
|
||||
msgid "Adjusted 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:313
|
||||
#, 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"
|
||||
|
||||
#. 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:136
|
||||
#, 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:143 src/xz/file_io.c:635
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s : Impossible de supprimer : %s"
|
||||
|
||||
#: src/xz/file_io.c:168
|
||||
#, 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:174
|
||||
#, 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:193
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s : Impossible de modifier les permissions du fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:340 src/xz/file_io.c:423
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s est un lien symbolique : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:468
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s est un répertoire : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:474
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s n'est pas un fichier régulier : ignoré"
|
||||
|
||||
#: src/xz/file_io.c:491
|
||||
#, 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:498
|
||||
#, 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:505
|
||||
#, 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:761
|
||||
#, 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:773
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s : Impossible de fermer le fichier : %s"
|
||||
|
||||
#: src/xz/file_io.c:809 src/xz/file_io.c:1008
|
||||
#, 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:883
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s : Erreur d'écriture : %s"
|
||||
|
||||
#: src/xz/file_io.c:906
|
||||
#, 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:916
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s : Fin de fichier inattendue"
|
||||
|
||||
#: src/xz/file_io.c:966
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s : Erreur d'écriture : %s"
|
||||
|
||||
#: src/xz/hardware.c:101
|
||||
msgid "Disabled"
|
||||
msgstr "Désactivé"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:120
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Quantité totale de mémoire physique (RAM) : "
|
||||
|
||||
#: src/xz/hardware.c:122
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limite d'utilisation pour la compression : "
|
||||
|
||||
#: src/xz/hardware.c:124
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Limite d'utilisation pour la décompression : "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Aucune"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Inconnue-2"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Inconnue-3"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Inconnue-5"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Inconnue-6"
|
||||
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Inconnue-7"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Inconnue-8"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Inconnue-9"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Inconnue-11"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Inconnue-12"
|
||||
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Inconnue-13"
|
||||
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Inconnue-14"
|
||||
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Inconnue-15"
|
||||
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s : Le fichier est vide"
|
||||
|
||||
#: src/xz/list.c:158
|
||||
#, 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:645
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr "Flux Blocs Compressé Décompressé Ratio Vérif Nom de fichier"
|
||||
|
||||
#: src/xz/list.c:685
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Flux : %s\n"
|
||||
|
||||
#: src/xz/list.c:687
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Blocs : %s\n"
|
||||
|
||||
#: src/xz/list.c:689
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Taille compressé : %s\n"
|
||||
|
||||
#: src/xz/list.c:692
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Taille décompressé : %s\n"
|
||||
|
||||
#: src/xz/list.c:695
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Ratio : %s\n"
|
||||
|
||||
#: src/xz/list.c:697
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Vérification : %s\n"
|
||||
|
||||
#: src/xz/list.c:698
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Octets de rembourrage du flux : %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:726
|
||||
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"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:781
|
||||
#, 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."
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:793
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres"
|
||||
|
||||
#: src/xz/list.c:871 src/xz/list.c:1046
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Mémoire nécessaire : %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:873 src/xz/list.c:1048
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Tailles stockées dans l'en-tête : %s\n"
|
||||
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "Yes"
|
||||
msgstr "Oui"
|
||||
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "No"
|
||||
msgstr "Non"
|
||||
|
||||
#: src/xz/list.c:875 src/xz/list.c:1050
|
||||
#, 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:1025
|
||||
#, 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:1038
|
||||
msgid "Totals:"
|
||||
msgstr "Totaux :"
|
||||
|
||||
#: src/xz/list.c:1039
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Nombre de fichiers : %s\n"
|
||||
|
||||
#: src/xz/list.c:1114
|
||||
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:1120
|
||||
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:174
|
||||
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:231
|
||||
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:733
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s : "
|
||||
|
||||
#: src/xz/message.c:796 src/xz/message.c:846
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Erreur interne (bug)"
|
||||
|
||||
#: src/xz/message.c:803
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Impossible d'installer le gestionnaire de signaux"
|
||||
|
||||
#: src/xz/message.c:812
|
||||
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:815
|
||||
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:822
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Limite d'utilisation mémoire atteinte"
|
||||
|
||||
#: src/xz/message.c:825
|
||||
msgid "File format not recognized"
|
||||
msgstr "Format de fichier inconnu"
|
||||
|
||||
#: src/xz/message.c:828
|
||||
msgid "Unsupported options"
|
||||
msgstr "Options non prises en charge"
|
||||
|
||||
#: src/xz/message.c:831
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Les données compressées sont corrompues"
|
||||
|
||||
#: src/xz/message.c:834
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Fin des données inattendue "
|
||||
|
||||
#: src/xz/message.c:867
|
||||
#, 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:895
|
||||
#, 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:1062
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s : Enchaînement de filtres : %s\n"
|
||||
|
||||
#: src/xz/message.c:1072
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Utilisez `%s --help' pour plus d'informations."
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
#, 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:1105
|
||||
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:1109
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Mode d'opération :\n"
|
||||
|
||||
#: src/xz/message.c:1112
|
||||
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 la compression\n"
|
||||
" -d, --decompress forcer la décompression\n"
|
||||
" -t, --test tester l'intégrité du fichier compressé\n"
|
||||
" -l, --list lister les informations à propos des fichiers .xz"
|
||||
|
||||
#: src/xz/message.c:1118
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Modifictauers :\n"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
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 (\"keep\")\n"
|
||||
" -f, --force forcer l'écrasement du fichier de sortie et\n"
|
||||
" (dé)compresser les liens\n"
|
||||
" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n"
|
||||
" fichiers d'entrée"
|
||||
|
||||
#: src/xz/message.c:1127
|
||||
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"
|
||||
" silenciseusement les données éventuellement restantes"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
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 de retour à la ligne\n"
|
||||
" --files0[=FILE] comme --files mais avec un caractère null comme séparateur"
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
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:1141
|
||||
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'"
|
||||
msgstr ""
|
||||
" -F, --format=FMT format de fichier à encoder ou décoder ; les possibilités\n"
|
||||
" sont : `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:1148
|
||||
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:1152
|
||||
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 sans affecter les besoins mémoire du\n"
|
||||
" décompresseur"
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
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=SIZE\n"
|
||||
" pour une compression au format .xz, entamer un nouveau\n"
|
||||
" bloc après SIZE octets d'entrée ; 0=désactivé (par défaut)"
|
||||
|
||||
#: src/xz/message.c:1161
|
||||
#, 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"
|
||||
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, % de\n"
|
||||
" RAM, ou 0 pour les valeurs par défaut"
|
||||
|
||||
#: src/xz/message.c:1168
|
||||
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:1174
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Enchaînement de filtres de compression personnalisé (au lieu des préréglages) :"
|
||||
|
||||
#: src/xz/message.c:1183
|
||||
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 ou LZMA2 ; OPTS est une liste de zéro ou plusieurs\n"
|
||||
" --lzma2[=OPTS] options parmi les suivantes (vals. valides ; 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:1198
|
||||
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)"
|
||||
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 start offset for conversions (default=0)"
|
||||
|
||||
#: src/xz/message.c:1210
|
||||
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\n"
|
||||
" les uns aux autres (1-256 ; 1)"
|
||||
|
||||
#: src/xz/message.c:1218
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Autres options :\n"
|
||||
|
||||
#: src/xz/message.c:1221
|
||||
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 supprimer les avertissemnts ; spécifier deux fois pour\n"
|
||||
" aussi supprimer les erreur\n"
|
||||
" -v, --verbose être bavard ; spécifier deux fois pour l'être davantage"
|
||||
|
||||
#: src/xz/message.c:1226
|
||||
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:1228
|
||||
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:1231
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently active\n"
|
||||
" memory usage limits, and exit"
|
||||
msgstr ""
|
||||
" --info-memory affiche la quantité totale de RAM et la limite actuelle\n"
|
||||
" en mémoire puis quitte"
|
||||
|
||||
#: src/xz/message.c:1234
|
||||
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 affiche l'aide courte (ne liste que les options de base)\n"
|
||||
" -H, --long-help affiche l'aide longue (ceci) puis quitte"
|
||||
|
||||
#: src/xz/message.c:1238
|
||||
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 affiche l'aide courte (ceci) puis quitte\n"
|
||||
" -H, --long-help affiche l'aide longue (liste aussi les options avancées)"
|
||||
|
||||
#: src/xz/message.c:1243
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version affiche le numéro de version puis quitte"
|
||||
|
||||
#: src/xz/message.c:1245
|
||||
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:1251
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
"Signaler les bogues à <%s> (en anglais ou en finlandais).\n"
|
||||
"Signaler les bogues de traduction à <camaradetux@gmail.com>.\n"
|
||||
|
||||
#: src/xz/message.c:1253
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "%s page du projet : <%s>\n"
|
||||
|
||||
#: 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 pris en charge : %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/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Le `match finder' choisi nécessite au moins nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, 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:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s : Le fichier a un suffixe inconnu, ignoré"
|
||||
|
||||
#: src/xz/suffix.c:185
|
||||
#, 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:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Suffixe de nom de fichier invalide"
|
||||
|
||||
#: src/xz/util.c:61
|
||||
#, 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:103
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s : Suffixe multiplicateur invalide"
|
||||
|
||||
#: src/xz/util.c:105
|
||||
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:122
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "La valeur de l'option '%s' doit être inclue entre %<PRIu64> et %<PRIu64>"
|
||||
|
||||
#: src/xz/util.c:247
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Nom de fichier vide, ignoré"
|
||||
|
||||
#: src/xz/util.c:261
|
||||
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:274
|
||||
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:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Impossible d'écrire vers la sortie standard"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Erreur inconnue"
|
||||
365
po/it.po
365
po/it.po
@@ -2,78 +2,97 @@
|
||||
# This file is in the public domain
|
||||
# Gruppo traduzione italiano di Ubuntu-it <gruppo-traduzione@ubuntu-it.org>, 2009, 2010
|
||||
# Lorenzo De Liso <blackz@ubuntu.com>, 2010.
|
||||
# Milo Casagrande <milo@ubuntu.com>, 2009, 2010.
|
||||
# Milo Casagrande <milo@ubuntu.com>, 2009, 2010, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz-utils\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2010-09-10 14:50+0300\n"
|
||||
"PO-Revision-Date: 2010-09-16 21:32+0200\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-05-27 11:59+0200\n"
|
||||
"PO-Revision-Date: 2011-05-27 11:59+0200\n"
|
||||
"Last-Translator: Milo Casagrande <milo@ubuntu.com>\n"
|
||||
"Language-Team: Italian <tp@lists.linux.it>\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-08-16 19:16+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
#: src/xz/args.c:333
|
||||
#: ../src/xz/args.c:338
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: tipo di formato del file sconosciutoN"
|
||||
msgstr "%s: tipo di formato del file sconosciuto"
|
||||
|
||||
#: src/xz/args.c:356 src/xz/args.c:364
|
||||
#: ../src/xz/args.c:361 ../src/xz/args.c:369
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: tipo di controllo integrità non supportato"
|
||||
|
||||
#: src/xz/args.c:382
|
||||
#: ../src/xz/args.c:396
|
||||
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:445
|
||||
#: ../src/xz/args.c:459
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "La variabile d'ambiente %s contiene troppi argomenti"
|
||||
|
||||
#: src/xz/coder.c:95
|
||||
#: ../src/xz/coder.c:105
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Il numero massimo di filtri è quattro"
|
||||
|
||||
#: src/xz/coder.c:108
|
||||
#: ../src/xz/coder.c:118
|
||||
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:129
|
||||
#. The message is shown only if warnings are allowed
|
||||
#. but the exit status isn't changed.
|
||||
#: ../src/xz/coder.c:148
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Non è consigliato usare un preset nella modalità raw."
|
||||
|
||||
#: src/xz/coder.c:131
|
||||
#: ../src/xz/coder.c:150
|
||||
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:157
|
||||
#: ../src/xz/coder.c:176
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Il formato .lzma supporta solo il filtro LZMA1"
|
||||
|
||||
#: src/xz/coder.c:165
|
||||
#: ../src/xz/coder.c:184
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 non può essere usato con il formato .xz"
|
||||
|
||||
#: src/xz/coder.c:182
|
||||
#: ../src/xz/coder.c:203
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Vengono usati circa %<PRIu32> thread."
|
||||
|
||||
#: ../src/xz/coder.c:216
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Catena di filtri od opzioni del filtro non supportata"
|
||||
|
||||
#: src/xz/coder.c:190
|
||||
#: ../src/xz/coder.c:224
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "L'estrazione necessita di %s MiB di memoria."
|
||||
|
||||
#: src/xz/coder.c:247
|
||||
#: ../src/xz/coder.c:259
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Adjusted 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"
|
||||
|
||||
#. Tell the user that we decreased the dictionary size.
|
||||
#: ../src/xz/coder.c:313
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
|
||||
@@ -92,119 +111,128 @@ msgstr ""
|
||||
#. 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:137
|
||||
#: ../src/xz/file_io.c:136
|
||||
#, 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:144 src/xz/file_io.c:590
|
||||
#: ../src/xz/file_io.c:143 ../src/xz/file_io.c:635
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: impossibile rimuovere: %s"
|
||||
|
||||
#: src/xz/file_io.c:169
|
||||
#: ../src/xz/file_io.c:168
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file owner: %s"
|
||||
msgstr "%s: impossibile impostare il proprietario del file: %s"
|
||||
|
||||
#: src/xz/file_io.c:175
|
||||
#: ../src/xz/file_io.c:174
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: impossibile impostare il gruppo del file: %s"
|
||||
|
||||
#: src/xz/file_io.c:194
|
||||
#: ../src/xz/file_io.c:193
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: impossibile impostare i permessi del file: %s"
|
||||
|
||||
#: src/xz/file_io.c:337 src/xz/file_io.c:420
|
||||
#: ../src/xz/file_io.c:340 ../src/xz/file_io.c:423
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: è un collegamento simbolico, viene saltato"
|
||||
|
||||
#: src/xz/file_io.c:455
|
||||
#: ../src/xz/file_io.c:468
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: è una directory, viene saltata"
|
||||
|
||||
#: src/xz/file_io.c:462
|
||||
#: ../src/xz/file_io.c:474
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: non è un file regolare, viene saltato"
|
||||
|
||||
#: src/xz/file_io.c:479
|
||||
#. gzip rejects setuid and setgid files even
|
||||
#. when --force was used. bzip2 doesn't check
|
||||
#. for them, but calls fchown() after fchmod(),
|
||||
#. and many systems automatically drop setuid
|
||||
#. and setgid bits there.
|
||||
#.
|
||||
#. We accept setuid and setgid files if
|
||||
#. --force was used. We drop these bits
|
||||
#. explicitly in io_copy_attr().
|
||||
#: ../src/xz/file_io.c:491
|
||||
#, 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:486
|
||||
#: ../src/xz/file_io.c:498
|
||||
#, 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:493
|
||||
#: ../src/xz/file_io.c:505
|
||||
#, 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:714
|
||||
#: ../src/xz/file_io.c:761
|
||||
#, 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:726
|
||||
#: ../src/xz/file_io.c:773
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: chiusura del file non riuscita: %s"
|
||||
|
||||
#: src/xz/file_io.c:762 src/xz/file_io.c:946
|
||||
#: ../src/xz/file_io.c:809 ../src/xz/file_io.c:1008
|
||||
#, 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:821
|
||||
#: ../src/xz/file_io.c:883
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: errore di lettura: %s"
|
||||
|
||||
#: src/xz/file_io.c:844
|
||||
#: ../src/xz/file_io.c:906
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: errore nel cercare il file: %s"
|
||||
|
||||
#: src/xz/file_io.c:854
|
||||
#: ../src/xz/file_io.c:916
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: fine del file inaspettata"
|
||||
|
||||
#: src/xz/file_io.c:904
|
||||
#: ../src/xz/file_io.c:966
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: errore di scrittura: %s"
|
||||
|
||||
#: src/xz/hardware.c:100
|
||||
#: ../src/xz/hardware.c:101
|
||||
msgid "Disabled"
|
||||
msgstr "Disabilitato"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:119
|
||||
#: ../src/xz/hardware.c:120
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Quantità totale di memoria fisica (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:121
|
||||
#: ../src/xz/hardware.c:122
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limite utilizzo memoria per la compressione: "
|
||||
|
||||
#: src/xz/hardware.c:123
|
||||
#: ../src/xz/hardware.c:124
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Limite utilizzo memoria per l'estrazione: "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:62
|
||||
#: ../src/xz/list.c:62
|
||||
msgid "None"
|
||||
msgstr "Nessuno"
|
||||
|
||||
@@ -212,61 +240,61 @@ msgstr "Nessuno"
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter.
|
||||
#: src/xz/list.c:69
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: ../src/xz/list.c:69
|
||||
msgid "Unknown-2"
|
||||
msgstr "Sconosc2"
|
||||
|
||||
#: src/xz/list.c:70
|
||||
#: ../src/xz/list.c:70
|
||||
msgid "Unknown-3"
|
||||
msgstr "Sconosc3"
|
||||
|
||||
#: src/xz/list.c:72
|
||||
#: ../src/xz/list.c:72
|
||||
msgid "Unknown-5"
|
||||
msgstr "Sconosc5"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
#: ../src/xz/list.c:73
|
||||
msgid "Unknown-6"
|
||||
msgstr "Sconosc6"
|
||||
|
||||
#: src/xz/list.c:74
|
||||
#: ../src/xz/list.c:74
|
||||
msgid "Unknown-7"
|
||||
msgstr "Sconosc7"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
#: ../src/xz/list.c:75
|
||||
msgid "Unknown-8"
|
||||
msgstr "Sconosc8"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
#: ../src/xz/list.c:76
|
||||
msgid "Unknown-9"
|
||||
msgstr "Sconosc9"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
#: ../src/xz/list.c:78
|
||||
msgid "Unknown-11"
|
||||
msgstr "Sconosc11"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
#: ../src/xz/list.c:79
|
||||
msgid "Unknown-12"
|
||||
msgstr "Sconosc12"
|
||||
|
||||
#: src/xz/list.c:80
|
||||
#: ../src/xz/list.c:80
|
||||
msgid "Unknown-13"
|
||||
msgstr "Sconosc13"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
#: ../src/xz/list.c:81
|
||||
msgid "Unknown-14"
|
||||
msgstr "Sconosc14"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
#: ../src/xz/list.c:82
|
||||
msgid "Unknown-15"
|
||||
msgstr "Sconosc15"
|
||||
|
||||
#: src/xz/list.c:126
|
||||
#: ../src/xz/list.c:126
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: il file è vuoto"
|
||||
|
||||
#: src/xz/list.c:131
|
||||
#: ../src/xz/list.c:131
|
||||
#, c-format
|
||||
msgid "%s: Too small to be a valid .xz file"
|
||||
msgstr "%s: troppo piccolo per essere un file .xz valido"
|
||||
@@ -275,49 +303,51 @@ msgstr "%s: troppo piccolo per essere un file .xz valido"
|
||||
#. 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:612
|
||||
#: ../src/xz/list.c:612
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr " Strm Blocc. Compresso Estratto Rapp. Contr Nome file"
|
||||
|
||||
#: src/xz/list.c:652
|
||||
#: ../src/xz/list.c:652
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Stream: %s\n"
|
||||
|
||||
#: src/xz/list.c:654
|
||||
#: ../src/xz/list.c:654
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Blocchi: %s\n"
|
||||
|
||||
#: src/xz/list.c:656
|
||||
#: ../src/xz/list.c:656
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Dim. compresso: %s\n"
|
||||
|
||||
#: src/xz/list.c:659
|
||||
#: ../src/xz/list.c:659
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Dim. estratto: %s\n"
|
||||
|
||||
#: src/xz/list.c:662
|
||||
#: ../src/xz/list.c:662
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Rapporto: %s\n"
|
||||
|
||||
#: src/xz/list.c:664
|
||||
#: ../src/xz/list.c:664
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Controllo: %s\n"
|
||||
|
||||
#: src/xz/list.c:665
|
||||
#: ../src/xz/list.c:665
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Padding dello stream: %s\n"
|
||||
|
||||
#. Print information about the Streams.
|
||||
#.
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:693
|
||||
#: ../src/xz/list.c:693
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize "
|
||||
@@ -329,7 +359,7 @@ msgstr ""
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:748
|
||||
#: ../src/xz/list.c:748
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
@@ -347,66 +377,74 @@ msgstr ""
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:760
|
||||
#: ../src/xz/list.c:760
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " Val.cont %*s Header Flag Dim.compr. Uso mem. Filtri"
|
||||
|
||||
#: src/xz/list.c:838 src/xz/list.c:1007
|
||||
#: ../src/xz/list.c:838 ../src/xz/list.c:1007
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Memoria necessaria: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:840 src/xz/list.c:1009
|
||||
#: ../src/xz/list.c:840 ../src/xz/list.c:1009
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Dim. negli header: %s\n"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
#: ../src/xz/list.c:841 ../src/xz/list.c:1010
|
||||
msgid "Yes"
|
||||
msgstr "Sì"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
#: ../src/xz/list.c:841 ../src/xz/list.c:1010
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#. Since we print totals only when there are at least two files,
|
||||
#. the English message will always use "%s files". But some other
|
||||
#. languages need different forms for different plurals so we
|
||||
#. have to translate this with ngettext().
|
||||
#.
|
||||
#. 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:986
|
||||
#: ../src/xz/list.c:986
|
||||
#, 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:999
|
||||
#: ../src/xz/list.c:999
|
||||
msgid "Totals:"
|
||||
msgstr "Totali:"
|
||||
|
||||
#: src/xz/list.c:1000
|
||||
#: ../src/xz/list.c:1000
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Numero di file: %s\n"
|
||||
|
||||
#: src/xz/list.c:1072
|
||||
#: ../src/xz/list.c:1072
|
||||
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:1078
|
||||
#: ../src/xz/list.c:1078
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list non è in grado di leggere dallo standard input"
|
||||
|
||||
#: src/xz/main.c:89
|
||||
#: ../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
|
||||
#: ../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
|
||||
#. A null character was found when using --files,
|
||||
#. which expects plain text input separated with
|
||||
#. newlines.
|
||||
#: ../src/xz/main.c:120
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: Null character found when reading filenames; maybe you meant to use `--"
|
||||
@@ -415,11 +453,11 @@ msgstr ""
|
||||
"%s: nessun carattere trovato durante la lettura dei nomi dei file; forse si "
|
||||
"intendeva usare \"--files0\" invece di \"--files\"?"
|
||||
|
||||
#: src/xz/main.c:174
|
||||
#: ../src/xz/main.c:174
|
||||
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:231
|
||||
#: ../src/xz/main.c:231
|
||||
msgid ""
|
||||
"Cannot read data from standard input when reading filenames from standard "
|
||||
"input"
|
||||
@@ -427,61 +465,72 @@ msgstr ""
|
||||
"Impossibile leggere i dati dallo standard input durante la lettura dei nomi "
|
||||
"dei file dallo standard input"
|
||||
|
||||
#: src/xz/message.c:800 src/xz/message.c:844
|
||||
#. 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:733
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s: "
|
||||
|
||||
#: ../src/xz/message.c:796 ../src/xz/message.c:846
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Errore interno (bug)"
|
||||
|
||||
#: src/xz/message.c:807
|
||||
#: ../src/xz/message.c:803
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Impossibile stabilire i gestori dei segnali"
|
||||
|
||||
#: src/xz/message.c:816
|
||||
#: ../src/xz/message.c:812
|
||||
msgid "No integrity check; not verifying file integrity"
|
||||
msgstr ""
|
||||
"Nessun controllo d'integrità; l'integrità del file non viene verificata"
|
||||
|
||||
#: src/xz/message.c:819
|
||||
#: ../src/xz/message.c:815
|
||||
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:826
|
||||
#: ../src/xz/message.c:822
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Limite di utilizzo della memoria raggiunto"
|
||||
|
||||
#: src/xz/message.c:829
|
||||
#: ../src/xz/message.c:825
|
||||
msgid "File format not recognized"
|
||||
msgstr "Formato di file non riconosciuto"
|
||||
|
||||
#: src/xz/message.c:832
|
||||
#: ../src/xz/message.c:828
|
||||
msgid "Unsupported options"
|
||||
msgstr "Opzioni non supportate"
|
||||
|
||||
#: src/xz/message.c:835
|
||||
#: ../src/xz/message.c:831
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "I dati compressi sono danneggiati"
|
||||
|
||||
#: src/xz/message.c:838
|
||||
#: ../src/xz/message.c:834
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Fine dell'input non attesa"
|
||||
|
||||
#: src/xz/message.c:886
|
||||
#: ../src/xz/message.c:885
|
||||
#, 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:1053
|
||||
#: ../src/xz/message.c:1052
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: catena di filtri: %s\n"
|
||||
|
||||
#: src/xz/message.c:1063
|
||||
#. Print this with V_WARNING instead of V_ERROR to prevent it from
|
||||
#. showing up when --quiet has been specified.
|
||||
#: ../src/xz/message.c:1062
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Provare \"%s --help\" per maggiori informazioni."
|
||||
|
||||
#: src/xz/message.c:1089
|
||||
#: ../src/xz/message.c:1088
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
@@ -492,18 +541,18 @@ msgstr ""
|
||||
"Comprime o estrae i FILE nel formato .xz.\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1096
|
||||
#: ../src/xz/message.c:1095
|
||||
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:1100
|
||||
#: ../src/xz/message.c:1099
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Modalità di operazione:\n"
|
||||
|
||||
#: src/xz/message.c:1103
|
||||
#: ../src/xz/message.c:1102
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
@@ -515,7 +564,7 @@ msgstr ""
|
||||
" -t, --test Verifica l'integrità dei file compressi\n"
|
||||
" -l, --list Elenca informazioni sui file .xz"
|
||||
|
||||
#: src/xz/message.c:1109
|
||||
#: ../src/xz/message.c:1108
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
@@ -523,7 +572,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Modificatori di operazioni:\n"
|
||||
|
||||
#: src/xz/message.c:1112
|
||||
#: ../src/xz/message.c:1111
|
||||
msgid ""
|
||||
" -k, --keep keep (don't delete) input files\n"
|
||||
" -f, --force force overwrite of output file and (de)compress links\n"
|
||||
@@ -536,7 +585,15 @@ msgstr ""
|
||||
" -c, --stdout Scrive sullo standard output e non elimina i file di "
|
||||
"input"
|
||||
|
||||
#: src/xz/message.c:1118
|
||||
#: ../src/xz/message.c:1117
|
||||
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:1120
|
||||
msgid ""
|
||||
" --no-sparse do not create sparse files when decompressing\n"
|
||||
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
|
||||
@@ -556,7 +613,7 @@ msgstr ""
|
||||
" di newline\n"
|
||||
" --files0=[FILE] Come --files ma usa il carattere null come terminatore"
|
||||
|
||||
#: src/xz/message.c:1126
|
||||
#: ../src/xz/message.c:1129
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
@@ -564,7 +621,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Formato file di base e opzioni di compressione:\n"
|
||||
|
||||
#: src/xz/message.c:1128
|
||||
#: ../src/xz/message.c:1131
|
||||
msgid ""
|
||||
" -F, --format=FMT file format to encode or decode; possible values are\n"
|
||||
" `auto' (default), `xz', `lzma', and `raw'\n"
|
||||
@@ -579,12 +636,12 @@ msgstr ""
|
||||
"attenzione),\n"
|
||||
" \"crc32\", \"crc64\" (predefinito) o \"sha256\""
|
||||
|
||||
#: src/xz/message.c:1135
|
||||
#: ../src/xz/message.c:1138
|
||||
msgid ""
|
||||
" -0 ... -9 compression preset; default is 6; take compressor "
|
||||
"*and*\n"
|
||||
" decompressor memory usage into account before using 7-"
|
||||
"9!"
|
||||
" decompressor memory usage into account before using "
|
||||
"7-9!"
|
||||
msgstr ""
|
||||
" -0 ... -9 Preset di compressione; predefinito è 6; tenere a "
|
||||
"mente\n"
|
||||
@@ -592,7 +649,7 @@ msgstr ""
|
||||
"prima\n"
|
||||
" di usare 7-9"
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
#: ../src/xz/message.c:1142
|
||||
msgid ""
|
||||
" -e, --extreme try to improve compression ratio by using more CPU "
|
||||
"time;\n"
|
||||
@@ -603,7 +660,17 @@ msgstr ""
|
||||
"di\n"
|
||||
" memoria in fase di estrazione"
|
||||
|
||||
#: src/xz/message.c:1144
|
||||
#: ../src/xz/message.c:1147
|
||||
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=DIM \n"
|
||||
" Comprimendo nel formato .zx, comincia un nuovo blocco\n"
|
||||
" dopo DIM byte di input; 0=disabilitato (predefinito)"
|
||||
|
||||
#: ../src/xz/message.c:1151
|
||||
#, no-c-format
|
||||
msgid ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
@@ -621,7 +688,7 @@ msgstr ""
|
||||
"byte,\n"
|
||||
" % della memoria RAM oppure 0 per il valore predefinito"
|
||||
|
||||
#: src/xz/message.c:1151
|
||||
#: ../src/xz/message.c:1158
|
||||
msgid ""
|
||||
" --no-adjust if compression settings exceed the memory usage "
|
||||
"limit,\n"
|
||||
@@ -633,7 +700,7 @@ msgstr ""
|
||||
" utilizzo della memoria, lancia un errore invece di\n"
|
||||
" utilizzare valori più piccoli"
|
||||
|
||||
#: src/xz/message.c:1157
|
||||
#: ../src/xz/message.c:1164
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
@@ -642,7 +709,7 @@ msgstr ""
|
||||
" Catena di filtri personalizzati per la compressione (alternative per\n"
|
||||
" l'utilizzo di preset):"
|
||||
|
||||
#: src/xz/message.c:1166
|
||||
#: ../src/xz/message.c:1173
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
|
||||
@@ -672,8 +739,8 @@ msgstr ""
|
||||
" (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"
|
||||
" 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"
|
||||
@@ -685,7 +752,7 @@ msgstr ""
|
||||
"0=automatica\n"
|
||||
" (predefinito)"
|
||||
|
||||
#: src/xz/message.c:1181
|
||||
#: ../src/xz/message.c:1188
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
@@ -708,7 +775,7 @@ msgstr ""
|
||||
" start=NUM Offset iniziale per le conversioni\n"
|
||||
" (predefinito=0)"
|
||||
|
||||
#: src/xz/message.c:1193
|
||||
#: ../src/xz/message.c:1200
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
@@ -720,7 +787,7 @@ msgstr ""
|
||||
" dist=NUM Distanza tra byte sottratti\n"
|
||||
" gli uni dagli altri (1-256; 1)"
|
||||
|
||||
#: src/xz/message.c:1201
|
||||
#: ../src/xz/message.c:1208
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
@@ -728,7 +795,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Altre opzioni:\n"
|
||||
|
||||
#: src/xz/message.c:1204
|
||||
#: ../src/xz/message.c:1211
|
||||
msgid ""
|
||||
" -q, --quiet suppress warnings; specify twice to suppress errors "
|
||||
"too\n"
|
||||
@@ -741,16 +808,16 @@ msgstr ""
|
||||
"ancora\n"
|
||||
" più prolisso"
|
||||
|
||||
#: src/xz/message.c:1209
|
||||
#: ../src/xz/message.c:1216
|
||||
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:1211
|
||||
#: ../src/xz/message.c:1218
|
||||
msgid ""
|
||||
" --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr " --robot Usa messaggi analizzabili (utile per gli script)"
|
||||
|
||||
#: src/xz/message.c:1214
|
||||
#: ../src/xz/message.c:1221
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently "
|
||||
"active\n"
|
||||
@@ -760,7 +827,7 @@ msgstr ""
|
||||
"attuale\n"
|
||||
" attivo di utilizzo della memore ed esce"
|
||||
|
||||
#: src/xz/message.c:1217
|
||||
#: ../src/xz/message.c:1224
|
||||
msgid ""
|
||||
" -h, --help display the short help (lists only the basic options)\n"
|
||||
" -H, --long-help display this long help and exit"
|
||||
@@ -768,7 +835,7 @@ 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:1221
|
||||
#: ../src/xz/message.c:1228
|
||||
msgid ""
|
||||
" -h, --help display this short help and exit\n"
|
||||
" -H, --long-help display the long help (lists also the advanced options)"
|
||||
@@ -776,11 +843,11 @@ 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:1226
|
||||
#: ../src/xz/message.c:1233
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version Stampa il numero della versione ed esce"
|
||||
|
||||
#: src/xz/message.c:1228
|
||||
#: ../src/xz/message.c:1235
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
@@ -792,51 +859,51 @@ msgstr ""
|
||||
#. 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:1234
|
||||
#: ../src/xz/message.c:1241
|
||||
#, 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 <tp@lists.linux.it>.\n"
|
||||
|
||||
#: src/xz/message.c:1236
|
||||
#: ../src/xz/message.c:1243
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Sito web di %s: <%s>\n"
|
||||
|
||||
#: src/xz/options.c:86
|
||||
#: ../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
|
||||
#: ../src/xz/options.c:93
|
||||
#, c-format
|
||||
msgid "%s: Invalid option name"
|
||||
msgstr "%s: nome opzione non valido"
|
||||
|
||||
#: src/xz/options.c:113
|
||||
#: ../src/xz/options.c:113
|
||||
#, c-format
|
||||
msgid "%s: Invalid option value"
|
||||
msgstr "%s: valore dell'opzione non valido"
|
||||
|
||||
#: src/xz/options.c:247
|
||||
#: ../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
|
||||
#: ../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/options.c:359
|
||||
#: ../src/xz/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr ""
|
||||
"Lo strumento per cercare corrispondenze selezionato richiede almeno nice=%"
|
||||
"<PRIu32>"
|
||||
"Lo strumento per cercare corrispondenze selezionato richiede almeno nice="
|
||||
"%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:79 src/xz/suffix.c:164
|
||||
#: ../src/xz/suffix.c:133 ../src/xz/suffix.c:258
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
|
||||
@@ -844,59 +911,59 @@ msgstr ""
|
||||
"%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva "
|
||||
"sullo stdout"
|
||||
|
||||
#: src/xz/suffix.c:99
|
||||
#: ../src/xz/suffix.c:164
|
||||
#, 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:154
|
||||
#: ../src/xz/suffix.c:185
|
||||
#, 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:205
|
||||
#: ../src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: suffisso del nome del file non valido"
|
||||
|
||||
#: src/xz/util.c:61
|
||||
#: ../src/xz/util.c:61
|
||||
#, 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:103
|
||||
#: ../src/xz/util.c:103
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s: suffisso del moltiplicatore non valido"
|
||||
|
||||
#: src/xz/util.c:105
|
||||
#: ../src/xz/util.c:105
|
||||
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:122
|
||||
#: ../src/xz/util.c:122
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr ""
|
||||
"Il valore dell'opzione \"%s\" deve essere nell'intervallo [%<PRIu64>, %"
|
||||
"<PRIu64>]"
|
||||
"Il valore dell'opzione \"%s\" deve essere nell'intervallo [%<PRIu64>, "
|
||||
"%<PRIu64>]"
|
||||
|
||||
#: src/xz/util.c:247
|
||||
#: ../src/xz/util.c:247
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Nome file vuoto, viene saltato"
|
||||
|
||||
#: src/xz/util.c:261
|
||||
#: ../src/xz/util.c:261
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "I dati compressi non possono essere letti da un terminale"
|
||||
|
||||
#: src/xz/util.c:274
|
||||
#: ../src/xz/util.c:274
|
||||
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:39
|
||||
#: ../src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Scrittura sullo standard ouput non riuscita"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
#: ../src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Errore sconosciuto"
|
||||
|
||||
872
po/pl.po
Normal file
872
po/pl.po
Normal file
@@ -0,0 +1,872 @@
|
||||
# Polish translation for xz.
|
||||
# This file is in the public domain.
|
||||
# Jakub Bogusz <qboosh@pld-linux.org>, 2011-2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz 5.1.1\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2012-05-29 13:59+0300\n"
|
||||
"PO-Revision-Date: 2012-05-29 18:15+0200\n"
|
||||
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
|
||||
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
|
||||
"Language: pl\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%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
|
||||
#: src/xz/args.c:338
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Nieznany typ formatu pliku"
|
||||
|
||||
#: src/xz/args.c:361 src/xz/args.c:369
|
||||
#, c-format
|
||||
msgid "%s: Unsupported integrity check type"
|
||||
msgstr "%s: Nieobsługiwany typ kontroli spójności"
|
||||
|
||||
#: src/xz/args.c:396
|
||||
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:459
|
||||
#, c-format
|
||||
msgid "The environment variable %s contains too many arguments"
|
||||
msgstr "Zmienna środowiskowa %s zawiera zbyt dużo argumentów"
|
||||
|
||||
#: src/xz/coder.c:105
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maksymalna liczba filtrów to cztery"
|
||||
|
||||
#: src/xz/coder.c:118
|
||||
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:148
|
||||
msgid "Using a preset in raw mode is discouraged."
|
||||
msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane."
|
||||
|
||||
#: src/xz/coder.c:150
|
||||
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:176
|
||||
msgid "The .lzma format supports only the LZMA1 filter"
|
||||
msgstr "Format .lzma obsługuje tylko filtr LZMA1"
|
||||
|
||||
#: src/xz/coder.c:184
|
||||
msgid "LZMA1 cannot be used with the .xz format"
|
||||
msgstr "LZMA1 nie może być używany z formatem .xz"
|
||||
|
||||
#: src/xz/coder.c:203
|
||||
#, c-format
|
||||
msgid "Using up to %<PRIu32> threads."
|
||||
msgstr "Maksymalna liczba używanych wątków: %<PRIu32>."
|
||||
|
||||
#: src/xz/coder.c:216
|
||||
msgid "Unsupported filter chain or filter options"
|
||||
msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra"
|
||||
|
||||
#: src/xz/coder.c:224
|
||||
#, c-format
|
||||
msgid "Decompression will need %s MiB of memory."
|
||||
msgstr "Dekompresja będzie wymagała %s MiB pamięci."
|
||||
|
||||
#: src/xz/coder.c:259
|
||||
#, c-format
|
||||
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
|
||||
msgstr "Skorygowano liczbę wątków z %s do %s, aby nie przekroczyć limitu użycia pamięci %s MiB"
|
||||
|
||||
#: src/xz/coder.c:313
|
||||
#, 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"
|
||||
|
||||
#. 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:136
|
||||
#, 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:143 src/xz/file_io.c:635
|
||||
#, c-format
|
||||
msgid "%s: Cannot remove: %s"
|
||||
msgstr "%s: Nie można usunąć: %s"
|
||||
|
||||
#: src/xz/file_io.c:168
|
||||
#, 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:174
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file group: %s"
|
||||
msgstr "%s: Nie można ustawić grupy pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:193
|
||||
#, c-format
|
||||
msgid "%s: Cannot set the file permissions: %s"
|
||||
msgstr "%s: Nie można ustawić uprawnień pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:340 src/xz/file_io.c:423
|
||||
#, c-format
|
||||
msgid "%s: Is a symbolic link, skipping"
|
||||
msgstr "%s: Jest dowiązaniem symbolicznym, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:468
|
||||
#, c-format
|
||||
msgid "%s: Is a directory, skipping"
|
||||
msgstr "%s: Jest katalogiem, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:474
|
||||
#, c-format
|
||||
msgid "%s: Not a regular file, skipping"
|
||||
msgstr "%s: Nie jest zwykłym plikiem, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:491
|
||||
#, 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:498
|
||||
#, c-format
|
||||
msgid "%s: File has sticky bit set, skipping"
|
||||
msgstr "%s: Plik ma ustawiony bit sticky, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:505
|
||||
#, 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:761
|
||||
#, 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:773
|
||||
#, c-format
|
||||
msgid "%s: Closing the file failed: %s"
|
||||
msgstr "%s: Zamknięcie pliku nie powiodło się: %s"
|
||||
|
||||
#: src/xz/file_io.c:809 src/xz/file_io.c:1008
|
||||
#, 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:883
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Błąd odczytu: %s"
|
||||
|
||||
#: src/xz/file_io.c:906
|
||||
#, c-format
|
||||
msgid "%s: Error seeking the file: %s"
|
||||
msgstr "%s: Błąd podczas zmiany pozycji w pliku: %s"
|
||||
|
||||
#: src/xz/file_io.c:916
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Nieoczekiwany koniec pliku"
|
||||
|
||||
#: src/xz/file_io.c:966
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Błąd zapisu: %s"
|
||||
|
||||
#: src/xz/hardware.c:101
|
||||
msgid "Disabled"
|
||||
msgstr "Wyłączony"
|
||||
|
||||
#. TRANSLATORS: Test with "xz --info-memory" to see if
|
||||
#. the alignment looks nice.
|
||||
#: src/xz/hardware.c:120
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:122
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limit użycia pamięci dla kompresji: "
|
||||
|
||||
#: src/xz/hardware.c:124
|
||||
msgid "Memory usage limit for decompression: "
|
||||
msgstr "Limit użycia pamięci dla dekompresji: "
|
||||
|
||||
#. TRANSLATORS: Indicates that there is no integrity check.
|
||||
#. This string is used in tables, so the width must not
|
||||
#. exceed ten columns with a fixed-width font.
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Brak"
|
||||
|
||||
#. TRANSLATORS: Indicates that integrity check name is not known,
|
||||
#. but the Check ID is known (here 2). This and other "Unknown-N"
|
||||
#. strings are used in tables, so the width must not exceed ten
|
||||
#. columns with a fixed-width font. It's OK to omit the dash if
|
||||
#. you need space for one extra letter, but don't use spaces.
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Nieznany-2"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Nieznany-3"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Nieznany-5"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Nieznany-6"
|
||||
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Nieznany-7"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Nieznany-8"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Nieznany-9"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Nieznany11"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Nieznany12"
|
||||
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Nieznany13"
|
||||
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Nieznany14"
|
||||
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Nieznany15"
|
||||
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Plik jest pusty"
|
||||
|
||||
#: src/xz/list.c:158
|
||||
#, 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:645
|
||||
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
|
||||
msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
|
||||
|
||||
#: src/xz/list.c:685
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Strumienie: %s\n"
|
||||
|
||||
#: src/xz/list.c:687
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Bloki: %s\n"
|
||||
|
||||
#: src/xz/list.c:689
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Rozmiar spakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:692
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Rozmiar rozpakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:695
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Współczynnik: %s\n"
|
||||
|
||||
#: src/xz/list.c:697
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Kontrola spójności: %s\n"
|
||||
|
||||
#: src/xz/list.c:698
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Wyrównanie strumienia: %s\n"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All except
|
||||
#. Check are right aligned; Check is left aligned. Test with
|
||||
#. "xz -lv foo.xz".
|
||||
#: src/xz/list.c:726
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
|
||||
msgstr ""
|
||||
" Strumienie:\n"
|
||||
" Strumień Bloki Offset spak. Offset rozp. Rozm.spak. Rozm.rozp. Wsp. Kontrola Wyrównanie"
|
||||
|
||||
#. TRANSLATORS: The second line is column headings. All
|
||||
#. except Check are right aligned; Check is left aligned.
|
||||
#: src/xz/list.c:781
|
||||
#, c-format
|
||||
msgid ""
|
||||
" Blocks:\n"
|
||||
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
|
||||
msgstr ""
|
||||
" Bloki:\n"
|
||||
" Strumień Blok Offset spak. Offset rozp. Rozm.całkowity Rozm.rozp. Wsp. Kontrola"
|
||||
|
||||
#. TRANSLATORS: These are additional column headings
|
||||
#. for the most verbose listing mode. CheckVal
|
||||
#. (Check value), Flags, and Filters are left aligned.
|
||||
#. Header (Block Header Size), CompSize, and MemUsage
|
||||
#. are right aligned. %*s is replaced with 0-120
|
||||
#. spaces to make the CheckVal column wide enough.
|
||||
#. Test with "xz -lvv foo.xz".
|
||||
#: src/xz/list.c:793
|
||||
#, c-format
|
||||
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
|
||||
msgstr " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
|
||||
|
||||
#: src/xz/list.c:871 src/xz/list.c:1046
|
||||
#, c-format
|
||||
msgid " Memory needed: %s MiB\n"
|
||||
msgstr " Wymagana pamięć: %s MiB\n"
|
||||
|
||||
#: src/xz/list.c:873 src/xz/list.c:1048
|
||||
#, c-format
|
||||
msgid " Sizes in headers: %s\n"
|
||||
msgstr " Rozmiar w nagłówkach: %s\n"
|
||||
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "Yes"
|
||||
msgstr "Tak"
|
||||
|
||||
#: src/xz/list.c:874 src/xz/list.c:1049
|
||||
msgid "No"
|
||||
msgstr "Nie"
|
||||
|
||||
#: src/xz/list.c:875 src/xz/list.c:1050
|
||||
#, 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:1025
|
||||
#, 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:1038
|
||||
msgid "Totals:"
|
||||
msgstr "Sumarycznie:"
|
||||
|
||||
#: src/xz/list.c:1039
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Liczba plików: %s\n"
|
||||
|
||||
#: src/xz/list.c:1114
|
||||
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:1120
|
||||
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:174
|
||||
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:231
|
||||
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:733
|
||||
#, c-format
|
||||
msgid "%s: "
|
||||
msgstr "%s: "
|
||||
|
||||
#: src/xz/message.c:796 src/xz/message.c:846
|
||||
msgid "Internal error (bug)"
|
||||
msgstr "Błąd wewnętrzny"
|
||||
|
||||
#: src/xz/message.c:803
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Nie można ustawić obsługi sygnałów"
|
||||
|
||||
#: src/xz/message.c:812
|
||||
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:815
|
||||
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:822
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Osiągnięto limit użycia pamięci"
|
||||
|
||||
#: src/xz/message.c:825
|
||||
msgid "File format not recognized"
|
||||
msgstr "Nie rozpoznany format pliku"
|
||||
|
||||
#: src/xz/message.c:828
|
||||
msgid "Unsupported options"
|
||||
msgstr "Nieobsługiwane opcje"
|
||||
|
||||
#: src/xz/message.c:831
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Dane skompresowane są uszkodzone"
|
||||
|
||||
#: src/xz/message.c:834
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Nieoczekiwany koniec wejścia"
|
||||
|
||||
#: src/xz/message.c:867
|
||||
#, 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:895
|
||||
#, 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:1062
|
||||
#, c-format
|
||||
msgid "%s: Filter chain: %s\n"
|
||||
msgstr "%s: Łańcuch filtrów: %s\n"
|
||||
|
||||
#: src/xz/message.c:1072
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Polecenie `%s --help' pokaże więcej informacji."
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
#, 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:1105
|
||||
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:1109
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Tryb pracy:\n"
|
||||
|
||||
#: src/xz/message.c:1112
|
||||
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:1118
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Modyfikatory operacji:\n"
|
||||
|
||||
#: src/xz/message.c:1121
|
||||
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:1127
|
||||
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:1130
|
||||
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:1139
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Podstawowe opcje formatu pliku i kompresji:\n"
|
||||
|
||||
#: src/xz/message.c:1141
|
||||
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'"
|
||||
msgstr ""
|
||||
" -F, --format=FORM format pliki do kodowania lub dekodowania; możliwe to\n"
|
||||
" `auto' (domyślny), `xz', 'lzma' 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:1148
|
||||
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:1152
|
||||
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:1157
|
||||
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=LICZBA\n"
|
||||
" przy kompresji do formatu .xz: rozpoczynanie nowego bloku\n"
|
||||
" po każdej LICZBIE bajtów wejścia; 0=wyłączone (domyślne)"
|
||||
|
||||
#: src/xz/message.c:1161
|
||||
#, 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"
|
||||
msgstr ""
|
||||
" --memlimit-compress=LIMIT\n"
|
||||
" --memlimit-decompress=LIMIT\n"
|
||||
" -M, --memlimit=LIMIT\n"
|
||||
" ustawienie limitu użycia pamięci dla kompresji,\n"
|
||||
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
|
||||
" dla limitów domyślnych"
|
||||
|
||||
#: src/xz/message.c:1168
|
||||
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:1174
|
||||
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:1183
|
||||
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:1198
|
||||
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)"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" --x86[=OPCJE] Filtr BCJ x86 (32-bitowy lub 64-bitowy)\n"
|
||||
" --powerpc[=OPCJE] Filtr BCJ PowerPC (tylko big-endian)\n"
|
||||
" --ia64[=OPCJE] Filtr BCJ IA-64 (Itanium)\n"
|
||||
" --arm[=OPCJE] Filtr BCJ ARM (tylko little-endian)\n"
|
||||
" --armthumb[=OPCJE] Filtr BCJ ARM-Thumb (tylko little-endian)\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:1210
|
||||
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:1218
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Inne opcje:\n"
|
||||
|
||||
#: src/xz/message.c:1221
|
||||
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:1226
|
||||
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:1228
|
||||
msgid " --robot use machine-parsable messages (useful for scripts)"
|
||||
msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)"
|
||||
|
||||
#: src/xz/message.c:1231
|
||||
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:1234
|
||||
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:1238
|
||||
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:1243
|
||||
msgid " -V, --version display the version number and exit"
|
||||
msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie"
|
||||
|
||||
#: src/xz/message.c:1245
|
||||
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:1251
|
||||
#, 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"
|
||||
"<translation-team-pl@lists.sourceforge.net>.\n"
|
||||
|
||||
#: src/xz/message.c:1253
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Strona domowa %s: <%s>\n"
|
||||
|
||||
#: 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/options.c:359
|
||||
#, c-format
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:133 src/xz/suffix.c:258
|
||||
#, 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:164
|
||||
#, c-format
|
||||
msgid "%s: Filename has an unknown suffix, skipping"
|
||||
msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto"
|
||||
|
||||
#: src/xz/suffix.c:185
|
||||
#, c-format
|
||||
msgid "%s: File already has `%s' suffix, skipping"
|
||||
msgstr "%s: Plik już ma rozszerzenie `%s', pominięto"
|
||||
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Błędne rozszerzenie nazwy pliku"
|
||||
|
||||
#: src/xz/util.c:61
|
||||
#, 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:103
|
||||
#, c-format
|
||||
msgid "%s: Invalid multiplier suffix"
|
||||
msgstr "%s: Błędny przyrostek mnożnika"
|
||||
|
||||
#: src/xz/util.c:105
|
||||
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:122
|
||||
#, c-format
|
||||
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
|
||||
msgstr "Wartość opcji `%s' musi być w przedziale [%<PRIu64>, %<PRIu64>]"
|
||||
|
||||
#: src/xz/util.c:247
|
||||
msgid "Empty filename, skipping"
|
||||
msgstr "Pusta nazwa pliku, pominięto"
|
||||
|
||||
#: src/xz/util.c:261
|
||||
msgid "Compressed data cannot be read from a terminal"
|
||||
msgstr "Dane skompresowane nie mogą być czytane z terminala"
|
||||
|
||||
#: src/xz/util.c:274
|
||||
msgid "Compressed data cannot be written to a terminal"
|
||||
msgstr "Dane skompresowane nie mogą być zapisywane na terminal"
|
||||
|
||||
#: src/common/tuklib_exit.c:39
|
||||
msgid "Writing to standard output failed"
|
||||
msgstr "Zapis na standardowe wyjście nie powiódł się"
|
||||
|
||||
#: src/common/tuklib_exit.c:42
|
||||
msgid "Unknown error"
|
||||
msgstr "Nieznany błąd"
|
||||
@@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file mythread.h
|
||||
/// \brief Wrappers for threads
|
||||
/// \brief Some threading related helper macros and functions
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
@@ -10,33 +10,218 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef MYTHREAD_H
|
||||
#define MYTHREAD_H
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
# include <pthread.h>
|
||||
|
||||
# define mythread_once(func) \
|
||||
do { \
|
||||
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
|
||||
pthread_once(&once_, &func); \
|
||||
} while (0)
|
||||
////////////////////
|
||||
// Using pthreads //
|
||||
////////////////////
|
||||
|
||||
# define mythread_sigmask(how, set, oset) \
|
||||
pthread_sigmask(how, set, oset)
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#ifdef __VMS
|
||||
// Do nothing on OpenVMS. It doesn't have pthread_sigmask().
|
||||
#define mythread_sigmask(how, set, oset) do { } while (0)
|
||||
#else
|
||||
/// \brief Set the process signal mask
|
||||
///
|
||||
/// If threads are disabled, sigprocmask() is used instead
|
||||
/// of pthread_sigmask().
|
||||
#define mythread_sigmask(how, set, oset) \
|
||||
pthread_sigmask(how, set, oset)
|
||||
#endif
|
||||
|
||||
/// \brief Call the given function once
|
||||
///
|
||||
/// If threads are disabled, a thread-unsafe version is used.
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
|
||||
pthread_once(&once_, &func); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/// \brief Lock a mutex for a duration of a block
|
||||
///
|
||||
/// Perform pthread_mutex_lock(&mutex) in the beginning of a block
|
||||
/// and pthread_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 pthread_mutex_lock(&mutex)
|
||||
/// and pthread_mutex_unlock(&mutex) calls.
|
||||
///
|
||||
#define mythread_sync(mutex) mythread_sync_helper(mutex, __LINE__)
|
||||
#define mythread_sync_helper(mutex, line) \
|
||||
for (unsigned int mythread_i_ ## line = 0; \
|
||||
mythread_i_ ## line \
|
||||
? (pthread_mutex_unlock(&(mutex)), 0) \
|
||||
: (pthread_mutex_lock(&(mutex)), 1); \
|
||||
mythread_i_ ## line = 1) \
|
||||
for (unsigned int mythread_j_ ## line = 0; \
|
||||
!mythread_j_ ## line; \
|
||||
mythread_j_ ## line = 1)
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Condition variable
|
||||
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;
|
||||
|
||||
|
||||
/// \brief Initialize a condition variable to use CLOCK_MONOTONIC
|
||||
///
|
||||
/// 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.
|
||||
static inline int
|
||||
mythread_cond_init(mythread_cond *mycond)
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
// NOTE: HAVE_DECL_CLOCK_MONOTONIC is always defined to 0 or 1.
|
||||
# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && HAVE_DECL_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.
|
||||
# endif
|
||||
|
||||
mycond->clk_id = CLOCK_REALTIME;
|
||||
#endif
|
||||
|
||||
return pthread_cond_init(&mycond->cond, NULL);
|
||||
}
|
||||
|
||||
|
||||
/// \brief Convert relative time to absolute time for use with timed wait
|
||||
///
|
||||
/// The current time of the clock associated with the condition variable
|
||||
/// is added to the relative time in *ts.
|
||||
static inline void
|
||||
mythread_cond_abstime(const mythread_cond *mycond, struct timespec *ts)
|
||||
{
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
struct timespec now;
|
||||
clock_gettime(mycond->clk_id, &now);
|
||||
|
||||
ts->tv_sec += now.tv_sec;
|
||||
ts->tv_nsec += now.tv_nsec;
|
||||
#else
|
||||
(void)mycond;
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
ts->tv_sec += now.tv_sec;
|
||||
ts->tv_nsec += now.tv_usec * 1000L;
|
||||
#endif
|
||||
|
||||
// tv_nsec must stay in the range [0, 999_999_999].
|
||||
if (ts->tv_nsec >= 1000000000L) {
|
||||
ts->tv_nsec -= 1000000000L;
|
||||
++ts->tv_sec;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#define mythread_cond_wait(mycondptr, mutexptr) \
|
||||
pthread_cond_wait(&(mycondptr)->cond, mutexptr)
|
||||
|
||||
#define mythread_cond_timedwait(mycondptr, mutexptr, abstimeptr) \
|
||||
pthread_cond_timedwait(&(mycondptr)->cond, mutexptr, abstimeptr)
|
||||
|
||||
#define mythread_cond_signal(mycondptr) \
|
||||
pthread_cond_signal(&(mycondptr)->cond)
|
||||
|
||||
#define mythread_cond_broadcast(mycondptr) \
|
||||
pthread_cond_broadcast(&(mycondptr)->cond)
|
||||
|
||||
#define mythread_cond_destroy(mycondptr) \
|
||||
pthread_cond_destroy(&(mycondptr)->cond)
|
||||
|
||||
|
||||
/// \brief Create a thread with all signals blocked
|
||||
static inline int
|
||||
mythread_create(pthread_t *thread, void *(*func)(void *arg), void *arg)
|
||||
{
|
||||
sigset_t old;
|
||||
sigset_t all;
|
||||
sigfillset(&all);
|
||||
|
||||
pthread_sigmask(SIG_SETMASK, &all, &old);
|
||||
const int ret = pthread_create(thread, NULL, func, arg);
|
||||
pthread_sigmask(SIG_SETMASK, &old, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
} while (0)
|
||||
//////////////////
|
||||
// No threading //
|
||||
//////////////////
|
||||
|
||||
# define mythread_sigmask(how, set, oset) \
|
||||
sigprocmask(how, set, oset)
|
||||
#define mythread_sigmask(how, set, oset) \
|
||||
sigprocmask(how, set, oset)
|
||||
|
||||
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -103,9 +103,12 @@
|
||||
# define UINT64_MAX UINT64_C(18446744073709551615)
|
||||
#endif
|
||||
|
||||
// Interix has broken header files, which typedef size_t to unsigned long,
|
||||
// but a few lines later define SIZE_MAX to INT32_MAX.
|
||||
#ifdef __INTERIX
|
||||
// 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
|
||||
|
||||
|
||||
@@ -39,12 +39,14 @@ tuklib_open_stdxxx(int err_status)
|
||||
| (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.
|
||||
(void)close(fd);
|
||||
exit(err_status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,13 @@ liblzma_la_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/liblzma/simple \
|
||||
-I$(top_srcdir)/src/common \
|
||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 5:0:0
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 5:99:0
|
||||
|
||||
if COND_SYMVERS
|
||||
EXTRA_DIST += liblzma.map
|
||||
liblzma_la_LDFLAGS += \
|
||||
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
|
||||
endif
|
||||
|
||||
include $(srcdir)/common/Makefile.inc
|
||||
include $(srcdir)/check/Makefile.inc
|
||||
|
||||
@@ -332,11 +332,19 @@ typedef enum {
|
||||
* malloc() and free(). C++ users should note that the custom memory
|
||||
* handling functions must not throw exceptions.
|
||||
*
|
||||
* 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).
|
||||
* 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 {
|
||||
/**
|
||||
|
||||
@@ -483,6 +483,7 @@ extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_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
|
||||
|
||||
@@ -60,12 +60,139 @@
|
||||
#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31)
|
||||
|
||||
|
||||
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */
|
||||
/**
|
||||
* \brief Multithreading options
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* \brief Flags
|
||||
*
|
||||
* Set this to zero if no flags are wanted.
|
||||
*
|
||||
* No flags are currently supported.
|
||||
*/
|
||||
uint32_t flags;
|
||||
|
||||
/**
|
||||
* \brief Number of worker threads to use
|
||||
*/
|
||||
uint32_t threads;
|
||||
|
||||
/**
|
||||
* \brief 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.
|
||||
*/
|
||||
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 Compression preset (level and possible flags)
|
||||
*
|
||||
* The preset is set just like with lzma_easy_encoder().
|
||||
* The preset is ignored if filters below is non-NULL.
|
||||
*/
|
||||
uint32_t preset;
|
||||
|
||||
/**
|
||||
* \brief 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 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;
|
||||
uint64_t reserved_int5;
|
||||
uint64_t reserved_int6;
|
||||
uint64_t reserved_int7;
|
||||
uint64_t reserved_int8;
|
||||
void *reserved_ptr1;
|
||||
void *reserved_ptr2;
|
||||
void *reserved_ptr3;
|
||||
void *reserved_ptr4;
|
||||
|
||||
} lzma_mt;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* \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;
|
||||
@@ -77,6 +204,11 @@ extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t 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;
|
||||
@@ -148,6 +280,7 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
|
||||
*
|
||||
* \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
|
||||
@@ -171,6 +304,7 @@ extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
|
||||
*
|
||||
* \return - LZMA_OK: Initialization was successful.
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_UNSUPPORTED_CHECK
|
||||
* - LZMA_OPTIONS_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
@@ -179,6 +313,50 @@ extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm,
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */
|
||||
/**
|
||||
* \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.
|
||||
*
|
||||
* TODO: For lzma_code(), only LZMA_RUN and LZMA_FINISH are currently
|
||||
* supported. Support for other actions has been planned.
|
||||
*
|
||||
* \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;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* \brief Initialize .lzma encoder (legacy file format)
|
||||
*
|
||||
@@ -250,6 +428,7 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_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
|
||||
|
||||
@@ -131,7 +131,9 @@ extern LZMA_API(lzma_ret) lzma_filters_copy(const lzma_filter *src,
|
||||
* .id == LZMA_VLI_UNKNOWN.
|
||||
*
|
||||
* \return Number of bytes of memory required for the given
|
||||
* filter chain when encoding.
|
||||
* 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;
|
||||
@@ -148,7 +150,9 @@ extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
|
||||
* .id == LZMA_VLI_UNKNOWN.
|
||||
*
|
||||
* \return Number of bytes of memory required for the given
|
||||
* filter chain when decoding.
|
||||
* 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;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
* Version number split into components
|
||||
*/
|
||||
#define LZMA_VERSION_MAJOR 5
|
||||
#define LZMA_VERSION_MINOR 0
|
||||
#define LZMA_VERSION_PATCH 0
|
||||
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
|
||||
#define LZMA_VERSION_MINOR 1
|
||||
#define LZMA_VERSION_PATCH 2
|
||||
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_ALPHA
|
||||
|
||||
#ifndef LZMA_VERSION_COMMIT
|
||||
# define LZMA_VERSION_COMMIT ""
|
||||
|
||||
@@ -47,5 +47,7 @@ endif
|
||||
endif
|
||||
|
||||
if COND_CHECK_SHA256
|
||||
if COND_INTERNAL_SHA256
|
||||
liblzma_la_SOURCES += check/sha256.c
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -15,6 +15,43 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#elif defined(HAVE_SHA256_H)
|
||||
# include <sys/types.h>
|
||||
# include <sha256.h>
|
||||
#elif defined(HAVE_SHA2_H)
|
||||
# include <sys/types.h>
|
||||
# include <sha2.h>
|
||||
#elif defined(HAVE_MINIX_SHA2_H)
|
||||
# include <sys/types.h>
|
||||
# include <minix/sha2.h>
|
||||
#endif
|
||||
|
||||
#if 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;
|
||||
#else
|
||||
/// 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;
|
||||
#endif
|
||||
|
||||
#if 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.
|
||||
@@ -43,14 +80,7 @@ typedef struct {
|
||||
union {
|
||||
uint32_t crc32;
|
||||
uint64_t crc64;
|
||||
|
||||
struct {
|
||||
/// Internal state
|
||||
uint32_t state[8];
|
||||
|
||||
/// Size of the message excluding padding
|
||||
uint64_t size;
|
||||
} sha256;
|
||||
lzma_sha256_state sha256;
|
||||
} state;
|
||||
|
||||
} lzma_check_state;
|
||||
@@ -82,6 +112,8 @@ extern void lzma_check_update(lzma_check_state *check, lzma_check type,
|
||||
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);
|
||||
|
||||
@@ -92,4 +124,39 @@ extern void lzma_sha256_update(
|
||||
/// 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
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "check.h"
|
||||
|
||||
// Avoid bogus warnings in transform().
|
||||
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __GNUC__ > 4
|
||||
#if TUKLIB_GNUC_REQ(4, 2)
|
||||
# pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
#endif
|
||||
|
||||
#include "check.h"
|
||||
|
||||
// At least on x86, GCC is able to optimize this to a rotate instruction.
|
||||
#define rotr_32(num, amount) ((num) >> (amount) | (num) << (32 - (amount)))
|
||||
|
||||
|
||||
@@ -38,9 +38,15 @@ liblzma_la_SOURCES += \
|
||||
common/index_encoder.h \
|
||||
common/stream_buffer_encoder.c \
|
||||
common/stream_encoder.c \
|
||||
common/stream_encoder.h \
|
||||
common/stream_flags_encoder.c \
|
||||
common/vli_encoder.c
|
||||
|
||||
if COND_THREADS
|
||||
liblzma_la_SOURCES += \
|
||||
common/outqueue.c \
|
||||
common/outqueue.h \
|
||||
common/stream_encoder_mt.c
|
||||
endif
|
||||
endif
|
||||
|
||||
if COND_MAIN_DECODER
|
||||
|
||||
@@ -46,7 +46,7 @@ struct lzma_coder_s {
|
||||
|
||||
static lzma_ret
|
||||
alone_decode(lzma_coder *coder,
|
||||
lzma_allocator *allocator lzma_attribute((unused)),
|
||||
lzma_allocator *allocator lzma_attribute((__unused__)),
|
||||
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,
|
||||
|
||||
@@ -32,7 +32,7 @@ struct lzma_coder_s {
|
||||
|
||||
static lzma_ret
|
||||
alone_encode(lzma_coder *coder,
|
||||
lzma_allocator *allocator lzma_attribute((unused)),
|
||||
lzma_allocator *allocator lzma_attribute((__unused__)),
|
||||
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,
|
||||
@@ -103,7 +103,7 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
if (options->dict_size < LZMA_DICT_SIZE_MIN)
|
||||
return LZMA_OPTIONS_ERROR;
|
||||
|
||||
// Round up to to the next 2^n or 2^n + 2^(n - 1) depending on which
|
||||
// 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.
|
||||
|
||||
@@ -226,16 +226,23 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
// Sanity checks
|
||||
if (block == NULL || block->filters == NULL
|
||||
|| (in == NULL && in_size != 0) || out == NULL
|
||||
// Validate the arguments.
|
||||
if (block == NULL || (in == NULL && in_size != 0) || out == NULL
|
||||
|| out_pos == NULL || *out_pos > out_size)
|
||||
return LZMA_PROG_ERROR;
|
||||
|
||||
// Check the version field.
|
||||
// The contents of the structure may depend on the version so
|
||||
// check the version before validating the contents of *block.
|
||||
if (block->version != 0)
|
||||
return LZMA_OPTIONS_ERROR;
|
||||
|
||||
if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX
|
||||
|| 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.
|
||||
@@ -243,8 +250,7 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
|
||||
// Get the size of the Check field.
|
||||
const size_t check_size = lzma_check_size(block->check);
|
||||
if (check_size == UINT32_MAX)
|
||||
return LZMA_PROG_ERROR;
|
||||
assert(check_size != UINT32_MAX);
|
||||
|
||||
// Reserve space for the Check field.
|
||||
if (out_size - *out_pos <= check_size)
|
||||
|
||||
@@ -144,7 +144,7 @@ block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
static lzma_ret
|
||||
block_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
const lzma_filter *filters lzma_attribute((unused)),
|
||||
const lzma_filter *filters lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
if (coder->sequence != SEQ_CODE)
|
||||
@@ -161,6 +161,11 @@ lzma_block_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
{
|
||||
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 != 0)
|
||||
return LZMA_OPTIONS_ERROR;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ lzma_version_string(void)
|
||||
// Memory allocation //
|
||||
///////////////////////
|
||||
|
||||
extern void * lzma_attribute((malloc))
|
||||
extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
|
||||
lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||
{
|
||||
// Some malloc() variants return NULL if called with size == 0.
|
||||
@@ -156,10 +156,8 @@ lzma_strm_init(lzma_stream *strm)
|
||||
strm->internal->next = LZMA_NEXT_CODER_INIT;
|
||||
}
|
||||
|
||||
strm->internal->supported_actions[LZMA_RUN] = false;
|
||||
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = false;
|
||||
strm->internal->supported_actions[LZMA_FULL_FLUSH] = false;
|
||||
strm->internal->supported_actions[LZMA_FINISH] = false;
|
||||
memzero(strm->internal->supported_actions,
|
||||
sizeof(strm->internal->supported_actions));
|
||||
strm->internal->sequence = ISEQ_RUN;
|
||||
strm->internal->allow_buf_error = false;
|
||||
|
||||
@@ -265,7 +263,9 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
|
||||
strm->internal->avail_in = strm->avail_in;
|
||||
|
||||
switch (ret) {
|
||||
// Cast is needed to silence a warning about LZMA_TIMED_OUT, which
|
||||
// isn't part of lzma_ret enumeration.
|
||||
switch ((unsigned int)(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
|
||||
@@ -281,6 +281,11 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
}
|
||||
break;
|
||||
|
||||
case LZMA_TIMED_OUT:
|
||||
strm->internal->allow_buf_error = false;
|
||||
ret = LZMA_OK;
|
||||
break;
|
||||
|
||||
case LZMA_STREAM_END:
|
||||
if (strm->internal->sequence == ISEQ_SYNC_FLUSH
|
||||
|| strm->internal->sequence == ISEQ_FULL_FLUSH)
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#define LZMA_API(type) LZMA_API_EXPORT type LZMA_API_CALL
|
||||
|
||||
#define LZMA_UNSTABLE
|
||||
|
||||
#include "lzma.h"
|
||||
|
||||
// These allow helping the compiler in some often-executed branches, whose
|
||||
@@ -49,6 +51,13 @@
|
||||
#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
|
||||
@@ -69,6 +78,13 @@
|
||||
| LZMA_CONCATENATED )
|
||||
|
||||
|
||||
/// 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(). This is not in the lzma_ret enumeration because
|
||||
/// there's no need to have it in the public API.
|
||||
#define LZMA_TIMED_OUT 32
|
||||
|
||||
|
||||
/// Type of encoder/decoder specific data; the actual structure is defined
|
||||
/// differently in different coders.
|
||||
typedef struct lzma_coder_s lzma_coder;
|
||||
@@ -205,7 +221,7 @@ struct lzma_internal_s {
|
||||
|
||||
/// Allocates memory
|
||||
extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||
lzma_attribute((malloc)) lzma_attr_alloc_size(1);
|
||||
lzma_attribute((__malloc__)) lzma_attr_alloc_size(1);
|
||||
|
||||
/// Frees memory
|
||||
extern void lzma_free(void *ptr, lzma_allocator *allocator);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "easy_preset.h"
|
||||
#include "stream_encoder.h"
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
|
||||
@@ -43,7 +43,7 @@ static const struct {
|
||||
.changes_size = true,
|
||||
},
|
||||
#endif
|
||||
#ifdef HAVE_DECODER_LZMA2
|
||||
#if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2)
|
||||
{
|
||||
.id = LZMA_FILTER_LZMA2,
|
||||
.options_size = sizeof(lzma_options_lzma),
|
||||
@@ -52,7 +52,7 @@ static const struct {
|
||||
.changes_size = true,
|
||||
},
|
||||
#endif
|
||||
#ifdef HAVE_DECODER_X86
|
||||
#if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86)
|
||||
{
|
||||
.id = LZMA_FILTER_X86,
|
||||
.options_size = sizeof(lzma_options_bcj),
|
||||
@@ -70,7 +70,7 @@ static const struct {
|
||||
.changes_size = false,
|
||||
},
|
||||
#endif
|
||||
#ifdef HAVE_DECODER_IA64
|
||||
#if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64)
|
||||
{
|
||||
.id = LZMA_FILTER_IA64,
|
||||
.options_size = sizeof(lzma_options_bcj),
|
||||
|
||||
@@ -30,11 +30,11 @@ typedef struct {
|
||||
/// invalid, UINT64_MAX is returned.
|
||||
uint64_t (*memusage)(const void *options);
|
||||
|
||||
/// Calculates the minimum sane size for Blocks (or other types of
|
||||
/// chunks) 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.
|
||||
lzma_vli (*chunk_size)(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, UINT32_MAX is returned. If this is NULL, props_size_fixed
|
||||
@@ -59,7 +59,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_LZMA1,
|
||||
.init = &lzma_lzma_encoder_init,
|
||||
.memusage = &lzma_lzma_encoder_memusage,
|
||||
.chunk_size = NULL, // FIXME
|
||||
.block_size = NULL, // FIXME
|
||||
.props_size_get = NULL,
|
||||
.props_size_fixed = 5,
|
||||
.props_encode = &lzma_lzma_props_encode,
|
||||
@@ -70,7 +70,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_LZMA2,
|
||||
.init = &lzma_lzma2_encoder_init,
|
||||
.memusage = &lzma_lzma2_encoder_memusage,
|
||||
.chunk_size = NULL, // FIXME
|
||||
.block_size = &lzma_lzma2_block_size, // FIXME
|
||||
.props_size_get = NULL,
|
||||
.props_size_fixed = 1,
|
||||
.props_encode = &lzma_lzma2_props_encode,
|
||||
@@ -81,7 +81,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_X86,
|
||||
.init = &lzma_simple_x86_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -91,7 +91,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_POWERPC,
|
||||
.init = &lzma_simple_powerpc_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -101,7 +101,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_IA64,
|
||||
.init = &lzma_simple_ia64_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -111,7 +111,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_ARM,
|
||||
.init = &lzma_simple_arm_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -121,7 +121,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_ARMTHUMB,
|
||||
.init = &lzma_simple_armthumb_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -131,7 +131,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_SPARC,
|
||||
.init = &lzma_simple_sparc_encoder_init,
|
||||
.memusage = NULL,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = &lzma_simple_props_size,
|
||||
.props_encode = &lzma_simple_props_encode,
|
||||
},
|
||||
@@ -141,7 +141,7 @@ static const lzma_filter_encoder encoders[] = {
|
||||
.id = LZMA_FILTER_DELTA,
|
||||
.init = &lzma_delta_encoder_init,
|
||||
.memusage = &lzma_delta_coder_memusage,
|
||||
.chunk_size = NULL,
|
||||
.block_size = NULL,
|
||||
.props_size_get = NULL,
|
||||
.props_size_fixed = 1,
|
||||
.props_encode = &lzma_delta_props_encode,
|
||||
@@ -226,20 +226,19 @@ lzma_raw_encoder_memusage(const lzma_filter *filters)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
extern LZMA_API(lzma_vli)
|
||||
lzma_chunk_size(const lzma_filter *filters)
|
||||
extern uint64_t
|
||||
lzma_mt_block_size(const lzma_filter *filters)
|
||||
{
|
||||
lzma_vli max = 0;
|
||||
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->chunk_size != NULL) {
|
||||
const lzma_vli size
|
||||
= fe->chunk_size(filters[i].options);
|
||||
if (size == LZMA_VLI_UNKNOWN)
|
||||
return LZMA_VLI_UNKNOWN;
|
||||
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;
|
||||
@@ -248,7 +247,6 @@ lzma_chunk_size(const lzma_filter *filters)
|
||||
|
||||
return max;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "common.h"
|
||||
|
||||
|
||||
// FIXME: Might become a part of the public API once finished.
|
||||
// extern lzma_vli lzma_chunk_size(const lzma_filter *filters);
|
||||
// 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(
|
||||
|
||||
@@ -398,10 +398,13 @@ extern LZMA_API(lzma_index *)
|
||||
lzma_index_init(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 (i == NULL || s == NULL) {
|
||||
index_stream_end(s, allocator);
|
||||
if (s == NULL) {
|
||||
lzma_free(i, allocator);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
index_tree_append(&i->streams, &s->node);
|
||||
|
||||
@@ -56,10 +56,11 @@ struct lzma_coder_s {
|
||||
static lzma_ret
|
||||
index_decode(lzma_coder *coder, 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)))
|
||||
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__)))
|
||||
{
|
||||
// Similar optimization as in index_encoder.c
|
||||
const size_t in_start = *in_pos;
|
||||
|
||||
@@ -42,12 +42,13 @@ struct lzma_coder_s {
|
||||
|
||||
static lzma_ret
|
||||
index_encode(lzma_coder *coder,
|
||||
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)),
|
||||
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)))
|
||||
size_t out_size,
|
||||
lzma_action action lzma_attribute((__unused__)))
|
||||
{
|
||||
// Position where to start calculating CRC32. The idea is that we
|
||||
// need to call lzma_crc32() only once per call to index_encode().
|
||||
|
||||
184
src/liblzma/common/outqueue.c
Normal file
184
src/liblzma/common/outqueue.c
Normal file
@@ -0,0 +1,184 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \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"
|
||||
|
||||
|
||||
/// This is to ease integer overflow checking: We may allocate up to
|
||||
/// 2 * LZMA_THREADS_MAX buffers and we need some extra memory for other
|
||||
/// data structures (that's the second /2).
|
||||
#define BUF_SIZE_MAX (UINT64_MAX / LZMA_THREADS_MAX / 2 / 2)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
get_options(uint64_t *bufs_alloc_size, uint32_t *bufs_count,
|
||||
uint64_t buf_size_max, uint32_t threads)
|
||||
{
|
||||
if (threads > LZMA_THREADS_MAX || buf_size_max > BUF_SIZE_MAX)
|
||||
return LZMA_OPTIONS_ERROR;
|
||||
|
||||
// The number of buffers is twice the number of threads.
|
||||
// This wastes RAM but keeps the threads busy when buffers
|
||||
// finish out of order.
|
||||
//
|
||||
// NOTE: If this is changed, update BUF_SIZE_MAX too.
|
||||
*bufs_count = threads * 2;
|
||||
*bufs_alloc_size = *bufs_count * buf_size_max;
|
||||
|
||||
return LZMA_OK;
|
||||
}
|
||||
|
||||
|
||||
extern uint64_t
|
||||
lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads)
|
||||
{
|
||||
uint64_t bufs_alloc_size;
|
||||
uint32_t bufs_count;
|
||||
|
||||
if (get_options(&bufs_alloc_size, &bufs_count, buf_size_max, threads)
|
||||
!= LZMA_OK)
|
||||
return UINT64_MAX;
|
||||
|
||||
return sizeof(lzma_outq) + bufs_count * sizeof(lzma_outbuf)
|
||||
+ bufs_alloc_size;
|
||||
}
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
|
||||
uint64_t buf_size_max, uint32_t threads)
|
||||
{
|
||||
uint64_t bufs_alloc_size;
|
||||
uint32_t bufs_count;
|
||||
|
||||
// Set bufs_count and bufs_alloc_size.
|
||||
return_if_error(get_options(&bufs_alloc_size, &bufs_count,
|
||||
buf_size_max, threads));
|
||||
|
||||
// Allocate memory if needed.
|
||||
if (outq->buf_size_max != buf_size_max
|
||||
|| outq->bufs_allocated != bufs_count) {
|
||||
lzma_outq_end(outq, allocator);
|
||||
|
||||
#if SIZE_MAX < UINT64_MAX
|
||||
if (bufs_alloc_size > SIZE_MAX)
|
||||
return LZMA_MEM_ERROR;
|
||||
#endif
|
||||
|
||||
outq->bufs = lzma_alloc(bufs_count * sizeof(lzma_outbuf),
|
||||
allocator);
|
||||
outq->bufs_mem = lzma_alloc((size_t)(bufs_alloc_size),
|
||||
allocator);
|
||||
|
||||
if (outq->bufs == NULL || outq->bufs_mem == NULL) {
|
||||
lzma_outq_end(outq, allocator);
|
||||
return LZMA_MEM_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the rest of the main structure. Initialization of
|
||||
// outq->bufs[] is done when they are actually needed.
|
||||
outq->buf_size_max = (size_t)(buf_size_max);
|
||||
outq->bufs_allocated = bufs_count;
|
||||
outq->bufs_pos = 0;
|
||||
outq->bufs_used = 0;
|
||||
outq->read_pos = 0;
|
||||
|
||||
return LZMA_OK;
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator)
|
||||
{
|
||||
lzma_free(outq->bufs, allocator);
|
||||
outq->bufs = NULL;
|
||||
|
||||
lzma_free(outq->bufs_mem, allocator);
|
||||
outq->bufs_mem = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
extern lzma_outbuf *
|
||||
lzma_outq_get_buf(lzma_outq *outq)
|
||||
{
|
||||
// Caller must have checked it with lzma_outq_has_buf().
|
||||
assert(outq->bufs_used < outq->bufs_allocated);
|
||||
|
||||
// Initialize the new buffer.
|
||||
lzma_outbuf *buf = &outq->bufs[outq->bufs_pos];
|
||||
buf->buf = outq->bufs_mem + outq->bufs_pos * outq->buf_size_max;
|
||||
buf->size = 0;
|
||||
buf->finished = false;
|
||||
|
||||
// Update the queue state.
|
||||
if (++outq->bufs_pos == outq->bufs_allocated)
|
||||
outq->bufs_pos = 0;
|
||||
|
||||
++outq->bufs_used;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
extern bool
|
||||
lzma_outq_is_readable(const lzma_outq *outq)
|
||||
{
|
||||
uint32_t i = outq->bufs_pos - outq->bufs_used;
|
||||
if (outq->bufs_pos < outq->bufs_used)
|
||||
i += outq->bufs_allocated;
|
||||
|
||||
return outq->bufs[i].finished;
|
||||
}
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_outq_read(lzma_outq *restrict outq, 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_used == 0)
|
||||
return LZMA_OK;
|
||||
|
||||
// Get the buffer.
|
||||
uint32_t i = outq->bufs_pos - outq->bufs_used;
|
||||
if (outq->bufs_pos < outq->bufs_used)
|
||||
i += outq->bufs_allocated;
|
||||
|
||||
lzma_outbuf *buf = &outq->bufs[i];
|
||||
|
||||
// If it isn't finished yet, we cannot read from it.
|
||||
if (!buf->finished)
|
||||
return LZMA_OK;
|
||||
|
||||
// Copy from the buffer to output.
|
||||
lzma_bufcpy(buf->buf, &outq->read_pos, buf->size,
|
||||
out, out_pos, out_size);
|
||||
|
||||
// Return if we didn't get all the data from the buffer.
|
||||
if (outq->read_pos < buf->size)
|
||||
return LZMA_OK;
|
||||
|
||||
// The buffer was finished. Tell the caller its size information.
|
||||
*unpadded_size = buf->unpadded_size;
|
||||
*uncompressed_size = buf->uncompressed_size;
|
||||
|
||||
// Free this buffer for further use.
|
||||
--outq->bufs_used;
|
||||
outq->read_pos = 0;
|
||||
|
||||
return LZMA_STREAM_END;
|
||||
}
|
||||
155
src/liblzma/common/outqueue.h
Normal file
155
src/liblzma/common/outqueue.h
Normal file
@@ -0,0 +1,155 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \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 {
|
||||
/// Pointer to the output buffer of lzma_outq.buf_size_max bytes
|
||||
uint8_t *buf;
|
||||
|
||||
/// Amount of data written to buf
|
||||
size_t size;
|
||||
|
||||
/// Additional size information
|
||||
lzma_vli unpadded_size;
|
||||
lzma_vli uncompressed_size;
|
||||
|
||||
/// 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;
|
||||
|
||||
} lzma_outbuf;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Array of buffers that are used cyclically.
|
||||
lzma_outbuf *bufs;
|
||||
|
||||
/// Memory allocated for all the buffers
|
||||
uint8_t *bufs_mem;
|
||||
|
||||
/// Amount of buffer space available in each buffer
|
||||
size_t buf_size_max;
|
||||
|
||||
/// Number of buffers allocated
|
||||
uint32_t bufs_allocated;
|
||||
|
||||
/// Position in the bufs array. The next buffer to be taken
|
||||
/// into use is bufs[bufs_pos].
|
||||
uint32_t bufs_pos;
|
||||
|
||||
/// Number of buffers in use
|
||||
uint32_t bufs_used;
|
||||
|
||||
/// Position in the buffer in lzma_outq_read()
|
||||
size_t read_pos;
|
||||
|
||||
} 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 buf_size_max Maximum amount of data that a single buffer
|
||||
/// in the queue may need to store.
|
||||
/// \param threads Number of buffers that may be in use
|
||||
/// concurrently. Note that more than this number
|
||||
/// of buffers will actually get allocated to
|
||||
/// improve performance when buffers finish
|
||||
/// out of order.
|
||||
///
|
||||
/// \return - LZMA_OK
|
||||
/// - LZMA_MEM_ERROR
|
||||
///
|
||||
extern lzma_ret lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
|
||||
uint64_t buf_size_max, uint32_t threads);
|
||||
|
||||
|
||||
/// \brief Free the memory associated with the output queue
|
||||
extern void lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator);
|
||||
|
||||
|
||||
/// \brief Get a new buffer
|
||||
///
|
||||
/// lzma_outq_has_buf() must be used to check that there is a buffer
|
||||
/// available before calling lzma_outq_get_buf().
|
||||
///
|
||||
extern lzma_outbuf *lzma_outq_get_buf(lzma_outq *outq);
|
||||
|
||||
|
||||
/// \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.
|
||||
///
|
||||
/// \note This reads lzma_outbuf.finished variables and thus call
|
||||
/// to this function needs to be protected with a mutex.
|
||||
///
|
||||
extern lzma_ret lzma_outq_read(lzma_outq *restrict outq,
|
||||
uint8_t *restrict out, size_t *restrict out_pos,
|
||||
size_t out_size, lzma_vli *restrict unpadded_size,
|
||||
lzma_vli *restrict uncompressed_size);
|
||||
|
||||
|
||||
/// \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_used < outq->bufs_allocated;
|
||||
}
|
||||
|
||||
|
||||
/// \brief Test if the queue is completely empty
|
||||
static inline bool
|
||||
lzma_outq_is_empty(const lzma_outq *outq)
|
||||
{
|
||||
return outq->bufs_used == 0;
|
||||
}
|
||||
@@ -51,6 +51,9 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
|
||||
|| 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
|
||||
@@ -81,26 +84,32 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
|
||||
|
||||
out_pos += LZMA_STREAM_HEADER_SIZE;
|
||||
|
||||
// Block
|
||||
// Encode a Block but only if there is at least one byte of input.
|
||||
lzma_block block = {
|
||||
.version = 0,
|
||||
.check = check,
|
||||
.filters = filters,
|
||||
};
|
||||
|
||||
return_if_error(lzma_block_buffer_encode(&block, allocator,
|
||||
in, in_size, out, &out_pos, out_size));
|
||||
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 with one Record.
|
||||
// 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_index_append(i, allocator,
|
||||
lzma_block_unpadded_size(&block),
|
||||
block.uncompressed_size);
|
||||
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.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stream_encoder.h"
|
||||
#include "block_encoder.h"
|
||||
#include "index_encoder.h"
|
||||
|
||||
@@ -26,7 +25,7 @@ struct lzma_coder_s {
|
||||
} sequence;
|
||||
|
||||
/// True if Block encoder has been initialized by
|
||||
/// lzma_stream_encoder_init() or stream_encoder_update()
|
||||
/// stream_encoder_init() or stream_encoder_update()
|
||||
/// and thus doesn't need to be initialized in stream_encode().
|
||||
bool block_encoder_is_initialized;
|
||||
|
||||
@@ -126,7 +125,7 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
}
|
||||
|
||||
// Initialize the Block encoder unless it was already
|
||||
// initialized by lzma_stream_encoder_init() or
|
||||
// initialized by stream_encoder_init() or
|
||||
// stream_encoder_update().
|
||||
if (!coder->block_encoder_is_initialized)
|
||||
return_if_error(block_encoder_init(coder, allocator));
|
||||
@@ -262,11 +261,11 @@ stream_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
}
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
static lzma_ret
|
||||
stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, lzma_check check)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_stream_encoder_init, next, allocator);
|
||||
lzma_next_coder_init(&stream_encoder_init, next, allocator);
|
||||
|
||||
if (filters == NULL)
|
||||
return LZMA_PROG_ERROR;
|
||||
@@ -280,6 +279,7 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
next->end = &stream_encoder_end;
|
||||
next->update = &stream_encoder_update;
|
||||
|
||||
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
|
||||
next->coder->block_encoder = LZMA_NEXT_CODER_INIT;
|
||||
next->coder->index_encoder = LZMA_NEXT_CODER_INIT;
|
||||
next->coder->index = NULL;
|
||||
@@ -289,7 +289,6 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
next->coder->sequence = SEQ_STREAM_HEADER;
|
||||
next->coder->block_options.version = 0;
|
||||
next->coder->block_options.check = check;
|
||||
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
|
||||
|
||||
// Initialize the Index
|
||||
lzma_index_end(next->coder->index, allocator);
|
||||
@@ -320,7 +319,7 @@ extern LZMA_API(lzma_ret)
|
||||
lzma_stream_encoder(lzma_stream *strm,
|
||||
const lzma_filter *filters, lzma_check check)
|
||||
{
|
||||
lzma_next_strm_init(lzma_stream_encoder_init, strm, filters, 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;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file stream_encoder.h
|
||||
/// \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.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_STREAM_ENCODER_H
|
||||
#define LZMA_STREAM_ENCODER_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
extern lzma_ret lzma_stream_encoder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, lzma_check check);
|
||||
|
||||
#endif
|
||||
1013
src/liblzma/common/stream_encoder_mt.c
Normal file
1013
src/liblzma/common/stream_encoder_mt.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -85,7 +85,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
static lzma_ret
|
||||
delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
const lzma_filter *filters_null lzma_attribute((unused)),
|
||||
const lzma_filter *filters_null lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
// Delta doesn't and will never support changing the options in
|
||||
|
||||
105
src/liblzma/liblzma.map
Normal file
105
src/liblzma/liblzma.map
Normal file
@@ -0,0 +1,105 @@
|
||||
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;
|
||||
};
|
||||
|
||||
XZ_5.1.2alpha {
|
||||
global:
|
||||
lzma_stream_encoder_mt;
|
||||
lzma_stream_encoder_mt_memusage;
|
||||
|
||||
local:
|
||||
*;
|
||||
} XZ_5.0;
|
||||
@@ -16,4 +16,4 @@ URL: @PACKAGE_URL@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -llzma
|
||||
Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
Libs.private: @PTHREAD_CFLAGS@ @LIBS@
|
||||
|
||||
@@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder,
|
||||
|
||||
static lzma_ret
|
||||
lz_decode(lzma_coder *coder,
|
||||
lzma_allocator *allocator lzma_attribute((unused)),
|
||||
lzma_allocator *allocator lzma_attribute((__unused__)),
|
||||
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,
|
||||
|
||||
@@ -480,7 +480,7 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
static lzma_ret
|
||||
lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
const lzma_filter *filters_null lzma_attribute((unused)),
|
||||
const lzma_filter *filters_null lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
if (coder->lz.options_update == NULL)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
// 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 = *(const uint16_t *)(cur);
|
||||
const uint32_t hash_value = *(const uint16_t *)(cur)
|
||||
#else
|
||||
# define hash_2_calc() \
|
||||
const uint32_t hash_value \
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
#ifndef LZMA_FASTPOS_H
|
||||
#define LZMA_FASTPOS_H
|
||||
|
||||
// LZMA encodes match distances (positions) 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 new .lzma
|
||||
// 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:
|
||||
//
|
||||
// pos return
|
||||
// dist return
|
||||
// 0 0
|
||||
// 1 1
|
||||
// 2 2
|
||||
@@ -48,10 +48,10 @@
|
||||
// Provided functions or macros
|
||||
// ----------------------------
|
||||
//
|
||||
// get_pos_slot(pos) is the basic version. get_pos_slot_2(pos)
|
||||
// assumes that pos >= FULL_DISTANCES, thus the result is at least
|
||||
// FULL_DISTANCES_BITS * 2. Using get_pos_slot(pos) instead of
|
||||
// get_pos_slot_2(pos) would give the same result, but get_pos_slot_2(pos)
|
||||
// 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.
|
||||
//
|
||||
//
|
||||
@@ -76,13 +76,14 @@
|
||||
// slightly faster, but sometimes it is a lot slower.
|
||||
|
||||
#ifdef HAVE_SMALL
|
||||
# define get_pos_slot(pos) ((pos) <= 4 ? (pos) : get_pos_slot_2(pos))
|
||||
# define get_dist_slot(dist) \
|
||||
((dist) <= 4 ? (dist) : get_dist_slot_2(dist))
|
||||
|
||||
static inline uint32_t
|
||||
get_pos_slot_2(uint32_t pos)
|
||||
get_dist_slot_2(uint32_t dist)
|
||||
{
|
||||
const uint32_t i = bsr32(pos);
|
||||
return (i + i) + ((pos >> (i - 1)) & 1);
|
||||
const uint32_t i = bsr32(dist);
|
||||
return (i + i) + ((dist >> (i - 1)) & 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,39 +100,39 @@ extern const uint8_t lzma_fastpos[1 << FASTPOS_BITS];
|
||||
#define fastpos_limit(extra, n) \
|
||||
(UINT32_C(1) << (FASTPOS_BITS + fastpos_shift(extra, n)))
|
||||
|
||||
#define fastpos_result(pos, extra, n) \
|
||||
lzma_fastpos[(pos) >> fastpos_shift(extra, n)] \
|
||||
#define fastpos_result(dist, extra, n) \
|
||||
lzma_fastpos[(dist) >> fastpos_shift(extra, n)] \
|
||||
+ 2 * fastpos_shift(extra, n)
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
get_pos_slot(uint32_t pos)
|
||||
get_dist_slot(uint32_t dist)
|
||||
{
|
||||
// If it is small enough, we can pick the result directly from
|
||||
// the precalculated table.
|
||||
if (pos < fastpos_limit(0, 0))
|
||||
return lzma_fastpos[pos];
|
||||
if (dist < fastpos_limit(0, 0))
|
||||
return lzma_fastpos[dist];
|
||||
|
||||
if (pos < fastpos_limit(0, 1))
|
||||
return fastpos_result(pos, 0, 1);
|
||||
if (dist < fastpos_limit(0, 1))
|
||||
return fastpos_result(dist, 0, 1);
|
||||
|
||||
return fastpos_result(pos, 0, 2);
|
||||
return fastpos_result(dist, 0, 2);
|
||||
}
|
||||
|
||||
|
||||
#ifdef FULL_DISTANCES_BITS
|
||||
static inline uint32_t
|
||||
get_pos_slot_2(uint32_t pos)
|
||||
get_dist_slot_2(uint32_t dist)
|
||||
{
|
||||
assert(pos >= FULL_DISTANCES);
|
||||
assert(dist >= FULL_DISTANCES);
|
||||
|
||||
if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 0))
|
||||
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 0);
|
||||
if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 0))
|
||||
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 0);
|
||||
|
||||
if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 1))
|
||||
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 1);
|
||||
if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 1))
|
||||
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 1);
|
||||
|
||||
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 2);
|
||||
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -67,6 +67,10 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
|
||||
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.
|
||||
@@ -104,10 +108,6 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
|
||||
&coder->options);
|
||||
}
|
||||
} else {
|
||||
// End marker
|
||||
if (control == 0x00)
|
||||
return LZMA_STREAM_END;
|
||||
|
||||
// Invalid control values
|
||||
if (control > 2)
|
||||
return LZMA_DATA_ERROR;
|
||||
|
||||
@@ -374,7 +374,7 @@ lzma_lzma2_props_encode(const void *options, uint8_t *out)
|
||||
const lzma_options_lzma *const opt = options;
|
||||
uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN);
|
||||
|
||||
// Round up to to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending
|
||||
// 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;
|
||||
@@ -387,7 +387,17 @@ lzma_lzma2_props_encode(const void *options, uint8_t *out)
|
||||
if (d == UINT32_MAX)
|
||||
out[0] = 40;
|
||||
else
|
||||
out[0] = get_pos_slot(d + 1) - 24;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -38,4 +38,6 @@ 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
|
||||
|
||||
@@ -171,53 +171,54 @@ literal_init(probability (*probs)[LITERAL_CODER_SIZE],
|
||||
// Match distance //
|
||||
////////////////////
|
||||
|
||||
// Different set of probabilities is used for match distances that have very
|
||||
// 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 LEN_TO_POS_STATES 4
|
||||
#define DIST_STATES 4
|
||||
|
||||
// Macro to get the index of the appropriate probability array.
|
||||
#define get_len_to_pos_state(len) \
|
||||
((len) < LEN_TO_POS_STATES + MATCH_LEN_MIN \
|
||||
#define get_dist_state(len) \
|
||||
((len) < DIST_STATES + MATCH_LEN_MIN \
|
||||
? (len) - MATCH_LEN_MIN \
|
||||
: LEN_TO_POS_STATES - 1)
|
||||
: DIST_STATES - 1)
|
||||
|
||||
// The highest two bits of a match distance (pos slot) are encoded using six
|
||||
// bits. See fastpos.h for more explanation.
|
||||
#define POS_SLOT_BITS 6
|
||||
#define POS_SLOTS (1 << POS_SLOT_BITS)
|
||||
// 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 (pos slot) are always encoded using six bits, the
|
||||
// distances 0-3 don't need any additional bits to encode, since the pos
|
||||
// slot itself is the same as the actual distance. START_POS_MODEL_INDEX
|
||||
// indicates the first pos slot where at least one additional bit is needed.
|
||||
#define START_POS_MODEL_INDEX 4
|
||||
// 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:
|
||||
// - pos slot: the highest two bits
|
||||
// - 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 pos slot value of 14 is for distances 128-191 (see the table in
|
||||
// The distance slot value of 14 is for distances 128-191 (see the table in
|
||||
// fastpos.h to understand why).
|
||||
#define END_POS_MODEL_INDEX 14
|
||||
#define DIST_MODEL_END 14
|
||||
|
||||
// Pos slots that indicate a distance <= 127.
|
||||
#define FULL_DISTANCES_BITS (END_POS_MODEL_INDEX / 2)
|
||||
// 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_TABLE_SIZE (1 << ALIGN_BITS)
|
||||
#define ALIGN_MASK (ALIGN_TABLE_SIZE - 1)
|
||||
#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 REP_DISTANCES 4
|
||||
#define REPS 4
|
||||
|
||||
#endif
|
||||
|
||||
@@ -193,15 +193,15 @@ struct lzma_coder_s {
|
||||
/// 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 pos_slot[LEN_TO_POS_STATES][POS_SLOTS];
|
||||
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 - END_POS_MODEL_INDEX];
|
||||
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_TABLE_SIZE];
|
||||
probability pos_align[ALIGN_SIZE];
|
||||
|
||||
/// Length of a normal match
|
||||
lzma_length_decoder match_len_decoder;
|
||||
@@ -245,8 +245,8 @@ struct lzma_coder_s {
|
||||
SEQ_LITERAL_WRITE,
|
||||
SEQ_IS_REP,
|
||||
seq_len(SEQ_MATCH_LEN),
|
||||
seq_6(SEQ_POS_SLOT),
|
||||
SEQ_POS_MODEL,
|
||||
seq_6(SEQ_DIST_SLOT),
|
||||
SEQ_DIST_MODEL,
|
||||
SEQ_DIRECT,
|
||||
seq_4(SEQ_ALIGN),
|
||||
SEQ_EOPM,
|
||||
@@ -289,8 +289,12 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
// Initialization //
|
||||
////////////////////
|
||||
|
||||
if (!rc_read_init(&coder->rc, in, in_pos, in_size))
|
||||
return LZMA_OK;
|
||||
{
|
||||
const lzma_ret ret = rc_read_init(
|
||||
&coder->rc, in, in_pos, in_size);
|
||||
if (ret != LZMA_STREAM_END)
|
||||
return ret;
|
||||
}
|
||||
|
||||
///////////////
|
||||
// Variables //
|
||||
@@ -502,28 +506,28 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
|
||||
// Prepare to decode the highest two bits of the
|
||||
// match distance.
|
||||
probs = coder->pos_slot[get_len_to_pos_state(len)];
|
||||
probs = coder->dist_slot[get_dist_state(len)];
|
||||
symbol = 1;
|
||||
|
||||
#ifdef HAVE_SMALL
|
||||
case SEQ_POS_SLOT:
|
||||
case SEQ_DIST_SLOT:
|
||||
do {
|
||||
rc_bit(probs[symbol], , , SEQ_POS_SLOT);
|
||||
} while (symbol < POS_SLOTS);
|
||||
rc_bit(probs[symbol], , , SEQ_DIST_SLOT);
|
||||
} while (symbol < DIST_SLOTS);
|
||||
#else
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT0);
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT1);
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT2);
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT3);
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT4);
|
||||
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT5);
|
||||
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 -= POS_SLOTS;
|
||||
symbol -= DIST_SLOTS;
|
||||
assert(symbol <= 63);
|
||||
|
||||
if (symbol < START_POS_MODEL_INDEX) {
|
||||
if (symbol < DIST_MODEL_START) {
|
||||
// Match distances [0, 3] have only two bits.
|
||||
rep0 = symbol;
|
||||
} else {
|
||||
@@ -533,7 +537,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
assert(limit >= 1 && limit <= 30);
|
||||
rep0 = 2 + (symbol & 1);
|
||||
|
||||
if (symbol < END_POS_MODEL_INDEX) {
|
||||
if (symbol < DIST_MODEL_END) {
|
||||
// Prepare to decode the low bits for
|
||||
// a distance of [4, 127].
|
||||
assert(limit <= 5);
|
||||
@@ -553,12 +557,12 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
- symbol - 1;
|
||||
symbol = 1;
|
||||
offset = 0;
|
||||
case SEQ_POS_MODEL:
|
||||
case SEQ_DIST_MODEL:
|
||||
#ifdef HAVE_SMALL
|
||||
do {
|
||||
rc_bit(probs[symbol], ,
|
||||
rep0 += 1 << offset,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
} while (++offset < limit);
|
||||
#else
|
||||
switch (limit) {
|
||||
@@ -566,25 +570,25 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
assert(offset == 0);
|
||||
rc_bit(probs[symbol], ,
|
||||
rep0 += 1,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
++offset;
|
||||
--limit;
|
||||
case 4:
|
||||
rc_bit(probs[symbol], ,
|
||||
rep0 += 1 << offset,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
++offset;
|
||||
--limit;
|
||||
case 3:
|
||||
rc_bit(probs[symbol], ,
|
||||
rep0 += 1 << offset,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
++offset;
|
||||
--limit;
|
||||
case 2:
|
||||
rc_bit(probs[symbol], ,
|
||||
rep0 += 1 << offset,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
++offset;
|
||||
--limit;
|
||||
case 1:
|
||||
@@ -596,7 +600,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
// "symbol".
|
||||
rc_bit_last(probs[symbol], ,
|
||||
rep0 += 1 << offset,
|
||||
SEQ_POS_MODEL);
|
||||
SEQ_DIST_MODEL);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
@@ -637,7 +641,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
|
||||
rc_bit(coder->pos_align[symbol], ,
|
||||
rep0 += 4, SEQ_ALIGN2);
|
||||
case SEQ_ALIGN3:
|
||||
// Like in SEQ_POS_MODEL, we don't
|
||||
// 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], ,
|
||||
@@ -891,10 +895,10 @@ lzma_decoder_reset(lzma_coder *coder, const void *opt)
|
||||
bit_reset(coder->is_rep2[i]);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < LEN_TO_POS_STATES; ++i)
|
||||
bittree_reset(coder->pos_slot[i], POS_SLOT_BITS);
|
||||
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 - END_POS_MODEL_INDEX; ++i)
|
||||
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);
|
||||
|
||||
@@ -148,28 +148,28 @@ match(lzma_coder *coder, const uint32_t pos_state,
|
||||
length(&coder->rc, &coder->match_len_encoder, pos_state, len,
|
||||
coder->fast_mode);
|
||||
|
||||
const uint32_t pos_slot = get_pos_slot(distance);
|
||||
const uint32_t len_to_pos_state = get_len_to_pos_state(len);
|
||||
rc_bittree(&coder->rc, coder->pos_slot[len_to_pos_state],
|
||||
POS_SLOT_BITS, pos_slot);
|
||||
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 (pos_slot >= START_POS_MODEL_INDEX) {
|
||||
const uint32_t footer_bits = (pos_slot >> 1) - 1;
|
||||
const uint32_t base = (2 | (pos_slot & 1)) << footer_bits;
|
||||
const uint32_t pos_reduced = distance - base;
|
||||
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 (pos_slot < END_POS_MODEL_INDEX) {
|
||||
// Careful here: base - pos_slot - 1 can be -1, but
|
||||
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->pos_special + base - pos_slot - 1,
|
||||
footer_bits, pos_reduced);
|
||||
coder->dist_special + base - dist_slot - 1,
|
||||
footer_bits, dist_reduced);
|
||||
} else {
|
||||
rc_direct(&coder->rc, pos_reduced >> ALIGN_BITS,
|
||||
rc_direct(&coder->rc, dist_reduced >> ALIGN_BITS,
|
||||
footer_bits - ALIGN_BITS);
|
||||
rc_bittree_reverse(
|
||||
&coder->rc, coder->pos_align,
|
||||
ALIGN_BITS, pos_reduced & ALIGN_MASK);
|
||||
&coder->rc, coder->dist_align,
|
||||
ALIGN_BITS, dist_reduced & ALIGN_MASK);
|
||||
++coder->align_price_count;
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ encode_symbol(lzma_coder *coder, lzma_mf *mf,
|
||||
rc_bit(&coder->rc,
|
||||
&coder->is_match[coder->state][pos_state], 1);
|
||||
|
||||
if (back < REP_DISTANCES) {
|
||||
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);
|
||||
@@ -255,7 +255,7 @@ encode_symbol(lzma_coder *coder, lzma_mf *mf,
|
||||
} else {
|
||||
// Normal match
|
||||
rc_bit(&coder->rc, &coder->is_rep[coder->state], 0);
|
||||
match(coder, pos_state, back - REP_DISTANCES, len);
|
||||
match(coder, pos_state, back - REPS, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,9 +353,9 @@ lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
// Get optimal match (repeat position and length).
|
||||
// Value ranges for pos:
|
||||
// - [0, REP_DISTANCES): repeated match
|
||||
// - [REP_DISTANCES, UINT32_MAX):
|
||||
// match at (pos - REP_DISTANCES)
|
||||
// - [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]
|
||||
@@ -487,7 +487,7 @@ lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
|
||||
|
||||
// State
|
||||
coder->state = STATE_LIT_LIT;
|
||||
for (size_t i = 0; i < REP_DISTANCES; ++i)
|
||||
for (size_t i = 0; i < REPS; ++i)
|
||||
coder->reps[i] = 0;
|
||||
|
||||
literal_init(coder->literal, options->lc, options->lp);
|
||||
@@ -505,14 +505,14 @@ lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
|
||||
bit_reset(coder->is_rep2[i]);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < FULL_DISTANCES - END_POS_MODEL_INDEX; ++i)
|
||||
bit_reset(coder->pos_special[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 < LEN_TO_POS_STATES; ++i)
|
||||
bittree_reset(coder->pos_slot[i], POS_SLOT_BITS);
|
||||
for (size_t i = 0; i < DIST_STATES; ++i)
|
||||
bittree_reset(coder->dist_slot[i], DIST_SLOT_BITS);
|
||||
|
||||
bittree_reset(coder->pos_align, ALIGN_BITS);
|
||||
bittree_reset(coder->dist_align, ALIGN_BITS);
|
||||
|
||||
// Length encoders
|
||||
length_encoder_reset(&coder->match_len_encoder,
|
||||
|
||||
@@ -46,7 +46,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
uint32_t rep_len = 0;
|
||||
uint32_t rep_index = 0;
|
||||
|
||||
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
|
||||
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;
|
||||
|
||||
@@ -79,8 +79,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
// 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
|
||||
+ REP_DISTANCES;
|
||||
*back_res = coder->matches[matches_count - 1].dist + REPS;
|
||||
*len_res = len_main;
|
||||
mf_skip(mf, len_main - 1);
|
||||
return;
|
||||
@@ -155,7 +154,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
const uint32_t limit = len_main - 1;
|
||||
|
||||
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
|
||||
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))
|
||||
@@ -172,7 +171,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
}
|
||||
}
|
||||
|
||||
*back_res = back_main + REP_DISTANCES;
|
||||
*back_res = back_main + REPS;
|
||||
*len_res = len_main;
|
||||
mf_skip(mf, len_main - 2);
|
||||
return;
|
||||
|
||||
@@ -108,18 +108,18 @@ get_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
get_pos_len_price(const lzma_coder *const coder, const uint32_t pos,
|
||||
get_dist_len_price(const lzma_coder *const coder, const uint32_t dist,
|
||||
const uint32_t len, const uint32_t pos_state)
|
||||
{
|
||||
const uint32_t len_to_pos_state = get_len_to_pos_state(len);
|
||||
const uint32_t dist_state = get_dist_state(len);
|
||||
uint32_t price;
|
||||
|
||||
if (pos < FULL_DISTANCES) {
|
||||
price = coder->distances_prices[len_to_pos_state][pos];
|
||||
if (dist < FULL_DISTANCES) {
|
||||
price = coder->dist_prices[dist_state][dist];
|
||||
} else {
|
||||
const uint32_t pos_slot = get_pos_slot_2(pos);
|
||||
price = coder->pos_slot_prices[len_to_pos_state][pos_slot]
|
||||
+ coder->align_prices[pos & ALIGN_MASK];
|
||||
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);
|
||||
@@ -129,55 +129,53 @@ get_pos_len_price(const lzma_coder *const coder, const uint32_t pos,
|
||||
|
||||
|
||||
static void
|
||||
fill_distances_prices(lzma_coder *coder)
|
||||
fill_dist_prices(lzma_coder *coder)
|
||||
{
|
||||
for (uint32_t len_to_pos_state = 0;
|
||||
len_to_pos_state < LEN_TO_POS_STATES;
|
||||
++len_to_pos_state) {
|
||||
for (uint32_t dist_state = 0; dist_state < DIST_STATES; ++dist_state) {
|
||||
|
||||
uint32_t *const pos_slot_prices
|
||||
= coder->pos_slot_prices[len_to_pos_state];
|
||||
uint32_t *const dist_slot_prices
|
||||
= coder->dist_slot_prices[dist_state];
|
||||
|
||||
// Price to encode the pos_slot.
|
||||
for (uint32_t pos_slot = 0;
|
||||
pos_slot < coder->dist_table_size; ++pos_slot)
|
||||
pos_slot_prices[pos_slot] = rc_bittree_price(
|
||||
coder->pos_slot[len_to_pos_state],
|
||||
POS_SLOT_BITS, pos_slot);
|
||||
// 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 pos_slot = END_POS_MODEL_INDEX;
|
||||
pos_slot < coder->dist_table_size; ++pos_slot)
|
||||
pos_slot_prices[pos_slot] += rc_direct_price(
|
||||
((pos_slot >> 1) - 1) - ALIGN_BITS);
|
||||
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
|
||||
// pos_slot, so they are used for coder->distances_prices
|
||||
// dist_slot, so they are used for coder->dist_prices
|
||||
// as is.
|
||||
for (uint32_t i = 0; i < START_POS_MODEL_INDEX; ++i)
|
||||
coder->distances_prices[len_to_pos_state][i]
|
||||
= pos_slot_prices[i];
|
||||
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 pos_slot and pos_special.
|
||||
// We do this in a loop separate from the above loop to avoid
|
||||
// redundant calls to get_pos_slot().
|
||||
for (uint32_t i = START_POS_MODEL_INDEX; i < FULL_DISTANCES; ++i) {
|
||||
const uint32_t pos_slot = get_pos_slot(i);
|
||||
const uint32_t footer_bits = ((pos_slot >> 1) - 1);
|
||||
const uint32_t base = (2 | (pos_slot & 1)) << footer_bits;
|
||||
// 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->pos_special + base - pos_slot - 1,
|
||||
coder->dist_special + base - dist_slot - 1,
|
||||
footer_bits, i - base);
|
||||
|
||||
for (uint32_t len_to_pos_state = 0;
|
||||
len_to_pos_state < LEN_TO_POS_STATES;
|
||||
++len_to_pos_state)
|
||||
coder->distances_prices[len_to_pos_state][i]
|
||||
= price + coder->pos_slot_prices[
|
||||
len_to_pos_state][pos_slot];
|
||||
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;
|
||||
@@ -188,9 +186,9 @@ fill_distances_prices(lzma_coder *coder)
|
||||
static void
|
||||
fill_align_prices(lzma_coder *coder)
|
||||
{
|
||||
for (uint32_t i = 0; i < ALIGN_TABLE_SIZE; ++i)
|
||||
for (uint32_t i = 0; i < ALIGN_SIZE; ++i)
|
||||
coder->align_prices[i] = rc_bittree_reverse_price(
|
||||
coder->pos_align, ALIGN_BITS, i);
|
||||
coder->dist_align, ALIGN_BITS, i);
|
||||
|
||||
coder->align_price_count = 0;
|
||||
return;
|
||||
@@ -296,10 +294,10 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
const uint8_t *const buf = mf_ptr(mf) - 1;
|
||||
|
||||
uint32_t rep_lens[REP_DISTANCES];
|
||||
uint32_t rep_lens[REPS];
|
||||
uint32_t rep_max_index = 0;
|
||||
|
||||
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
|
||||
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)) {
|
||||
@@ -326,8 +324,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
|
||||
if (len_main >= nice_len) {
|
||||
*back_res = coder->matches[matches_count - 1].dist
|
||||
+ REP_DISTANCES;
|
||||
*back_res = coder->matches[matches_count - 1].dist + REPS;
|
||||
*len_res = len_main;
|
||||
mf_skip(mf, len_main - 1);
|
||||
return UINT32_MAX;
|
||||
@@ -381,7 +378,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
coder->opts[1].pos_prev = 0;
|
||||
|
||||
for (uint32_t i = 0; i < REP_DISTANCES; ++i)
|
||||
for (uint32_t i = 0; i < REPS; ++i)
|
||||
coder->opts[0].backs[i] = coder->reps[i];
|
||||
|
||||
uint32_t len = len_end;
|
||||
@@ -390,7 +387,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
} while (--len >= 2);
|
||||
|
||||
|
||||
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
|
||||
for (uint32_t i = 0; i < REPS; ++i) {
|
||||
uint32_t rep_len = rep_lens[i];
|
||||
if (rep_len < 2)
|
||||
continue;
|
||||
@@ -426,14 +423,13 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
for(; ; ++len) {
|
||||
const uint32_t dist = coder->matches[i].dist;
|
||||
const uint32_t cur_and_len_price = normal_match_price
|
||||
+ get_pos_len_price(coder,
|
||||
+ 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 + REP_DISTANCES;
|
||||
coder->opts[len].back_prev = dist + REPS;
|
||||
coder->opts[len].prev_1_is_literal = false;
|
||||
}
|
||||
|
||||
@@ -463,7 +459,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
|
||||
if (coder->opts[cur].prev_2) {
|
||||
state = coder->opts[coder->opts[cur].pos_prev_2].state;
|
||||
|
||||
if (coder->opts[cur].back_prev_2 < REP_DISTANCES)
|
||||
if (coder->opts[cur].back_prev_2 < REPS)
|
||||
update_long_rep(state);
|
||||
else
|
||||
update_match(state);
|
||||
@@ -492,33 +488,33 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
|
||||
update_long_rep(state);
|
||||
} else {
|
||||
pos = coder->opts[cur].back_prev;
|
||||
if (pos < REP_DISTANCES)
|
||||
if (pos < REPS)
|
||||
update_long_rep(state);
|
||||
else
|
||||
update_match(state);
|
||||
}
|
||||
|
||||
if (pos < REP_DISTANCES) {
|
||||
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 < REP_DISTANCES; ++i)
|
||||
for (; i < REPS; ++i)
|
||||
reps[i] = coder->opts[pos_prev].backs[i];
|
||||
|
||||
} else {
|
||||
reps[0] = pos - REP_DISTANCES;
|
||||
reps[0] = pos - REPS;
|
||||
|
||||
for (uint32_t i = 1; i < REP_DISTANCES; ++i)
|
||||
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 < REP_DISTANCES; ++i)
|
||||
for (uint32_t i = 0; i < REPS; ++i)
|
||||
coder->opts[cur].backs[i] = reps[i];
|
||||
|
||||
const uint32_t cur_price = coder->opts[cur].price;
|
||||
@@ -611,7 +607,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
|
||||
|
||||
uint32_t start_len = 2; // speed optimization
|
||||
|
||||
for (uint32_t rep_index = 0; rep_index < REP_DISTANCES; ++rep_index) {
|
||||
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;
|
||||
@@ -728,14 +724,14 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
|
||||
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_pos_len_price(coder,
|
||||
+ 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 + REP_DISTANCES;
|
||||
= cur_back + REPS;
|
||||
coder->opts[cur + len_test].prev_1_is_literal = false;
|
||||
}
|
||||
|
||||
@@ -795,7 +791,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
|
||||
coder->opts[offset].prev_2 = true;
|
||||
coder->opts[offset].pos_prev_2 = cur;
|
||||
coder->opts[offset].back_prev_2
|
||||
= cur_back + REP_DISTANCES;
|
||||
= cur_back + REPS;
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -831,9 +827,9 @@ lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
// In liblzma they were moved into this single place.
|
||||
if (mf->read_ahead == 0) {
|
||||
if (coder->match_price_count >= (1 << 7))
|
||||
fill_distances_prices(coder);
|
||||
fill_dist_prices(coder);
|
||||
|
||||
if (coder->align_price_count >= ALIGN_TABLE_SIZE)
|
||||
if (coder->align_price_count >= ALIGN_SIZE)
|
||||
fill_align_prices(coder);
|
||||
}
|
||||
|
||||
@@ -845,7 +841,7 @@ lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
if (len_end == UINT32_MAX)
|
||||
return;
|
||||
|
||||
uint32_t reps[REP_DISTANCES];
|
||||
uint32_t reps[REPS];
|
||||
memcpy(reps, coder->reps, sizeof(reps));
|
||||
|
||||
uint32_t cur;
|
||||
|
||||
@@ -64,7 +64,7 @@ typedef struct {
|
||||
uint32_t pos_prev; // pos_next;
|
||||
uint32_t back_prev;
|
||||
|
||||
uint32_t backs[REP_DISTANCES];
|
||||
uint32_t backs[REPS];
|
||||
|
||||
} lzma_optimal;
|
||||
|
||||
@@ -77,7 +77,7 @@ struct lzma_coder_s {
|
||||
lzma_lzma_state state;
|
||||
|
||||
/// The four most recent match distances
|
||||
uint32_t reps[REP_DISTANCES];
|
||||
uint32_t reps[REPS];
|
||||
|
||||
/// Array of match candidates
|
||||
lzma_match matches[MATCH_LEN_MAX + 1];
|
||||
@@ -112,9 +112,9 @@ struct lzma_coder_s {
|
||||
probability is_rep1[STATES];
|
||||
probability is_rep2[STATES];
|
||||
probability is_rep0_long[STATES][POS_STATES_MAX];
|
||||
probability pos_slot[LEN_TO_POS_STATES][POS_SLOTS];
|
||||
probability pos_special[FULL_DISTANCES - END_POS_MODEL_INDEX];
|
||||
probability pos_align[ALIGN_TABLE_SIZE];
|
||||
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.
|
||||
@@ -122,12 +122,12 @@ struct lzma_coder_s {
|
||||
lzma_length_encoder rep_len_encoder;
|
||||
|
||||
// Price tables
|
||||
uint32_t pos_slot_prices[LEN_TO_POS_STATES][POS_SLOTS];
|
||||
uint32_t distances_prices[LEN_TO_POS_STATES][FULL_DISTANCES];
|
||||
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_TABLE_SIZE];
|
||||
uint32_t align_prices[ALIGN_SIZE];
|
||||
uint32_t align_price_count;
|
||||
|
||||
// Optimal
|
||||
|
||||
@@ -25,20 +25,26 @@ typedef struct {
|
||||
|
||||
|
||||
/// Reads the first five bytes to initialize the range decoder.
|
||||
static inline bool
|
||||
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 false;
|
||||
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 true;
|
||||
return LZMA_STREAM_END;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static size_t
|
||||
arm_code(lzma_simple *simple lzma_attribute((unused)),
|
||||
arm_code(lzma_simple *simple lzma_attribute((__unused__)),
|
||||
uint32_t now_pos, bool is_encoder,
|
||||
uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static size_t
|
||||
armthumb_code(lzma_simple *simple lzma_attribute((unused)),
|
||||
armthumb_code(lzma_simple *simple lzma_attribute((__unused__)),
|
||||
uint32_t now_pos, bool is_encoder,
|
||||
uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static size_t
|
||||
ia64_code(lzma_simple *simple lzma_attribute((unused)),
|
||||
ia64_code(lzma_simple *simple lzma_attribute((__unused__)),
|
||||
uint32_t now_pos, bool is_encoder,
|
||||
uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static size_t
|
||||
powerpc_code(lzma_simple *simple lzma_attribute((unused)),
|
||||
powerpc_code(lzma_simple *simple lzma_attribute((__unused__)),
|
||||
uint32_t now_pos, bool is_encoder,
|
||||
uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
||||
@@ -35,9 +35,6 @@ copy_or_code(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
} else {
|
||||
// Call the next coder in the chain to provide us some data.
|
||||
// We don't care about uncompressed_size here, because
|
||||
// the next filter in the chain will do it for us (since
|
||||
// we don't change the size of the data).
|
||||
const lzma_ret ret = coder->next.code(
|
||||
coder->next.coder, allocator,
|
||||
in, in_pos, in_size,
|
||||
@@ -110,7 +107,7 @@ simple_code(lzma_coder *coder, lzma_allocator *allocator,
|
||||
// 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) {
|
||||
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;
|
||||
@@ -212,7 +209,7 @@ simple_coder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
static lzma_ret
|
||||
simple_coder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
const lzma_filter *filters_null lzma_attribute((unused)),
|
||||
const lzma_filter *filters_null lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
// No update support, just call the next filter in the chain.
|
||||
|
||||
@@ -22,8 +22,7 @@ struct lzma_coder_s {
|
||||
/// Next filter in the chain
|
||||
lzma_next_coder next;
|
||||
|
||||
/// True if the next coder in the chain has returned LZMA_STREAM_END
|
||||
/// or if we have processed uncompressed_size bytes.
|
||||
/// 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.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static size_t
|
||||
sparc_code(lzma_simple *simple lzma_attribute((unused)),
|
||||
sparc_code(lzma_simple *simple lzma_attribute((__unused__)),
|
||||
uint32_t now_pos, bool is_encoder,
|
||||
uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
||||
68
src/liblzma/validate_map.sh
Normal file
68
src/liblzma/validate_map.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check liblzma.map for certain types of errors
|
||||
#
|
||||
# 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.map.
|
||||
SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \
|
||||
api/lzma/*.h \
|
||||
| sort \
|
||||
| grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma.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.map | grep -Fv "$VER")
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check for duplicate lines. It can catch missing dependencies.
|
||||
DUPS=$(sort liblzma.map | sed '/^$/d;/^global:$/d' | uniq -d)
|
||||
|
||||
# Print error messages if needed.
|
||||
if test -n "$SYMS$NAMES$DUPS"; then
|
||||
echo
|
||||
echo 'validate_map.sh found problems from liblzma.map:'
|
||||
echo
|
||||
|
||||
if test -n "$SYMS"; then
|
||||
echo 'liblzma.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
|
||||
|
||||
STATUS=1
|
||||
fi
|
||||
|
||||
# Exit status is 1 if problems were found, 0 otherwise.
|
||||
exit "$STATUS"
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
help(void)
|
||||
{
|
||||
printf(
|
||||
@@ -45,7 +45,7 @@ _("Usage: %s [--help] [--version] [FILE]...\n"
|
||||
}
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
version(void)
|
||||
{
|
||||
puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
.\"
|
||||
.\" License: GNU GPLv2+
|
||||
.\"
|
||||
.TH XZDIFF 1 "2010-09-27" "Tukaani" "XZ Utils"
|
||||
.TH XZDIFF 1 "2011-03-19" "Tukaani" "XZ Utils"
|
||||
.SH NAME
|
||||
xzcmp, xzdiff, lzcmp, lzdiff \- compare compressed files
|
||||
.SH SYNOPSIS
|
||||
@@ -33,8 +33,9 @@ on files compressed with
|
||||
.BR xz (1),
|
||||
.BR lzma (1),
|
||||
.BR gzip (1),
|
||||
.BR bzip2 (1),
|
||||
or
|
||||
.BR bzip2 (1).
|
||||
.BR lzop (1).
|
||||
All options specified are passed directly to
|
||||
.BR cmp (1)
|
||||
or
|
||||
@@ -66,6 +67,7 @@ are provided for backward compatibility with LZMA Utils.
|
||||
.BR xz (1),
|
||||
.BR gzip (1),
|
||||
.BR bzip2 (1),
|
||||
.BR lzop (1),
|
||||
.BR zdiff (1)
|
||||
.SH BUGS
|
||||
Messages from the
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
||||
# autodetection. This way memory usage limit and thread limit can be
|
||||
# specified via XZ_OPT. With gzip and bzip2 it's OK to just unset the
|
||||
# specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset the
|
||||
# environment variables.
|
||||
xz='@xz@ --format=auto'
|
||||
unset GZIP BZIP BZIP2
|
||||
unset GZIP BZIP BZIP2 LZOP
|
||||
|
||||
case ${0##*/} in
|
||||
*cmp*) prog=xzcmp; cmp=${CMP:-cmp};;
|
||||
@@ -77,17 +77,21 @@ if test $# -eq 1; then
|
||||
xz1=bzip2;;
|
||||
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z)
|
||||
xz1=gzip;;
|
||||
*[-.]lzo | *.tzo)
|
||||
xz1=lzop;;
|
||||
*)
|
||||
echo >&2 "$0: $1: Unknown compressed file name suffix"
|
||||
exit 2;;
|
||||
esac
|
||||
case $1 in
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma)
|
||||
FILE=`expr "X$1" : 'X\(.*\)[-.][abglmxzZ2]*$'`;;
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lzo)
|
||||
FILE=`expr "X$1" : 'X\(.*\)[-.][abglmoxzZ2]*$'`;;
|
||||
*.t[abglx]z)
|
||||
FILE=`expr "X$1" : 'X\(.*[-.]t\)[abglx]z$'`ar;;
|
||||
*.tbz2)
|
||||
FILE=`expr "X$1" : 'X\(.*[-.]t\)bz2$'`ar;;
|
||||
*.tzo)
|
||||
FILE=`expr "X$1" : 'X\(.*[-.]t\)zo$'`ar;;
|
||||
esac
|
||||
xz_status=$(
|
||||
exec 4>&1
|
||||
@@ -97,15 +101,17 @@ elif test $# -eq 2; then
|
||||
case $1 in
|
||||
*[-.]bz2 | *.tbz | *.tbz2) xz1=bzip2;;
|
||||
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=gzip;;
|
||||
*[-.]lzo | *.tzo) xz1=lzop;;
|
||||
esac
|
||||
case $2 in
|
||||
*[-.]bz2 | *.tbz | *.tbz2) xz2=bzip2;;
|
||||
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz2=gzip;;
|
||||
*[-.]lzo | *.tzo) xz2=lzop;;
|
||||
esac
|
||||
case $1 in
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
|
||||
case "$2" in
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
|
||||
if test "$1$2" = --; then
|
||||
xz_status=$(
|
||||
exec 4>&1
|
||||
@@ -120,12 +126,14 @@ elif test $# -eq 2; then
|
||||
( ($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
|
||||
eval "$cmp" /dev/fd/5 - >&3) 5<&0
|
||||
)
|
||||
cmp_status=$?
|
||||
case $xz_status in
|
||||
*[1-9]*) xz_status=1;;
|
||||
*) xz_status=0;;
|
||||
esac
|
||||
(exit $cmp_status)
|
||||
else
|
||||
F=`expr "/$2" : '.*/\(.*\)[-.][ablmtxz2]*$'` || F=$prog
|
||||
F=`expr "/$2" : '.*/\(.*\)[-.][ablmotxz2]*$'` || F=$prog
|
||||
tmp=
|
||||
trap '
|
||||
test -n "$tmp" && rm -f "$tmp"
|
||||
@@ -152,7 +160,7 @@ elif test $# -eq 2; then
|
||||
esac;;
|
||||
*)
|
||||
case "$2" in
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
|
||||
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
|
||||
xz_status=$(
|
||||
exec 4>&1
|
||||
($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
.\"
|
||||
.\" License: GNU GPLv2+
|
||||
.\"
|
||||
.TH XZGREP 1 "2010-09-27" "Tukaani" "XZ Utils"
|
||||
.TH XZGREP 1 "2011-03-19" "Tukaani" "XZ Utils"
|
||||
.SH NAME
|
||||
xzgrep \- search compressed files for a regular expression
|
||||
.SH SYNOPSIS
|
||||
@@ -40,8 +40,9 @@ which may be either uncompressed or compressed with
|
||||
.BR xz (1),
|
||||
.BR lzma (1),
|
||||
.BR gzip (1),
|
||||
.BR bzip2 (1),
|
||||
or
|
||||
.BR bzip2 (1).
|
||||
.BR lzop (1).
|
||||
All options specified are passed directly to
|
||||
.BR grep (1).
|
||||
.PP
|
||||
@@ -51,9 +52,10 @@ is specified, then standard input is decompressed if necessary
|
||||
and fed to
|
||||
.BR grep (1).
|
||||
When reading from standard input,
|
||||
.BR gzip (1)
|
||||
.BR gzip (1),
|
||||
.BR bzip2 (1),
|
||||
and
|
||||
.BR bzip2 (1)
|
||||
.BR lzop (1)
|
||||
compressed files are not supported.
|
||||
.PP
|
||||
If
|
||||
@@ -92,4 +94,5 @@ or
|
||||
.BR xz (1),
|
||||
.BR gzip (1),
|
||||
.BR bzip2 (1),
|
||||
.BR lzop (1),
|
||||
.BR zgrep (1)
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
||||
# autodetection. This way memory usage limit and thread limit can be
|
||||
# specified via XZ_OPT. With gzip and bzip2 it's OK to just unset the
|
||||
# specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset the
|
||||
# environment variables.
|
||||
xz='@xz@ --format=auto'
|
||||
unset GZIP BZIP BZIP2
|
||||
unset GZIP BZIP BZIP2 LZOP
|
||||
|
||||
case ${0##/*} in
|
||||
case ${0##*/} in
|
||||
*egrep*) prog=xzegrep; grep=${GREP:-egrep};;
|
||||
*fgrep*) prog=xzfgrep; grep=${GREP:-fgrep};;
|
||||
*) prog=xzgrep; grep=${GREP:-grep};;
|
||||
@@ -35,7 +35,7 @@ esac
|
||||
|
||||
version="$prog (@PACKAGE_NAME@) @VERSION@"
|
||||
|
||||
usage="Usage: ${0##/*} [OPTION]... [-e] PATTERN [FILE]...
|
||||
usage="Usage: ${0##*/} [OPTION]... [-e] PATTERN [FILE]...
|
||||
Look for instances of PATTERN in the input FILEs, using their
|
||||
uncompressed contents if they are compressed.
|
||||
|
||||
@@ -126,6 +126,10 @@ while test $# -ne 0; do
|
||||
grep="$grep $option$optarg"
|
||||
done
|
||||
|
||||
if test $files_with_matches -eq 1 || test $files_without_matches -eq 1; then
|
||||
grep="$grep -q"
|
||||
fi
|
||||
|
||||
eval "set -- $operands "'${1+"$@"}'
|
||||
|
||||
if test $have_pat -eq 0; then
|
||||
@@ -149,6 +153,7 @@ for i; do
|
||||
case $i in
|
||||
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) uncompress="gzip -cdfq";;
|
||||
*[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdfq";;
|
||||
*[-.]lzo | *[-.]tzo) uncompress="lzop -cdfq";;
|
||||
*) uncompress="$xz -cdfq";;
|
||||
esac
|
||||
# Fail if xz or grep (or sed) fails.
|
||||
@@ -156,9 +161,9 @@ for i; do
|
||||
exec 5>&1
|
||||
($uncompress -- "$i" 5>&-; echo $? >&5) 3>&- |
|
||||
if test $files_with_matches -eq 1; then
|
||||
eval "$grep" -q && { printf '%s\n' "$i" || exit 2; }
|
||||
eval "$grep" && { printf '%s\n' "$i" || exit 2; }
|
||||
elif test $files_without_matches -eq 1; then
|
||||
eval "$grep" -q || {
|
||||
eval "$grep" || {
|
||||
r=$?
|
||||
if test $r -eq 1; then
|
||||
printf '%s\n' "$i" || r=2
|
||||
@@ -190,7 +195,8 @@ for i; do
|
||||
fi >&3 5>&-
|
||||
)
|
||||
r=$?
|
||||
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 || r=2
|
||||
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 \
|
||||
|| test "$(kill -l "$xz_status" 2> /dev/null)" = "PIPE" || r=2
|
||||
test $res -lt $r && res=$r
|
||||
done
|
||||
exit $res
|
||||
|
||||
@@ -54,6 +54,67 @@ parse_memlimit(const char *name, const char *name_percentage, char *str,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
parse_block_list(char *str)
|
||||
{
|
||||
// It must be non-empty and not begin with a comma.
|
||||
if (str[0] == '\0' || str[0] == ',')
|
||||
message_fatal(_("%s: Invalid argument to --block-list"), str);
|
||||
|
||||
// Count the number of comma-separated strings.
|
||||
size_t count = 1;
|
||||
for (size_t i = 0; str[i] != '\0'; ++i)
|
||||
if (str[i] == ',')
|
||||
++count;
|
||||
|
||||
// Prevent an unlikely integer overflow.
|
||||
if (count > SIZE_MAX / sizeof(uint64_t) - 1)
|
||||
message_fatal(_("%s: Too many arguments to --block-list"),
|
||||
str);
|
||||
|
||||
// Allocate memory to hold all the sizes specified.
|
||||
// If --block-list was specified already, its value is forgotten.
|
||||
free(opt_block_list);
|
||||
opt_block_list = xmalloc((count + 1) * sizeof(uint64_t));
|
||||
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
// Locate the next comma and replace it with \0.
|
||||
char *p = strchr(str, ',');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
|
||||
if (str[0] == '\0') {
|
||||
// There is no string, that is, a comma follows
|
||||
// another comma. Use the previous value.
|
||||
//
|
||||
// NOTE: We checked earler that the first char
|
||||
// of the whole list cannot be a comma.
|
||||
assert(i > 0);
|
||||
opt_block_list[i] = opt_block_list[i - 1];
|
||||
} else {
|
||||
opt_block_list[i] = str_to_uint64("block-list", str,
|
||||
0, UINT64_MAX);
|
||||
|
||||
// Zero indicates no more new Blocks.
|
||||
if (opt_block_list[i] == 0) {
|
||||
if (i + 1 != count)
|
||||
message_fatal(_("0 can only be used "
|
||||
"as the last element "
|
||||
"in --block-list"));
|
||||
|
||||
opt_block_list[i] = UINT64_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
str = p + 1;
|
||||
}
|
||||
|
||||
// Terminate the array.
|
||||
opt_block_list[count] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
parse_real(args_info *args, int argc, char **argv)
|
||||
{
|
||||
@@ -68,9 +129,12 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
OPT_LZMA1,
|
||||
OPT_LZMA2,
|
||||
|
||||
OPT_SINGLE_STREAM,
|
||||
OPT_NO_SPARSE,
|
||||
OPT_FILES,
|
||||
OPT_FILES0,
|
||||
OPT_BLOCK_SIZE,
|
||||
OPT_BLOCK_LIST,
|
||||
OPT_MEM_COMPRESS,
|
||||
OPT_MEM_DECOMPRESS,
|
||||
OPT_NO_ADJUST,
|
||||
@@ -94,6 +158,7 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
{ "force", no_argument, NULL, 'f' },
|
||||
{ "stdout", no_argument, NULL, 'c' },
|
||||
{ "to-stdout", no_argument, NULL, 'c' },
|
||||
{ "single-stream", no_argument, NULL, OPT_SINGLE_STREAM },
|
||||
{ "no-sparse", no_argument, NULL, OPT_NO_SPARSE },
|
||||
{ "suffix", required_argument, NULL, 'S' },
|
||||
// { "recursive", no_argument, NULL, 'r' }, // TODO
|
||||
@@ -103,6 +168,8 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
// Basic compression settings
|
||||
{ "format", required_argument, NULL, 'F' },
|
||||
{ "check", required_argument, NULL, 'C' },
|
||||
{ "block-size", required_argument, NULL, OPT_BLOCK_SIZE },
|
||||
{ "block-list", required_argument, NULL, OPT_BLOCK_LIST },
|
||||
{ "memlimit-compress", required_argument, NULL, OPT_MEM_COMPRESS },
|
||||
{ "memlimit-decompress", required_argument, NULL, OPT_MEM_DECOMPRESS },
|
||||
{ "memlimit", required_argument, NULL, 'M' },
|
||||
@@ -175,8 +242,9 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
hardware_threadlimit_set(str_to_uint64(
|
||||
"threads", optarg, 0, UINT32_MAX));
|
||||
// The max is from src/liblzma/common/common.h.
|
||||
hardware_threads_set(str_to_uint64("threads",
|
||||
optarg, 0, 16384));
|
||||
break;
|
||||
|
||||
// --version
|
||||
@@ -368,6 +436,20 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
case OPT_BLOCK_SIZE:
|
||||
opt_block_size = str_to_uint64("block-size", optarg,
|
||||
0, LZMA_VLI_MAX);
|
||||
break;
|
||||
|
||||
case OPT_BLOCK_LIST: {
|
||||
parse_block_list(optarg);
|
||||
break;
|
||||
}
|
||||
|
||||
case OPT_SINGLE_STREAM:
|
||||
opt_single_stream = true;
|
||||
break;
|
||||
|
||||
case OPT_NO_SPARSE:
|
||||
io_no_sparse();
|
||||
break;
|
||||
@@ -438,7 +520,7 @@ parse_environment(args_info *args, char *argv0, const char *varname)
|
||||
} else if (prev_was_space) {
|
||||
prev_was_space = false;
|
||||
|
||||
// Keep argc small enough to fit into a singed int
|
||||
// Keep argc small enough to fit into a signed int
|
||||
// and to keep it usable for memory allocation.
|
||||
if (++argc == my_min(
|
||||
INT_MAX, SIZE_MAX / sizeof(char *)))
|
||||
@@ -576,3 +658,13 @@ args_parse(args_info *args, int argc, char **argv)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
extern void
|
||||
args_free(void)
|
||||
{
|
||||
free(opt_block_list);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -40,3 +40,4 @@ extern bool opt_robot;
|
||||
extern const char stdin_filename[];
|
||||
|
||||
extern void args_parse(args_info *args, int argc, char **argv);
|
||||
extern void args_free(void);
|
||||
|
||||
319
src/xz/coder.c
319
src/xz/coder.c
@@ -24,6 +24,9 @@ enum coder_init_ret {
|
||||
enum operation_mode opt_mode = MODE_COMPRESS;
|
||||
enum format_type opt_format = FORMAT_AUTO;
|
||||
bool opt_auto_adjust = true;
|
||||
bool opt_single_stream = false;
|
||||
uint64_t opt_block_size = 0;
|
||||
uint64_t *opt_block_list = NULL;
|
||||
|
||||
|
||||
/// Stream used to communicate with liblzma
|
||||
@@ -37,10 +40,10 @@ static io_buf in_buf;
|
||||
static io_buf out_buf;
|
||||
|
||||
/// Number of filters. Zero indicates that we are using a preset.
|
||||
static size_t filters_count = 0;
|
||||
static uint32_t filters_count = 0;
|
||||
|
||||
/// Number of the preset (0-9)
|
||||
static size_t preset_number = 6;
|
||||
static uint32_t preset_number = 6;
|
||||
|
||||
/// If a preset is used (no custom filter chain) and preset_extreme is true,
|
||||
/// a significantly slower compression is used to achieve slightly better
|
||||
@@ -53,6 +56,14 @@ static lzma_check check;
|
||||
/// This becomes false if the --check=CHECK option is used.
|
||||
static bool check_default = true;
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
static lzma_mt mt_options = {
|
||||
.flags = 0,
|
||||
.timeout = 300,
|
||||
.filters = filters,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
extern void
|
||||
coder_set_check(lzma_check new_check)
|
||||
@@ -64,7 +75,7 @@ coder_set_check(lzma_check new_check)
|
||||
|
||||
|
||||
extern void
|
||||
coder_set_preset(size_t new_preset)
|
||||
coder_set_preset(uint32_t new_preset)
|
||||
{
|
||||
preset_number = new_preset;
|
||||
|
||||
@@ -102,7 +113,7 @@ coder_add_filter(lzma_vli id, void *options)
|
||||
}
|
||||
|
||||
|
||||
static void lzma_attribute((noreturn))
|
||||
static void lzma_attribute((__noreturn__))
|
||||
memlimit_too_small(uint64_t memory_usage)
|
||||
{
|
||||
message(V_ERROR, _("Memory usage limit is too low for the given "
|
||||
@@ -115,6 +126,15 @@ memlimit_too_small(uint64_t memory_usage)
|
||||
extern void
|
||||
coder_set_compression_settings(void)
|
||||
{
|
||||
// The default check type is CRC64, but fallback to CRC32
|
||||
// if CRC64 isn't supported by the copy of liblzma we are
|
||||
// using. CRC32 is always supported.
|
||||
if (check_default) {
|
||||
check = LZMA_CHECK_CRC64;
|
||||
if (!lzma_check_is_supported(check))
|
||||
check = LZMA_CHECK_CRC32;
|
||||
}
|
||||
|
||||
// Options for LZMA1 or LZMA2 in case we are using a preset.
|
||||
static lzma_options_lzma opt_lzma;
|
||||
|
||||
@@ -168,15 +188,30 @@ coder_set_compression_settings(void)
|
||||
// Print the selected filter chain.
|
||||
message_filters_show(V_DEBUG, filters);
|
||||
|
||||
// If using --format=raw, we can be decoding. The memusage function
|
||||
// also validates the filter chain and the options used for the
|
||||
// filters.
|
||||
// Get the memory usage. Note that if --format=raw was used,
|
||||
// we can be decompressing.
|
||||
const uint64_t memory_limit = hardware_memlimit_get(opt_mode);
|
||||
uint64_t memory_usage;
|
||||
if (opt_mode == MODE_COMPRESS)
|
||||
memory_usage = lzma_raw_encoder_memusage(filters);
|
||||
else
|
||||
if (opt_mode == MODE_COMPRESS) {
|
||||
#ifdef HAVE_PTHREAD
|
||||
if (opt_format == FORMAT_XZ && hardware_threads_get() > 1) {
|
||||
mt_options.threads = hardware_threads_get();
|
||||
mt_options.block_size = opt_block_size;
|
||||
mt_options.check = check;
|
||||
memory_usage = lzma_stream_encoder_mt_memusage(
|
||||
&mt_options);
|
||||
if (memory_usage != UINT64_MAX)
|
||||
message(V_DEBUG, _("Using up to %" PRIu32
|
||||
" threads."),
|
||||
mt_options.threads);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
memory_usage = lzma_raw_encoder_memusage(filters);
|
||||
}
|
||||
} else {
|
||||
memory_usage = lzma_raw_decoder_memusage(filters);
|
||||
}
|
||||
|
||||
if (memory_usage == UINT64_MAX)
|
||||
message_fatal(_("Unsupported filter chain or filter options"));
|
||||
@@ -192,90 +227,99 @@ coder_set_compression_settings(void)
|
||||
round_up_to_mib(decmem), 0));
|
||||
}
|
||||
|
||||
if (memory_usage > memory_limit) {
|
||||
// If --no-auto-adjust was used or we didn't find LZMA1 or
|
||||
// LZMA2 as the last filter, give an error immediately.
|
||||
// --format=raw implies --no-auto-adjust.
|
||||
if (!opt_auto_adjust || opt_format == FORMAT_RAW)
|
||||
memlimit_too_small(memory_usage);
|
||||
if (memory_usage <= memory_limit)
|
||||
return;
|
||||
|
||||
assert(opt_mode == MODE_COMPRESS);
|
||||
// If --no-auto-adjust was used or we didn't find LZMA1 or
|
||||
// LZMA2 as the last filter, give an error immediately.
|
||||
// --format=raw implies --no-auto-adjust.
|
||||
if (!opt_auto_adjust || opt_format == FORMAT_RAW)
|
||||
memlimit_too_small(memory_usage);
|
||||
|
||||
// Look for the last filter if it is LZMA2 or LZMA1, so
|
||||
// we can make it use less RAM. With other filters we don't
|
||||
// know what to do.
|
||||
size_t i = 0;
|
||||
while (filters[i].id != LZMA_FILTER_LZMA2
|
||||
&& filters[i].id != LZMA_FILTER_LZMA1) {
|
||||
if (filters[i].id == LZMA_VLI_UNKNOWN)
|
||||
assert(opt_mode == MODE_COMPRESS);
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
if (opt_format == FORMAT_XZ && mt_options.threads > 1) {
|
||||
// Try to reduce the number of threads before
|
||||
// adjusting the compression settings down.
|
||||
do {
|
||||
// FIXME? The real single-threaded mode has
|
||||
// lower memory usage, but it's not comparable
|
||||
// because it doesn't write the size info
|
||||
// into Block Headers.
|
||||
if (--mt_options.threads == 0)
|
||||
memlimit_too_small(memory_usage);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
// Decrease the dictionary size until we meet the memory
|
||||
// usage limit. First round down to full mebibytes.
|
||||
lzma_options_lzma *opt = filters[i].options;
|
||||
const uint32_t orig_dict_size = opt->dict_size;
|
||||
opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
|
||||
while (true) {
|
||||
// If it is below 1 MiB, auto-adjusting failed. We
|
||||
// could be more sophisticated and scale it down even
|
||||
// more, but let's see if many complain about this
|
||||
// version.
|
||||
//
|
||||
// FIXME: Displays the scaled memory usage instead
|
||||
// of the original.
|
||||
if (opt->dict_size < (UINT32_C(1) << 20))
|
||||
memlimit_too_small(memory_usage);
|
||||
|
||||
memory_usage = lzma_raw_encoder_memusage(filters);
|
||||
memory_usage = lzma_stream_encoder_mt_memusage(
|
||||
&mt_options);
|
||||
if (memory_usage == UINT64_MAX)
|
||||
message_bug();
|
||||
|
||||
// Accept it if it is low enough.
|
||||
if (memory_usage <= memory_limit)
|
||||
break;
|
||||
} while (memory_usage > memory_limit);
|
||||
|
||||
// Otherwise 1 MiB down and try again. I hope this
|
||||
// isn't too slow method for cases where the original
|
||||
// dict_size is very big.
|
||||
opt->dict_size -= UINT32_C(1) << 20;
|
||||
}
|
||||
message(V_WARNING, _("Adjusted the number of threads "
|
||||
"from %s to %s to not exceed "
|
||||
"the memory usage limit of %s MiB"),
|
||||
uint64_to_str(hardware_threads_get(), 0),
|
||||
uint64_to_str(mt_options.threads, 1),
|
||||
uint64_to_str(round_up_to_mib(
|
||||
memory_limit), 2));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Tell the user that we decreased the dictionary size.
|
||||
message(V_WARNING, _("Adjusted LZMA%c dictionary size "
|
||||
"from %s MiB to %s MiB to not exceed "
|
||||
"the memory usage limit of %s MiB"),
|
||||
filters[i].id == LZMA_FILTER_LZMA2
|
||||
? '2' : '1',
|
||||
uint64_to_str(orig_dict_size >> 20, 0),
|
||||
uint64_to_str(opt->dict_size >> 20, 1),
|
||||
uint64_to_str(round_up_to_mib(
|
||||
memory_limit), 2));
|
||||
if (memory_usage <= memory_limit)
|
||||
return;
|
||||
|
||||
// Look for the last filter if it is LZMA2 or LZMA1, so we can make
|
||||
// it use less RAM. With other filters we don't know what to do.
|
||||
size_t i = 0;
|
||||
while (filters[i].id != LZMA_FILTER_LZMA2
|
||||
&& filters[i].id != LZMA_FILTER_LZMA1) {
|
||||
if (filters[i].id == LZMA_VLI_UNKNOWN)
|
||||
memlimit_too_small(memory_usage);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
/*
|
||||
// Limit the number of worker threads so that memory usage
|
||||
// limit isn't exceeded.
|
||||
assert(memory_usage > 0);
|
||||
size_t thread_limit = memory_limit / memory_usage;
|
||||
if (thread_limit == 0)
|
||||
thread_limit = 1;
|
||||
// Decrease the dictionary size until we meet the memory
|
||||
// usage limit. First round down to full mebibytes.
|
||||
lzma_options_lzma *opt = filters[i].options;
|
||||
const uint32_t orig_dict_size = opt->dict_size;
|
||||
opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
|
||||
while (true) {
|
||||
// If it is below 1 MiB, auto-adjusting failed. We could be
|
||||
// more sophisticated and scale it down even more, but let's
|
||||
// see if many complain about this version.
|
||||
//
|
||||
// FIXME: Displays the scaled memory usage instead
|
||||
// of the original.
|
||||
if (opt->dict_size < (UINT32_C(1) << 20))
|
||||
memlimit_too_small(memory_usage);
|
||||
|
||||
if (opt_threads > thread_limit)
|
||||
opt_threads = thread_limit;
|
||||
*/
|
||||
memory_usage = lzma_raw_encoder_memusage(filters);
|
||||
if (memory_usage == UINT64_MAX)
|
||||
message_bug();
|
||||
|
||||
if (check_default) {
|
||||
// The default check type is CRC64, but fallback to CRC32
|
||||
// if CRC64 isn't supported by the copy of liblzma we are
|
||||
// using. CRC32 is always supported.
|
||||
check = LZMA_CHECK_CRC64;
|
||||
if (!lzma_check_is_supported(check))
|
||||
check = LZMA_CHECK_CRC32;
|
||||
// Accept it if it is low enough.
|
||||
if (memory_usage <= memory_limit)
|
||||
break;
|
||||
|
||||
// Otherwise 1 MiB down and try again. I hope this
|
||||
// isn't too slow method for cases where the original
|
||||
// dict_size is very big.
|
||||
opt->dict_size -= UINT32_C(1) << 20;
|
||||
}
|
||||
|
||||
// Tell the user that we decreased the dictionary size.
|
||||
message(V_WARNING, _("Adjusted LZMA%c dictionary size "
|
||||
"from %s MiB to %s MiB to not exceed "
|
||||
"the memory usage limit of %s MiB"),
|
||||
filters[i].id == LZMA_FILTER_LZMA2
|
||||
? '2' : '1',
|
||||
uint64_to_str(orig_dict_size >> 20, 0),
|
||||
uint64_to_str(opt->dict_size >> 20, 1),
|
||||
uint64_to_str(round_up_to_mib(memory_limit), 2));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -284,7 +328,10 @@ coder_set_compression_settings(void)
|
||||
static bool
|
||||
is_format_xz(void)
|
||||
{
|
||||
return strm.avail_in >= 6 && memcmp(in_buf.u8, "\3757zXZ", 6) == 0;
|
||||
// Specify the magic as hex to be compatible with EBCDIC systems.
|
||||
static const uint8_t magic[6] = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 };
|
||||
return strm.avail_in >= sizeof(magic)
|
||||
&& memcmp(in_buf.u8, magic, sizeof(magic)) == 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +401,14 @@ coder_init(file_pair *pair)
|
||||
break;
|
||||
|
||||
case FORMAT_XZ:
|
||||
ret = lzma_stream_encoder(&strm, filters, check);
|
||||
#ifdef HAVE_PTHREAD
|
||||
if (hardware_threads_get() > 1)
|
||||
ret = lzma_stream_encoder_mt(
|
||||
&strm, &mt_options);
|
||||
else
|
||||
#endif
|
||||
ret = lzma_stream_encoder(
|
||||
&strm, filters, check);
|
||||
break;
|
||||
|
||||
case FORMAT_LZMA:
|
||||
@@ -366,8 +420,9 @@ coder_init(file_pair *pair)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK
|
||||
| LZMA_CONCATENATED;
|
||||
uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK;
|
||||
if (!opt_single_stream)
|
||||
flags |= LZMA_CONCATENATED;
|
||||
|
||||
// We abuse FORMAT_AUTO to indicate unknown file format,
|
||||
// for which we may consider passthru mode.
|
||||
@@ -398,7 +453,7 @@ coder_init(file_pair *pair)
|
||||
|
||||
switch (init_format) {
|
||||
case FORMAT_AUTO:
|
||||
// Uknown file format. If --decompress --stdout
|
||||
// Unknown file format. If --decompress --stdout
|
||||
// --force have been given, then we copy the input
|
||||
// as is to stdout. Checking for MODE_DECOMPRESS
|
||||
// is needed, because we don't want to do use
|
||||
@@ -459,8 +514,8 @@ coder_normal(file_pair *pair)
|
||||
// Encoder needs to know when we have given all the input to it.
|
||||
// The decoders need to know it too when we are using
|
||||
// LZMA_CONCATENATED. We need to check for src_eof here, because
|
||||
// the first input chunk has been already read, and that may
|
||||
// have been the only chunk we will read.
|
||||
// the first input chunk has been already read if decompressing,
|
||||
// and that may have been the only chunk we will read.
|
||||
lzma_action action = pair->src_eof ? LZMA_FINISH : LZMA_RUN;
|
||||
|
||||
lzma_ret ret;
|
||||
@@ -468,6 +523,37 @@ coder_normal(file_pair *pair)
|
||||
// Assume that something goes wrong.
|
||||
bool success = false;
|
||||
|
||||
// block_remaining indicates how many input bytes to encode before
|
||||
// finishing the current .xz Block. The Block size is set with
|
||||
// --block-size=SIZE and --block-list. They have an effect only when
|
||||
// compressing to the .xz format. If block_remaining == UINT64_MAX,
|
||||
// only a single block is created.
|
||||
uint64_t block_remaining = UINT64_MAX;
|
||||
|
||||
// Position in opt_block_list. Unused if --block-list wasn't used.
|
||||
size_t list_pos = 0;
|
||||
|
||||
// Handle --block-size for single-threaded mode and the first step
|
||||
// of --block-list.
|
||||
if (opt_mode == MODE_COMPRESS && opt_format == FORMAT_XZ) {
|
||||
// --block-size doesn't do anything here in threaded mode,
|
||||
// because the threaded encoder will take care of splitting
|
||||
// to fixed-sized Blocks.
|
||||
if (hardware_threads_get() == 1 && opt_block_size > 0)
|
||||
block_remaining = opt_block_size;
|
||||
|
||||
// If --block-list was used, start with the first size.
|
||||
//
|
||||
// FIXME: Currently this overrides --block-size but this isn't
|
||||
// good. For threaded case, we want --block-size to specify
|
||||
// how big Blocks the encoder needs to be prepared to create
|
||||
// at maximum and --block-list will simultaneously cause new
|
||||
// Blocks to be started at specified intervals. To keep things
|
||||
// logical, the same should be done in single-threaded mode.
|
||||
if (opt_block_list != NULL)
|
||||
block_remaining = opt_block_list[list_pos];
|
||||
}
|
||||
|
||||
strm.next_out = out_buf.u8;
|
||||
strm.avail_out = IO_BUFFER_SIZE;
|
||||
|
||||
@@ -476,14 +562,23 @@ coder_normal(file_pair *pair)
|
||||
// end of file yet.
|
||||
if (strm.avail_in == 0 && !pair->src_eof) {
|
||||
strm.next_in = in_buf.u8;
|
||||
strm.avail_in = io_read(
|
||||
pair, &in_buf, IO_BUFFER_SIZE);
|
||||
strm.avail_in = io_read(pair, &in_buf,
|
||||
my_min(block_remaining,
|
||||
IO_BUFFER_SIZE));
|
||||
|
||||
if (strm.avail_in == SIZE_MAX)
|
||||
break;
|
||||
|
||||
if (pair->src_eof)
|
||||
if (pair->src_eof) {
|
||||
action = LZMA_FINISH;
|
||||
|
||||
} else if (block_remaining != UINT64_MAX) {
|
||||
// Start a new Block after every
|
||||
// opt_block_size bytes of input.
|
||||
block_remaining -= strm.avail_in;
|
||||
if (block_remaining == 0)
|
||||
action = LZMA_FULL_FLUSH;
|
||||
}
|
||||
}
|
||||
|
||||
// Let liblzma do the actual work.
|
||||
@@ -499,7 +594,22 @@ coder_normal(file_pair *pair)
|
||||
strm.avail_out = IO_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if (ret != LZMA_OK) {
|
||||
if (ret == LZMA_STREAM_END && action == LZMA_FULL_FLUSH) {
|
||||
// Start a new Block.
|
||||
action = LZMA_RUN;
|
||||
|
||||
if (opt_block_list == NULL) {
|
||||
block_remaining = opt_block_size;
|
||||
} else {
|
||||
// FIXME: Make it work together with
|
||||
// --block-size.
|
||||
if (opt_block_list[list_pos + 1] != 0)
|
||||
++list_pos;
|
||||
|
||||
block_remaining = opt_block_list[list_pos];
|
||||
}
|
||||
|
||||
} else if (ret != LZMA_OK) {
|
||||
// Determine if the return value indicates that we
|
||||
// won't continue coding.
|
||||
const bool stop = ret != LZMA_NO_CHECK
|
||||
@@ -518,6 +628,12 @@ coder_normal(file_pair *pair)
|
||||
}
|
||||
|
||||
if (ret == LZMA_STREAM_END) {
|
||||
if (opt_single_stream) {
|
||||
io_fix_src_pos(pair, strm.avail_in);
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Check that there is no trailing garbage.
|
||||
// This is needed for LZMA_Alone and raw
|
||||
// streams.
|
||||
@@ -620,10 +736,15 @@ coder_run(const char *filename)
|
||||
// Assume that something goes wrong.
|
||||
bool success = false;
|
||||
|
||||
// Read the first chunk of input data. This is needed to detect
|
||||
// the input file type (for now, only for decompression).
|
||||
strm.next_in = in_buf.u8;
|
||||
strm.avail_in = io_read(pair, &in_buf, IO_BUFFER_SIZE);
|
||||
if (opt_mode == MODE_COMPRESS) {
|
||||
strm.next_in = NULL;
|
||||
strm.avail_in = 0;
|
||||
} else {
|
||||
// Read the first chunk of input data. This is needed
|
||||
// to detect the input file type.
|
||||
strm.next_in = in_buf.u8;
|
||||
strm.avail_in = io_read(pair, &in_buf, IO_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
if (strm.avail_in != SIZE_MAX) {
|
||||
// Initialize the coder. This will detect the file format
|
||||
@@ -661,3 +782,13 @@ coder_run(const char *filename)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
extern void
|
||||
coder_free(void)
|
||||
{
|
||||
lzma_end(&strm);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -41,12 +41,22 @@ extern enum format_type opt_format;
|
||||
/// they exceed the memory usage limit.
|
||||
extern bool opt_auto_adjust;
|
||||
|
||||
/// If true, stop after decoding the first stream.
|
||||
extern bool opt_single_stream;
|
||||
|
||||
/// If non-zero, start a new .xz Block after every opt_block_size bytes
|
||||
/// of input. This has an effect only when compressing to the .xz format.
|
||||
extern uint64_t opt_block_size;
|
||||
|
||||
/// This is non-NULL if --block-list was used. This contains the Block sizes
|
||||
/// as an array that is terminated with 0.
|
||||
extern uint64_t *opt_block_list;
|
||||
|
||||
/// Set the integrity check type used when compressing
|
||||
extern void coder_set_check(lzma_check check);
|
||||
|
||||
/// Set preset number
|
||||
extern void coder_set_preset(size_t new_preset);
|
||||
extern void coder_set_preset(uint32_t new_preset);
|
||||
|
||||
/// Enable extreme mode
|
||||
extern void coder_set_extreme(void);
|
||||
@@ -59,3 +69,8 @@ extern void coder_set_compression_settings(void);
|
||||
|
||||
/// Compress or decompress the given file
|
||||
extern void coder_run(const char *filename);
|
||||
|
||||
#ifndef NDEBUG
|
||||
/// Free the memory allocated for the coder and kill the worker threads.
|
||||
extern void coder_free(void);
|
||||
#endif
|
||||
|
||||
@@ -53,7 +53,7 @@ static bool io_write_buf(file_pair *pair, const uint8_t *buf, size_t size);
|
||||
extern void
|
||||
io_init(void)
|
||||
{
|
||||
// Make sure that stdin, stdout, and and stderr are connected to
|
||||
// Make sure that stdin, stdout, and stderr are connected to
|
||||
// a valid file descriptor. Exit immediately with exit code ERROR
|
||||
// if we cannot make the file descriptors valid. Maybe we should
|
||||
// print an error message, but our stderr could be screwed anyway.
|
||||
@@ -68,8 +68,7 @@ io_init(void)
|
||||
#ifdef __DJGPP__
|
||||
// Avoid doing useless things when statting files.
|
||||
// This isn't important but doesn't hurt.
|
||||
_djstat_flags = _STAT_INODE | _STAT_EXEC_EXT
|
||||
| _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
|
||||
_djstat_flags = _STAT_EXEC_EXT | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
|
||||
#endif
|
||||
|
||||
return;
|
||||
@@ -293,6 +292,10 @@ io_open_src_real(file_pair *pair)
|
||||
pair->src_fd = STDIN_FILENO;
|
||||
#ifdef TUKLIB_DOSLIKE
|
||||
setmode(STDIN_FILENO, O_BINARY);
|
||||
#endif
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
// It will fail if stdin is a pipe and that's fine.
|
||||
(void)posix_fadvise(STDIN_FILENO, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -448,8 +451,18 @@ io_open_src_real(file_pair *pair)
|
||||
|
||||
// Stat the source file. We need the result also when we copy
|
||||
// the permissions, and when unlinking.
|
||||
//
|
||||
// NOTE: Use stat() instead of fstat() with DJGPP, because
|
||||
// then we have a better chance to get st_ino value that can
|
||||
// be used in io_open_dest_real() to prevent overwriting the
|
||||
// source file.
|
||||
#ifdef __DJGPP__
|
||||
if (stat(pair->src_name, &pair->src_st))
|
||||
goto error_msg;
|
||||
#else
|
||||
if (fstat(pair->src_fd, &pair->src_st))
|
||||
goto error_msg;
|
||||
#endif
|
||||
|
||||
if (S_ISDIR(pair->src_st.st_mode)) {
|
||||
message_warning(_("%s: Is a directory, skipping"),
|
||||
@@ -497,6 +510,17 @@ io_open_src_real(file_pair *pair)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
const int fadvise_ret = posix_fadvise(
|
||||
pair->src_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
|
||||
// It shouldn't fail, but if it does anyway, it doesn't matter.
|
||||
// Check it with an assertion so that if something gets messed
|
||||
// up in the future, it will get caught when debugging is enabled.
|
||||
assert(fadvise_ret == 0);
|
||||
(void)fadvise_ret;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
|
||||
error_msg:
|
||||
@@ -584,6 +608,28 @@ io_open_dest_real(file_pair *pair)
|
||||
if (pair->dest_name == NULL)
|
||||
return true;
|
||||
|
||||
#ifdef __DJGPP__
|
||||
struct stat st;
|
||||
if (stat(pair->dest_name, &st) == 0) {
|
||||
// Check that it isn't a special file like "prn".
|
||||
if (st.st_dev == -1) {
|
||||
message_error("%s: Refusing to write to "
|
||||
"a DOS special file",
|
||||
pair->dest_name);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check that we aren't overwriting the source file.
|
||||
if (st.st_dev == pair->src_st.st_dev
|
||||
&& st.st_ino == pair->src_st.st_ino) {
|
||||
message_error("%s: Output file is the same "
|
||||
"as the input file",
|
||||
pair->dest_name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// If --force was used, unlink the target file first.
|
||||
if (opt_force && unlink(pair->dest_name) && errno != ENOENT) {
|
||||
message_error(_("%s: Cannot remove: %s"),
|
||||
@@ -606,17 +652,19 @@ io_open_dest_real(file_pair *pair)
|
||||
}
|
||||
}
|
||||
|
||||
// If this really fails... well, we have a safe fallback.
|
||||
#ifndef TUKLIB_DOSLIKE
|
||||
// dest_st isn't used on DOS-like systems except as a dummy
|
||||
// argument to io_unlink(), so don't fstat() on such systems.
|
||||
if (fstat(pair->dest_fd, &pair->dest_st)) {
|
||||
#if defined(__VMS)
|
||||
// If fstat() really fails, we have a safe fallback here.
|
||||
# if defined(__VMS)
|
||||
pair->dest_st.st_ino[0] = 0;
|
||||
pair->dest_st.st_ino[1] = 0;
|
||||
pair->dest_st.st_ino[2] = 0;
|
||||
#elif !defined(TUKLIB_DOSLIKE)
|
||||
# else
|
||||
pair->dest_st.st_dev = 0;
|
||||
pair->dest_st.st_ino = 0;
|
||||
#endif
|
||||
#ifndef TUKLIB_DOSLIKE
|
||||
# endif
|
||||
} else if (try_sparse && opt_mode == MODE_DECOMPRESS) {
|
||||
// When writing to standard output, we need to be extra
|
||||
// careful:
|
||||
@@ -674,8 +722,8 @@ io_open_dest_real(file_pair *pair)
|
||||
}
|
||||
|
||||
pair->dest_try_sparse = true;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -792,6 +840,21 @@ io_close(file_pair *pair, bool success)
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
io_fix_src_pos(file_pair *pair, size_t rewind_size)
|
||||
{
|
||||
assert(rewind_size <= IO_BUFFER_SIZE);
|
||||
|
||||
if (rewind_size > 0) {
|
||||
// This doesn't need to work on unseekable file descriptors,
|
||||
// so just ignore possible errors.
|
||||
(void)lseek(pair->src_fd, -(off_t)(rewind_size), SEEK_CUR);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
extern size_t
|
||||
io_read(file_pair *pair, io_buf *buf_union, size_t size)
|
||||
{
|
||||
|
||||
@@ -102,6 +102,19 @@ extern void io_close(file_pair *pair, bool success);
|
||||
extern size_t io_read(file_pair *pair, io_buf *buf, size_t size);
|
||||
|
||||
|
||||
/// \brief Fix the position in src_fd
|
||||
///
|
||||
/// This is used when --single-thream has been specified and decompression
|
||||
/// is successful. If the input file descriptor supports seeking, this
|
||||
/// function fixes the input position to point to the next byte after the
|
||||
/// decompressed stream.
|
||||
///
|
||||
/// \param pair File pair having the source file open for reading
|
||||
/// \param rewind_size How many bytes of extra have been read i.e.
|
||||
/// how much to seek backwards.
|
||||
extern void io_fix_src_pos(file_pair *pair, size_t rewind_size);
|
||||
|
||||
|
||||
/// \brief Read from source file from given offset to a buffer
|
||||
///
|
||||
/// This is remotely similar to standard pread(). This uses lseek() though,
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
#include "tuklib_cpucores.h"
|
||||
|
||||
|
||||
/// Maximum number of free *coder* threads. This can be set with
|
||||
/// Maximum number of worker threads. This can be set with
|
||||
/// the --threads=NUM command line option.
|
||||
static uint32_t threadlimit;
|
||||
static uint32_t threads_max = 1;
|
||||
|
||||
/// Memory usage limit for compression
|
||||
static uint64_t memlimit_compress;
|
||||
@@ -29,15 +29,16 @@ static uint64_t total_ram;
|
||||
|
||||
|
||||
extern void
|
||||
hardware_threadlimit_set(uint32_t new_threadlimit)
|
||||
hardware_threads_set(uint32_t n)
|
||||
{
|
||||
if (new_threadlimit == 0) {
|
||||
// The default is the number of available CPU cores.
|
||||
threadlimit = tuklib_cpucores();
|
||||
if (threadlimit == 0)
|
||||
threadlimit = 1;
|
||||
if (n == 0) {
|
||||
// Automatic number of threads was requested.
|
||||
// Use the number of available CPU cores.
|
||||
threads_max = tuklib_cpucores();
|
||||
if (threads_max == 0)
|
||||
threads_max = 1;
|
||||
} else {
|
||||
threadlimit = new_threadlimit;
|
||||
threads_max = n;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -45,9 +46,9 @@ hardware_threadlimit_set(uint32_t new_threadlimit)
|
||||
|
||||
|
||||
extern uint32_t
|
||||
hardware_threadlimit_get(void)
|
||||
hardware_threads_get(void)
|
||||
{
|
||||
return threadlimit;
|
||||
return threads_max;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +140,5 @@ hardware_init(void)
|
||||
|
||||
// Set the defaults.
|
||||
hardware_memlimit_set(0, true, true, false);
|
||||
hardware_threadlimit_set(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,11 @@
|
||||
extern void hardware_init(void);
|
||||
|
||||
|
||||
/// Set custom value for maximum number of coder threads.
|
||||
extern void hardware_threadlimit_set(uint32_t threadlimit);
|
||||
/// Set the maximum number of worker threads.
|
||||
extern void hardware_threads_set(uint32_t threadlimit);
|
||||
|
||||
/// Get the maximum number of coder threads. Some additional helper threads
|
||||
/// are allowed on top of this).
|
||||
extern uint32_t hardware_threadlimit_get(void);
|
||||
/// Get the maximum number of worker threads.
|
||||
extern uint32_t hardware_threads_get(void);
|
||||
|
||||
|
||||
/// Set the memory usage limit. There are separate limits for compression
|
||||
@@ -35,4 +34,4 @@ extern void hardware_memlimit_set(uint64_t new_memlimit,
|
||||
extern uint64_t hardware_memlimit_get(enum operation_mode mode);
|
||||
|
||||
/// Display the amount of RAM and memory usage limits and exit.
|
||||
extern void hardware_memlimit_show(void) lzma_attribute((noreturn));
|
||||
extern void hardware_memlimit_show(void) lzma_attribute((__noreturn__));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user