mirror of
https://github.com/PCSX2/xz.git
synced 2026-02-05 11:51:17 +01:00
Compare commits
149 Commits
v5.1.1alph
...
v5.1.3alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae222fe980 | ||
|
|
2193837a6a | ||
|
|
ed48e75e27 | ||
|
|
841da0352d | ||
|
|
56feb8665b | ||
|
|
ba413da1d5 | ||
|
|
0cd45fc2bc | ||
|
|
97bb38712f | ||
|
|
fef0c6b410 | ||
|
|
8083e03291 | ||
|
|
6b44b4a775 | ||
|
|
ae0ab74a88 | ||
|
|
72975df6c8 | ||
|
|
1c2b6e7e83 | ||
|
|
124eb69c78 | ||
|
|
eada8a875c | ||
|
|
be0100d01c | ||
|
|
416729e2d7 | ||
|
|
16581080e5 | ||
|
|
3e2b198ba3 | ||
|
|
dee6ad3d59 | ||
|
|
fa381acaf9 | ||
|
|
ea00545bea | ||
|
|
736903c64b | ||
|
|
24edf8d807 | ||
|
|
c0627b3fce | ||
|
|
1936718bb3 | ||
|
|
a37ae8b5eb | ||
|
|
cdba9ddd87 | ||
|
|
e61a5c95da | ||
|
|
9dc319eabb | ||
|
|
3541bc79d0 | ||
|
|
78673a08be | ||
|
|
a616fdad34 | ||
|
|
4a08a6e4c6 | ||
|
|
b790b435da | ||
|
|
84d2da6c9d | ||
|
|
9376f5f8f7 | ||
|
|
b7e200d7bd | ||
|
|
46540e4c10 | ||
|
|
ebb501ec73 | ||
|
|
c09e91dd23 | ||
|
|
eb6ca9854b | ||
|
|
0c0a1947e6 | ||
|
|
2fcda89939 | ||
|
|
97379c5ea7 | ||
|
|
8957c58609 | ||
|
|
ed886e1a92 | ||
|
|
5019413a05 | ||
|
|
5ea900cb5a | ||
|
|
bb117fffa8 | ||
|
|
e572e123b5 | ||
|
|
b465da5988 | ||
|
|
9e6dabcf22 | ||
|
|
e7b424d267 | ||
|
|
2ebbb994e3 | ||
|
|
4c7e28705f | ||
|
|
db5c1817fa | ||
|
|
65536214a3 | ||
|
|
3d93b63549 | ||
|
|
ab22562066 | ||
|
|
f3c1ec69d9 | ||
|
|
d8eaf9d827 | ||
|
|
96e08902b0 | ||
|
|
3778db1be5 | ||
|
|
d625c7cf82 | ||
|
|
0b09d266cc | ||
|
|
d6e0b23d46 | ||
|
|
19de545d86 | ||
|
|
672eccf57c | ||
|
|
cafb523ada | ||
|
|
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 |
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.
|
||||
|
||||
95
INSTALL
95
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,7 +64,14 @@ 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
|
||||
@@ -73,16 +82,18 @@ XZ Utils Installation
|
||||
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.
|
||||
|
||||
@@ -90,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
|
||||
@@ -100,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
|
||||
@@ -127,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
|
||||
@@ -286,16 +307,42 @@ XZ Utils Installation
|
||||
the amount of RAM on the operating system you use. See
|
||||
src/common/tuklib_physmem.c for details.
|
||||
|
||||
--disable-threads
|
||||
Disable threading support. This makes some things
|
||||
thread-unsafe, meaning that if multithreaded application
|
||||
calls liblzma functions from more than one thread,
|
||||
something bad may happen.
|
||||
--enable-threads=METHOD
|
||||
Threading support is enabled by default so normally there
|
||||
is no need to specify this option.
|
||||
|
||||
Use this option if threading support causes you trouble,
|
||||
or if you know that you will use liblzma only from
|
||||
single-threaded applications and want to avoid dependency
|
||||
on libpthread.
|
||||
Supported values for METHOD:
|
||||
|
||||
yes Autodetect the threading method. If none
|
||||
is found, configure will give an error.
|
||||
|
||||
posix Use POSIX pthreads. This is the default
|
||||
except on Windows outside Cygwin.
|
||||
|
||||
win95 Use Windows 95 compatible threads. This
|
||||
is compatible with Windows XP and later
|
||||
too. This is the default for 32-bit x86
|
||||
Windows builds. The `win95' threading is
|
||||
incompatible with --enable-small.
|
||||
|
||||
vista Use Windows Vista compatible threads. The
|
||||
resulting binaries won't run on Windows XP
|
||||
or older. This is the default for Windows
|
||||
excluding 32-bit x86 builds (that is, on
|
||||
x86-64 the default is `vista').
|
||||
|
||||
no Disable threading support. This is the
|
||||
same as using --disable-threads.
|
||||
NOTE: If combined with --enable-small, the
|
||||
resulting liblzma won't be thread safe,
|
||||
that is, if a multi-threaded application
|
||||
calls any liblzma functions from more than
|
||||
one thread, something bad may happen.
|
||||
|
||||
--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
|
||||
|
||||
17
Makefile.am
17
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,13 +32,22 @@ 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 \
|
||||
dos \
|
||||
windows \
|
||||
macosx \
|
||||
autogen.sh \
|
||||
Doxyfile.in \
|
||||
COPYING.GPLv2 \
|
||||
@@ -84,6 +96,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-`; \
|
||||
|
||||
197
NEWS
197
NEWS
@@ -2,6 +2,82 @@
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
5.1.3alpha (2013-10-26)
|
||||
|
||||
* All fixes from 5.0.5
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock in the threaded encoder.
|
||||
|
||||
- Made the uses of lzma_allocator const correct.
|
||||
|
||||
- Added lzma_block_uncomp_encode() to create uncompressed
|
||||
.xz Blocks using LZMA2 uncompressed chunks.
|
||||
|
||||
- Added support for native threads on Windows and the ability
|
||||
to detect the number of CPU cores.
|
||||
|
||||
* xz:
|
||||
|
||||
- Fixed a race condition in the signal handling. It was
|
||||
possible that e.g. the first SIGINT didn't make xz exit
|
||||
if reading or writing blocked and one had bad luck. The fix
|
||||
is non-trivial, so as of writing it is unknown if it will be
|
||||
backported to the v5.0 branch.
|
||||
|
||||
- Made the progress indicator work correctly in threaded mode.
|
||||
|
||||
- Threaded encoder now works together with --block-list=SIZES.
|
||||
|
||||
- Added preliminary support for --flush-timeout=TIMEOUT.
|
||||
It can be useful for (somewhat) real-time streaming. For
|
||||
now the decompression side has to be done with something
|
||||
else than the xz tool due to how xz does buffering, but this
|
||||
should be fixed.
|
||||
|
||||
|
||||
5.1.2alpha (2012-07-04)
|
||||
|
||||
* All fixes from 5.0.3 and 5.0.4
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fixed a deadlock and an invalid free() in the threaded encoder.
|
||||
|
||||
- Added support for symbol versioning. It is enabled by default
|
||||
on GNU/Linux, other GNU-based systems, and FreeBSD.
|
||||
|
||||
- Use SHA-256 implementation from the operating system if one is
|
||||
available in libc, libmd, or libutil. liblzma won't use e.g.
|
||||
OpenSSL or libgcrypt to avoid introducing new dependencies.
|
||||
|
||||
- Fixed liblzma.pc for static linking.
|
||||
|
||||
- Fixed a few portability bugs.
|
||||
|
||||
* xz --decompress --single-stream now fixes the input position after
|
||||
successful decompression. Now the following works:
|
||||
|
||||
echo foo | xz > foo.xz
|
||||
echo bar | xz >> foo.xz
|
||||
( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz
|
||||
|
||||
Note that it doesn't work if the input is not seekable
|
||||
or if there is Stream Padding between the concatenated
|
||||
.xz Streams.
|
||||
|
||||
* xz -lvv now shows the minimum xz version that is required to
|
||||
decompress the file. Currently it is 5.0.0 for all supported .xz
|
||||
files except files with empty LZMA2 streams require 5.0.2.
|
||||
|
||||
* Added an *incomplete* implementation of --block-list=SIZES to xz.
|
||||
It only works correctly in single-threaded mode and when
|
||||
--block-size isn't used at the same time. --block-list allows
|
||||
specifying the sizes of Blocks which can be useful e.g. when
|
||||
creating files for random-access reading.
|
||||
|
||||
|
||||
5.1.1alpha (2011-04-12)
|
||||
|
||||
* All fixes from 5.0.2
|
||||
@@ -45,6 +121,127 @@ XZ Utils Release Notes
|
||||
experimental and may change before it gets into a stable release.
|
||||
|
||||
|
||||
5.0.5 (2013-06-30)
|
||||
|
||||
* lzmadec and liblzma's lzma_alone_decoder(): Support decompressing
|
||||
.lzma files that have less common settings in the headers
|
||||
(dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed
|
||||
size greater than 256 GiB). The limitations existed to avoid false
|
||||
positives when detecting .lzma files. The lc + lp <= 4 limitation
|
||||
still remains since liblzma's LZMA decoder has that limitation.
|
||||
|
||||
NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT
|
||||
affected by this change. They still consider uncommon .lzma headers
|
||||
as not being in the .lzma format. Changing this would give way too
|
||||
many false positives.
|
||||
|
||||
* xz:
|
||||
|
||||
- Interaction of preset and custom filter chain options was
|
||||
made less illogical. This affects only certain less typical
|
||||
uses cases so few people are expected to notice this change.
|
||||
|
||||
Now when a custom filter chain option (e.g. --lzma2) is
|
||||
specified, all preset options (-0 ... -9, -e) earlier are on
|
||||
the command line are completely forgotten. Similarly, when
|
||||
a preset option is specified, all custom filter chain options
|
||||
earlier on the command line are completely forgotten.
|
||||
|
||||
Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e"
|
||||
which is equivalent to "xz -6e". Earlier -e didn't put xz back
|
||||
into preset mode and thus the example command was equivalent
|
||||
to "xz --lzma2=preset=5".
|
||||
|
||||
Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to
|
||||
"xz -7". Earlier a custom filter chain option didn't make
|
||||
xz forget the -e option so the example was equivalent to
|
||||
"xz -7e".
|
||||
|
||||
- Fixes and improvements to error handling.
|
||||
|
||||
- Various fixes to the man page.
|
||||
|
||||
* xzless: Fixed to work with "less" versions 448 and later.
|
||||
|
||||
* xzgrep: Made -h an alias for --no-filename.
|
||||
|
||||
* Include the previously missing debug/translation.bash which can
|
||||
be useful for translators.
|
||||
|
||||
* Include a build script for Mac OS X. This has been in the Git
|
||||
repository since 2010 but due to a mistake in Makefile.am the
|
||||
script hasn't been included in a release tarball before.
|
||||
|
||||
|
||||
5.0.4 (2012-06-22)
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fix lzma_index_init(). It could crash if memory allocation
|
||||
failed.
|
||||
|
||||
- Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ
|
||||
filter is used and the application only provides exactly as
|
||||
much output space as is the uncompressed size of the file.
|
||||
|
||||
- Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't
|
||||
check if the last call to lzma_code() really returned
|
||||
LZMA_STREAM_END, which made the program think that truncated
|
||||
files are valid.
|
||||
|
||||
- New example programs in doc/examples (old programs are now in
|
||||
doc/examples_old). These have more comments and more detailed
|
||||
error handling.
|
||||
|
||||
* Fix "xz -lvv foo.xz". It could crash on some corrupted files.
|
||||
|
||||
* Fix output of "xz --robot -lv" and "xz --robot -lvv" which
|
||||
incorrectly printed the filename also in the "foo (x/x)" format.
|
||||
|
||||
* Fix exit status of "xzdiff foo.xz bar.xz".
|
||||
|
||||
* Fix exit status of "xzgrep foo binary_file".
|
||||
|
||||
* Fix portability to EBCDIC systems.
|
||||
|
||||
* Fix a configure issue on AIX with the XL C compiler. See INSTALL
|
||||
for details.
|
||||
|
||||
* Update French, German, Italian, and Polish translations.
|
||||
|
||||
|
||||
5.0.3 (2011-05-21)
|
||||
|
||||
* liblzma fixes:
|
||||
|
||||
- A memory leak was fixed.
|
||||
|
||||
- lzma_stream_buffer_encode() no longer creates an empty .xz
|
||||
Block if encoding an empty buffer. Such an empty Block with
|
||||
LZMA2 data would trigger a bug in 5.0.1 and older (see the
|
||||
first bullet point in 5.0.2 notes). When releasing 5.0.2,
|
||||
I thought that no encoder creates this kind of files but
|
||||
I was wrong.
|
||||
|
||||
- Validate function arguments better in a few functions. Most
|
||||
importantly, specifying an unsupported integrity check to
|
||||
lzma_stream_buffer_encode() no longer creates a corrupt .xz
|
||||
file. Probably no application tries to do that, so this
|
||||
shouldn't be a big problem in practice.
|
||||
|
||||
- Document that lzma_block_buffer_encode(),
|
||||
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
|
||||
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
|
||||
|
||||
- The return values of the _memusage() functions are now
|
||||
documented better.
|
||||
|
||||
* Fix command name detection in xzgrep. xzegrep and xzfgrep now
|
||||
correctly use egrep and fgrep instead of grep.
|
||||
|
||||
* French translation was added.
|
||||
|
||||
|
||||
5.0.2 (2011-04-01)
|
||||
|
||||
* LZMA2 decompressor now correctly accepts LZMA2 streams with no
|
||||
|
||||
58
README
58
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
|
||||
@@ -206,15 +210,15 @@ XZ Utils
|
||||
# <Edit the .po file in the po directory.>
|
||||
make -C po update-po
|
||||
make install
|
||||
bash debug/translations.bash | less
|
||||
bash debug/translations.bash | less -S # For --list outputs
|
||||
bash debug/translation.bash | less
|
||||
bash debug/translation.bash | less -S # For --list outputs
|
||||
|
||||
Repeat the above as needed (no need to re-run configure though).
|
||||
|
||||
Note especially the following:
|
||||
|
||||
- The output of --help and --long-help must look nice on
|
||||
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,
|
||||
|
||||
22
THANKS
22
THANKS
@@ -6,63 +6,85 @@ Some people have helped more, some less, but nevertheless everyone's help
|
||||
has been important. :-) In alphabetical order:
|
||||
- Mark Adler
|
||||
- H. Peter Anvin
|
||||
- Jeff Bastian
|
||||
- Nelson H. F. Beebe
|
||||
- Karl 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
|
||||
- Christian Hesse
|
||||
- Peter Ivanov
|
||||
- Jouk Jansen
|
||||
- Per Øyvind Karlsen
|
||||
- Thomas Klausner
|
||||
- Richard Koch
|
||||
- Ville Koskinen
|
||||
- Jan Kratochvil
|
||||
- Christian Kujau
|
||||
- Stephan Kulow
|
||||
- Peter Lawler
|
||||
- Hin-Tak Leung
|
||||
- Andraž 'ruskie' Levstik
|
||||
- Cary Lewis
|
||||
- Wim Lewis
|
||||
- Lorenzo De Liso
|
||||
- Bela Lubkin
|
||||
- Gregory Margo
|
||||
- Jim Meyering
|
||||
- Arkadiusz Miskiewicz
|
||||
- Conley Moorhous
|
||||
- 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
|
||||
- Pavel Raiskup
|
||||
- Robert Readman
|
||||
- Bernhard Reutner-Fischer
|
||||
- Eric S. Raymond
|
||||
- Cristian Rodríguez
|
||||
- Christian von Roques
|
||||
- Jukka Salmi
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Vincent Torri
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Patrick J. Volkerding
|
||||
- Martin Väth
|
||||
- Christian Weisgerber
|
||||
- Bert Wesarg
|
||||
- Ralf Wildenhues
|
||||
|
||||
16
TODO
16
TODO
@@ -12,10 +12,6 @@ Known bugs
|
||||
it would be possible by switching from BT2/BT3/BT4 match finder to
|
||||
HC3/HC4.
|
||||
|
||||
The code to detect number of CPU cores doesn't count hyperthreading
|
||||
as multiple cores. In context of xz, it probably should.
|
||||
Hyperthreading is good at least with p7zip.
|
||||
|
||||
XZ Utils compress some files significantly worse than LZMA Utils.
|
||||
This is due to faster compression presets used by XZ Utils, and
|
||||
can often be worked around by using "xz --extreme". With some files
|
||||
@@ -32,10 +28,20 @@ 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.
|
||||
|
||||
@@ -53,8 +59,6 @@ Missing features
|
||||
It will be a separate library that supports uncompressed, .gz,
|
||||
.bz2, .lzma, and .xz files.
|
||||
|
||||
Check the first 0x00 byte of LZMA data.
|
||||
|
||||
Support changing lzma_options_lzma.mode with lzma_filters_update().
|
||||
|
||||
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
|
||||
|
||||
219
configure.ac
219
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
|
||||
|
||||
@@ -260,7 +260,7 @@ else
|
||||
done
|
||||
AC_MSG_RESULT([$enable_checks])
|
||||
fi
|
||||
if test "x$enable_checks_crc32" = xno ; then
|
||||
if test "x$enable_check_crc32" = xno ; then
|
||||
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
|
||||
fi
|
||||
|
||||
@@ -328,15 +328,48 @@ AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
|
||||
#############
|
||||
|
||||
AC_MSG_CHECKING([if threading support is wanted])
|
||||
AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads],
|
||||
[Disable threading support.
|
||||
This makes some things thread-unsafe.]),
|
||||
AC_ARG_ENABLE([threads], AC_HELP_STRING([--enable-threads=METHOD],
|
||||
[Supported METHODS are `yes', `no', `posix', `win95', and
|
||||
`vista'. The default is `yes'. Using `no' together with
|
||||
--enable-small makes liblzma thread unsafe.]),
|
||||
[], [enable_threads=yes])
|
||||
if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no'])
|
||||
|
||||
if test "x$enable_threads" = xyes; then
|
||||
case $host_os in
|
||||
mingw*)
|
||||
case $host_cpu in
|
||||
i?86) enable_threads=win95 ;;
|
||||
*) enable_threads=vista ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
enable_threads=posix
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT([$enable_threads])
|
||||
|
||||
case $enable_threads in
|
||||
posix | win95 | vista)
|
||||
AC_MSG_RESULT([yes, $enable_threads])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([--enable-threads only accepts
|
||||
\`yes', \`no', \`posix', \`win95', or \`vista'])
|
||||
;;
|
||||
esac
|
||||
|
||||
# The Win95 threading lacks thread-safe one-time initialization function.
|
||||
# It's better to disallow it instead of allowing threaded but thread-unsafe
|
||||
# build.
|
||||
if test "x$enable_small$enable_threads" = xyeswin95; then
|
||||
AC_MSG_ERROR([--enable-threads=win95 and --enable-small cannot be
|
||||
used at the same time])
|
||||
fi
|
||||
|
||||
# We use the actual result a little later.
|
||||
|
||||
|
||||
@@ -403,6 +436,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.
|
||||
###############################################################################
|
||||
@@ -416,7 +476,7 @@ fi
|
||||
echo
|
||||
echo "Initializing Automake:"
|
||||
|
||||
AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99])
|
||||
AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 serial-tests])
|
||||
AC_PROG_LN_S
|
||||
|
||||
AC_PROG_CC_C99
|
||||
@@ -428,16 +488,49 @@ AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
if test "x$enable_threads" = xyes; then
|
||||
echo
|
||||
echo "Threading support:"
|
||||
AX_PTHREAD
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
CC="$PTHREAD_CC"
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
fi
|
||||
AM_CONDITIONAL([COND_THREADS], [test "x$ax_pthread_ok" = xyes])
|
||||
case $enable_threads in
|
||||
posix)
|
||||
echo
|
||||
echo "POSIX threading support:"
|
||||
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
||||
dnl but it's tricky to get it right together with
|
||||
dnl AC_PROG_CC_C99. Thus, this is handled by telling the
|
||||
dnl user in INSTALL to set the correct CC manually.
|
||||
|
||||
AC_DEFINE([MYTHREAD_POSIX], [1],
|
||||
[Define to 1 when using POSIX threads (pthreads).])
|
||||
|
||||
# These are nice to have but not mandatory.
|
||||
#
|
||||
# FIXME: xz uses clock_gettime if it is available and can do
|
||||
# it even when threading is disabled. Moving this outside
|
||||
# of pthread detection may be undesirable because then
|
||||
# liblzma may get linked against librt even when librt isn't
|
||||
# needed by liblzma.
|
||||
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
|
||||
;;
|
||||
win95)
|
||||
AC_DEFINE([MYTHREAD_WIN95], [1], [Define to 1 when using
|
||||
Windows 95 (and thus XP) compatible threads.
|
||||
This avoids use of features that were added in
|
||||
Windows Vista.])
|
||||
;;
|
||||
vista)
|
||||
AC_DEFINE([MYTHREAD_VISTA], [1], [Define to 1 when using
|
||||
Windows Vista compatible threads. This uses
|
||||
features that are not available on Windows XP.])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL([COND_THREADS], [test "x$enable_threads" != xno])
|
||||
|
||||
echo
|
||||
echo "Initializing Libtool:"
|
||||
@@ -458,7 +551,7 @@ AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
|
||||
|
||||
echo
|
||||
echo "Initializing gettext:"
|
||||
AM_GNU_GETTEXT_VERSION([0.16.1])
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
###############################################################################
|
||||
@@ -496,7 +589,7 @@ AC_TYPE_UINTPTR_T
|
||||
AC_CHECK_SIZEOF([size_t])
|
||||
|
||||
# The command line tool can copy high resolution timestamps if such
|
||||
# information is availabe in struct stat. Otherwise one second accuracy
|
||||
# information is available in struct stat. Otherwise one second accuracy
|
||||
# is used.
|
||||
AC_CHECK_MEMBERS([
|
||||
struct stat.st_atim.tv_nsec,
|
||||
@@ -528,6 +621,60 @@ 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:
|
||||
@@ -561,6 +708,7 @@ if test "$GCC" = yes ; then
|
||||
for NEW_FLAG in \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wvla \
|
||||
-Wformat=2 \
|
||||
-Winit-self \
|
||||
-Wmissing-include-dirs \
|
||||
@@ -625,20 +773,19 @@ AC_CONFIG_FILES([
|
||||
po/Makefile.in
|
||||
lib/Makefile
|
||||
src/Makefile
|
||||
src/liblzma/liblzma.pc
|
||||
src/liblzma/Makefile
|
||||
src/liblzma/api/Makefile
|
||||
src/xz/Makefile
|
||||
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
|
||||
|
||||
@@ -651,9 +798,15 @@ 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
|
||||
|
||||
if test "x$enable_threads$enable_small" = xnoyes; then
|
||||
echo
|
||||
echo "NOTE:"
|
||||
echo "liblzma will be thread unsafe due the combination"
|
||||
echo "of --disable-threads --enable-small."
|
||||
fi
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
## You can do whatever you want with this file.
|
||||
##
|
||||
|
||||
EXTRA_DIST = \
|
||||
translation.bash
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
repeat \
|
||||
sync_flush \
|
||||
|
||||
@@ -3,7 +3,7 @@ Debug tools
|
||||
-----------
|
||||
|
||||
This directory contains a few tiny programs that may be helpful when
|
||||
debugging LZMA Utils.
|
||||
debugging XZ Utils.
|
||||
|
||||
These tools are not meant to be installed. Often one needs to edit
|
||||
the source code a little to make the programs do the wanted things.
|
||||
|
||||
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
|
||||
|
||||
@@ -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".
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# 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
|
||||
@@ -45,9 +49,12 @@
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# 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
|
||||
@@ -75,13 +82,12 @@
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 11
|
||||
#serial 18
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
@@ -139,8 +145,8 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
|
||||
# --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
|
||||
@@ -153,9 +159,9 @@ case "${host_cpu}-${host_os}" in
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
*-darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
@@ -171,12 +177,12 @@ for flag in $ax_pthread_flags; do
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
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`"
|
||||
;;
|
||||
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])
|
||||
@@ -198,16 +204,17 @@ for flag in $ax_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>
|
||||
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])
|
||||
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"
|
||||
@@ -230,12 +237,14 @@ if test "x$ax_pthread_ok" = xyes; then
|
||||
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,
|
||||
@@ -245,24 +254,41 @@ if test "x$ax_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
|
||||
@@ -279,5 +305,5 @@ else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
# This information is used by tuklib_cpucores.c.
|
||||
#
|
||||
# Supported methods:
|
||||
# - GetSystemInfo(): Windows (including Cygwin)
|
||||
# - sysctl(): BSDs, OS/2
|
||||
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, Cygwin
|
||||
# - sysconf(): GNU/Linux, Solaris, Tru64, IRIX, AIX, Cygwin (but
|
||||
# GetSystemInfo() is used on Cygwin)
|
||||
# - pstat_getdynamic(): HP-UX
|
||||
#
|
||||
# COPYING
|
||||
@@ -30,6 +32,19 @@ AC_CHECK_HEADERS([sys/param.h])
|
||||
AC_CACHE_CHECK([how to detect the number of available CPU cores],
|
||||
[tuklib_cv_cpucores_method], [
|
||||
|
||||
# Maybe checking $host_os would be enough but this matches what
|
||||
# tuklib_cpucores.c does.
|
||||
#
|
||||
# NOTE: IRIX has a compiler that doesn't error out with #error, so use
|
||||
# a non-compilable text instead of #error to generate an error.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
int main(void) { return 0; }
|
||||
#else
|
||||
compile error
|
||||
#endif
|
||||
]])], [tuklib_cv_cpucores_method=special], [
|
||||
|
||||
# Look for sysctl() solution first, because on OS/2, both sysconf()
|
||||
# and sysctl() pass the tests in this file, but only sysctl()
|
||||
# actually works.
|
||||
@@ -82,7 +97,7 @@ main(void)
|
||||
]])], [tuklib_cv_cpucores_method=pstat_getdynamic], [
|
||||
|
||||
tuklib_cv_cpucores_method=unknown
|
||||
])])])])
|
||||
])])])])])
|
||||
|
||||
case $tuklib_cv_cpucores_method in
|
||||
sysctl)
|
||||
|
||||
@@ -13,14 +13,26 @@ mkdir -p Resources
|
||||
# Abort immediately if something goes wrong.
|
||||
set -e
|
||||
|
||||
GCC="gcc-4.2"
|
||||
SDK="/Developer/SDKs/MacOSX10.5.sdk"
|
||||
MDT="10.5"
|
||||
GTT=i686-apple-darwin9
|
||||
|
||||
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
|
||||
ARCHES2="-arch ppc -arch i386"
|
||||
PKGFORMAT="10.5" # xar
|
||||
|
||||
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
|
||||
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
|
||||
|
||||
# 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
|
||||
CC="$GCC" \
|
||||
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
|
||||
|
||||
make
|
||||
|
||||
@@ -32,9 +44,9 @@ 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
|
||||
CC="$GCC" \
|
||||
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
|
||||
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
|
||||
|
||||
make -C src/liblzma
|
||||
make -C src/xzdec
|
||||
@@ -44,6 +56,19 @@ cp -a ../extra Root/usr/local/share/doc/xz
|
||||
|
||||
make distclean
|
||||
|
||||
# Move development files to different package
|
||||
|
||||
test -d liblzma && rm -r liblzma
|
||||
mkdir -p liblzma/usr/local
|
||||
|
||||
mv Root/usr/local/include liblzma/usr/local
|
||||
mv Root/usr/local/lib liblzma/usr/local
|
||||
|
||||
mkdir -p Root/usr/local/lib
|
||||
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
|
||||
mkdir -p liblzma/usr/local/share/doc/xz
|
||||
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
|
||||
|
||||
# Strip debugging symbols and make relocatable
|
||||
|
||||
for bin in xz lzmainfo xzdec lzmadec; do
|
||||
@@ -56,19 +81,12 @@ for lib in liblzma.5.dylib; do
|
||||
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 * )
|
||||
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
|
||||
|
||||
# Include documentation files for package
|
||||
|
||||
@@ -80,12 +98,15 @@ cp -p ../COPYING Resources/License.txt
|
||||
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
|
||||
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
|
||||
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
|
||||
|
||||
# Put the package in a disk image
|
||||
|
||||
if [ "$PKGFORMAT" != "10.5" ]; then
|
||||
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
|
||||
hdiutil internet-enable -yes -quiet XZ.dmg
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Build completed successfully."
|
||||
|
||||
@@ -1,4 +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"
|
||||
|
||||
283
po/pl.po
283
po/pl.po
@@ -1,13 +1,13 @@
|
||||
# Polish translation for xz.
|
||||
# This file is in the public domain.
|
||||
# Jakub Bogusz <qboosh@pld-linux.org>, 2011.
|
||||
# Jakub Bogusz <qboosh@pld-linux.org>, 2011-2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: xz 5.0.1\n"
|
||||
"Project-Id-Version: xz 5.1.1\n"
|
||||
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
|
||||
"POT-Creation-Date: 2011-01-28 20:01+0200\n"
|
||||
"PO-Revision-Date: 2011-02-02 16:51+0100\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"
|
||||
@@ -16,59 +16,69 @@ msgstr ""
|
||||
"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:333
|
||||
#: src/xz/args.c:338
|
||||
#, c-format
|
||||
msgid "%s: Unknown file format type"
|
||||
msgstr "%s: Nieznany typ formatu pliku"
|
||||
|
||||
#: 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: Nieobsługiwany typ kontroli spójności"
|
||||
|
||||
#: src/xz/args.c:382
|
||||
#: 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:445
|
||||
#: 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:95
|
||||
#: src/xz/coder.c:105
|
||||
msgid "Maximum number of filters is four"
|
||||
msgstr "Maksymalna liczba filtrów to cztery"
|
||||
|
||||
#: src/xz/coder.c:108
|
||||
#: 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:129
|
||||
#: 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:131
|
||||
#: 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:157
|
||||
#: 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:165
|
||||
#: 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:182
|
||||
#: 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:190
|
||||
#: 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: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 "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"
|
||||
@@ -83,118 +93,118 @@ msgstr "Skorygowano rozmiar słownika LZMA%c z %s MiB do %s MiB aby nie przekroc
|
||||
#. 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: Plik wygląda na przeniesiony, nie zostanie usunięty"
|
||||
|
||||
#: src/xz/file_io.c:144 src/xz/file_io.c:589
|
||||
#: 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:169
|
||||
#: 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:175
|
||||
#: 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:194
|
||||
#: 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: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: Jest dowiązaniem symbolicznym, pominięto"
|
||||
|
||||
#: src/xz/file_io.c:455
|
||||
#: 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:461
|
||||
#: 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:478
|
||||
#: 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:485
|
||||
#: 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:492
|
||||
#: 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:713
|
||||
#: 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:725
|
||||
#: 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:761 src/xz/file_io.c:945
|
||||
#: 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:820
|
||||
#: src/xz/file_io.c:883
|
||||
#, c-format
|
||||
msgid "%s: Read error: %s"
|
||||
msgstr "%s: Błąd odczytu: %s"
|
||||
|
||||
#: src/xz/file_io.c:843
|
||||
#: 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:853
|
||||
#: src/xz/file_io.c:916
|
||||
#, c-format
|
||||
msgid "%s: Unexpected end of file"
|
||||
msgstr "%s: Nieoczekiwany koniec pliku"
|
||||
|
||||
#: src/xz/file_io.c:903
|
||||
#: src/xz/file_io.c:966
|
||||
#, c-format
|
||||
msgid "%s: Write error: %s"
|
||||
msgstr "%s: Błąd zapisu: %s"
|
||||
|
||||
#: src/xz/hardware.c:100
|
||||
#: 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:119
|
||||
#: src/xz/hardware.c:120
|
||||
msgid "Total amount of physical memory (RAM): "
|
||||
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
|
||||
|
||||
#: src/xz/hardware.c:121
|
||||
#: src/xz/hardware.c:122
|
||||
msgid "Memory usage limit for compression: "
|
||||
msgstr "Limit użycia pamięci dla kompresji: "
|
||||
|
||||
#: src/xz/hardware.c:123
|
||||
#: 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:62
|
||||
#: src/xz/list.c:65
|
||||
msgid "None"
|
||||
msgstr "Brak"
|
||||
|
||||
@@ -203,60 +213,60 @@ msgstr "Brak"
|
||||
#. 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:69
|
||||
#: src/xz/list.c:72
|
||||
msgid "Unknown-2"
|
||||
msgstr "Nieznany-2"
|
||||
|
||||
#: src/xz/list.c:70
|
||||
#: src/xz/list.c:73
|
||||
msgid "Unknown-3"
|
||||
msgstr "Nieznany-3"
|
||||
|
||||
#: src/xz/list.c:72
|
||||
#: src/xz/list.c:75
|
||||
msgid "Unknown-5"
|
||||
msgstr "Nieznany-5"
|
||||
|
||||
#: src/xz/list.c:73
|
||||
#: src/xz/list.c:76
|
||||
msgid "Unknown-6"
|
||||
msgstr "Nieznany-6"
|
||||
|
||||
#: src/xz/list.c:74
|
||||
#: src/xz/list.c:77
|
||||
msgid "Unknown-7"
|
||||
msgstr "Nieznany-7"
|
||||
|
||||
#: src/xz/list.c:75
|
||||
#: src/xz/list.c:78
|
||||
msgid "Unknown-8"
|
||||
msgstr "Nieznany-8"
|
||||
|
||||
#: src/xz/list.c:76
|
||||
#: src/xz/list.c:79
|
||||
msgid "Unknown-9"
|
||||
msgstr "Nieznany-9"
|
||||
|
||||
#: src/xz/list.c:78
|
||||
#: src/xz/list.c:81
|
||||
msgid "Unknown-11"
|
||||
msgstr "Nieznany11"
|
||||
|
||||
#: src/xz/list.c:79
|
||||
#: src/xz/list.c:82
|
||||
msgid "Unknown-12"
|
||||
msgstr "Nieznany12"
|
||||
|
||||
#: src/xz/list.c:80
|
||||
#: src/xz/list.c:83
|
||||
msgid "Unknown-13"
|
||||
msgstr "Nieznany13"
|
||||
|
||||
#: src/xz/list.c:81
|
||||
#: src/xz/list.c:84
|
||||
msgid "Unknown-14"
|
||||
msgstr "Nieznany14"
|
||||
|
||||
#: src/xz/list.c:82
|
||||
#: src/xz/list.c:85
|
||||
msgid "Unknown-15"
|
||||
msgstr "Nieznany15"
|
||||
|
||||
#: src/xz/list.c:126
|
||||
#: src/xz/list.c:153
|
||||
#, c-format
|
||||
msgid "%s: File is empty"
|
||||
msgstr "%s: Plik jest pusty"
|
||||
|
||||
#: src/xz/list.c:131
|
||||
#: 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"
|
||||
@@ -265,41 +275,41 @@ msgstr "%s: Za mały na poprawny plik .xz"
|
||||
#. 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 "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
|
||||
|
||||
#: src/xz/list.c:652
|
||||
#: src/xz/list.c:685
|
||||
#, c-format
|
||||
msgid " Streams: %s\n"
|
||||
msgstr " Strumienie: %s\n"
|
||||
|
||||
#: src/xz/list.c:654
|
||||
#: src/xz/list.c:687
|
||||
#, c-format
|
||||
msgid " Blocks: %s\n"
|
||||
msgstr " Bloki: %s\n"
|
||||
|
||||
#: src/xz/list.c:656
|
||||
#: src/xz/list.c:689
|
||||
#, c-format
|
||||
msgid " Compressed size: %s\n"
|
||||
msgstr " Rozmiar spakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:659
|
||||
#: src/xz/list.c:692
|
||||
#, c-format
|
||||
msgid " Uncompressed size: %s\n"
|
||||
msgstr " Rozmiar rozpakowany: %s\n"
|
||||
|
||||
#: src/xz/list.c:662
|
||||
#: src/xz/list.c:695
|
||||
#, c-format
|
||||
msgid " Ratio: %s\n"
|
||||
msgstr " Współczynnik: %s\n"
|
||||
|
||||
#: src/xz/list.c:664
|
||||
#: src/xz/list.c:697
|
||||
#, c-format
|
||||
msgid " Check: %s\n"
|
||||
msgstr " Kontrola spójności: %s\n"
|
||||
|
||||
#: src/xz/list.c:665
|
||||
#: src/xz/list.c:698
|
||||
#, c-format
|
||||
msgid " Stream padding: %s\n"
|
||||
msgstr " Wyrównanie strumienia: %s\n"
|
||||
@@ -307,7 +317,7 @@ 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:693
|
||||
#: src/xz/list.c:726
|
||||
msgid ""
|
||||
" Streams:\n"
|
||||
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
|
||||
@@ -317,7 +327,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"
|
||||
@@ -333,32 +343,37 @@ 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 " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
|
||||
|
||||
#: 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 " Wymagana pamięć: %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 " Rozmiar w nagłówkach: %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 "Tak"
|
||||
|
||||
#: src/xz/list.c:841 src/xz/list.c:1010
|
||||
#: 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:986
|
||||
#: src/xz/list.c:1025
|
||||
#, c-format
|
||||
msgid "%s file\n"
|
||||
msgid_plural "%s files\n"
|
||||
@@ -366,20 +381,20 @@ msgstr[0] "%s plik\n"
|
||||
msgstr[1] "%s pliki\n"
|
||||
msgstr[2] "%s plików\n"
|
||||
|
||||
#: src/xz/list.c:999
|
||||
#: src/xz/list.c:1038
|
||||
msgid "Totals:"
|
||||
msgstr "Sumarycznie:"
|
||||
|
||||
#: src/xz/list.c:1000
|
||||
#: src/xz/list.c:1039
|
||||
#, c-format
|
||||
msgid " Number of files: %s\n"
|
||||
msgstr " Liczba plików: %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 działa tylko z plikami .xz (--format=xz lub --format=auto)"
|
||||
|
||||
#: src/xz/list.c:1078
|
||||
#: src/xz/list.c:1120
|
||||
msgid "--list does not support reading from standard input"
|
||||
msgstr "--list nie obsługuje odczytu ze standardowego wejścia"
|
||||
|
||||
@@ -406,58 +421,72 @@ msgstr "Kompresja i dekompresja z opcją --robot nie jest jeszcze obsługiwana."
|
||||
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"
|
||||
|
||||
#: src/xz/message.c:792 src/xz/message.c:842
|
||||
#. 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:799
|
||||
#: src/xz/message.c:803
|
||||
msgid "Cannot establish signal handlers"
|
||||
msgstr "Nie można ustawić obsługi sygnałów"
|
||||
|
||||
#: src/xz/message.c:808
|
||||
#: 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:811
|
||||
#: 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:818
|
||||
#: src/xz/message.c:822
|
||||
msgid "Memory usage limit reached"
|
||||
msgstr "Osiągnięto limit użycia pamięci"
|
||||
|
||||
#: src/xz/message.c:821
|
||||
#: src/xz/message.c:825
|
||||
msgid "File format not recognized"
|
||||
msgstr "Nie rozpoznany format pliku"
|
||||
|
||||
#: src/xz/message.c:824
|
||||
#: src/xz/message.c:828
|
||||
msgid "Unsupported options"
|
||||
msgstr "Nieobsługiwane opcje"
|
||||
|
||||
#: src/xz/message.c:827
|
||||
#: src/xz/message.c:831
|
||||
msgid "Compressed data is corrupt"
|
||||
msgstr "Dane skompresowane są uszkodzone"
|
||||
|
||||
#: src/xz/message.c:830
|
||||
#: src/xz/message.c:834
|
||||
msgid "Unexpected end of input"
|
||||
msgstr "Nieoczekiwany koniec wejścia"
|
||||
|
||||
#: src/xz/message.c:881
|
||||
#: 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:1048
|
||||
#: 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:1058
|
||||
#: 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:1084
|
||||
#: src/xz/message.c:1098
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Usage: %s [OPTION]... [FILE]...\n"
|
||||
@@ -468,17 +497,17 @@ msgstr ""
|
||||
"Kompresja lub dekompresja PLIKÓW w formacie .xz.\n"
|
||||
"\n"
|
||||
|
||||
#: src/xz/message.c:1091
|
||||
#: 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:1095
|
||||
#: src/xz/message.c:1109
|
||||
msgid " Operation mode:\n"
|
||||
msgstr " Tryb pracy:\n"
|
||||
|
||||
#: src/xz/message.c:1098
|
||||
#: src/xz/message.c:1112
|
||||
msgid ""
|
||||
" -z, --compress force compression\n"
|
||||
" -d, --decompress force decompression\n"
|
||||
@@ -490,7 +519,7 @@ msgstr ""
|
||||
" -t, --test sprawdzenie spójności plików skompresowanych\n"
|
||||
" -l, --list wypisanie informacji o plikach .xz"
|
||||
|
||||
#: src/xz/message.c:1104
|
||||
#: src/xz/message.c:1118
|
||||
msgid ""
|
||||
"\n"
|
||||
" Operation modifiers:\n"
|
||||
@@ -498,7 +527,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Modyfikatory operacji:\n"
|
||||
|
||||
#: src/xz/message.c:1107
|
||||
#: 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"
|
||||
@@ -508,7 +537,15 @@ msgstr ""
|
||||
" -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:1113
|
||||
#: 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"
|
||||
@@ -524,7 +561,7 @@ msgstr ""
|
||||
" 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:1121
|
||||
#: src/xz/message.c:1139
|
||||
msgid ""
|
||||
"\n"
|
||||
" Basic file format and compression options:\n"
|
||||
@@ -532,7 +569,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Podstawowe opcje formatu pliku i kompresji:\n"
|
||||
|
||||
#: src/xz/message.c:1123
|
||||
#: 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"
|
||||
@@ -544,7 +581,7 @@ msgstr ""
|
||||
" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n"
|
||||
" `crc32', `crc64' (domyślny) lub `sha256'"
|
||||
|
||||
#: src/xz/message.c:1130
|
||||
#: 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!"
|
||||
@@ -553,7 +590,7 @@ msgstr ""
|
||||
" użyciem wartości 7-9 należy wziąć pod uwagę wykorzystanie\n"
|
||||
" pamięci przy kompresji *oraz* dekompresji!"
|
||||
|
||||
#: src/xz/message.c:1134
|
||||
#: 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"
|
||||
@@ -562,7 +599,17 @@ msgstr ""
|
||||
" ilości czasu procesora; nie wpływa na wymagania\n"
|
||||
" pamięciowe dekompresora"
|
||||
|
||||
#: src/xz/message.c:1139
|
||||
#: 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"
|
||||
@@ -578,7 +625,7 @@ msgstr ""
|
||||
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
|
||||
" dla limitów domyślnych"
|
||||
|
||||
#: src/xz/message.c:1146
|
||||
#: 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"
|
||||
@@ -587,7 +634,7 @@ msgstr ""
|
||||
" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n"
|
||||
" ustawień"
|
||||
|
||||
#: src/xz/message.c:1152
|
||||
#: src/xz/message.c:1174
|
||||
msgid ""
|
||||
"\n"
|
||||
" Custom filter chain for compression (alternative for using presets):"
|
||||
@@ -595,7 +642,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):"
|
||||
|
||||
#: src/xz/message.c:1161
|
||||
#: src/xz/message.c:1183
|
||||
msgid ""
|
||||
"\n"
|
||||
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
|
||||
@@ -624,7 +671,7 @@ msgstr ""
|
||||
" mf=NAZWA dopasowywacz (hc3, hc4, bt2, bt3, bt4; bt4)\n"
|
||||
" depth=ILE maks. głębokość szukania; 0=auto (domyślne)"
|
||||
|
||||
#: src/xz/message.c:1176
|
||||
#: src/xz/message.c:1198
|
||||
msgid ""
|
||||
"\n"
|
||||
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
|
||||
@@ -646,7 +693,7 @@ msgstr ""
|
||||
" Poprawne OPCJE dla wszystkich filtrów BCJ:\n"
|
||||
" start=ILE offset początku konwersji (domyślnie=0)"
|
||||
|
||||
#: src/xz/message.c:1188
|
||||
#: src/xz/message.c:1210
|
||||
msgid ""
|
||||
"\n"
|
||||
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
|
||||
@@ -658,7 +705,7 @@ msgstr ""
|
||||
" dist=ILE odległość między bajtami odejmowanymi od\n"
|
||||
" siebie (1-256; 1)"
|
||||
|
||||
#: src/xz/message.c:1196
|
||||
#: src/xz/message.c:1218
|
||||
msgid ""
|
||||
"\n"
|
||||
" Other options:\n"
|
||||
@@ -666,7 +713,7 @@ msgstr ""
|
||||
"\n"
|
||||
" Inne opcje:\n"
|
||||
|
||||
#: src/xz/message.c:1199
|
||||
#: 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"
|
||||
@@ -674,15 +721,15 @@ 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:1204
|
||||
#: 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:1206
|
||||
#: 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:1209
|
||||
#: src/xz/message.c:1231
|
||||
msgid ""
|
||||
" --info-memory display the total amount of RAM and the currently active\n"
|
||||
" memory usage limits, and exit"
|
||||
@@ -690,7 +737,7 @@ 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:1212
|
||||
#: 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"
|
||||
@@ -698,7 +745,7 @@ 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:1216
|
||||
#: 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)"
|
||||
@@ -706,11 +753,11 @@ 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:1221
|
||||
#: 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:1223
|
||||
#: src/xz/message.c:1245
|
||||
msgid ""
|
||||
"\n"
|
||||
"With no FILE, or when FILE is -, read standard input.\n"
|
||||
@@ -722,7 +769,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:1229
|
||||
#: src/xz/message.c:1251
|
||||
#, c-format
|
||||
msgid "Report bugs to <%s> (in English or Finnish).\n"
|
||||
msgstr ""
|
||||
@@ -731,7 +778,7 @@ msgstr ""
|
||||
"Błędy w tłumaczeniu prosimy zgłaszać na adres\n"
|
||||
"<translation-team-pl@lists.sourceforge.net>.\n"
|
||||
|
||||
#: src/xz/message.c:1231
|
||||
#: src/xz/message.c:1253
|
||||
#, c-format
|
||||
msgid "%s home page: <%s>\n"
|
||||
msgstr "Strona domowa %s: <%s>\n"
|
||||
@@ -765,22 +812,22 @@ msgstr "Suma lc i lp nie może przekroczyć 4"
|
||||
msgid "The selected match finder requires at least nice=%<PRIu32>"
|
||||
msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%<PRIu32>"
|
||||
|
||||
#: src/xz/suffix.c:104 src/xz/suffix.c:189
|
||||
#: 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:124
|
||||
#: 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:179
|
||||
#: 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:230
|
||||
#: src/xz/suffix.c:393
|
||||
#, c-format
|
||||
msgid "%s: Invalid filename suffix"
|
||||
msgstr "%s: Błędne rozszerzenie nazwy pliku"
|
||||
|
||||
@@ -10,93 +10,215 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef MYTHREAD_H
|
||||
#define MYTHREAD_H
|
||||
|
||||
#include "sysdefs.h"
|
||||
|
||||
// If any type of threading is enabled, #define MYTHREAD_ENABLED.
|
||||
#if defined(MYTHREAD_POSIX) || defined(MYTHREAD_WIN95) \
|
||||
|| defined(MYTHREAD_VISTA)
|
||||
# define MYTHREAD_ENABLED 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
|
||||
#ifdef MYTHREAD_ENABLED
|
||||
|
||||
////////////////////////////////////////
|
||||
// Shared betewen all threading types //
|
||||
////////////////////////////////////////
|
||||
|
||||
// Locks a mutex for a duration of a block.
|
||||
//
|
||||
// Perform mythread_mutex_lock(&mutex) in the beginning of a block
|
||||
// and mythread_mutex_unlock(&mutex) at the end of the block. "break"
|
||||
// may be used to unlock the mutex and jump out of the block.
|
||||
// mythread_sync blocks may be nested.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// mythread_sync(mutex) {
|
||||
// foo();
|
||||
// if (some_error)
|
||||
// break; // Skips bar()
|
||||
// bar();
|
||||
// }
|
||||
//
|
||||
// At least GCC optimizes the loops completely away so it doesn't slow
|
||||
// things down at all compared to plain mythread_mutex_lock(&mutex)
|
||||
// and mythread_mutex_unlock(&mutex) calls.
|
||||
//
|
||||
#define mythread_sync(mutex) mythread_sync_helper1(mutex, __LINE__)
|
||||
#define mythread_sync_helper1(mutex, line) mythread_sync_helper2(mutex, line)
|
||||
#define mythread_sync_helper2(mutex, line) \
|
||||
for (unsigned int mythread_i_ ## line = 0; \
|
||||
mythread_i_ ## line \
|
||||
? (mythread_mutex_unlock(&(mutex)), 0) \
|
||||
: (mythread_mutex_lock(&(mutex)), 1); \
|
||||
mythread_i_ ## line = 1) \
|
||||
for (unsigned int mythread_j_ ## line = 0; \
|
||||
!mythread_j_ ## line; \
|
||||
mythread_j_ ## line = 1)
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(MYTHREAD_ENABLED)
|
||||
|
||||
//////////////////
|
||||
// No threading //
|
||||
//////////////////
|
||||
|
||||
// Calls the given function once. This isn't thread safe.
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#if !(defined(_WIN32) && !defined(__CYGWIN__))
|
||||
// Use sigprocmask() to set the signal mask in single-threaded programs.
|
||||
static inline void
|
||||
mythread_sigmask(int how, const sigset_t *restrict set,
|
||||
sigset_t *restrict oset)
|
||||
{
|
||||
int ret = sigprocmask(how, set, oset);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(MYTHREAD_POSIX)
|
||||
|
||||
////////////////////
|
||||
// Using pthreads //
|
||||
////////////////////
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define MYTHREAD_RET_TYPE void *
|
||||
#define MYTHREAD_RET_VALUE NULL
|
||||
|
||||
/// \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)
|
||||
|
||||
|
||||
/// \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 pthread_t mythread;
|
||||
typedef pthread_mutex_t mythread_mutex;
|
||||
|
||||
typedef struct {
|
||||
/// Condition variable
|
||||
pthread_cond_t cond;
|
||||
|
||||
/// Clock ID (CLOCK_REALTIME or CLOCK_MONOTONIC) associated with
|
||||
/// the condition variable
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
// Clock ID (CLOCK_REALTIME or CLOCK_MONOTONIC) associated with
|
||||
// the condition variable.
|
||||
clockid_t clk_id;
|
||||
|
||||
#endif
|
||||
} mythread_cond;
|
||||
|
||||
typedef struct timespec mythread_condtime;
|
||||
|
||||
/// \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.
|
||||
|
||||
// Calls the given function once in a thread-safe way.
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
|
||||
pthread_once(&once_, &func); \
|
||||
} while (0)
|
||||
|
||||
|
||||
// Use pthread_sigmask() to set the signal mask in multi-threaded programs.
|
||||
// Do nothing on OpenVMS since it lacks pthread_sigmask().
|
||||
static inline void
|
||||
mythread_sigmask(int how, const sigset_t *restrict set,
|
||||
sigset_t *restrict oset)
|
||||
{
|
||||
#ifdef __VMS
|
||||
(void)how;
|
||||
(void)set;
|
||||
(void)oset;
|
||||
#else
|
||||
int ret = pthread_sigmask(how, set, oset);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Creates a new thread with all signals blocked. Returns zero on success
|
||||
// and non-zero on error.
|
||||
static inline int
|
||||
mythread_create(mythread *thread, void *(*func)(void *arg), void *arg)
|
||||
{
|
||||
sigset_t old;
|
||||
sigset_t all;
|
||||
sigfillset(&all);
|
||||
|
||||
mythread_sigmask(SIG_SETMASK, &all, &old);
|
||||
const int ret = pthread_create(thread, NULL, func, arg);
|
||||
mythread_sigmask(SIG_SETMASK, &old, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Joins a thread. Returns zero on success and non-zero on error.
|
||||
static inline int
|
||||
mythread_join(mythread thread)
|
||||
{
|
||||
return pthread_join(thread, NULL);
|
||||
}
|
||||
|
||||
|
||||
// Initiatlizes a mutex. Returns zero on success and non-zero on error.
|
||||
static inline int
|
||||
mythread_mutex_init(mythread_mutex *mutex)
|
||||
{
|
||||
return pthread_mutex_init(mutex, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_destroy(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_destroy(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_lock(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_lock(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_unlock(mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_mutex_unlock(mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
|
||||
// Initializes a condition variable.
|
||||
//
|
||||
// Using CLOCK_MONOTONIC instead of the default CLOCK_REALTIME makes the
|
||||
// timeout in pthread_cond_timedwait() work correctly also if system time
|
||||
// is suddenly changed. Unfortunately CLOCK_MONOTONIC isn't available
|
||||
// everywhere while the default CLOCK_REALTIME is, so the default is
|
||||
// used if CLOCK_MONOTONIC isn't available.
|
||||
//
|
||||
// If clock_gettime() isn't available at all, gettimeofday() will be used.
|
||||
static inline int
|
||||
mythread_cond_init(mythread_cond *mycond)
|
||||
{
|
||||
#if defined(_POSIX_CLOCK_SELECTION) && defined(_POSIX_MONOTONIC_CLOCK)
|
||||
#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;
|
||||
|
||||
@@ -119,84 +241,279 @@ mythread_cond_init(mythread_cond *mycond)
|
||||
}
|
||||
|
||||
// If anything above fails, fall back to the default CLOCK_REALTIME.
|
||||
#endif
|
||||
// POSIX requires that all implementations of clock_gettime() must
|
||||
// support at least CLOCK_REALTIME.
|
||||
# endif
|
||||
|
||||
mycond->clk_id = CLOCK_REALTIME;
|
||||
#endif
|
||||
|
||||
return pthread_cond_init(&mycond->cond, NULL);
|
||||
}
|
||||
|
||||
|
||||
/// \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)
|
||||
mythread_cond_destroy(mythread_cond *cond)
|
||||
{
|
||||
struct timespec now;
|
||||
clock_gettime(mycond->clk_id, &now);
|
||||
int ret = pthread_cond_destroy(&cond->cond);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
ts->tv_sec += now.tv_sec;
|
||||
ts->tv_nsec += now.tv_nsec;
|
||||
static inline void
|
||||
mythread_cond_signal(mythread_cond *cond)
|
||||
{
|
||||
int ret = pthread_cond_signal(&cond->cond);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex)
|
||||
{
|
||||
int ret = pthread_cond_wait(&cond->cond, mutex);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
|
||||
// Waits on a condition or until a timeout expires. If the timeout expires,
|
||||
// non-zero is returned, otherwise zero is returned.
|
||||
static inline int
|
||||
mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex,
|
||||
const mythread_condtime *condtime)
|
||||
{
|
||||
int ret = pthread_cond_timedwait(&cond->cond, mutex, condtime);
|
||||
assert(ret == 0 || ret == ETIMEDOUT);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Sets condtime to the absolute time that is timeout_ms milliseconds
|
||||
// in the future. The type of the clock to use is taken from cond.
|
||||
static inline void
|
||||
mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond,
|
||||
uint32_t timeout_ms)
|
||||
{
|
||||
condtime->tv_sec = timeout_ms / 1000;
|
||||
condtime->tv_nsec = (timeout_ms % 1000) * 1000000;
|
||||
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
struct timespec now;
|
||||
int ret = clock_gettime(cond->clk_id, &now);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
|
||||
condtime->tv_sec += now.tv_sec;
|
||||
condtime->tv_nsec += now.tv_nsec;
|
||||
#else
|
||||
(void)cond;
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
condtime->tv_sec += now.tv_sec;
|
||||
condtime->tv_nsec += now.tv_usec * 1000L;
|
||||
#endif
|
||||
|
||||
// tv_nsec must stay in the range [0, 999_999_999].
|
||||
if (ts->tv_nsec >= 1000000000L) {
|
||||
ts->tv_nsec -= 1000000000L;
|
||||
++ts->tv_sec;
|
||||
if (condtime->tv_nsec >= 1000000000L) {
|
||||
condtime->tv_nsec -= 1000000000L;
|
||||
++condtime->tv_sec;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#define mythread_cond_wait(mycondptr, mutexptr) \
|
||||
pthread_cond_wait(&(mycondptr)->cond, mutexptr)
|
||||
#elif defined(MYTHREAD_WIN95) || defined(MYTHREAD_VISTA)
|
||||
|
||||
#define mythread_cond_timedwait(mycondptr, mutexptr, abstimeptr) \
|
||||
pthread_cond_timedwait(&(mycondptr)->cond, mutexptr, abstimeptr)
|
||||
/////////////////////
|
||||
// Windows threads //
|
||||
/////////////////////
|
||||
|
||||
#define mythread_cond_signal(mycondptr) \
|
||||
pthread_cond_signal(&(mycondptr)->cond)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifdef MYTHREAD_VISTA
|
||||
# undef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#define mythread_cond_broadcast(mycondptr) \
|
||||
pthread_cond_broadcast(&(mycondptr)->cond)
|
||||
#define MYTHREAD_RET_TYPE unsigned int __stdcall
|
||||
#define MYTHREAD_RET_VALUE 0
|
||||
|
||||
#define mythread_cond_destroy(mycondptr) \
|
||||
pthread_cond_destroy(&(mycondptr)->cond)
|
||||
typedef HANDLE mythread;
|
||||
typedef CRITICAL_SECTION mythread_mutex;
|
||||
|
||||
#ifdef MYTHREAD_WIN95
|
||||
typedef HANDLE mythread_cond;
|
||||
#else
|
||||
typedef CONDITION_VARIABLE mythread_cond;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
// Tick count (milliseconds) in the beginning of the timeout.
|
||||
// NOTE: This is 32 bits so it wraps around after 49.7 days.
|
||||
// Multi-day timeouts may not work as expected.
|
||||
DWORD start;
|
||||
|
||||
// Length of the timeout in milliseconds. The timeout expires
|
||||
// when the current tick count minus "start" is equal or greater
|
||||
// than "timeout".
|
||||
DWORD timeout;
|
||||
} mythread_condtime;
|
||||
|
||||
|
||||
// mythread_once() is only available with Vista threads.
|
||||
#ifdef MYTHREAD_VISTA
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static INIT_ONCE once_ = INIT_ONCE_STATIC_INIT; \
|
||||
BOOL pending_; \
|
||||
if (!InitOnceBeginInitialize(&once_, 0, &pending_, NULL)) \
|
||||
abort(); \
|
||||
if (pending_) \
|
||||
func(); \
|
||||
if (!InitOnceComplete(&once, 0, NULL)) \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
||||
// mythread_sigmask() isn't available on Windows. Even a dummy version would
|
||||
// make no sense because the other POSIX signal functions are missing anyway.
|
||||
|
||||
|
||||
/// \brief Create a thread with all signals blocked
|
||||
static inline int
|
||||
mythread_create(pthread_t *thread, void *(*func)(void *arg), void *arg)
|
||||
mythread_create(mythread *thread,
|
||||
unsigned int (__stdcall *func)(void *arg), void *arg)
|
||||
{
|
||||
sigset_t old;
|
||||
sigset_t all;
|
||||
sigfillset(&all);
|
||||
uintptr_t ret = _beginthreadex(NULL, 0, func, arg, 0, NULL);
|
||||
if (ret == 0)
|
||||
return -1;
|
||||
|
||||
pthread_sigmask(SIG_SETMASK, &all, &old);
|
||||
const int ret = pthread_create(thread, NULL, func, arg);
|
||||
pthread_sigmask(SIG_SETMASK, &old, NULL);
|
||||
*thread = (HANDLE)ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mythread_join(mythread thread)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0)
|
||||
ret = -1;
|
||||
|
||||
if (!CloseHandle(thread))
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
mythread_mutex_init(mythread_mutex *mutex)
|
||||
{
|
||||
InitializeCriticalSection(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_destroy(mythread_mutex *mutex)
|
||||
{
|
||||
DeleteCriticalSection(mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_lock(mythread_mutex *mutex)
|
||||
{
|
||||
EnterCriticalSection(mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_mutex_unlock(mythread_mutex *mutex)
|
||||
{
|
||||
LeaveCriticalSection(mutex);
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
mythread_cond_init(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
*cond = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
return *cond == NULL ? -1 : 0;
|
||||
#else
|
||||
InitializeConditionVariable(cond);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// No threading //
|
||||
//////////////////
|
||||
static inline void
|
||||
mythread_cond_destroy(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
CloseHandle(*cond);
|
||||
#else
|
||||
(void)cond;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define mythread_sigmask(how, set, oset) \
|
||||
sigprocmask(how, set, oset)
|
||||
static inline void
|
||||
mythread_cond_signal(mythread_cond *cond)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
SetEvent(*cond);
|
||||
#else
|
||||
WakeConditionVariable(cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_cond_wait(mythread_cond *cond, mythread_mutex *mutex)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
LeaveCriticalSection(mutex);
|
||||
WaitForSingleObject(*cond, INFINITE);
|
||||
EnterCriticalSection(mutex);
|
||||
#else
|
||||
BOOL ret = SleepConditionVariableCS(cond, mutex, INFINITE);
|
||||
assert(ret);
|
||||
(void)ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define mythread_once(func) \
|
||||
do { \
|
||||
static bool once_ = false; \
|
||||
if (!once_) { \
|
||||
func(); \
|
||||
once_ = true; \
|
||||
} \
|
||||
} while (0)
|
||||
static inline int
|
||||
mythread_cond_timedwait(mythread_cond *cond, mythread_mutex *mutex,
|
||||
const mythread_condtime *condtime)
|
||||
{
|
||||
#ifdef MYTHREAD_WIN95
|
||||
LeaveCriticalSection(mutex);
|
||||
#endif
|
||||
|
||||
DWORD elapsed = GetTickCount() - condtime->start;
|
||||
DWORD timeout = elapsed >= condtime->timeout
|
||||
? 0 : condtime->timeout - elapsed;
|
||||
|
||||
#ifdef MYTHREAD_WIN95
|
||||
DWORD ret = WaitForSingleObject(*cond, timeout);
|
||||
assert(ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT);
|
||||
|
||||
EnterCriticalSection(mutex);
|
||||
|
||||
return ret == WAIT_TIMEOUT;
|
||||
#else
|
||||
BOOL ret = SleepConditionVariableCS(cond, mutex, timeout);
|
||||
assert(ret || GetLastError() == ERROR_TIMEOUT);
|
||||
return !ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
mythread_condtime_set(mythread_condtime *condtime, const mythread_cond *cond,
|
||||
uint32_t timeout)
|
||||
{
|
||||
(void)cond;
|
||||
condtime->start = GetTickCount();
|
||||
condtime->timeout = timeout;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -12,7 +12,13 @@
|
||||
|
||||
#include "tuklib_cpucores.h"
|
||||
|
||||
#if defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# include <windows.h>
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
# ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
@@ -33,7 +39,12 @@ tuklib_cpucores(void)
|
||||
{
|
||||
uint32_t ret = 0;
|
||||
|
||||
#if defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
ret = sysinfo.dwNumberOfProcessors;
|
||||
|
||||
#elif defined(TUKLIB_CPUCORES_SYSCTL)
|
||||
int name[2] = { CTL_HW, HW_NCPU };
|
||||
int cpus;
|
||||
size_t cpus_size = sizeof(cpus);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ liblzma_la_CPPFLAGS = \
|
||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 5:99:0
|
||||
|
||||
EXTRA_DIST += liblzma.map validate_map.sh
|
||||
if COND_SYMVERS
|
||||
liblzma_la_LDFLAGS += \
|
||||
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
|
||||
endif
|
||||
|
||||
include $(srcdir)/common/Makefile.inc
|
||||
include $(srcdir)/check/Makefile.inc
|
||||
|
||||
@@ -88,3 +94,23 @@ endif
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = liblzma.pc
|
||||
EXTRA_DIST += liblzma.pc.in
|
||||
|
||||
pc_verbose = $(pc_verbose_@AM_V@)
|
||||
pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
|
||||
pc_verbose_0 = @echo " PC " $@;
|
||||
|
||||
liblzma.pc: $(srcdir)/liblzma.pc.in
|
||||
$(AM_V_at)rm -f $@
|
||||
$(pc_verbose)sed \
|
||||
-e 's,@prefix[@],$(prefix),g' \
|
||||
-e 's,@exec_prefix[@],$(exec_prefix),g' \
|
||||
-e 's,@libdir[@],$(libdir),g' \
|
||||
-e 's,@includedir[@],$(includedir),g' \
|
||||
-e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
|
||||
-e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
||||
-e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
|
||||
-e 's,@LIBS[@],$(LIBS),g' \
|
||||
< $< > $@ || { rm -f $@; exit 1; }
|
||||
|
||||
clean-local:
|
||||
rm -f liblzma.pc
|
||||
|
||||
@@ -240,12 +240,12 @@ typedef enum {
|
||||
/**
|
||||
* \brief The `action' argument for lzma_code()
|
||||
*
|
||||
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH,
|
||||
* the same `action' must is used until lzma_code() returns LZMA_STREAM_END.
|
||||
* Also, the amount of input (that is, strm->avail_in) must not be modified
|
||||
* by the application until lzma_code() returns LZMA_STREAM_END. Changing the
|
||||
* `action' or modifying the amount of input will make lzma_code() return
|
||||
* LZMA_PROG_ERROR.
|
||||
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER,
|
||||
* or LZMA_FINISH, the same `action' must is used until lzma_code() returns
|
||||
* LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must
|
||||
* not be modified by the application until lzma_code() returns
|
||||
* LZMA_STREAM_END. Changing the `action' or modifying the amount of input
|
||||
* will make lzma_code() return LZMA_PROG_ERROR.
|
||||
*/
|
||||
typedef enum {
|
||||
LZMA_RUN = 0,
|
||||
@@ -293,7 +293,7 @@ typedef enum {
|
||||
*
|
||||
* All the input data going to the current Block must have
|
||||
* been given to the encoder (the last bytes can still be
|
||||
* pending in* next_in). Call lzma_code() with LZMA_FULL_FLUSH
|
||||
* pending in *next_in). Call lzma_code() with LZMA_FULL_FLUSH
|
||||
* until it returns LZMA_STREAM_END. Then continue normally
|
||||
* with LZMA_RUN or finish the Stream with LZMA_FINISH.
|
||||
*
|
||||
@@ -302,6 +302,29 @@ typedef enum {
|
||||
* no unfinished Block, no empty Block is created.
|
||||
*/
|
||||
|
||||
LZMA_FULL_BARRIER = 4,
|
||||
/**<
|
||||
* \brief Finish encoding of the current Block
|
||||
*
|
||||
* This is like LZMA_FULL_FLUSH except that this doesn't
|
||||
* necessarily wait until all the input has been made
|
||||
* available via the output buffer. That is, lzma_code()
|
||||
* might return LZMA_STREAM_END as soon as all the input
|
||||
* has been consumed (avail_in == 0).
|
||||
*
|
||||
* LZMA_FULL_BARRIER is useful with a threaded encoder if
|
||||
* one wants to split the .xz Stream into Blocks at specific
|
||||
* offsets but doesn't care if the output isn't flushed
|
||||
* immediately. Using LZMA_FULL_BARRIER allows keeping
|
||||
* the threads busy while LZMA_FULL_FLUSH would make
|
||||
* lzma_code() wait until all the threads have finished
|
||||
* until more data could be passed to the encoder.
|
||||
*
|
||||
* With a lzma_stream initialized with the single-threaded
|
||||
* lzma_stream_encoder() or lzma_easy_encoder(),
|
||||
* LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH.
|
||||
*/
|
||||
|
||||
LZMA_FINISH = 3
|
||||
/**<
|
||||
* \brief Finish the coding operation
|
||||
@@ -456,7 +479,8 @@ typedef struct lzma_internal_s lzma_internal;
|
||||
*
|
||||
* Application may modify the values of total_in and total_out as it wants.
|
||||
* They are updated by liblzma to match the amount of data read and
|
||||
* written, but aren't used for anything else.
|
||||
* written but aren't used for anything else except as a possible return
|
||||
* values from lzma_get_progress().
|
||||
*/
|
||||
typedef struct {
|
||||
const uint8_t *next_in; /**< Pointer to the next input byte. */
|
||||
@@ -472,8 +496,10 @@ typedef struct {
|
||||
*
|
||||
* In most cases this is NULL which makes liblzma use
|
||||
* the standard malloc() and free().
|
||||
*
|
||||
* \note In 5.0.x this is not a const pointer.
|
||||
*/
|
||||
lzma_allocator *allocator;
|
||||
const lzma_allocator *allocator;
|
||||
|
||||
/** Internal state is not visible to applications. */
|
||||
lzma_internal *internal;
|
||||
@@ -554,6 +580,25 @@ extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action)
|
||||
extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get progress information
|
||||
*
|
||||
* In single-threaded mode, applications can get progress information from
|
||||
* strm->total_in and strm->total_out. In multi-threaded mode this is less
|
||||
* useful because a significant amount of both input and output data gets
|
||||
* buffered internally by liblzma. This makes total_in and total_out give
|
||||
* misleading information and also makes the progress indicator updates
|
||||
* non-smooth.
|
||||
*
|
||||
* This function gives realistic progress information also in multi-threaded
|
||||
* mode by taking into account the progress made by each thread. In
|
||||
* single-threaded mode *progress_in and *progress_out are set to
|
||||
* strm->total_in and strm->total_out, respectively.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_get_progress(lzma_stream *strm,
|
||||
uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the memory usage of decoder filter chain
|
||||
*
|
||||
|
||||
@@ -341,7 +341,7 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
|
||||
* block->header_size is invalid or block->filters is NULL.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block,
|
||||
lzma_allocator *allocator, const uint8_t *in)
|
||||
const lzma_allocator *allocator, const uint8_t *in)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -490,7 +490,25 @@ extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
|
||||
lzma_block *block, lzma_allocator *allocator,
|
||||
lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Single-call uncompress .xz Block encoder
|
||||
*
|
||||
* This is like lzma_block_buffer_encode() except this doesn't try to
|
||||
* compress the data and instead encodes the data using LZMA2 uncompressed
|
||||
* chunks. The required output buffer size can be determined with
|
||||
* lzma_block_buffer_bound().
|
||||
*
|
||||
* Since the data won't be compressed, this function ignores block->filters.
|
||||
* This function doesn't take lzma_allocator because this function doesn't
|
||||
* allocate any memory from the heap.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_uncomp_encode(lzma_block *block,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
@@ -524,7 +542,7 @@ extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_block_buffer_decode(
|
||||
lzma_block *block, lzma_allocator *allocator,
|
||||
lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow;
|
||||
|
||||
@@ -288,7 +288,8 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
|
||||
uint32_t preset, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
|
||||
@@ -436,7 +437,8 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
|
||||
lzma_filter *filters, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -585,7 +587,8 @@ extern LZMA_API(lzma_ret) lzma_alone_decoder(
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_stream_buffer_decode(
|
||||
uint64_t *memlimit, uint32_t flags, lzma_allocator *allocator,
|
||||
uint64_t *memlimit, uint32_t flags,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -116,8 +116,9 @@ extern LZMA_API(lzma_bool) lzma_filter_decoder_is_supported(lzma_vli id)
|
||||
* is not NULL.
|
||||
* - LZMA_PROG_ERROR: src or dest is NULL.
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filters_copy(const lzma_filter *src,
|
||||
lzma_filter *dest, lzma_allocator *allocator) lzma_nothrow;
|
||||
extern LZMA_API(lzma_ret) lzma_filters_copy(
|
||||
const lzma_filter *src, lzma_filter *dest,
|
||||
const lzma_allocator *allocator) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
@@ -256,7 +257,7 @@ extern LZMA_API(lzma_ret) lzma_filters_update(
|
||||
* won't necessarily meet that bound.)
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_raw_buffer_encode(
|
||||
const lzma_filter *filters, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size, uint8_t *out,
|
||||
size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
@@ -280,7 +281,7 @@ extern LZMA_API(lzma_ret) lzma_raw_buffer_encode(
|
||||
* which no data is written to is out[out_size].
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_raw_buffer_decode(
|
||||
const lzma_filter *filters, lzma_allocator *allocator,
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow;
|
||||
|
||||
@@ -356,7 +357,7 @@ extern LZMA_API(lzma_ret) lzma_properties_encode(
|
||||
* - LZMA_MEM_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_properties_decode(
|
||||
lzma_filter *filter, lzma_allocator *allocator,
|
||||
lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size) lzma_nothrow;
|
||||
|
||||
|
||||
@@ -419,6 +420,6 @@ extern LZMA_API(lzma_ret) lzma_filter_flags_encode(const lzma_filter *filter,
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_filter_flags_decode(
|
||||
lzma_filter *filter, lzma_allocator *allocator,
|
||||
lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -303,7 +303,7 @@ extern LZMA_API(uint64_t) lzma_index_memused(const lzma_index *i)
|
||||
* \return On success, a pointer to an empty initialized lzma_index is
|
||||
* returned. If allocation fails, NULL is returned.
|
||||
*/
|
||||
extern LZMA_API(lzma_index *) lzma_index_init(lzma_allocator *allocator)
|
||||
extern LZMA_API(lzma_index *) lzma_index_init(const lzma_allocator *allocator)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
@@ -312,8 +312,8 @@ extern LZMA_API(lzma_index *) lzma_index_init(lzma_allocator *allocator)
|
||||
*
|
||||
* If i is NULL, this does nothing.
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
lzma_nothrow;
|
||||
extern LZMA_API(void) lzma_index_end(
|
||||
lzma_index *i, const lzma_allocator *allocator) lzma_nothrow;
|
||||
|
||||
|
||||
/**
|
||||
@@ -341,7 +341,7 @@ extern LZMA_API(void) lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_append(
|
||||
lzma_index *i, lzma_allocator *allocator,
|
||||
lzma_index *i, const lzma_allocator *allocator,
|
||||
lzma_vli unpadded_size, lzma_vli uncompressed_size)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
@@ -564,8 +564,8 @@ extern LZMA_API(lzma_bool) lzma_index_iter_locate(
|
||||
* - LZMA_MEM_ERROR
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_cat(
|
||||
lzma_index *dest, lzma_index *src, lzma_allocator *allocator)
|
||||
extern LZMA_API(lzma_ret) lzma_index_cat(lzma_index *dest, lzma_index *src,
|
||||
const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -575,7 +575,7 @@ extern LZMA_API(lzma_ret) lzma_index_cat(
|
||||
* \return A copy of the lzma_index, or NULL if memory allocation failed.
|
||||
*/
|
||||
extern LZMA_API(lzma_index *) lzma_index_dup(
|
||||
const lzma_index *i, lzma_allocator *allocator)
|
||||
const lzma_index *i, const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -677,6 +677,6 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i,
|
||||
* - LZMA_PROG_ERROR
|
||||
*/
|
||||
extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i,
|
||||
uint64_t *memlimit, lzma_allocator *allocator,
|
||||
uint64_t *memlimit, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
lzma_nothrow;
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef struct lzma_index_hash_s lzma_index_hash;
|
||||
* pointer than the index_hash that was given as an argument.
|
||||
*/
|
||||
extern LZMA_API(lzma_index_hash *) lzma_index_hash_init(
|
||||
lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash *index_hash, const lzma_allocator *allocator)
|
||||
lzma_nothrow lzma_attr_warn_unused_result;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ extern LZMA_API(lzma_index_hash *) lzma_index_hash_init(
|
||||
* \brief Deallocate lzma_index_hash structure
|
||||
*/
|
||||
extern LZMA_API(void) lzma_index_hash_end(
|
||||
lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash *index_hash, const lzma_allocator *allocator)
|
||||
lzma_nothrow;
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
#define LZMA_VERSION_MAJOR 5
|
||||
#define LZMA_VERSION_MINOR 1
|
||||
#define LZMA_VERSION_PATCH 1
|
||||
#define LZMA_VERSION_PATCH 3
|
||||
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_ALPHA
|
||||
|
||||
#ifndef 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
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
/// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they
|
||||
/// are imported to liblzma, SSE instructions need to be used
|
||||
/// conditionally to keep the code working on older boxes.
|
||||
/// We could also support using some external libary for SHA-256.
|
||||
//
|
||||
// This code is based on the code found from 7-Zip, which has a modified
|
||||
// version of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>.
|
||||
|
||||
@@ -24,6 +24,7 @@ if COND_MAIN_ENCODER
|
||||
liblzma_la_SOURCES += \
|
||||
common/alone_encoder.c \
|
||||
common/block_buffer_encoder.c \
|
||||
common/block_buffer_encoder.h \
|
||||
common/block_encoder.c \
|
||||
common/block_encoder.h \
|
||||
common/block_header_encoder.c \
|
||||
|
||||
@@ -26,6 +26,11 @@ struct lzma_coder_s {
|
||||
SEQ_CODE,
|
||||
} sequence;
|
||||
|
||||
/// If true, reject files that are unlikely to be .lzma files.
|
||||
/// If false, more non-.lzma files get accepted and will give
|
||||
/// LZMA_DATA_ERROR either immediately or after a few output bytes.
|
||||
bool picky;
|
||||
|
||||
/// Position in the header fields
|
||||
size_t pos;
|
||||
|
||||
@@ -46,7 +51,7 @@ struct lzma_coder_s {
|
||||
|
||||
static lzma_ret
|
||||
alone_decode(lzma_coder *coder,
|
||||
lzma_allocator *allocator lzma_attribute((unused)),
|
||||
const 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,
|
||||
@@ -68,13 +73,13 @@ alone_decode(lzma_coder *coder,
|
||||
|= (size_t)(in[*in_pos]) << (coder->pos * 8);
|
||||
|
||||
if (++coder->pos == 4) {
|
||||
if (coder->options.dict_size != UINT32_MAX) {
|
||||
if (coder->picky && coder->options.dict_size
|
||||
!= UINT32_MAX) {
|
||||
// A hack to ditch tons of false positives:
|
||||
// We allow only dictionary sizes that are
|
||||
// 2^n or 2^n + 2^(n-1). LZMA_Alone created
|
||||
// only files with 2^n, but accepts any
|
||||
// dictionary size. If someone complains, this
|
||||
// will be reconsidered.
|
||||
// dictionary size.
|
||||
uint32_t d = coder->options.dict_size - 1;
|
||||
d |= d >> 2;
|
||||
d |= d >> 3;
|
||||
@@ -103,9 +108,9 @@ alone_decode(lzma_coder *coder,
|
||||
|
||||
// Another hack to ditch false positives: Assume that
|
||||
// if the uncompressed size is known, it must be less
|
||||
// than 256 GiB. Again, if someone complains, this
|
||||
// will be reconsidered.
|
||||
if (coder->uncompressed_size != LZMA_VLI_UNKNOWN
|
||||
// than 256 GiB.
|
||||
if (coder->picky
|
||||
&& coder->uncompressed_size != LZMA_VLI_UNKNOWN
|
||||
&& coder->uncompressed_size
|
||||
>= (LZMA_VLI_C(1) << 38))
|
||||
return LZMA_FORMAT_ERROR;
|
||||
@@ -161,7 +166,7 @@ alone_decode(lzma_coder *coder,
|
||||
|
||||
|
||||
static void
|
||||
alone_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
alone_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -188,8 +193,8 @@ alone_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
uint64_t memlimit)
|
||||
lzma_alone_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
uint64_t memlimit, bool picky)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator);
|
||||
|
||||
@@ -208,6 +213,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
}
|
||||
|
||||
next->coder->sequence = SEQ_PROPERTIES;
|
||||
next->coder->picky = picky;
|
||||
next->coder->pos = 0;
|
||||
next->coder->options.dict_size = 0;
|
||||
next->coder->options.preset_dict = NULL;
|
||||
@@ -223,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit)
|
||||
{
|
||||
lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit);
|
||||
lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false);
|
||||
|
||||
strm->internal->supported_actions[LZMA_RUN] = true;
|
||||
strm->internal->supported_actions[LZMA_FINISH] = true;
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
#include "common.h"
|
||||
|
||||
|
||||
extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, uint64_t memlimit);
|
||||
extern lzma_ret lzma_alone_decoder_init(
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
uint64_t memlimit, bool picky);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ struct lzma_coder_s {
|
||||
|
||||
static lzma_ret
|
||||
alone_encode(lzma_coder *coder,
|
||||
lzma_allocator *allocator lzma_attribute((unused)),
|
||||
const 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,
|
||||
@@ -65,7 +65,7 @@ alone_encode(lzma_coder *coder,
|
||||
|
||||
|
||||
static void
|
||||
alone_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
alone_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -75,7 +75,7 @@ alone_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
// At least for now, this is not used by any internal function.
|
||||
static lzma_ret
|
||||
alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
alone_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_options_lzma *options)
|
||||
{
|
||||
lzma_next_coder_init(&alone_encoder_init, next, allocator);
|
||||
@@ -137,7 +137,7 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
/*
|
||||
extern lzma_ret
|
||||
lzma_alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_alone_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_options_alone *options)
|
||||
{
|
||||
lzma_next_coder_init(&alone_encoder_init, next, allocator, options);
|
||||
|
||||
@@ -30,7 +30,7 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
static lzma_ret
|
||||
auto_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
auto_decode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -54,7 +54,7 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
coder->memlimit, coder->flags));
|
||||
} else {
|
||||
return_if_error(lzma_alone_decoder_init(&coder->next,
|
||||
allocator, coder->memlimit));
|
||||
allocator, coder->memlimit, true));
|
||||
|
||||
// If the application wants to know about missing
|
||||
// integrity check or about the check in general, we
|
||||
@@ -100,7 +100,7 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
auto_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
auto_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -143,7 +143,7 @@ auto_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
auto_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
auto_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
uint64_t memlimit, uint32_t flags)
|
||||
{
|
||||
lzma_next_coder_init(&auto_decoder_init, next, allocator);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator,
|
||||
lzma_block_buffer_decode(lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "block_buffer_encoder.h"
|
||||
#include "block_encoder.h"
|
||||
#include "filter_encoder.h"
|
||||
#include "lzma2_encoder.h"
|
||||
@@ -28,8 +29,8 @@
|
||||
+ LZMA_CHECK_SIZE_MAX + 3) & ~3)
|
||||
|
||||
|
||||
static lzma_vli
|
||||
lzma2_bound(lzma_vli uncompressed_size)
|
||||
static uint64_t
|
||||
lzma2_bound(uint64_t uncompressed_size)
|
||||
{
|
||||
// Prevent integer overflow in overhead calculation.
|
||||
if (uncompressed_size > COMPRESSED_SIZE_MAX)
|
||||
@@ -39,7 +40,7 @@ lzma2_bound(lzma_vli uncompressed_size)
|
||||
// uncompressed_size up to the next multiple of LZMA2_CHUNK_MAX,
|
||||
// multiply by the size of per-chunk header, and add one byte for
|
||||
// the end marker.
|
||||
const lzma_vli overhead = ((uncompressed_size + LZMA2_CHUNK_MAX - 1)
|
||||
const uint64_t overhead = ((uncompressed_size + LZMA2_CHUNK_MAX - 1)
|
||||
/ LZMA2_CHUNK_MAX)
|
||||
* LZMA2_HEADER_UNCOMPRESSED + 1;
|
||||
|
||||
@@ -51,30 +52,36 @@ lzma2_bound(lzma_vli uncompressed_size)
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(size_t)
|
||||
lzma_block_buffer_bound(size_t uncompressed_size)
|
||||
extern uint64_t
|
||||
lzma_block_buffer_bound64(uint64_t uncompressed_size)
|
||||
{
|
||||
// For now, if the data doesn't compress, we always use uncompressed
|
||||
// chunks of LZMA2. In future we may use Subblock filter too, but
|
||||
// but for simplicity we probably will still use the same bound
|
||||
// calculation even though Subblock filter would have slightly less
|
||||
// overhead.
|
||||
lzma_vli lzma2_size = lzma2_bound(uncompressed_size);
|
||||
// If the data doesn't compress, we always use uncompressed
|
||||
// LZMA2 chunks.
|
||||
uint64_t lzma2_size = lzma2_bound(uncompressed_size);
|
||||
if (lzma2_size == 0)
|
||||
return 0;
|
||||
|
||||
// Take Block Padding into account.
|
||||
lzma2_size = (lzma2_size + 3) & ~LZMA_VLI_C(3);
|
||||
lzma2_size = (lzma2_size + 3) & ~UINT64_C(3);
|
||||
|
||||
#if SIZE_MAX < LZMA_VLI_MAX
|
||||
// Catch the possible integer overflow on 32-bit systems. There's no
|
||||
// overflow on 64-bit systems, because lzma2_bound() already takes
|
||||
// No risk of integer overflow because lzma2_bound() already takes
|
||||
// into account the size of the headers in the Block.
|
||||
if (SIZE_MAX - HEADERS_BOUND < lzma2_size)
|
||||
return HEADERS_BOUND + lzma2_size;
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(size_t)
|
||||
lzma_block_buffer_bound(size_t uncompressed_size)
|
||||
{
|
||||
uint64_t ret = lzma_block_buffer_bound64(uncompressed_size);
|
||||
|
||||
#if SIZE_MAX < UINT64_MAX
|
||||
// Catch the possible integer overflow on 32-bit systems.
|
||||
if (ret > SIZE_MAX)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return HEADERS_BOUND + lzma2_size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,9 +89,6 @@ static lzma_ret
|
||||
block_encode_uncompressed(lzma_block *block, const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
// TODO: Figure out if the last filter is LZMA2 or Subblock and use
|
||||
// that filter to encode the uncompressed chunks.
|
||||
|
||||
// Use LZMA2 uncompressed chunks. We wouldn't need a dictionary at
|
||||
// all, but LZMA2 always requires a dictionary, so use the minimum
|
||||
// value to minimize memory usage of the decoder.
|
||||
@@ -160,16 +164,11 @@ block_encode_uncompressed(lzma_block *block, const uint8_t *in, size_t in_size,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
block_encode_normal(lzma_block *block, lzma_allocator *allocator,
|
||||
block_encode_normal(lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
// Find out the size of the Block Header.
|
||||
block->compressed_size = lzma2_bound(in_size);
|
||||
if (block->compressed_size == 0)
|
||||
return LZMA_DATA_ERROR;
|
||||
|
||||
block->uncompressed_size = in_size;
|
||||
return_if_error(lzma_block_header_size(block));
|
||||
|
||||
// Reserve space for the Block Header and skip it for now.
|
||||
@@ -221,10 +220,11 @@ block_encode_normal(lzma_block *block, lzma_allocator *allocator,
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
static lzma_ret
|
||||
block_buffer_encode(lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
uint8_t *out, size_t *out_pos, size_t out_size,
|
||||
bool try_to_compress)
|
||||
{
|
||||
// Validate the arguments.
|
||||
if (block == NULL || (in == NULL && in_size != 0) || out == NULL
|
||||
@@ -237,7 +237,7 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
return LZMA_OPTIONS_ERROR;
|
||||
|
||||
if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX
|
||||
|| block->filters == NULL)
|
||||
|| (try_to_compress && block->filters == NULL))
|
||||
return LZMA_PROG_ERROR;
|
||||
|
||||
if (!lzma_check_is_supported(block->check))
|
||||
@@ -258,9 +258,19 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
|
||||
out_size -= check_size;
|
||||
|
||||
// Initialize block->uncompressed_size and calculate the worst-case
|
||||
// value for block->compressed_size.
|
||||
block->uncompressed_size = in_size;
|
||||
block->compressed_size = lzma2_bound(in_size);
|
||||
if (block->compressed_size == 0)
|
||||
return LZMA_DATA_ERROR;
|
||||
|
||||
// Do the actual compression.
|
||||
const lzma_ret ret = block_encode_normal(block, allocator,
|
||||
in, in_size, out, out_pos, out_size);
|
||||
lzma_ret ret = LZMA_BUF_ERROR;
|
||||
if (try_to_compress)
|
||||
ret = block_encode_normal(block, allocator,
|
||||
in, in_size, out, out_pos, out_size);
|
||||
|
||||
if (ret != LZMA_OK) {
|
||||
// If the error was something else than output buffer
|
||||
// becoming full, return the error now.
|
||||
@@ -303,3 +313,25 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
|
||||
|
||||
return LZMA_OK;
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_block_buffer_encode(lzma_block *block, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
return block_buffer_encode(block, allocator,
|
||||
in, in_size, out, out_pos, out_size, true);
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_block_uncomp_encode(lzma_block *block,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
// It won't allocate any memory from heap so no need
|
||||
// for lzma_allocator.
|
||||
return block_buffer_encode(block, NULL,
|
||||
in, in_size, out, out_pos, out_size, false);
|
||||
}
|
||||
|
||||
24
src/liblzma/common/block_buffer_encoder.h
Normal file
24
src/liblzma/common/block_buffer_encoder.h
Normal file
@@ -0,0 +1,24 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/// \file block_buffer_encoder.h
|
||||
/// \brief Single-call .xz Block encoder
|
||||
//
|
||||
// Author: Lasse Collin
|
||||
//
|
||||
// This file has been put into the public domain.
|
||||
// You can do whatever you want with this file.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_BLOCK_BUFFER_ENCODER_H
|
||||
#define LZMA_BLOCK_BUFFER_ENCODER_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
/// uint64_t version of lzma_block_buffer_bound(). It is used by
|
||||
/// stream_encoder_mt.c. Probably the original lzma_block_buffer_bound()
|
||||
/// should have been 64-bit, but fixing it would break the ABI.
|
||||
extern uint64_t lzma_block_buffer_bound64(uint64_t uncompressed_size);
|
||||
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ is_size_valid(lzma_vli size, lzma_vli reference)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
block_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
block_decode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -170,7 +170,7 @@ block_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
block_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
block_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -179,7 +179,7 @@ block_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_block_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_block_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
lzma_block *block)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_block_decoder_init, next, allocator);
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
|
||||
|
||||
extern lzma_ret lzma_block_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, lzma_block *block);
|
||||
const lzma_allocator *allocator, lzma_block *block);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
static lzma_ret
|
||||
block_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
block_encode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -134,7 +134,7 @@ block_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
block_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -143,8 +143,8 @@ 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)),
|
||||
block_encoder_update(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
if (coder->sequence != SEQ_CODE)
|
||||
@@ -156,7 +156,7 @@ block_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_block_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_block_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
lzma_block *block)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_block_encoder_init, next, allocator);
|
||||
|
||||
@@ -42,6 +42,6 @@
|
||||
|
||||
|
||||
extern lzma_ret lzma_block_encoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, lzma_block *block);
|
||||
const lzma_allocator *allocator, lzma_block *block);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static void
|
||||
free_properties(lzma_block *block, lzma_allocator *allocator)
|
||||
free_properties(lzma_block *block, const lzma_allocator *allocator)
|
||||
{
|
||||
// Free allocated filter options. The last array member is not
|
||||
// touched after the initialization in the beginning of
|
||||
@@ -32,7 +32,7 @@ free_properties(lzma_block *block, lzma_allocator *allocator)
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_block_header_decode(lzma_block *block,
|
||||
lzma_allocator *allocator, const uint8_t *in)
|
||||
const lzma_allocator *allocator, const uint8_t *in)
|
||||
{
|
||||
// NOTE: We consider the header to be corrupt not only when the
|
||||
// CRC32 doesn't match, but also when variable-length integers
|
||||
|
||||
@@ -35,8 +35,8 @@ lzma_version_string(void)
|
||||
// Memory allocation //
|
||||
///////////////////////
|
||||
|
||||
extern void * lzma_attribute((malloc))
|
||||
lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||
extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
|
||||
lzma_alloc(size_t size, const lzma_allocator *allocator)
|
||||
{
|
||||
// Some malloc() variants return NULL if called with size == 0.
|
||||
if (size == 0)
|
||||
@@ -54,7 +54,7 @@ lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern void
|
||||
lzma_free(void *ptr, lzma_allocator *allocator)
|
||||
lzma_free(void *ptr, const lzma_allocator *allocator)
|
||||
{
|
||||
if (allocator != NULL && allocator->free != NULL)
|
||||
allocator->free(allocator->opaque, ptr);
|
||||
@@ -88,7 +88,7 @@ lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_next_filter_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_filter_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
lzma_next_coder_init(filters[0].init, next, allocator);
|
||||
@@ -99,7 +99,7 @@ lzma_next_filter_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_next_filter_update(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_filter_update(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
// Check that the application isn't trying to change the Filter ID.
|
||||
@@ -117,7 +117,7 @@ lzma_next_filter_update(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern void
|
||||
lzma_next_end(lzma_next_coder *next, lzma_allocator *allocator)
|
||||
lzma_next_end(lzma_next_coder *next, const lzma_allocator *allocator)
|
||||
{
|
||||
if (next->init != (uintptr_t)(NULL)) {
|
||||
// To avoid tiny end functions that simply call
|
||||
@@ -176,7 +176,7 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
|| (strm->next_out == NULL && strm->avail_out != 0)
|
||||
|| strm->internal == NULL
|
||||
|| strm->internal->next.code == NULL
|
||||
|| (unsigned int)(action) > LZMA_FINISH
|
||||
|| (unsigned int)(action) > LZMA_ACTION_MAX
|
||||
|| !strm->internal->supported_actions[action])
|
||||
return LZMA_PROG_ERROR;
|
||||
|
||||
@@ -211,6 +211,10 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
case LZMA_FINISH:
|
||||
strm->internal->sequence = ISEQ_FINISH;
|
||||
break;
|
||||
|
||||
case LZMA_FULL_BARRIER:
|
||||
strm->internal->sequence = ISEQ_FULL_BARRIER;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -238,6 +242,13 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
|
||||
break;
|
||||
|
||||
case ISEQ_FULL_BARRIER:
|
||||
if (action != LZMA_FULL_BARRIER
|
||||
|| strm->internal->avail_in != strm->avail_in)
|
||||
return LZMA_PROG_ERROR;
|
||||
|
||||
break;
|
||||
|
||||
case ISEQ_END:
|
||||
return LZMA_STREAM_END;
|
||||
|
||||
@@ -288,7 +299,9 @@ lzma_code(lzma_stream *strm, lzma_action action)
|
||||
|
||||
case LZMA_STREAM_END:
|
||||
if (strm->internal->sequence == ISEQ_SYNC_FLUSH
|
||||
|| strm->internal->sequence == ISEQ_FULL_FLUSH)
|
||||
|| strm->internal->sequence == ISEQ_FULL_FLUSH
|
||||
|| strm->internal->sequence
|
||||
== ISEQ_FULL_BARRIER)
|
||||
strm->internal->sequence = ISEQ_RUN;
|
||||
else
|
||||
strm->internal->sequence = ISEQ_END;
|
||||
@@ -328,6 +341,22 @@ lzma_end(lzma_stream *strm)
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(void)
|
||||
lzma_get_progress(lzma_stream *strm,
|
||||
uint64_t *progress_in, uint64_t *progress_out)
|
||||
{
|
||||
if (strm->internal->next.get_progress != NULL) {
|
||||
strm->internal->next.get_progress(strm->internal->next.coder,
|
||||
progress_in, progress_out);
|
||||
} else {
|
||||
*progress_in = strm->total_in;
|
||||
*progress_out = strm->total_out;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
extern LZMA_API(lzma_check)
|
||||
lzma_get_check(const lzma_stream *strm)
|
||||
{
|
||||
|
||||
@@ -78,6 +78,10 @@
|
||||
| LZMA_CONCATENATED )
|
||||
|
||||
|
||||
/// Largest valid lzma_action value as unsigned integer.
|
||||
#define LZMA_ACTION_MAX ((unsigned int)(LZMA_FULL_BARRIER))
|
||||
|
||||
|
||||
/// Special return value (lzma_ret) to indicate that a timeout was reached
|
||||
/// and lzma_code() must not return LZMA_BUF_ERROR. This is converted to
|
||||
/// LZMA_OK in lzma_code(). This is not in the lzma_ret enumeration because
|
||||
@@ -96,7 +100,7 @@ typedef struct lzma_filter_info_s lzma_filter_info;
|
||||
|
||||
/// Type of a function used to initialize a filter encoder or decoder
|
||||
typedef lzma_ret (*lzma_init_function)(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
/// Type of a function to do some kind of coding work (filters, Stream,
|
||||
@@ -104,7 +108,7 @@ typedef lzma_ret (*lzma_init_function)(
|
||||
/// input and output buffers, but for simplicity they still use this same
|
||||
/// function prototype.
|
||||
typedef lzma_ret (*lzma_code_function)(
|
||||
lzma_coder *coder, lzma_allocator *allocator,
|
||||
lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size,
|
||||
@@ -112,7 +116,7 @@ typedef lzma_ret (*lzma_code_function)(
|
||||
|
||||
/// Type of a function to free the memory allocated for the coder
|
||||
typedef void (*lzma_end_function)(
|
||||
lzma_coder *coder, lzma_allocator *allocator);
|
||||
lzma_coder *coder, const lzma_allocator *allocator);
|
||||
|
||||
|
||||
/// Raw coder validates and converts an array of lzma_filter structures to
|
||||
@@ -155,6 +159,11 @@ struct lzma_next_coder_s {
|
||||
/// lzma_next_coder.coder.
|
||||
lzma_end_function end;
|
||||
|
||||
/// Pointer to a function to get progress information. If this is NULL,
|
||||
/// lzma_stream.total_in and .total_out are used instead.
|
||||
void (*get_progress)(lzma_coder *coder,
|
||||
uint64_t *progress_in, uint64_t *progress_out);
|
||||
|
||||
/// Pointer to function to return the type of the integrity check.
|
||||
/// Most coders won't support this.
|
||||
lzma_check (*get_check)(const lzma_coder *coder);
|
||||
@@ -166,7 +175,7 @@ struct lzma_next_coder_s {
|
||||
|
||||
/// Update the filter-specific options or the whole filter chain
|
||||
/// in the encoder.
|
||||
lzma_ret (*update)(lzma_coder *coder, lzma_allocator *allocator,
|
||||
lzma_ret (*update)(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters,
|
||||
const lzma_filter *reversed_filters);
|
||||
};
|
||||
@@ -180,6 +189,7 @@ struct lzma_next_coder_s {
|
||||
.id = LZMA_VLI_UNKNOWN, \
|
||||
.code = NULL, \
|
||||
.end = NULL, \
|
||||
.get_progress = NULL, \
|
||||
.get_check = NULL, \
|
||||
.memconfig = NULL, \
|
||||
.update = NULL, \
|
||||
@@ -201,6 +211,7 @@ struct lzma_internal_s {
|
||||
ISEQ_SYNC_FLUSH,
|
||||
ISEQ_FULL_FLUSH,
|
||||
ISEQ_FINISH,
|
||||
ISEQ_FULL_BARRIER,
|
||||
ISEQ_END,
|
||||
ISEQ_ERROR,
|
||||
} sequence;
|
||||
@@ -211,7 +222,7 @@ struct lzma_internal_s {
|
||||
size_t avail_in;
|
||||
|
||||
/// Indicates which lzma_action values are allowed by next.code.
|
||||
bool supported_actions[4];
|
||||
bool supported_actions[LZMA_ACTION_MAX + 1];
|
||||
|
||||
/// If true, lzma_code will return LZMA_BUF_ERROR if no progress was
|
||||
/// made (no input consumed and no output produced by next.code).
|
||||
@@ -220,11 +231,11 @@ struct lzma_internal_s {
|
||||
|
||||
|
||||
/// Allocates memory
|
||||
extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||
lzma_attribute((malloc)) lzma_attr_alloc_size(1);
|
||||
extern void *lzma_alloc(size_t size, const lzma_allocator *allocator)
|
||||
lzma_attribute((__malloc__)) lzma_attr_alloc_size(1);
|
||||
|
||||
/// Frees memory
|
||||
extern void lzma_free(void *ptr, lzma_allocator *allocator);
|
||||
extern void lzma_free(void *ptr, const lzma_allocator *allocator);
|
||||
|
||||
|
||||
/// Allocates strm->internal if it is NULL, and initializes *strm and
|
||||
@@ -236,17 +247,19 @@ extern lzma_ret lzma_strm_init(lzma_stream *strm);
|
||||
/// than the filter being initialized now. This way the actual filter
|
||||
/// initialization functions don't need to use lzma_next_coder_init macro.
|
||||
extern lzma_ret lzma_next_filter_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
/// Update the next filter in the chain, if any. This checks that
|
||||
/// the application is not trying to change the Filter IDs.
|
||||
extern lzma_ret lzma_next_filter_update(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *reversed_filters);
|
||||
|
||||
/// Frees the memory allocated for next->coder either using next->end or,
|
||||
/// if next->end is NULL, using lzma_free.
|
||||
extern void lzma_next_end(lzma_next_coder *next, lzma_allocator *allocator);
|
||||
extern void lzma_next_end(lzma_next_coder *next,
|
||||
const lzma_allocator *allocator);
|
||||
|
||||
|
||||
/// Copy as much data as possible from in[] to out[] and update *in_pos
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_easy_buffer_encode(uint32_t preset, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
const lzma_allocator *allocator, const uint8_t *in,
|
||||
size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
lzma_options_easy opt_easy;
|
||||
if (lzma_easy_preset(&opt_easy, preset))
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_raw_buffer_decode(const lzma_filter *filters, lzma_allocator *allocator,
|
||||
lzma_raw_buffer_decode(
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_raw_buffer_encode(const lzma_filter *filters, lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size, uint8_t *out,
|
||||
size_t *out_pos, size_t out_size)
|
||||
lzma_raw_buffer_encode(
|
||||
const lzma_filter *filters, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
// Validate what isn't validated later in filter_common.c.
|
||||
if ((in == NULL && in_size != 0) || out == NULL
|
||||
|
||||
@@ -123,7 +123,7 @@ static const struct {
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_filters_copy(const lzma_filter *src, lzma_filter *dest,
|
||||
lzma_allocator *allocator)
|
||||
const lzma_allocator *allocator)
|
||||
{
|
||||
if (src == NULL || dest == NULL)
|
||||
return LZMA_PROG_ERROR;
|
||||
@@ -239,7 +239,7 @@ validate_chain(const lzma_filter *filters, size_t *count)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_raw_coder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_raw_coder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *options,
|
||||
lzma_filter_find coder_find, bool is_encoder)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
|
||||
|
||||
|
||||
extern lzma_ret lzma_raw_coder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters,
|
||||
lzma_filter_find coder_find, bool is_encoder);
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ typedef struct {
|
||||
/// \return - LZMA_OK: Properties decoded successfully.
|
||||
/// - LZMA_OPTIONS_ERROR: Unsupported properties
|
||||
/// - LZMA_MEM_ERROR: Memory allocation failed.
|
||||
lzma_ret (*props_decode)(void **options, lzma_allocator *allocator,
|
||||
lzma_ret (*props_decode)(
|
||||
void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size);
|
||||
|
||||
} lzma_filter_decoder;
|
||||
@@ -136,7 +137,7 @@ lzma_filter_decoder_is_supported(lzma_vli id)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_raw_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_raw_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *options)
|
||||
{
|
||||
return lzma_raw_coder_init(next, allocator,
|
||||
@@ -165,7 +166,7 @@ lzma_raw_decoder_memusage(const lzma_filter *filters)
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_properties_decode(lzma_filter *filter, lzma_allocator *allocator,
|
||||
lzma_properties_decode(lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size)
|
||||
{
|
||||
// Make it always NULL so that the caller can always safely free() it.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
extern lzma_ret lzma_raw_decoder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *options);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -196,7 +196,7 @@ lzma_filters_update(lzma_stream *strm, const lzma_filter *filters)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_raw_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_raw_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *options)
|
||||
{
|
||||
return lzma_raw_coder_init(next, allocator,
|
||||
|
||||
@@ -21,7 +21,7 @@ extern uint64_t lzma_mt_block_size(const lzma_filter *filters);
|
||||
|
||||
|
||||
extern lzma_ret lzma_raw_encoder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_filter_flags_decode(
|
||||
lzma_filter *filter, lzma_allocator *allocator,
|
||||
lzma_filter *filter, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
{
|
||||
// Set the pointer to NULL so the caller can always safely free it.
|
||||
|
||||
@@ -191,8 +191,8 @@ index_tree_init(index_tree *tree)
|
||||
|
||||
/// Helper for index_tree_end()
|
||||
static void
|
||||
index_tree_node_end(index_tree_node *node, lzma_allocator *allocator,
|
||||
void (*free_func)(void *node, lzma_allocator *allocator))
|
||||
index_tree_node_end(index_tree_node *node, const lzma_allocator *allocator,
|
||||
void (*free_func)(void *node, const lzma_allocator *allocator))
|
||||
{
|
||||
// The tree won't ever be very huge, so recursion should be fine.
|
||||
// 20 levels in the tree is likely quite a lot already in practice.
|
||||
@@ -215,8 +215,8 @@ index_tree_node_end(index_tree_node *node, lzma_allocator *allocator,
|
||||
/// to free the Record groups from each index_stream before freeing
|
||||
/// the index_stream itself.
|
||||
static void
|
||||
index_tree_end(index_tree *tree, lzma_allocator *allocator,
|
||||
void (*free_func)(void *node, lzma_allocator *allocator))
|
||||
index_tree_end(index_tree *tree, const lzma_allocator *allocator,
|
||||
void (*free_func)(void *node, const lzma_allocator *allocator))
|
||||
{
|
||||
if (tree->root != NULL)
|
||||
index_tree_node_end(tree->root, allocator, free_func);
|
||||
@@ -340,7 +340,7 @@ index_tree_locate(const index_tree *tree, lzma_vli target)
|
||||
static index_stream *
|
||||
index_stream_init(lzma_vli compressed_base, lzma_vli uncompressed_base,
|
||||
lzma_vli stream_number, lzma_vli block_number_base,
|
||||
lzma_allocator *allocator)
|
||||
const lzma_allocator *allocator)
|
||||
{
|
||||
index_stream *s = lzma_alloc(sizeof(index_stream), allocator);
|
||||
if (s == NULL)
|
||||
@@ -368,7 +368,7 @@ index_stream_init(lzma_vli compressed_base, lzma_vli uncompressed_base,
|
||||
|
||||
/// Free the memory allocated for a Stream and its Record groups.
|
||||
static void
|
||||
index_stream_end(void *node, lzma_allocator *allocator)
|
||||
index_stream_end(void *node, const lzma_allocator *allocator)
|
||||
{
|
||||
index_stream *s = node;
|
||||
index_tree_end(&s->groups, allocator, NULL);
|
||||
@@ -377,7 +377,7 @@ index_stream_end(void *node, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_index *
|
||||
index_init_plain(lzma_allocator *allocator)
|
||||
index_init_plain(const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_index *i = lzma_alloc(sizeof(lzma_index), allocator);
|
||||
if (i != NULL) {
|
||||
@@ -395,13 +395,16 @@ index_init_plain(lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern LZMA_API(lzma_index *)
|
||||
lzma_index_init(lzma_allocator *allocator)
|
||||
lzma_index_init(const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_index *i = index_init_plain(allocator);
|
||||
if (i == NULL)
|
||||
return NULL;
|
||||
|
||||
index_stream *s = index_stream_init(0, 0, 1, 0, allocator);
|
||||
if (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);
|
||||
@@ -411,7 +414,7 @@ lzma_index_init(lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern LZMA_API(void)
|
||||
lzma_index_end(lzma_index *i, lzma_allocator *allocator)
|
||||
lzma_index_end(lzma_index *i, const lzma_allocator *allocator)
|
||||
{
|
||||
// NOTE: If you modify this function, check also the bottom
|
||||
// of lzma_index_cat().
|
||||
@@ -634,7 +637,7 @@ lzma_index_stream_padding(lzma_index *i, lzma_vli stream_padding)
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_index_append(lzma_index *i, lzma_allocator *allocator,
|
||||
lzma_index_append(lzma_index *i, const lzma_allocator *allocator,
|
||||
lzma_vli unpadded_size, lzma_vli uncompressed_size)
|
||||
{
|
||||
// Validate.
|
||||
@@ -762,7 +765,7 @@ index_cat_helper(const index_cat_info *info, index_stream *this)
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src,
|
||||
lzma_allocator *allocator)
|
||||
const lzma_allocator *allocator)
|
||||
{
|
||||
const lzma_vli dest_file_size = lzma_index_file_size(dest);
|
||||
|
||||
@@ -856,7 +859,7 @@ lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src,
|
||||
|
||||
/// Duplicate an index_stream.
|
||||
static index_stream *
|
||||
index_dup_stream(const index_stream *src, lzma_allocator *allocator)
|
||||
index_dup_stream(const index_stream *src, const lzma_allocator *allocator)
|
||||
{
|
||||
// Catch a somewhat theoretical integer overflow.
|
||||
if (src->record_count > PREALLOC_MAX)
|
||||
@@ -916,7 +919,7 @@ index_dup_stream(const index_stream *src, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern LZMA_API(lzma_index *)
|
||||
lzma_index_dup(const lzma_index *src, lzma_allocator *allocator)
|
||||
lzma_index_dup(const lzma_index *src, const lzma_allocator *allocator)
|
||||
{
|
||||
// Allocate the base structure (no initial Stream).
|
||||
lzma_index *dest = index_init_plain(allocator);
|
||||
|
||||
@@ -54,12 +54,13 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
static lzma_ret
|
||||
index_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
index_decode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out lzma_attribute((unused)),
|
||||
size_t *restrict out_pos lzma_attribute((unused)),
|
||||
size_t out_size lzma_attribute((unused)),
|
||||
lzma_action action lzma_attribute((unused)))
|
||||
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;
|
||||
@@ -206,7 +207,7 @@ out:
|
||||
|
||||
|
||||
static void
|
||||
index_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
index_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_index_end(coder->index, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -233,7 +234,7 @@ index_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
index_decoder_reset(lzma_coder *coder, lzma_allocator *allocator,
|
||||
index_decoder_reset(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
lzma_index **i, uint64_t memlimit)
|
||||
{
|
||||
// Remember the pointer given by the application. We will set it
|
||||
@@ -260,7 +261,7 @@ index_decoder_reset(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
index_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
lzma_index **i, uint64_t memlimit)
|
||||
{
|
||||
lzma_next_coder_init(&index_decoder_init, next, allocator);
|
||||
@@ -298,8 +299,8 @@ lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit)
|
||||
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_index_buffer_decode(
|
||||
lzma_index **i, uint64_t *memlimit, lzma_allocator *allocator,
|
||||
lzma_index_buffer_decode(lzma_index **i, uint64_t *memlimit,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||
{
|
||||
// Sanity checks
|
||||
|
||||
@@ -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)),
|
||||
const lzma_allocator *allocator lzma_attribute((__unused__)),
|
||||
const uint8_t *restrict in lzma_attribute((__unused__)),
|
||||
size_t *restrict in_pos lzma_attribute((__unused__)),
|
||||
size_t in_size lzma_attribute((__unused__)),
|
||||
uint8_t *restrict out, size_t *restrict out_pos,
|
||||
size_t out_size, lzma_action action lzma_attribute((unused)))
|
||||
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().
|
||||
@@ -158,7 +159,7 @@ out:
|
||||
|
||||
|
||||
static void
|
||||
index_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
index_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_free(coder, allocator);
|
||||
return;
|
||||
@@ -180,7 +181,7 @@ index_encoder_reset(lzma_coder *coder, const lzma_index *i)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_index_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_index_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_index *i)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_index_encoder_init, next, allocator);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
extern lzma_ret lzma_index_encoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_index *i);
|
||||
const lzma_allocator *allocator, const lzma_index *i);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,8 @@ struct lzma_index_hash_s {
|
||||
|
||||
|
||||
extern LZMA_API(lzma_index_hash *)
|
||||
lzma_index_hash_init(lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash_init(lzma_index_hash *index_hash,
|
||||
const lzma_allocator *allocator)
|
||||
{
|
||||
if (index_hash == NULL) {
|
||||
index_hash = lzma_alloc(sizeof(lzma_index_hash), allocator);
|
||||
@@ -101,7 +102,8 @@ lzma_index_hash_init(lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern LZMA_API(void)
|
||||
lzma_index_hash_end(lzma_index_hash *index_hash, lzma_allocator *allocator)
|
||||
lzma_index_hash_end(lzma_index_hash *index_hash,
|
||||
const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_free(index_hash, allocator);
|
||||
return;
|
||||
|
||||
@@ -54,7 +54,7 @@ lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
|
||||
lzma_outq_init(lzma_outq *outq, const lzma_allocator *allocator,
|
||||
uint64_t buf_size_max, uint32_t threads)
|
||||
{
|
||||
uint64_t bufs_alloc_size;
|
||||
@@ -98,10 +98,14 @@ lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern void
|
||||
lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator)
|
||||
lzma_outq_end(lzma_outq *outq, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_free(outq->bufs, allocator);
|
||||
outq->bufs = NULL;
|
||||
|
||||
lzma_free(outq->bufs_mem, allocator);
|
||||
outq->bufs_mem = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,12 +87,13 @@ extern uint64_t lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads);
|
||||
/// \return - LZMA_OK
|
||||
/// - LZMA_MEM_ERROR
|
||||
///
|
||||
extern lzma_ret lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
|
||||
extern lzma_ret lzma_outq_init(
|
||||
lzma_outq *outq, const 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);
|
||||
extern void lzma_outq_end(lzma_outq *outq, const lzma_allocator *allocator);
|
||||
|
||||
|
||||
/// \brief Get a new buffer
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_stream_buffer_decode(uint64_t *memlimit, uint32_t flags,
|
||||
lzma_allocator *allocator,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos, size_t out_size)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,8 @@ lzma_stream_buffer_bound(size_t uncompressed_size)
|
||||
|
||||
extern LZMA_API(lzma_ret)
|
||||
lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
|
||||
lzma_allocator *allocator, const uint8_t *in, size_t in_size,
|
||||
const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t in_size,
|
||||
uint8_t *out, size_t *out_pos_ptr, size_t out_size)
|
||||
{
|
||||
// Sanity checks
|
||||
|
||||
@@ -80,7 +80,7 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_decoder_reset(lzma_coder *coder, lzma_allocator *allocator)
|
||||
stream_decoder_reset(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
// Initialize the Index hash used to verify the Index.
|
||||
coder->index_hash = lzma_index_hash_init(coder->index_hash, allocator);
|
||||
@@ -96,7 +96,7 @@ stream_decoder_reset(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
stream_decode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -366,7 +366,7 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
stream_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
stream_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->block_decoder, allocator);
|
||||
lzma_index_hash_end(coder->index_hash, allocator);
|
||||
@@ -401,7 +401,8 @@ stream_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_stream_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_stream_decoder_init(
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
uint64_t memlimit, uint32_t flags)
|
||||
{
|
||||
lzma_next_coder_init(&lzma_stream_decoder_init, next, allocator);
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
extern lzma_ret lzma_stream_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, uint64_t memlimit, uint32_t flags);
|
||||
extern lzma_ret lzma_stream_decoder_init(
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
uint64_t memlimit, uint32_t flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
static lzma_ret
|
||||
block_encoder_init(lzma_coder *coder, lzma_allocator *allocator)
|
||||
block_encoder_init(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
// Prepare the Block options. Even though Block encoder doesn't need
|
||||
// compressed_size, uncompressed_size, and header_size to be
|
||||
@@ -78,7 +78,7 @@ block_encoder_init(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
stream_encode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -146,11 +146,12 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
}
|
||||
|
||||
case SEQ_BLOCK_ENCODE: {
|
||||
static const lzma_action convert[4] = {
|
||||
static const lzma_action convert[LZMA_ACTION_MAX + 1] = {
|
||||
LZMA_RUN,
|
||||
LZMA_SYNC_FLUSH,
|
||||
LZMA_FINISH,
|
||||
LZMA_FINISH,
|
||||
LZMA_FINISH,
|
||||
};
|
||||
|
||||
const lzma_ret ret = coder->block_encoder.code(
|
||||
@@ -208,7 +209,7 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
stream_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
stream_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->block_encoder, allocator);
|
||||
lzma_next_end(&coder->index_encoder, allocator);
|
||||
@@ -223,7 +224,7 @@ stream_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
stream_encoder_update(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters,
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
@@ -262,7 +263,7 @@ stream_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
stream_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters, lzma_check check)
|
||||
{
|
||||
lzma_next_coder_init(&stream_encoder_init, next, allocator);
|
||||
@@ -324,6 +325,7 @@ lzma_stream_encoder(lzma_stream *strm,
|
||||
strm->internal->supported_actions[LZMA_RUN] = true;
|
||||
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
|
||||
strm->internal->supported_actions[LZMA_FULL_FLUSH] = true;
|
||||
strm->internal->supported_actions[LZMA_FULL_BARRIER] = true;
|
||||
strm->internal->supported_actions[LZMA_FINISH] = true;
|
||||
|
||||
return LZMA_OK;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "filter_encoder.h"
|
||||
#include "easy_preset.h"
|
||||
#include "block_encoder.h"
|
||||
#include "block_buffer_encoder.h"
|
||||
#include "index_encoder.h"
|
||||
#include "outqueue.h"
|
||||
|
||||
@@ -69,7 +70,13 @@ struct worker_thread_s {
|
||||
/// The allocator is set by the main thread. Since a copy of the
|
||||
/// pointer is kept here, the application must not change the
|
||||
/// allocator before calling lzma_end().
|
||||
lzma_allocator *allocator;
|
||||
const lzma_allocator *allocator;
|
||||
|
||||
/// Amount of uncompressed data that has already been compressed.
|
||||
uint64_t progress_in;
|
||||
|
||||
/// Amount of compressed data that is ready.
|
||||
uint64_t progress_out;
|
||||
|
||||
/// Block encoder
|
||||
lzma_next_coder block_encoder;
|
||||
@@ -80,12 +87,12 @@ struct worker_thread_s {
|
||||
/// Next structure in the stack of free worker threads.
|
||||
worker_thread *next;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
mythread_mutex mutex;
|
||||
mythread_cond cond;
|
||||
|
||||
/// The ID of this thread is used to join the thread
|
||||
/// when it's not needed anymore.
|
||||
pthread_t thread_id;
|
||||
mythread thread_id;
|
||||
};
|
||||
|
||||
|
||||
@@ -126,12 +133,9 @@ struct lzma_coder_s {
|
||||
lzma_outq outq;
|
||||
|
||||
|
||||
/// True if wait_max is used.
|
||||
bool has_timeout;
|
||||
|
||||
/// Maximum wait time if cannot use all the input and cannot
|
||||
/// fill the output buffer.
|
||||
struct timespec wait_max;
|
||||
/// fill the output buffer. This is in milliseconds.
|
||||
uint32_t timeout;
|
||||
|
||||
|
||||
/// Error code from a worker thread
|
||||
@@ -157,7 +161,17 @@ struct lzma_coder_s {
|
||||
/// the new input from the application.
|
||||
worker_thread *thr;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
/// Amount of uncompressed data in Blocks that have already
|
||||
/// been finished.
|
||||
uint64_t progress_in;
|
||||
|
||||
/// Amount of compressed data in Stream Header + Blocks that
|
||||
/// have already been finished.
|
||||
uint64_t progress_out;
|
||||
|
||||
|
||||
mythread_mutex mutex;
|
||||
mythread_cond cond;
|
||||
};
|
||||
|
||||
@@ -183,6 +197,9 @@ worker_error(worker_thread *thr, lzma_ret ret)
|
||||
static worker_state
|
||||
worker_encode(worker_thread *thr, worker_state state)
|
||||
{
|
||||
assert(thr->progress_in == 0);
|
||||
assert(thr->progress_out == 0);
|
||||
|
||||
// Set the Block options.
|
||||
thr->block_options = (lzma_block){
|
||||
.version = 0,
|
||||
@@ -221,17 +238,22 @@ worker_encode(worker_thread *thr, worker_state state)
|
||||
|
||||
do {
|
||||
mythread_sync(thr->mutex) {
|
||||
// Store in_pos and out_pos into *thr so that
|
||||
// an application may read them via
|
||||
// lzma_get_progress() to get progress information.
|
||||
//
|
||||
// NOTE: These aren't updated when the encoding
|
||||
// finishes. Instead, the final values are taken
|
||||
// later from thr->outbuf.
|
||||
thr->progress_in = in_pos;
|
||||
thr->progress_out = thr->outbuf->size;
|
||||
|
||||
while (in_size == thr->in_size
|
||||
&& thr->state == THR_RUN)
|
||||
pthread_cond_wait(&thr->cond, &thr->mutex);
|
||||
mythread_cond_wait(&thr->cond, &thr->mutex);
|
||||
|
||||
state = thr->state;
|
||||
in_size = thr->in_size;
|
||||
|
||||
// TODO? Store in_pos and out_pos into *thr here
|
||||
// so that the application may read them via
|
||||
// some currently non-existing function to get
|
||||
// progress information.
|
||||
}
|
||||
|
||||
// Return if we were asked to stop or exit.
|
||||
@@ -255,19 +277,55 @@ worker_encode(worker_thread *thr, worker_state state)
|
||||
thr->block_encoder.coder, thr->allocator,
|
||||
thr->in, &in_pos, in_limit, thr->outbuf->buf,
|
||||
&thr->outbuf->size, out_size, action);
|
||||
} while (ret == LZMA_OK);
|
||||
} while (ret == LZMA_OK && thr->outbuf->size < out_size);
|
||||
|
||||
if (ret != LZMA_STREAM_END) {
|
||||
worker_error(thr, ret);
|
||||
return THR_STOP;
|
||||
}
|
||||
switch (ret) {
|
||||
case LZMA_STREAM_END:
|
||||
assert(state == THR_FINISH);
|
||||
|
||||
assert(state == THR_FINISH);
|
||||
// Encode the Block Header. By doing it after
|
||||
// the compression, we can store the Compressed Size
|
||||
// and Uncompressed Size fields.
|
||||
ret = lzma_block_header_encode(&thr->block_options,
|
||||
thr->outbuf->buf);
|
||||
if (ret != LZMA_OK) {
|
||||
worker_error(thr, ret);
|
||||
return THR_STOP;
|
||||
}
|
||||
|
||||
// Encode the Block Header. By doing it after the compression,
|
||||
// we can store the Compressed Size and Uncompressed Size fields.
|
||||
ret = lzma_block_header_encode(&thr->block_options, thr->outbuf->buf);
|
||||
if (ret != LZMA_OK) {
|
||||
break;
|
||||
|
||||
case LZMA_OK:
|
||||
// The data was incompressible. Encode it using uncompressed
|
||||
// LZMA2 chunks.
|
||||
//
|
||||
// First wait that we have gotten all the input.
|
||||
mythread_sync(thr->mutex) {
|
||||
while (thr->state == THR_RUN)
|
||||
mythread_cond_wait(&thr->cond, &thr->mutex);
|
||||
|
||||
state = thr->state;
|
||||
in_size = thr->in_size;
|
||||
}
|
||||
|
||||
if (state >= THR_STOP)
|
||||
return state;
|
||||
|
||||
// Do the encoding. This takes care of the Block Header too.
|
||||
thr->outbuf->size = 0;
|
||||
ret = lzma_block_uncomp_encode(&thr->block_options,
|
||||
thr->in, in_size, thr->outbuf->buf,
|
||||
&thr->outbuf->size, out_size);
|
||||
|
||||
// It shouldn't fail.
|
||||
if (ret != LZMA_OK) {
|
||||
worker_error(thr, LZMA_PROG_ERROR);
|
||||
return THR_STOP;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
worker_error(thr, ret);
|
||||
return THR_STOP;
|
||||
}
|
||||
@@ -283,7 +341,7 @@ worker_encode(worker_thread *thr, worker_state state)
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
static MYTHREAD_RET_TYPE
|
||||
worker_start(void *thr_ptr)
|
||||
{
|
||||
worker_thread *thr = thr_ptr;
|
||||
@@ -295,14 +353,16 @@ worker_start(void *thr_ptr)
|
||||
while (true) {
|
||||
// The thread is already idle so if we are
|
||||
// requested to stop, just set the state.
|
||||
if (thr->state == THR_STOP)
|
||||
if (thr->state == THR_STOP) {
|
||||
thr->state = THR_IDLE;
|
||||
mythread_cond_signal(&thr->cond);
|
||||
}
|
||||
|
||||
state = thr->state;
|
||||
if (state != THR_IDLE)
|
||||
break;
|
||||
|
||||
pthread_cond_wait(&thr->cond, &thr->mutex);
|
||||
mythread_cond_wait(&thr->cond, &thr->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,11 +375,14 @@ worker_start(void *thr_ptr)
|
||||
if (state == THR_EXIT)
|
||||
break;
|
||||
|
||||
// Mark the thread as idle. Signal is needed for the case
|
||||
// Mark the thread as idle unless the main thread has
|
||||
// told us to exit. Signal is needed for the case
|
||||
// where the main thread is waiting for the threads to stop.
|
||||
mythread_sync(thr->mutex) {
|
||||
thr->state = THR_IDLE;
|
||||
pthread_cond_signal(&thr->cond);
|
||||
if (thr->state != THR_EXIT) {
|
||||
thr->state = THR_IDLE;
|
||||
mythread_cond_signal(&thr->cond);
|
||||
}
|
||||
}
|
||||
|
||||
mythread_sync(thr->coder->mutex) {
|
||||
@@ -327,6 +390,13 @@ worker_start(void *thr_ptr)
|
||||
// no errors occurred.
|
||||
thr->outbuf->finished = state == THR_FINISH;
|
||||
|
||||
// Update the main progress info.
|
||||
thr->coder->progress_in
|
||||
+= thr->outbuf->uncompressed_size;
|
||||
thr->coder->progress_out += thr->outbuf->size;
|
||||
thr->progress_in = 0;
|
||||
thr->progress_out = 0;
|
||||
|
||||
// Return this thread to the stack of free threads.
|
||||
thr->next = thr->coder->threads_free;
|
||||
thr->coder->threads_free = thr;
|
||||
@@ -336,35 +406,35 @@ worker_start(void *thr_ptr)
|
||||
}
|
||||
|
||||
// Exiting, free the resources.
|
||||
pthread_mutex_destroy(&thr->mutex);
|
||||
pthread_cond_destroy(&thr->cond);
|
||||
mythread_mutex_destroy(&thr->mutex);
|
||||
mythread_cond_destroy(&thr->cond);
|
||||
|
||||
lzma_next_end(&thr->block_encoder, thr->allocator);
|
||||
lzma_free(thr->in, thr->allocator);
|
||||
return NULL;
|
||||
return MYTHREAD_RET_VALUE;
|
||||
}
|
||||
|
||||
|
||||
/// Make the threads stop but not exit. Optionally wait for them to stop.
|
||||
static void
|
||||
threads_stop(lzma_coder *coder, bool wait)
|
||||
threads_stop(lzma_coder *coder, bool wait_for_threads)
|
||||
{
|
||||
// Tell the threads to stop.
|
||||
for (uint32_t i = 0; i < coder->threads_initialized; ++i) {
|
||||
mythread_sync(coder->threads[i].mutex) {
|
||||
coder->threads[i].state = THR_STOP;
|
||||
pthread_cond_signal(&coder->threads[i].cond);
|
||||
mythread_cond_signal(&coder->threads[i].cond);
|
||||
}
|
||||
}
|
||||
|
||||
if (!wait)
|
||||
if (!wait_for_threads)
|
||||
return;
|
||||
|
||||
// Wait for the threads to settle in the idle state.
|
||||
for (uint32_t i = 0; i < coder->threads_initialized; ++i) {
|
||||
mythread_sync(coder->threads[i].mutex) {
|
||||
while (coder->threads[i].state != THR_IDLE)
|
||||
pthread_cond_wait(&coder->threads[i].cond,
|
||||
mythread_cond_wait(&coder->threads[i].cond,
|
||||
&coder->threads[i].mutex);
|
||||
}
|
||||
}
|
||||
@@ -376,17 +446,17 @@ threads_stop(lzma_coder *coder, bool wait)
|
||||
/// Stop the threads and free the resources associated with them.
|
||||
/// Wait until the threads have exited.
|
||||
static void
|
||||
threads_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
threads_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
for (uint32_t i = 0; i < coder->threads_initialized; ++i) {
|
||||
mythread_sync(coder->threads[i].mutex) {
|
||||
coder->threads[i].state = THR_EXIT;
|
||||
pthread_cond_signal(&coder->threads[i].cond);
|
||||
mythread_cond_signal(&coder->threads[i].cond);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < coder->threads_initialized; ++i) {
|
||||
int ret = pthread_join(coder->threads[i].thread_id, NULL);
|
||||
int ret = mythread_join(coder->threads[i].thread_id);
|
||||
assert(ret == 0);
|
||||
(void)ret;
|
||||
}
|
||||
@@ -398,7 +468,7 @@ threads_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
/// Initialize a new worker_thread structure and create a new thread.
|
||||
static lzma_ret
|
||||
initialize_new_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
initialize_new_thread(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
worker_thread *thr = &coder->threads[coder->threads_initialized];
|
||||
|
||||
@@ -406,15 +476,17 @@ initialize_new_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
if (thr->in == NULL)
|
||||
return LZMA_MEM_ERROR;
|
||||
|
||||
if (pthread_mutex_init(&thr->mutex, NULL))
|
||||
if (mythread_mutex_init(&thr->mutex))
|
||||
goto error_mutex;
|
||||
|
||||
if (pthread_cond_init(&thr->cond, NULL))
|
||||
if (mythread_cond_init(&thr->cond))
|
||||
goto error_cond;
|
||||
|
||||
thr->state = THR_IDLE;
|
||||
thr->allocator = allocator;
|
||||
thr->coder = coder;
|
||||
thr->progress_in = 0;
|
||||
thr->progress_out = 0;
|
||||
thr->block_encoder = LZMA_NEXT_CODER_INIT;
|
||||
|
||||
if (mythread_create(&thr->thread_id, &worker_start, thr))
|
||||
@@ -426,10 +498,10 @@ initialize_new_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
return LZMA_OK;
|
||||
|
||||
error_thread:
|
||||
pthread_cond_destroy(&thr->cond);
|
||||
mythread_cond_destroy(&thr->cond);
|
||||
|
||||
error_cond:
|
||||
pthread_mutex_destroy(&thr->mutex);
|
||||
mythread_mutex_destroy(&thr->mutex);
|
||||
|
||||
error_mutex:
|
||||
lzma_free(thr->in, allocator);
|
||||
@@ -438,7 +510,7 @@ error_mutex:
|
||||
|
||||
|
||||
static lzma_ret
|
||||
get_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
get_thread(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
// If there are no free output subqueues, there is no
|
||||
// point to try getting a thread.
|
||||
@@ -468,7 +540,7 @@ get_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
coder->thr->state = THR_RUN;
|
||||
coder->thr->in_size = 0;
|
||||
coder->thr->outbuf = lzma_outq_get_buf(&coder->outq);
|
||||
pthread_cond_signal(&coder->thr->cond);
|
||||
mythread_cond_signal(&coder->thr->cond);
|
||||
}
|
||||
|
||||
return LZMA_OK;
|
||||
@@ -476,7 +548,7 @@ get_thread(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encode_in(lzma_coder *coder, lzma_allocator *allocator,
|
||||
stream_encode_in(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, lzma_action action)
|
||||
{
|
||||
@@ -519,7 +591,7 @@ stream_encode_in(lzma_coder *coder, lzma_allocator *allocator,
|
||||
if (finish)
|
||||
coder->thr->state = THR_FINISH;
|
||||
|
||||
pthread_cond_signal(&coder->thr->cond);
|
||||
mythread_cond_signal(&coder->thr->cond);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,21 +616,20 @@ stream_encode_in(lzma_coder *coder, lzma_allocator *allocator,
|
||||
/// Wait until more input can be consumed, more output can be read, or
|
||||
/// an optional timeout is reached.
|
||||
static bool
|
||||
wait_for_work(lzma_coder *coder, struct timespec *wait_abs,
|
||||
wait_for_work(lzma_coder *coder, mythread_condtime *wait_abs,
|
||||
bool *has_blocked, bool has_input)
|
||||
{
|
||||
if (coder->has_timeout && !*has_blocked) {
|
||||
if (coder->timeout != 0 && !*has_blocked) {
|
||||
// Every time when stream_encode_mt() is called via
|
||||
// lzma_code(), *has_block starts as false. We set it
|
||||
// lzma_code(), *has_blocked starts as false. We set it
|
||||
// to true here and calculate the absolute time when
|
||||
// we must return if there's nothing to do.
|
||||
//
|
||||
// The idea of *has_blocked is to avoid unneeded calls
|
||||
// to mythread_cond_abstime(), which may do a syscall
|
||||
// to mythread_condtime_set(), which may do a syscall
|
||||
// depending on the operating system.
|
||||
*has_blocked = true;
|
||||
*wait_abs = coder->wait_max;
|
||||
mythread_cond_abstime(&coder->cond, wait_abs);
|
||||
mythread_condtime_set(wait_abs, &coder->cond, coder->timeout);
|
||||
}
|
||||
|
||||
bool timed_out = false;
|
||||
@@ -576,7 +647,7 @@ wait_for_work(lzma_coder *coder, struct timespec *wait_abs,
|
||||
&& !lzma_outq_is_readable(&coder->outq)
|
||||
&& coder->thread_error == LZMA_OK
|
||||
&& !timed_out) {
|
||||
if (coder->has_timeout)
|
||||
if (coder->timeout != 0)
|
||||
timed_out = mythread_cond_timedwait(
|
||||
&coder->cond, &coder->mutex,
|
||||
wait_abs) != 0;
|
||||
@@ -591,7 +662,7 @@ wait_for_work(lzma_coder *coder, struct timespec *wait_abs,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
stream_encode_mt(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -617,7 +688,7 @@ stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
// These are for wait_for_work().
|
||||
bool has_blocked = false;
|
||||
struct timespec wait_abs;
|
||||
mythread_condtime wait_abs;
|
||||
|
||||
while (true) {
|
||||
mythread_sync(coder->mutex) {
|
||||
@@ -655,13 +726,6 @@ stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Check if the last Block was finished.
|
||||
if (action == LZMA_FINISH
|
||||
&& *in_pos == in_size
|
||||
&& lzma_outq_is_empty(
|
||||
&coder->outq))
|
||||
break;
|
||||
|
||||
// Try to give uncompressed data to a worker thread.
|
||||
ret = stream_encode_in(coder, allocator,
|
||||
in, in_pos, in_size, action);
|
||||
@@ -670,14 +734,44 @@ stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Return if
|
||||
// - we have used all the input and expect to
|
||||
// get more input; or
|
||||
// - the output buffer has been filled.
|
||||
// See if we should wait or return.
|
||||
//
|
||||
// TODO: Support flushing.
|
||||
if ((*in_pos == in_size && action != LZMA_FINISH)
|
||||
|| *out_pos == out_size)
|
||||
// TODO: LZMA_SYNC_FLUSH and LZMA_SYNC_BARRIER.
|
||||
if (*in_pos == in_size) {
|
||||
// LZMA_RUN: More data is probably coming
|
||||
// so return to let the caller fill the
|
||||
// input buffer.
|
||||
if (action == LZMA_RUN)
|
||||
return LZMA_OK;
|
||||
|
||||
// LZMA_FULL_BARRIER: The same as with
|
||||
// LZMA_RUN but tell the caller that the
|
||||
// barrier was completed.
|
||||
if (action == LZMA_FULL_BARRIER)
|
||||
return LZMA_STREAM_END;
|
||||
|
||||
// Finishing or flushing isn't completed until
|
||||
// all input data has been encoded and copied
|
||||
// to the output buffer.
|
||||
if (lzma_outq_is_empty(&coder->outq)) {
|
||||
// LZMA_FINISH: Continue to encode
|
||||
// the Index field.
|
||||
if (action == LZMA_FINISH)
|
||||
break;
|
||||
|
||||
// LZMA_FULL_FLUSH: Return to tell
|
||||
// the caller that flushing was
|
||||
// completed.
|
||||
if (action == LZMA_FULL_FLUSH)
|
||||
return LZMA_STREAM_END;
|
||||
}
|
||||
}
|
||||
|
||||
// Return if there is no output space left.
|
||||
// This check must be done after testing the input
|
||||
// buffer, because we might want to use a different
|
||||
// return code.
|
||||
if (*out_pos == out_size)
|
||||
return LZMA_OK;
|
||||
|
||||
// Neither in nor out has been used completely.
|
||||
@@ -693,6 +787,13 @@ stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
&coder->index_encoder, allocator,
|
||||
coder->index));
|
||||
coder->sequence = SEQ_INDEX;
|
||||
|
||||
// Update the progress info to take the Index and
|
||||
// Stream Footer into account. Those are very fast to encode
|
||||
// so in terms of progress information they can be thought
|
||||
// to be ready to be copied out.
|
||||
coder->progress_out += lzma_index_size(coder->index)
|
||||
+ LZMA_STREAM_HEADER_SIZE;
|
||||
}
|
||||
|
||||
// Fall through
|
||||
@@ -733,7 +834,7 @@ stream_encode_mt(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static void
|
||||
stream_encoder_mt_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
stream_encoder_mt_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
// Threads must be killed before the output queue can be freed.
|
||||
threads_end(coder, allocator);
|
||||
@@ -746,7 +847,7 @@ stream_encoder_mt_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
lzma_index_end(coder->index, allocator);
|
||||
|
||||
mythread_cond_destroy(&coder->cond);
|
||||
pthread_mutex_destroy(&coder->mutex);
|
||||
mythread_mutex_destroy(&coder->mutex);
|
||||
|
||||
lzma_free(coder, allocator);
|
||||
return;
|
||||
@@ -797,19 +898,38 @@ get_options(const lzma_mt *options, lzma_options_easy *opt_easy,
|
||||
// Calculate the maximum amount output that a single output buffer
|
||||
// may need to hold. This is the same as the maximum total size of
|
||||
// a Block.
|
||||
//
|
||||
// FIXME: As long as the encoder keeps the whole input buffer
|
||||
// available and doesn't start writing output before finishing
|
||||
// the Block, it could use lzma_stream_buffer_bound() and use
|
||||
// uncompressed LZMA2 chunks if the data doesn't compress.
|
||||
*outbuf_size_max = *block_size + *block_size / 16 + 16384;
|
||||
*outbuf_size_max = lzma_block_buffer_bound64(*block_size);
|
||||
if (*outbuf_size_max == 0)
|
||||
return LZMA_MEM_ERROR;
|
||||
|
||||
return LZMA_OK;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
get_progress(lzma_coder *coder, uint64_t *progress_in, uint64_t *progress_out)
|
||||
{
|
||||
// Lock coder->mutex to prevent finishing threads from moving their
|
||||
// progress info from the worker_thread structure to lzma_coder.
|
||||
mythread_sync(coder->mutex) {
|
||||
*progress_in = coder->progress_in;
|
||||
*progress_out = coder->progress_out;
|
||||
|
||||
for (size_t i = 0; i < coder->threads_initialized; ++i) {
|
||||
mythread_sync(coder->threads[i].mutex) {
|
||||
*progress_in += coder->threads[i].progress_in;
|
||||
*progress_out += coder->threads[i]
|
||||
.progress_out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static lzma_ret
|
||||
stream_encoder_mt_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
stream_encoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_mt *options)
|
||||
{
|
||||
lzma_next_coder_init(&stream_encoder_mt_init, next, allocator);
|
||||
@@ -848,14 +968,14 @@ stream_encoder_mt_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
// the error handling has to be done here because
|
||||
// stream_encoder_mt_end() doesn't know if they have
|
||||
// already been initialized or not.
|
||||
if (pthread_mutex_init(&next->coder->mutex, NULL)) {
|
||||
if (mythread_mutex_init(&next->coder->mutex)) {
|
||||
lzma_free(next->coder, allocator);
|
||||
next->coder = NULL;
|
||||
return LZMA_MEM_ERROR;
|
||||
}
|
||||
|
||||
if (mythread_cond_init(&next->coder->cond)) {
|
||||
pthread_mutex_destroy(&next->coder->mutex);
|
||||
mythread_mutex_destroy(&next->coder->mutex);
|
||||
lzma_free(next->coder, allocator);
|
||||
next->coder = NULL;
|
||||
return LZMA_MEM_ERROR;
|
||||
@@ -863,6 +983,7 @@ stream_encoder_mt_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
next->code = &stream_encode_mt;
|
||||
next->end = &stream_encoder_mt_end;
|
||||
next->get_progress = &get_progress;
|
||||
// next->update = &stream_encoder_mt_update;
|
||||
|
||||
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
|
||||
@@ -909,14 +1030,7 @@ stream_encoder_mt_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
outbuf_size_max, options->threads));
|
||||
|
||||
// Timeout
|
||||
if (options->timeout > 0) {
|
||||
next->coder->wait_max.tv_sec = options->timeout / 1000;
|
||||
next->coder->wait_max.tv_nsec
|
||||
= (options->timeout % 1000) * 1000000L;
|
||||
next->coder->has_timeout = true;
|
||||
} else {
|
||||
next->coder->has_timeout = false;
|
||||
}
|
||||
next->coder->timeout = options->timeout;
|
||||
|
||||
// Free the old filter chain and copy the new one.
|
||||
for (size_t i = 0; next->coder->filters[i].id != LZMA_VLI_UNKNOWN; ++i)
|
||||
@@ -939,6 +1053,10 @@ stream_encoder_mt_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
next->coder->header_pos = 0;
|
||||
|
||||
// Progress info
|
||||
next->coder->progress_in = 0;
|
||||
next->coder->progress_out = LZMA_STREAM_HEADER_SIZE;
|
||||
|
||||
return LZMA_OK;
|
||||
}
|
||||
|
||||
@@ -950,8 +1068,8 @@ lzma_stream_encoder_mt(lzma_stream *strm, const lzma_mt *options)
|
||||
|
||||
strm->internal->supported_actions[LZMA_RUN] = true;
|
||||
// strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
|
||||
// strm->internal->supported_actions[LZMA_FULL_FLUSH] = true;
|
||||
// strm->internal->supported_actions[LZMA_FULL_BARRIER] = true;
|
||||
strm->internal->supported_actions[LZMA_FULL_FLUSH] = true;
|
||||
strm->internal->supported_actions[LZMA_FULL_BARRIER] = true;
|
||||
strm->internal->supported_actions[LZMA_FINISH] = true;
|
||||
|
||||
return LZMA_OK;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
static void
|
||||
delta_coder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
delta_coder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -24,7 +24,7 @@ delta_coder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_delta_coder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_delta_coder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
// Allocate memory for the decoder if needed.
|
||||
|
||||
@@ -27,7 +27,7 @@ decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
delta_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
delta_decode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -47,7 +47,7 @@ delta_decode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_delta_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_delta_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
next->code = &delta_decode;
|
||||
@@ -56,7 +56,7 @@ lzma_delta_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_delta_props_decode(void **options, lzma_allocator *allocator,
|
||||
lzma_delta_props_decode(void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size)
|
||||
{
|
||||
if (props_size != 1)
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
#include "delta_common.h"
|
||||
|
||||
extern lzma_ret lzma_delta_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
extern lzma_ret lzma_delta_props_decode(
|
||||
void **options, lzma_allocator *allocator,
|
||||
void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,7 @@ encode_in_place(lzma_coder *coder, uint8_t *buffer, size_t size)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
delta_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
delta_encode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size, uint8_t *restrict out,
|
||||
size_t *restrict out_pos, size_t out_size, lzma_action action)
|
||||
@@ -84,8 +84,8 @@ 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)),
|
||||
delta_encoder_update(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters_null lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
// Delta doesn't and will never support changing the options in
|
||||
@@ -97,7 +97,7 @@ delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_delta_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_delta_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
next->code = &delta_encode;
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
#include "delta_common.h"
|
||||
|
||||
extern lzma_ret lzma_delta_encoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
extern lzma_ret lzma_delta_props_encode(const void *options, uint8_t *out);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ struct lzma_coder_s {
|
||||
|
||||
|
||||
extern lzma_ret lzma_delta_coder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
#endif
|
||||
|
||||
107
src/liblzma/liblzma.map
Normal file
107
src/liblzma/liblzma.map
Normal file
@@ -0,0 +1,107 @@
|
||||
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.3alpha {
|
||||
global:
|
||||
lzma_block_uncomp_encode;
|
||||
lzma_get_progress;
|
||||
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)),
|
||||
const 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,
|
||||
@@ -184,7 +184,7 @@ lz_decode(lzma_coder *coder,
|
||||
|
||||
|
||||
static void
|
||||
lz_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
lz_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
lzma_free(coder->dict.buf, allocator);
|
||||
@@ -200,10 +200,10 @@ lz_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lz_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_lz_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters,
|
||||
lzma_ret (*lz_init)(lzma_lz_decoder *lz,
|
||||
lzma_allocator *allocator, const void *options,
|
||||
const lzma_allocator *allocator, const void *options,
|
||||
lzma_lz_options *lz_options))
|
||||
{
|
||||
// Allocate the base structure if it isn't already allocated.
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct {
|
||||
lzma_vli uncompressed_size);
|
||||
|
||||
/// Free allocated resources
|
||||
void (*end)(lzma_coder *coder, lzma_allocator *allocator);
|
||||
void (*end)(lzma_coder *coder, const lzma_allocator *allocator);
|
||||
|
||||
} lzma_lz_decoder;
|
||||
|
||||
@@ -83,9 +83,10 @@ typedef struct {
|
||||
|
||||
|
||||
extern lzma_ret lzma_lz_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters,
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters,
|
||||
lzma_ret (*lz_init)(lzma_lz_decoder *lz,
|
||||
lzma_allocator *allocator, const void *options,
|
||||
const lzma_allocator *allocator, const void *options,
|
||||
lzma_lz_options *lz_options));
|
||||
|
||||
extern uint64_t lzma_lz_decoder_memusage(size_t dictionary_size);
|
||||
|
||||
@@ -76,8 +76,9 @@ move_window(lzma_mf *mf)
|
||||
/// This function must not be called once it has returned LZMA_STREAM_END.
|
||||
///
|
||||
static lzma_ret
|
||||
fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
|
||||
size_t *in_pos, size_t in_size, lzma_action action)
|
||||
fill_window(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *in, size_t *in_pos, size_t in_size,
|
||||
lzma_action action)
|
||||
{
|
||||
assert(coder->mf.read_pos <= coder->mf.write_pos);
|
||||
|
||||
@@ -148,7 +149,7 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
|
||||
|
||||
|
||||
static lzma_ret
|
||||
lz_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
lz_encode(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||
size_t in_size,
|
||||
uint8_t *restrict out, size_t *restrict out_pos,
|
||||
@@ -179,7 +180,7 @@ lz_encode(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static bool
|
||||
lz_encoder_prepare(lzma_mf *mf, lzma_allocator *allocator,
|
||||
lz_encoder_prepare(lzma_mf *mf, const lzma_allocator *allocator,
|
||||
const lzma_lz_options *lz_options)
|
||||
{
|
||||
// For now, the dictionary size is limited to 1.5 GiB. This may grow
|
||||
@@ -360,7 +361,7 @@ lz_encoder_prepare(lzma_mf *mf, lzma_allocator *allocator,
|
||||
|
||||
|
||||
static bool
|
||||
lz_encoder_init(lzma_mf *mf, lzma_allocator *allocator,
|
||||
lz_encoder_init(lzma_mf *mf, const lzma_allocator *allocator,
|
||||
const lzma_lz_options *lz_options)
|
||||
{
|
||||
// Allocate the history buffer.
|
||||
@@ -461,7 +462,7 @@ lzma_lz_encoder_memusage(const lzma_lz_options *lz_options)
|
||||
|
||||
|
||||
static void
|
||||
lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
lz_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_next_end(&coder->next, allocator);
|
||||
|
||||
@@ -479,8 +480,8 @@ 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)),
|
||||
lz_encoder_update(lzma_coder *coder, const lzma_allocator *allocator,
|
||||
const lzma_filter *filters_null lzma_attribute((__unused__)),
|
||||
const lzma_filter *reversed_filters)
|
||||
{
|
||||
if (coder->lz.options_update == NULL)
|
||||
@@ -495,10 +496,10 @@ lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lz_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters,
|
||||
lzma_ret (*lz_init)(lzma_lz_encoder *lz,
|
||||
lzma_allocator *allocator, const void *options,
|
||||
const lzma_allocator *allocator, const void *options,
|
||||
lzma_lz_options *lz_options))
|
||||
{
|
||||
#ifdef HAVE_SMALL
|
||||
|
||||
@@ -199,7 +199,7 @@ typedef struct {
|
||||
size_t *restrict out_pos, size_t out_size);
|
||||
|
||||
/// Free allocated resources
|
||||
void (*end)(lzma_coder *coder, lzma_allocator *allocator);
|
||||
void (*end)(lzma_coder *coder, const lzma_allocator *allocator);
|
||||
|
||||
/// Update the options in the middle of the encoding.
|
||||
lzma_ret (*options_update)(lzma_coder *coder,
|
||||
@@ -296,10 +296,10 @@ mf_read(lzma_mf *mf, uint8_t *out, size_t *out_pos, size_t out_size,
|
||||
|
||||
|
||||
extern lzma_ret lzma_lz_encoder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters,
|
||||
lzma_ret (*lz_init)(lzma_lz_encoder *lz,
|
||||
lzma_allocator *allocator, const void *options,
|
||||
const lzma_allocator *allocator, const void *options,
|
||||
lzma_lz_options *lz_options));
|
||||
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -209,7 +209,7 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
|
||||
|
||||
|
||||
static void
|
||||
lzma2_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
lzma2_decoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
assert(coder->lzma.end == NULL);
|
||||
lzma_free(coder->lzma.coder, allocator);
|
||||
@@ -221,7 +221,7 @@ lzma2_decoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
lzma2_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
lzma2_decoder_init(lzma_lz_decoder *lz, const lzma_allocator *allocator,
|
||||
const void *opt, lzma_lz_options *lz_options)
|
||||
{
|
||||
if (lz->coder == NULL) {
|
||||
@@ -248,7 +248,7 @@ lzma2_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma2_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_lzma2_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
// LZMA2 can only be the last filter in the chain. This is enforced
|
||||
@@ -269,7 +269,7 @@ lzma_lzma2_decoder_memusage(const void *options)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma2_props_decode(void **options, lzma_allocator *allocator,
|
||||
lzma_lzma2_props_decode(void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size)
|
||||
{
|
||||
if (props_size != 1)
|
||||
|
||||
@@ -17,12 +17,13 @@
|
||||
#include "common.h"
|
||||
|
||||
extern lzma_ret lzma_lzma2_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
extern uint64_t lzma_lzma2_decoder_memusage(const void *options);
|
||||
|
||||
extern lzma_ret lzma_lzma2_props_decode(
|
||||
void **options, lzma_allocator *allocator,
|
||||
void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -262,7 +262,7 @@ lzma2_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
|
||||
|
||||
|
||||
static void
|
||||
lzma2_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
|
||||
lzma2_encoder_end(lzma_coder *coder, const lzma_allocator *allocator)
|
||||
{
|
||||
lzma_free(coder->lzma, allocator);
|
||||
lzma_free(coder, allocator);
|
||||
@@ -304,7 +304,7 @@ lzma2_encoder_options_update(lzma_coder *coder, const lzma_filter *filter)
|
||||
|
||||
|
||||
static lzma_ret
|
||||
lzma2_encoder_init(lzma_lz_encoder *lz, lzma_allocator *allocator,
|
||||
lzma2_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator,
|
||||
const void *options, lzma_lz_options *lz_options)
|
||||
{
|
||||
if (options == NULL)
|
||||
@@ -349,7 +349,7 @@ lzma2_encoder_init(lzma_lz_encoder *lz, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma2_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_lzma2_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
return lzma_lz_encoder_init(
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
extern lzma_ret lzma_lzma2_encoder_init(
|
||||
lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
extern uint64_t lzma_lzma2_encoder_memusage(const void *options);
|
||||
|
||||
@@ -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 //
|
||||
@@ -933,7 +937,7 @@ lzma_decoder_reset(lzma_coder *coder, const void *opt)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma_decoder_create(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
lzma_lzma_decoder_create(lzma_lz_decoder *lz, const lzma_allocator *allocator,
|
||||
const void *opt, lzma_lz_options *lz_options)
|
||||
{
|
||||
if (lz->coder == NULL) {
|
||||
@@ -961,7 +965,7 @@ lzma_lzma_decoder_create(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
/// initialization (lzma_lzma_decoder_init() passes function pointer to
|
||||
/// the LZ initialization).
|
||||
static lzma_ret
|
||||
lzma_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
lzma_decoder_init(lzma_lz_decoder *lz, const lzma_allocator *allocator,
|
||||
const void *options, lzma_lz_options *lz_options)
|
||||
{
|
||||
if (!is_lclppb_valid(options))
|
||||
@@ -978,7 +982,7 @@ lzma_decoder_init(lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
|
||||
lzma_lzma_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters)
|
||||
{
|
||||
// LZMA can only be the last filter in the chain. This is enforced
|
||||
@@ -1025,7 +1029,7 @@ lzma_lzma_decoder_memusage(const void *options)
|
||||
|
||||
|
||||
extern lzma_ret
|
||||
lzma_lzma_props_decode(void **options, lzma_allocator *allocator,
|
||||
lzma_lzma_props_decode(void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size)
|
||||
{
|
||||
if (props_size != 5)
|
||||
|
||||
@@ -19,12 +19,13 @@
|
||||
|
||||
/// Allocates and initializes LZMA decoder
|
||||
extern lzma_ret lzma_lzma_decoder_init(lzma_next_coder *next,
|
||||
lzma_allocator *allocator, const lzma_filter_info *filters);
|
||||
const lzma_allocator *allocator,
|
||||
const lzma_filter_info *filters);
|
||||
|
||||
extern uint64_t lzma_lzma_decoder_memusage(const void *options);
|
||||
|
||||
extern lzma_ret lzma_lzma_props_decode(
|
||||
void **options, lzma_allocator *allocator,
|
||||
void **options, const lzma_allocator *allocator,
|
||||
const uint8_t *props, size_t props_size);
|
||||
|
||||
|
||||
@@ -40,7 +41,7 @@ extern bool lzma_lzma_lclppb_decode(
|
||||
/// Allocate and setup function pointers only. This is used by LZMA1 and
|
||||
/// LZMA2 decoders.
|
||||
extern lzma_ret lzma_lzma_decoder_create(
|
||||
lzma_lz_decoder *lz, lzma_allocator *allocator,
|
||||
lzma_lz_decoder *lz, const lzma_allocator *allocator,
|
||||
const void *opt, lzma_lz_options *lz_options);
|
||||
|
||||
/// Gets memory usage without validating lc/lp/pb. This is used by LZMA2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user