139 Commits

Author SHA1 Message Date
Lasse Collin
495aaf3a5b Bump version and soname for 5.0.7. 2014-09-20 20:44:32 +03:00
Lasse Collin
ac6c8921d1 Update NEWS for 5.0.7. 2014-09-20 20:43:29 +03:00
Lasse Collin
d1b0276aaf liblzma: Fix invalid Libs.private value in liblzma.pc. 2014-09-20 20:21:18 +03:00
Lasse Collin
cac72956b1 liblzma: Fix a portability problem in Makefile.am.
POSIX supports $< only in inference rules (suffix rules).
Using it elsewhere is a GNU make extension and doesn't
work e.g. with OpenBSD make.

Thanks to Christian Weisgerber for the patch.
2014-09-20 19:48:16 +03:00
Lasse Collin
2cdf0875de Bump version and soname for 5.0.6. 2014-09-14 19:35:45 +03:00
Lasse Collin
0168b6c8fb Update NEWS for 5.0.6. 2014-09-14 19:33:46 +03:00
Lasse Collin
13337714e8 xzgrep: List xzgrep_expected_output in tests/Makefile.am. 2014-09-09 19:18:23 +03:00
Lasse Collin
ccc728d829 xzgrep: Improve the test script.
Now it should be close to the functionality of the original
version by Pavel Raiskup.
2014-09-09 19:18:23 +03:00
Lasse Collin
948f5865fe xzgrep: Add a test for the previous fix.
This is a simplified version of Pavel Raiskup's
original patch.
2014-09-09 19:18:23 +03:00
Lasse Collin
64228d0d5c xzgrep: exit 0 when at least one file matches.
Mimic the original grep behavior and return exit_success when
at least one xz compressed file matches given pattern.

Original bugreport:
https://bugzilla.redhat.com/show_bug.cgi?id=1108085

Thanks to Pavel Raiskup for the patch.
2014-09-09 19:18:23 +03:00
Lasse Collin
98d3368ef4 Build: Fix the combination of --disable-xzdec --enable-lzmadec.
In this case "make install" could fail if the man page directory
didn't already exist at the destination. If it did exist, a
dangling symlink was created there. Now the link is omitted
instead. This isn't the best fix but it's better than the old
behavior.
2014-04-26 08:47:36 +03:00
Lasse Collin
ba3b5dd082 Build: Add --disable-doc to configure. 2014-04-26 08:47:36 +03:00
Lasse Collin
3d4575f236 Update INSTALL.
Add a note about failing "make check". The source of
the problem should be fixed in libtool (if it really is
a libtool bug and not mine) but I'm unable to spend time
on that for now. Thanks to Nelson H. F. Beebe for reporting
the issue.

Add a note about a possible need to run "ldconfig" after
"make install".
2014-04-26 08:47:24 +03:00
Lasse Collin
b9f0584e3e xz: Rename a variable to avoid a namespace collision on Solaris.
I don't know the details but I have an impression that there's
no problem in practice if using GCC since people have built xz
with GCC (without patching xz), but renaming the variable cannot
hurt either.

Thanks to Mark Ashley.
2014-04-26 08:47:24 +03:00
Lasse Collin
cc41bcaf77 xz: Fix a comment. 2014-04-26 08:45:49 +03:00
Lasse Collin
e34025d666 liblzma: Avoid C99 compound literal arrays.
MSVC 2013 doesn't like them. Maybe they aren't so good
for readability either since many aren't used to them.
2014-04-26 08:38:12 +03:00
Lasse Collin
0b6168974f liblzma: Remove a useless C99ism from sha256.c.
Unsurprisingly it makes no difference in compiled output.
2014-04-26 08:38:12 +03:00
Lasse Collin
41e436076c xz: Fix use of wrong variable.
Since the only call to suffix_set() uses optarg
as the argument, fixing this bug doesn't change
the behavior of the program.
2014-04-26 08:37:15 +03:00
Lasse Collin
c33efefd4e Fix typos in comments. 2014-04-26 08:37:00 +03:00
Lasse Collin
e560c82f1f Update THANKS. 2014-04-26 08:31:53 +03:00
Lasse Collin
05192b32e5 liblzma: Document the need for block->check for lzma_block_header_decode().
Thanks to Tomer Chachamu.
2014-04-26 08:31:43 +03:00
Lasse Collin
0f35eafe51 Update TODO. 2014-04-26 08:31:21 +03:00
Lasse Collin
fc9eaf81d7 Build: Remove a comment about Automake 1.10 from configure.ac.
The previous commit supports silent rules and that requires
Automake 1.11.
2014-04-26 08:30:00 +03:00
Lasse Collin
090c69dda5 Build: Create liblzma.pc in a src/liblzma/Makefile.am.
Previously it was done in configure, but doing that goes
against the Autoconf manual. Autoconf requires that it is
possible to override e.g. prefix after running configure
and that doesn't work correctly if liblzma.pc is created
by configure.

A potential downside of this change is that now e.g.
libdir in liblzma.pc is a standalone string instead of
being defined via ${prefix}, so if one overrides prefix
when running pkg-config the libdir won't get the new value.
I don't know if this matters in practice.

Thanks to Vincent Torri.
2014-04-26 08:29:17 +03:00
Anders F Bjorklund
1f35331332 macosx: separate liblzma package 2013-08-03 13:24:47 +03:00
Anders F Bjorklund
1415f1d946 macosx: set minimum to leopard 2013-08-03 13:24:47 +03:00
Anders F Bjorklund
41913949b9 move configurables into variables 2013-08-03 13:24:47 +03:00
Lasse Collin
3dffda33f4 Build: Fix the detection of missing CRC32.
Thanks to Vincent Torri.
2013-08-03 13:24:36 +03:00
Lasse Collin
b69900ed0b Man pages: Use similar syntax for synopsis as in xz.
The man pages of lzmainfo, xzmore, and xzdec had similar
constructs as the man page of xz had before the commit
eb6ca9854b. Eric S. Raymond
didn't mention these man pages in his bug report, but
it's nice to be consistent.
2013-06-30 18:03:54 +03:00
Lasse Collin
cf4a1e1879 Update NEWS for 5.0.5. 2013-06-30 15:55:09 +03:00
Lasse Collin
cb94bb6d1f Bump version and soname for 5.0.5. 2013-06-30 15:54:38 +03:00
Lasse Collin
b7dee202d5 xz: Fix return value type in io_write_buf().
It didn't affect the behavior of the code since -1
becomes true anyway.
2013-06-28 23:56:34 +03:00
Lasse Collin
265e7b44d8 xz: Remove an outdated NetBSD-specific comment.
Nowadays errno == EFTYPE is documented in open(2).
2013-06-28 22:04:40 +03:00
Lasse Collin
78c2f8db90 xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.
POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on
error and "other than -1" on success. This is how it is
documented e.g. on OpenBSD too. On Linux, success with
F_SETFL is always 0 (at least accorinding to fcntl(2)
from man-pages 3.51).
2013-06-28 22:04:36 +03:00
Lasse Collin
91750dff8f xz: Fix use of wrong variable in a fcntl() call.
Due to a wrong variable name, when writing a sparse file
to standard output, *all* file status flags were cleared
(to the extent the operating system allowed it) instead of
only clearing the O_APPEND flag. In practice this worked
fine in the common situations on GNU/Linux, but I didn't
check how it behaved elsewhere.

The original flags were still restored correctly. I still
changed the code to use a separate boolean variable to
indicate when the flags should be restored instead of
relying on a special value in stdout_flags.
2013-06-28 22:04:32 +03:00
Lasse Collin
e11888a79a xz: Check the value of lzma_stream_flags.version in --list.
It is a no-op for now, but if an old xz version is used
together with a newer liblzma that supports something new,
then this check becomes important and will stop the old xz
from trying to parse files that it won't understand.
2013-06-26 13:31:19 +03:00
Lasse Collin
f39ddd88f3 Build: Require Automake 1.12 and use serial-tests option.
It should actually still work with Automake 1.10 if
the serial-tests option is removed. Automake 1.13 started
using parallel tests by default and the option to get
the old behavior isn't supported before 1.12.

At least for now, parallel tests don't improve anything
in XZ Utils but they hide the progress output from
test_compress.sh.
2013-06-26 12:17:13 +03:00
Lasse Collin
cb84e27802 xz: Validate Uncompressed Size from Block Header in list.c.
This affects only "xz -lvv". Normal decompression with xz
already detected if Block Header and Index had mismatched
Uncompressed Size fields. So this just makes "xz -lvv"
show such files as corrupt instead of showing the
Uncompressed Size from Index.
2013-06-26 10:59:19 +03:00
Lasse Collin
f01780fce4 Update THANKS. 2013-06-26 10:58:58 +03:00
Lasse Collin
d98ede7d70 xz: Make the man page more friendly to doclifter.
Thanks to Eric S. Raymond.
2013-06-26 10:58:07 +03:00
Lasse Collin
19b447b64b xz: A couple of man page fixes.
Now the interaction of presets and custom filter chains
is described correctly. Earlier it contradicted itself.

Thanks to DevHC who reported these issues on IRC to me
on 2012-12-14.
2013-06-26 10:54:24 +03:00
Lasse Collin
45edf2966f xz: Fix interaction between preset and custom filter chains.
There was somewhat illogical behavior when --extreme was
specified and mixed with custom filter chains.

Before this commit, "xz -9 --lzma2 -e" was equivalent
to "xz --lzma2". After it is equivalent to "xz -6e"
(all earlier preset options get forgotten when a custom
filter chain is specified and the default preset is 6
to which -e is applied). I find this less illogical.

This also affects the meaning of "xz -9e --lzma2 -7".
Earlier it was equivalent to "xz -7e" (the -e specified
before a custom filter chain wasn't forgotten). Now it
is "xz -7". Note that "xz -7e" still is the same as "xz -e7".

Hopefully very few cared about this in the first place,
so pretty much no one should even notice this change.

Thanks to Conley Moorhous.
2013-06-26 10:54:18 +03:00
Lasse Collin
b065984e5a xz: Change size_t to uint32_t in a few places. 2013-06-26 10:54:09 +03:00
Lasse Collin
32be621f52 Build: Use -Wvla with GCC if supported.
Variable-length arrays are mandatory in C99 but optional in C11.
The code doesn't currently use any VLAs and it shouldn't in the
future either to stay compatible with C11 without requiring any
optional C11 features.
2013-06-26 10:53:57 +03:00
Lasse Collin
efb07cfba6 xzdec: Improve the --help message.
The options are now ordered in the same order as in xz's help
message.

Descriptions were added to the options that are ignored.
I left them in parenthesis even if it looks a bit weird
because I find it easier to spot the ignored vs. non-ignored
options from the list that way.
2013-06-26 10:53:57 +03:00
Lasse Collin
e3c8be1369 Update THANKS. 2013-04-05 19:34:42 +03:00
Jeff Bastian
ad8282efe4 xzgrep: make the '-h' option to be --no-filename equivalent
* src/scripts/xzgrep.in: Accept the '-h' option in argument parsing.
2013-04-05 19:34:42 +03:00
Lasse Collin
9271a3eb0e liblzma: Be less picky in lzma_alone_decoder().
To avoid false positives when detecting .lzma files,
rare values in dictionary size and uncompressed size fields
were rejected. They will still be rejected if .lzma files
are decoded with lzma_auto_decoder(), but when using
lzma_alone_decoder() directly, such files will now be accepted.
Hopefully this is an OK compromise.

This doesn't affect xz because xz still has its own file
format detection code. This does affect lzmadec though.
So after this commit lzmadec will accept files that xz or
xz-emulating-lzma doesn't.

NOTE: lzma_alone_decoder() still won't decode all .lzma files
because liblzma's LZMA decoder doesn't support lc + lp > 4.

Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/7068827

Conflicts:
	src/liblzma/common/alone_decoder.c
	src/liblzma/common/alone_decoder.h
2013-04-05 19:34:09 +03:00
Lasse Collin
211b931cee Avoid unneeded use of awk in xzless.
Use "read" instead of "awk" in xzless to get the version
number of "less". The need for awk was introduced in
the commit db5c1817fa.

Thanks to Ariel P for the patch.
2013-04-05 19:28:08 +03:00
Jonathan Nieder
9f62fd9605 xzless: Make "less -V" parsing more robust
In v4.999.9beta~30 (xzless: Support compressed standard input,
2009-08-09), xzless learned to parse ‘less -V’ output to figure out
whether less is new enough to handle $LESSOPEN settings starting
with “|-”.  That worked well for a while, but the version string from
‘less’ versions 448 (June, 2012) is misparsed, producing a warning:

	$ xzless /tmp/test.xz; echo $?
	/usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \
	integer expression expected
	0

More precisely, modern ‘less’ lists the regexp implementation along
with its version number, and xzless passes the entire version number
with attached parenthetical phrase as a number to "test $a -gt $b",
producing the above confusing message.

	$ less-444 -V | head -1
	less 444
	$ less -V | head -1
	less 456 (no regular expressions)

So relax the pattern matched --- instead of expecting "less <number>",
look for a line of the form "less <number>[ (extra parenthetical)]".
While at it, improve the behavior when no matching line is found ---
instead of producing a cryptic message, we can fall back on a LESSPIPE
setting that is supported by all versions of ‘less’.

The implementation uses "awk" for simplicity.  Hopefully that’s
portable enough.

Reported-by: Jörg-Volker Peetz <jvpeetz@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2012-12-15 20:01:45 +02:00
Lasse Collin
1d05980f5b xz: Fix the note about --rsyncable on the man page. 2012-12-15 20:01:45 +02:00
Lasse Collin
fb68497333 xz: Improve handling of failed realloc in xrealloc.
Thanks to Jim Meyering.
2012-12-15 20:01:45 +02:00
Lasse Collin
75013db6d4 A few typo fixes to comments and the xz man page.
Thanks to Jim Meyering.
2012-12-15 20:01:02 +02:00
Lasse Collin
e44b21839b Build: Bump gettext version requirement to 0.18.
Otherwise too old version of m4/lib-link.m4 gets included
when autoreconf -fi is run.
2012-08-02 17:14:06 +03:00
Lasse Collin
fd3dbb23ca Tests: Remove tests/test_block.c that had gotten committed accidentally. 2012-07-05 07:49:40 +03:00
Lasse Collin
05a735d279 Build: Include macosx/build.sh in the distribution.
It has been in the Git repository since 2010 but probably
few people have seen it since it hasn't been included in
the release tarballs. :-(
2012-07-05 07:49:31 +03:00
Lasse Collin
4e6d62793b Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. 2012-07-05 07:49:21 +03:00
Lasse Collin
dd95b5e761 Include debug/translation.bash in the distribution.
Also fix the script name mentioned in README.
2012-07-05 07:49:10 +03:00
Lasse Collin
20778053a0 xz: Update man page date to match the latest update. 2012-06-22 14:36:16 +03:00
Lasse Collin
2cefa84af6 Bump version and soname for 5.0.4. 2012-06-22 10:25:43 +03:00
Lasse Collin
433fec191a Update NEWS for 5.0.4. 2012-06-22 10:25:09 +03:00
Lasse Collin
711fa680f5 Docs: Language fix to 01_compress_easy.c.
Thanks to Jonathan Nieder.
2012-06-22 09:31:42 +03:00
Lasse Collin
3d7ab1dc61 Fix the top-level Makefile.am for the new example programs. 2012-06-22 09:31:42 +03:00
Lasse Collin
ef8b8e5f11 Docs: Add new example programs.
These have more comments than the old examples and
human-readable error messages. More tutorial-like examples
are needed but these are a start.
2012-06-22 09:31:42 +03:00
Lasse Collin
75c149bc80 Docs: Move xz_pipe_comp.c and xz_pipe_decomp.c to doc/examples_old.
It is good to keep these around to so that if someone has
copied the decompressor bug from xz_pipe_decomp.c he has
an example how to easily fix it.
2012-06-22 09:31:42 +03:00
Lasse Collin
456307ebf9 Docs: Fix a bug in xz_pipe_decomp.c example program. 2012-06-22 09:31:42 +03:00
Lasse Collin
4c310b8a29 Translations: Update the Italian translation.
Thanks to Milo Casagrande.
2012-05-31 15:53:25 +03:00
Lasse Collin
ec32b79366 Translations: Update the French translation.
Thanks to Adrien Nader.
2012-05-30 23:15:07 +03:00
Lasse Collin
dd06f40e4d Translations: Update the German translation. 2012-05-29 22:27:00 +03:00
Lasse Collin
c66808d1f5 Translations: Update Polish translation. 2012-05-29 22:12:57 +03:00
Lasse Collin
556c22dfed Preliminary NEWS for 5.0.4. 2012-05-29 13:10:36 +03:00
Lasse Collin
dd13b66bf5 liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.
lzma_code() could incorrectly return LZMA_BUF_ERROR if
all of the following was true:

  - The caller knows how many bytes of output to expect
    and only provides that much output space.

  - When the last output bytes are decoded, the
    caller-provided input buffer ends right before
    the LZMA2 end of payload marker. So LZMA2 won't
    provide more output anymore, but it won't know it
    yet and thus won't return LZMA_STREAM_END yet.

  - A BCJ filter is in use and it hasn't left any
    unfiltered bytes in the temp buffer. This can happen
    with any BCJ filter, but in practice it's more likely
    with filters other than the x86 BCJ.

Another situation where the bug can be triggered happens
if the uncompressed size is zero bytes and no output space
is provided. In this case the decompression can fail even
if the whole input file is given to lzma_code().

A similar bug was fixed in XZ Embedded on 2011-09-19.
2012-05-29 12:54:47 +03:00
Lasse Collin
a0223bf796 Update THANKS. 2012-05-29 12:54:47 +03:00
Lasse Collin
86e57e4bfe xz: Don't show a huge number in -vv when memory limit is disabled. 2012-05-29 12:54:47 +03:00
Lasse Collin
13e44a94da xz: Document the "summary" lines of --robot -lvv.
This documents only the columns that are in v5.0.
The new columns added in the master branch aren't
necessarily stable yet.
2012-05-29 12:54:22 +03:00
Lasse Collin
2f90345e13 xz: Fix output of verbose --robot --list modes.
It printed the filename in "filename (x/y)" format
which it obviously shouldn't do in robot mode.
2012-05-29 12:54:22 +03:00
Lasse Collin
8d4864f53f Update THANKS. 2012-05-24 19:16:37 +03:00
Lasse Collin
35e9c58abb Docs: Cleanup line wrapping a bit. 2012-05-24 19:16:37 +03:00
Benno Schulenberg
532b3e4c56 Fix a few typos and add some missing articles in some documents.
Also hyphenate several compound adjectives.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2012-05-24 19:16:37 +03:00
Lasse Collin
afb6ce8c82 Windows: Update notes about static linking with MSVC. 2012-05-24 19:16:14 +03:00
Lasse Collin
7c3ba2ed5c liblzma: Remove outdated comments. 2012-05-24 19:16:14 +03:00
Lasse Collin
f55db9c187 DOS: Link against DJGPP's libemu to support FPU emulation.
This way xz should work on 386SX and 486SX. Floating point
only is needed for verbose output in xz.
2012-05-24 19:16:14 +03:00
Lasse Collin
203edff4c7 Docs: Update MINIX 3 information in INSTALL. 2012-05-24 18:54:21 +03:00
Lasse Collin
f0a8f95c21 Update THANKS. 2012-05-24 18:52:59 +03:00
Lasse Collin
b7ad23fa78 Fix exit status of xzgrep when grepping binary files.
When grepping binary files, grep may exit before it has
read all the input. In this case, gzip -q returns 2 (eating
SIGPIPE), but xz and bzip2 show SIGPIPE as the exit status
(e.g. 141). This causes wrong exit status when grepping
xz- or bzip2-compressed binary files.

The fix checks for the special exit status that indicates SIGPIPE.
It uses kill -l which should be supported everywhere since it
is in both SUSv2 (1997) and POSIX.1-2008.

Thanks to James Buren for the bug report.
2012-05-24 18:52:48 +03:00
Lasse Collin
4e19fbb04a Update THANKS. 2012-05-24 18:52:48 +03:00
Lasse Collin
c6fa03a427 Fix compiling with IBM XL C on AIX. 2012-05-24 18:47:52 +03:00
Lasse Collin
7b6ffc9864 Build: Upgrade m4/acx_pthread.m4 to the latest version.
It was renamed to ax_pthread.m4 in Autoconf Archive.
2012-05-24 18:37:08 +03:00
Lasse Collin
bfac2be502 Tests: Fix a compiler warning with _FORTIFY_SOURCE.
Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/4927385
2012-05-24 18:24:44 +03:00
Lasse Collin
df85e15671 Docs: Explain the stable releases better in README. 2012-05-24 18:24:44 +03:00
Lasse Collin
d06d32f108 xz: Fix a typo in a comment.
Thanks to Bela Lubkin.
2011-11-04 17:57:45 +02:00
Lasse Collin
636fdcfbf5 Update THANKS. 2011-11-03 17:44:22 +02:00
Lasse Collin
55fd02f83e xz: Fix xz on EBCDIC systems.
Thanks to Chris Donawa.
2011-11-03 17:44:22 +02:00
Lasse Collin
4052f36053 Build: Fix "make check" on Windows. 2011-09-06 12:05:44 +03:00
Lasse Collin
0f25758459 Update THANKS. 2011-09-05 16:05:44 +03:00
Lasse Collin
70f03b51ff Workaround unusual SIZE_MAX on SCO OpenServer. 2011-09-05 16:05:44 +03:00
Lasse Collin
f138bdf76a Run the scripts with the correct shell in test_scripts.sh.
The scripts are now made executable in the build tree.
This way the scripts can be run like programs in
test_scripts.sh. Previously test_scripts.sh always
used sh but it's not correct if @POSIX_SHELL@ is set
to something else by configure.

Thanks to Jonathan Nieder for the patch.
2011-09-05 16:05:44 +03:00
Lasse Collin
2c144a0365 Fix exit status of "xzdiff foo.xz bar.xz".
xzdiff was clobbering the exit status from diff in a case
statement used to analyze the exit statuses from "xz" when
its operands were two compressed files. Save and restore
diff's exit status to fix this.

The bug is inherited from zdiff in GNU gzip and was fixed
there on 2009-10-09.

Thanks to Jonathan Nieder for the patch and
to Peter Pallinger for reporting the bug.
2011-09-05 16:05:44 +03:00
Anders F Bjorklund
edf339227a add build script for macosx universal 2011-07-07 23:09:11 +03:00
Lasse Collin
7fcc6334ea liblzma: Remove unneeded semicolon. 2011-06-16 12:16:05 +03:00
Lasse Collin
631f4d3ae6 Don't call close(-1) in tuklib_open_stdxxx() on error.
Thanks to Jim Meyering.
2011-05-28 18:54:42 +03:00
Lasse Collin
c89faf4c9e Translations: Update Italian translation.
Thanks to Milo Casagrande.
2011-05-28 09:47:56 +03:00
Lasse Collin
6fe2fc9b6a Tests: Add a test file for the bug in the previous commit. 2011-05-28 09:44:18 +03:00
Lasse Collin
6c4d4db2bc xz: Fix error handling in xz -lvv.
It could do an invalid free() and read past the end
of the uninitialized filters array.
2011-05-28 09:44:12 +03:00
Lasse Collin
844f84fcad liblzma: Handle allocation failures correctly in lzma_index_init().
Thanks to Jim Meyering.
2011-05-28 09:44:07 +03:00
Lasse Collin
240e8b9791 Build: Set GZIP_ENV=-9n in top-level Makefile.am. 2011-05-23 18:30:51 +03:00
Lasse Collin
e32cb264ea Bump version and soname for 5.0.3. 2011-05-21 16:59:22 +03:00
Lasse Collin
65cff45f8f Update NEWS for 5.0.3. 2011-05-21 16:56:53 +03:00
Lasse Collin
316c67ffda Add French translation.
It is known that the BCJ filter --help text is only
partially translated.
2011-05-21 16:29:11 +03:00
Lasse Collin
1931175eea xz: Translate also the string used to print the program name.
French needs a space before a colon, e.g. "xz : foo error".
2011-05-21 15:12:43 +03:00
Lasse Collin
841dc1f891 Update THANKS. 2011-05-17 12:28:18 +03:00
Lasse Collin
0f7e2d3624 Update INSTALL with a note about linker problem on OpenSolaris x86. 2011-05-17 12:28:14 +03:00
Lasse Collin
793d857e01 Build: Fix initialization of enable_check_* variables in configure.ac.
This doesn't matter much in practice since it is unlikely
that anyone would have such environment variable names.

Thanks to Wim Lewis.
2011-05-17 12:28:07 +03:00
Lasse Collin
afcff45cee Add underscores to attributes (__attribute((__foo__))). 2011-05-17 12:27:22 +03:00
Lasse Collin
22159c6ba2 Update THANKS. 2011-04-18 19:36:21 +03:00
Martin Väth
5e34990595 xzgrep: fix typo in $0 parsing
Reported-by: Diego Elio Pettenò <flameeyes@gentoo.org>
Signed-off-by: Martin Väth <vaeth@mathematik.uni-wuerzburg.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-18 19:36:14 +03:00
Lasse Collin
1125611b9b Remove doubled words from documentation and comments.
Spot candidates by running these commands:
  git ls-files |xargs perl -0777 -n \
    -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
    -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}'

Thanks to Jim Meyering for the original patch.
2011-04-12 12:03:31 +03:00
Lasse Collin
3f8fa53837 liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too. 2011-04-11 21:04:24 +03:00
Lasse Collin
320d734c20 liblzma: Document lzma_raw_(enc|dec)oder_memusage() better.
It didn't mention the return value that is used if
an error occurs.
2011-04-11 20:59:20 +03:00
Lasse Collin
2ee4edeffc liblzma: Don't create an empty Block in lzma_stream_buffer_encode().
Empty Block was created if the input buffer was empty.
Empty Block wastes a few bytes of space, but more importantly
it triggers a bug in XZ Utils 5.0.1 and older when trying
to decompress such a file. 5.0.1 and older consider such
files to be corrupt. I thought that no encoder creates empty
Blocks when releasing 5.0.2 but I was wrong.
2011-04-11 14:00:55 +03:00
Lasse Collin
73f56fb87d liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK.
This return value was missing from the API comments of
four functions.
2011-04-11 14:00:50 +03:00
Lasse Collin
4ce1cf97a8 liblzma: Validate encoder arguments better.
The biggest problem was that the integrity check type
wasn't validated, and e.g. lzma_easy_buffer_encode()
would create a corrupt .xz Stream if given an unsupported
Check ID. Luckily applications don't usually try to use
an unsupport Check ID, so this bug is unlikely to cause
many real-world problems.
2011-04-11 14:00:46 +03:00
Lasse Collin
972f05d7a4 Update THANKS. 2011-04-09 18:30:59 +03:00
Lasse Collin
28154eeaf6 liblzma: Add missing #ifdefs to filter_common.c.
Passing --disable-decoders to configure broke a few
encoders due to missing #ifdefs in filter_common.c.

Thanks to Jason Gorski for the patch.
2011-04-09 18:30:53 +03:00
Lasse Collin
aa95516d3d liblzma: Fix a memory leak in stream_encoder.c.
It leaks old filter options structures (hundred bytes or so)
every time the lzma_stream is reinitialized. With the xz tool,
this happens when compressing multiple files.
2011-04-05 15:27:48 +03:00
Lasse Collin
58f52c72f4 Bumped version and liblzma soname to 5.0.2. 2011-04-01 08:47:46 +03:00
Lasse Collin
162779682e Updated NEWS for 5.0.2. 2011-04-01 08:47:20 +03:00
Lasse Collin
45553f9b4b Update INSTALL with another note about IRIX. 2011-03-31 15:07:08 +03:00
Lasse Collin
af9d48d551 Tests: Add a new file to test empty LZMA2 streams. 2011-03-31 13:08:10 +03:00
Lasse Collin
d099ef9f51 liblzma: Fix decoding of LZMA2 streams having no uncompressed data.
The decoder considered empty LZMA2 streams to be corrupt.
This shouldn't matter much with .xz files, because no encoder
creates empty LZMA2 streams in .xz. This bug is more likely
to cause problems in applications that use raw LZMA2 streams.
2011-03-31 13:08:05 +03:00
Lasse Collin
df87249b26 Scripts: Better fix for xzgrep.
Now it uses "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:43:23 +02:00
Lasse Collin
68c453e1c7 Updated THANKS. 2011-03-24 01:24:16 +02:00
Lasse Collin
b441d39855 Scripts: Fix xzgrep -l.
It didn't work at all. It tried to use the -q option
for grep, but it appended it after "--". This works
around it by redirecting to /dev/null. The downside
is that this can be slower with big files compared
to proper use of "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:24:12 +02:00
Lasse Collin
82d5164839 xz: Clean up suffix.c.
struct suffix_pair isn't needed in compresed_name()
so get rid of it there.
2011-02-04 22:49:31 +02:00
Lasse Collin
6decc8b418 xz: Check if the file already has custom suffix when compressing.
Now "xz -S .test foo.test" refuses to compress the
file because it already has the suffix .test. The man
page had it documented this way already.
2011-02-04 11:29:47 +02:00
Lasse Collin
ecda90061d Updated THANKS. 2011-02-02 23:01:51 +02:00
Lasse Collin
0fda1ae5b1 Translations: Add Polish translation.
Thanks to Jakub Bogusz.
2011-02-02 23:00:33 +02:00
Lasse Collin
00be32978f Updated THANKS. 2011-02-02 22:24:00 +02:00
Lasse Collin
7232fcf96b Bump package version and liblzma soname to 5.0.1. 2011-01-28 20:26:38 +02:00
86 changed files with 1366 additions and 4167 deletions

View File

@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it

View File

@@ -1,5 +1,5 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -10,7 +10,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
@@ -500,3 +500,5 @@ necessary. Here is a sample; alter the names:
Ty Coon, President of Vice
That's all there is to it!

36
INSTALL
View File

@@ -26,6 +26,8 @@ XZ Utils Installation
4.2. "No POSIX conforming shell (sh) was found."
4.3. configure works but build fails at crc32_x86.S
4.4. Lots of warnings about symbol visibility
4.5. "make check" fails
4.6. liblzma.so (or similar) not found when running xz
0. Preface
@@ -251,6 +253,12 @@ XZ Utils Installation
Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
and their symlinks.
--disable-doc
Don't install the documentation files to $docdir
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
will still be installed. The $docdir can be changed
with --docdir=DIR.
--disable-assembler
liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for
@@ -318,11 +326,6 @@ XZ Utils Installation
single-threaded applications and want to avoid dependency
on libpthread.
--enable-symbol-versions
Use symbol versioning for liblzma. This is enabled by
default on GNU/Linux, other GNU-based systems, and
FreeBSD.
--enable-debug
This enables the assert() macro and possibly some other
run-time consistency checks. It makes the code slower, so
@@ -468,3 +471,26 @@ XZ Utils Installation
resulting binaries, but fewer warnings looks nicer and may allow
using --enable-werror.
4.5. "make check" fails
A likely reason is that libtool links the test programs against
an installed version of liblzma instead of the version that was
just built. This is obviously a bug which seems to happen on
some platforms. A workaround is to uninstall the old liblzma
versions first.
If the problem isn't the one described above, then it's likely
a bug in XZ Utils or in the compiler. See the platform-specific
notes in this file for possible known problems. Please report
a bug if you cannot solve the problem. See README for contact
information.
4.6. liblzma.so (or similar) not found when running xz
If you installed the package with "make install" and get an error
about liblzma.so (or a similarly named file) being missing, try
running "ldconfig" to update the run-time linker cache (if your
operating system has such a command).

View File

@@ -17,6 +17,7 @@ endif
SUBDIRS += src po tests
if COND_DOC
dist_doc_DATA = \
AUTHORS \
COPYING \
@@ -42,11 +43,13 @@ examplesolddir = $(docdir)/examples_old
dist_examplesold_DATA = \
doc/examples_old/xz_pipe_comp.c \
doc/examples_old/xz_pipe_decomp.c
endif
EXTRA_DIST = \
extra \
dos \
windows \
macosx \
autogen.sh \
Doxyfile.in \
COPYING.GPLv2 \
@@ -95,7 +98,6 @@ 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-`; \

118
NEWS
View File

@@ -2,88 +2,74 @@
XZ Utils Release Notes
======================
5.1.2alpha (2012-07-04)
5.0.7 (2014-09-20)
* All fixes from 5.0.3 and 5.0.4
* Fix regressions introduced in 5.0.6:
* liblzma:
- Fix building with non-GNU make.
- 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.
- Fix invalid Libs.private value in liblzma.pc which broke
static linking against liblzma if the linker flags were
taken from pkg-config.
5.1.1alpha (2011-04-12)
5.0.6 (2014-09-14)
* All fixes from 5.0.2
* xzgrep now exits with status 0 if at least one file matched.
* liblzma fixes that will also be included in 5.0.3:
* A few minor portability and build system 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.
5.0.5 (2013-06-30)
- 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.
* 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.
- Document that lzma_block_buffer_encode(),
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
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.
- The return values of the _memusage() functions are now
documented better.
* xz:
* Support for multithreaded compression was added using the simplest
method, which splits the input data into blocks and compresses
them independently. Other methods will be added in the future.
The current method has room for improvement, e.g. it is possible
to reduce the memory usage.
- 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.
* Added the options --single-stream and --block-size=SIZE to xz.
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.
* xzdiff and xzgrep now support .lzo files if lzop is installed.
The .tzo suffix is also recognized as a shorthand for .tar.lzo.
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".
* Support for short 8.3 filenames under DOS was added to xz. It is
experimental and may change before it gets into a stable release.
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)

4
README
View File

@@ -210,8 +210,8 @@ 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).

7
THANKS
View File

@@ -6,6 +6,7 @@ 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
@@ -19,6 +20,7 @@ has been important. :-) In alphabetical order:
- Daniel Mealha Cabrita
- Milo Casagrande
- Marek Černocký
- Tomer Chachamu
- Chris Donawa
- Andrew Dudman
- Markus Duft
@@ -28,7 +30,6 @@ has been important. :-) In alphabetical order:
- Denis Excoffier
- Michael Felt
- Mike Frysinger
- Bill Glessner
- Jason Gorski
- Juan Manuel Guerrero
- Joachim Henke
@@ -48,7 +49,7 @@ has been important. :-) In alphabetical order:
- Bela Lubkin
- Gregory Margo
- Jim Meyering
- Arkadiusz Miskiewicz
- Conley Moorhous
- Rafał Mużyło
- Adrien Nader
- Hongbo Ni
@@ -60,8 +61,10 @@ has been important. :-) In alphabetical order:
- 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

24
TODO
View File

@@ -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,27 +28,14 @@ Known bugs
time and calculated (de)compression speed won't make sense in the
progress indicator (xz --verbose).
If liblzma has created threads and fork() gets called, liblzma
code will break in the child process unless it calls exec() and
doesn't touch liblzma.
Missing features
----------------
Support LZMA_FINISH in raw decoder to indicate end of LZMA1 and
other streams that don't have an end of payload marker.
Adjust dictionary size when the input file size is known.
Maybe do this only if an option is given.
xz doesn't support copying extended attributes, access control
lists etc. from source to target file.
Multithreaded compression:
- Reduce memory usage of the current method.
- Implement threaded match finders.
- Implement pigz-style threading in LZMA2.
Multithreaded compression
Multithreaded decompression
@@ -63,11 +46,6 @@ Missing features
It will be a separate library that supports uncompressed, .gz,
.bz2, .lzma, and .xz files.
Support changing lzma_options_lzma.mode with lzma_filters_update().
Support LZMA_FULL_FLUSH for lzma_stream_decoder() to stop at
Block and Stream boundaries.
lzma_strerror() to convert lzma_ret to human readable form?
This is tricky, because the same error codes are used with
slightly different meanings, and this cannot be fixed anymore.

View File

@@ -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
@@ -402,32 +402,11 @@ AC_ARG_ENABLE([scripts], [AC_HELP_STRING([--disable-scripts],
[], [enable_scripts=yes])
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])
AC_ARG_ENABLE([doc], [AC_HELP_STRING([--disable-doc],
[do not install documentation files to docdir
(man pages will still be installed)])],
[], [enable_doc=yes])
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
###############################################################################
@@ -443,7 +422,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
@@ -466,16 +445,7 @@ if test "x$enable_threads" = xyes; then
dnl it's tricky to get it right together with AC_PROG_CC_C99.
dnl Thus, this is handled by telling the user in INSTALL to set
dnl the correct CC manually.
# These are nice to have but not mandatory.
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
CFLAGS=$OLD_CFLAGS
fi
AM_CONDITIONAL([COND_THREADS], [test "x$ax_pthread_ok" = xyes])
echo
echo "Initializing Libtool:"
@@ -496,7 +466,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])
###############################################################################
@@ -534,7 +504,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,
@@ -557,69 +527,12 @@ gl_GETOPT
# Find the best function to set timestamps.
AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
# This is nice to have but not mandatory.
AC_CHECK_FUNCS([posix_fadvise])
TUKLIB_PROGNAME
TUKLIB_INTEGER
TUKLIB_PHYSMEM
TUKLIB_CPUCORES
TUKLIB_MBSTR
# Check for system-provided SHA-256. At least the following is supported:
#
# OS Headers Library Type Function
# FreeBSD sys/types.h + sha256.h libmd SHA256_CTX SHA256_Init
# NetBSD sys/types.h + sha2.h SHA256_CTX SHA256_Init
# OpenBSD sys/types.h + sha2.h SHA2_CTX SHA256Init
# Solaris sys/types.h + sha2.h libmd SHA256_CTX SHA256Init
# MINIX 3 sys/types.h + minix/sha2.h libutil SHA256_CTX SHA256_Init
# Darwin CommonCrypto/CommonDigest.h CC_SHA256_CTX CC_SHA256_Init
#
# Note that Darwin's CC_SHA256_Update takes buffer size as uint32_t instead
# of size_t.
#
# We don't check for e.g. OpenSSL or libgcrypt because we don't want
# to introduce dependencies to other packages by default. Maybe such
# libraries could be supported via additional configure options though.
#
if test "x$enable_check_sha256" = "xyes"; then
# Test for Common Crypto before others, because Darwin has sha256.h
# too and we don't want to use that, because on older versions it
# uses OpenSSL functions, whose SHA256_Init is not guaranteed to
# succeed.
sha256_header_found=no
AC_CHECK_HEADERS(
[CommonCrypto/CommonDigest.h sha256.h sha2.h minix/sha2.h],
[sha256_header_found=yes ; break])
if test "x$sha256_header_found" = xyes; then
AC_CHECK_TYPES([CC_SHA256_CTX, SHA256_CTX, SHA2_CTX], [], [],
[[#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
# include <CommonCrypto/CommonDigest.h>
#endif
#ifdef HAVE_SHA256_H
# include <sha256.h>
#endif
#ifdef HAVE_SHA2_H
# include <sha2.h>
#endif
#ifdef HAVE_MINIX_SHA2_H
# include <minix/sha2.h>
#endif]])
AC_SEARCH_LIBS([SHA256_Init], [md util])
AC_SEARCH_LIBS([SHA256Init], [md])
AC_CHECK_FUNCS([CC_SHA256_Init SHA256_Init SHA256Init],
[break])
fi
fi
AM_CONDITIONAL([COND_INTERNAL_SHA256],
[test "x$ac_cv_func_SHA256_Init" != xyes \
&& test "x$ac_cv_func_SHA256Init" != xyes \
&& test "x$ac_cv_func_CC_SHA256_Init" != xyes])
###############################################################################
# If using GCC, set some additional AM_CFLAGS:
@@ -653,6 +566,7 @@ if test "$GCC" = yes ; then
for NEW_FLAG in \
-Wall \
-Wextra \
-Wvla \
-Wformat=2 \
-Winit-self \
-Wmissing-include-dirs \
@@ -717,7 +631,6 @@ AC_CONFIG_FILES([
po/Makefile.in
lib/Makefile
src/Makefile
src/liblzma/liblzma.pc
src/liblzma/Makefile
src/liblzma/api/Makefile
src/xz/Makefile
@@ -743,8 +656,9 @@ if test x$tuklib_cv_physmem_method = xunknown; then
echo "or make a patch to add support for this operating system."
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
# 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

View File

@@ -5,6 +5,9 @@
## You can do whatever you want with this file.
##
EXTRA_DIST = \
translation.bash
noinst_PROGRAMS = \
repeat \
sync_flush \

View File

@@ -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.

View File

@@ -1,6 +1,6 @@
Building XZ Utils for DOS
=========================
XZ Utils on DOS
===============
Introduction
@@ -77,3 +77,12 @@ Building
are not built. Having e.g. xzdec.exe doesn't save much space compared
to xz.exe, because the DJGPP runtime makes the .exe quite big anyway.
Bugs
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
when running under Windows XP Command Prompt (something goes wrong
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.

View File

@@ -1,123 +0,0 @@
XZ Utils on DOS
===============
DOS-specific filename handling
xz detects at runtime if long filename (LFN) support is
available and will use it by default. It can be disabled by
setting an environment variable:
set lfn=n
When xz is in LFN mode, it behaves pretty much the same as it
does on other operating systems. Examples:
xz foo.tar -> foo.tar.xz
xz -d foo.tar.xz -> foo.tar
xz -F lzma foo.tar -> foo.tar.lzma
xz -d foo.tar.lzma -> foo.tar
When LFN support isn't available or it is disabled with LFN=n
environment setting, xz works in short filename (SFN) mode. This
affects filename suffix handling when compressing.
When compressing to the .xz format in SFN mode:
- Files without an extension get .xz just like on LFN systems.
- *.tar files become *.txz (shorthand for *.tar.xz). *.txz
is recognized by xz on all supported operating systems.
(Try to avoid confusing this with gzipped .txt files.)
- Files with 1-3 character extension have their extension modified
so that the last character is a dash ("-"). If the extension
is already three characters, the last character is lost. The
resulting *.?- or *.??- filename is recognized in LFN mode, but
it isn't recognized by xz on other operating systems.
Examples:
xz foo -> foo.xz | xz -d foo.xz -> foo
xz foo.tar -> foo.txz | xz -d foo.txz -> foo.tar
xz foo.c -> foo.c- | xz -d foo.c- -> foo.c
xz read.me -> read.me- | xz -d read.me- -> read.me
xz foo.txt -> foo.tx- | xz -d foo.tx- -> foo.tx !
Note that in the last example above, the third character of the
filename extension is lost.
When compressing to the legacy .lzma format in SFN mode:
- *.tar files become *.tlz (shorthand for *.tar.lzma). *.tlz
is recognized by xz on all supported operating systems.
- Other files become *.lzm. The original filename extension
is lost. *.lzm is recognized also in LFN mode, but it is not
recognized by xz on other operating systems.
Examples:
xz -F lzma foo -> foo.lzm | xz -d foo.lzm -> foo
xz -F lzma foo.tar -> foo.tlz | xz -d foo.tlz -> foo.tar
xz -F lzma foo.c -> foo.lzm | xz -d foo.lzm -> foo !
xz -F lzma read.me -> read.lzm | xz -d read.lzm -> read !
xz -F lzma foo.txt -> foo.lzm | xz -d foo.lzm -> foo !
When compressing with a custom suffix (-S .SUF, --suffix=.SUF) to
any file format:
- If the suffix begins with a dot, the filename extension is
replaced with the new suffix. The original extension is lost.
- If the suffix doesn't begin with a dot and the filename has no
extension and the filename given on the command line doesn't
have a dot at the end, the custom suffix is appended just like
on LFN systems.
- If the suffix doesn't begin with a dot and the filename has
an extension (or an extension-less filename is given with a dot
at the end), the last 1-3 characters of the filename extension
may get overwritten to fit the given custom suffix.
Examples:
xz -S x foo -> foox | xz -dS x foox -> foo
xz -S x foo. -> foo.x | xz -dS x foo.x -> foo
xz -S .x foo -> foo.x | xz -dS .x foo.x -> foo
xz -S .x foo. -> foo.x | xz -dS .x foo.x -> foo
xz -S x.y foo -> foox.y | xz -dS x.y foox.y -> foo
xz -S .a foo.c -> foo.a | xz -dS .a foo.a -> foo !
xz -S a foo.c -> foo.ca | xz -dS a foo.ca -> foo.c
xz -S ab foo.c -> foo.cab | xz -dS ab foo.cab -> foo.c
xz -S ab read.me -> read.mab | xz -dS ab read.mab -> read.m !
xz -S ab foo.txt -> foo.tab | xz -dS ab foo.tab -> foo.t !
xz -S abc foo.txt -> foo.abc | xz -dS abc foo.abc -> foo !
When decompressing, the suffix handling in SFN mode is the same as
in LFN mode. The DOS-specific filenames *.lzm, *.?-, and *.??- are
recognized also in LFN mode.
xz handles certain uncommon situations safely:
- If the generated output filename refers to the same file as
the input file, xz detects this and refuses to compress or
decompress the input file even if --force is used. This can
happen when giving an overlong filename in SFN mode. E.g.
"xz -S x foo.texinfo" would try to write to foo.tex which on
SFN system is the same file as foo.texinfo.
- If the generated output filename is a special file like "con"
or "prn", xz detects this and refuses to compress or decompress
the input file even if --force is used.
Bugs
xz doesn't necessarily work in Dosbox. It should work in DOSEMU.
Pressing Ctrl-c or Ctrl-Break won't remove the incomplete target file
when running under Windows XP Command Prompt (something goes wrong
with SIGINT handling). It works correctly under Windows 95/98/98SE/ME.

View File

@@ -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."

229
po/de.po
View File

@@ -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: 2012-05-29 21:55+0200\n"
"POT-Creation-Date: 2012-05-29 17:20+0200\n"
"PO-Revision-Date: 2010-09-07 20:27+0200\n"
"Last-Translator: <maan@systemlinux.org>\n"
"Language-Team: German\n"
@@ -15,75 +15,63 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/xz/args.c:338
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Unbekanntes file format"
#: src/xz/args.c:361 src/xz/args.c:369
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: Integritäts-Check Typ nicht unterstützt"
#: src/xz/args.c:396
#: src/xz/args.c:382
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:459
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "Die Umgebungsvariable %s enthält zu viele Argumente"
#: src/xz/coder.c:105
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Maximal vier Filter möglich"
#: src/xz/coder.c:118
#: src/xz/coder.c:108
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:148
#: src/xz/coder.c:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Verwendung der Voreinstellung im raw Modus wird nicht empfohlen."
#: src/xz/coder.c:150
#: src/xz/coder.c:131
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:176
#: src/xz/coder.c:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Das .lzma Format unterstützt nur den LZMA1 Filter"
#: src/xz/coder.c:184
#: src/xz/coder.c:165
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 kann nicht mit dem .xz Format verwendet werden"
#: src/xz/coder.c:203
msgid "Using up to %<PRIu32> threads."
msgstr "Benutze bis zu %<PRIu32> Threads."
#: src/xz/coder.c:216
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Optionen nicht unterstützt"
#: src/xz/coder.c:224
#: src/xz/coder.c:190
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "Dekompression wird %s MiB Speicher brauchen."
#: 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
#: src/xz/coder.c:247
#, c-format
msgid ""
"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
@@ -102,121 +90,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:136
#: src/xz/file_io.c:137
#, 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:143 src/xz/file_io.c:635
#: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Kann nicht löschen: %s"
#: src/xz/file_io.c:168
#: src/xz/file_io.c:169
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Kann Datei Eigentümer nicht setzen: %s"
#: src/xz/file_io.c:174
#: src/xz/file_io.c:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Kann Datei Gruppe nicht setzen: %s"
#: src/xz/file_io.c:193
#: src/xz/file_io.c:194
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Kann Zugriffsrechte nicht setzen: %s"
#: src/xz/file_io.c:340 src/xz/file_io.c:423
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Überspringe symbolischen Verweis"
#: src/xz/file_io.c:468
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Überspringe Verzeichnis"
#: src/xz/file_io.c:474
#: src/xz/file_io.c:461
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Keine reguläre Datei, überspringe"
#: src/xz/file_io.c:491
#: src/xz/file_io.c:478
#, 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:498
#: src/xz/file_io.c:485
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Datei hat sticky Bit gesetzt, überspringe"
#: src/xz/file_io.c:505
#: src/xz/file_io.c:492
#, 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:761
#: src/xz/file_io.c:713
#, 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:773
#: src/xz/file_io.c:725
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Fehler beim Schießen der Datei: %s"
#: src/xz/file_io.c:809 src/xz/file_io.c:1008
#: src/xz/file_io.c:761 src/xz/file_io.c:945
#, 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:883
#: src/xz/file_io.c:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Lesefehler: %s"
#: src/xz/file_io.c:906
#: src/xz/file_io.c:843
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
#: src/xz/file_io.c:916
#: src/xz/file_io.c:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Unerwartetes Ende der Datei"
#: src/xz/file_io.c:966
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Schreibfehler: %s"
#: src/xz/hardware.c:101
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Deaktiviert"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:120
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Gesamtmenge physikalischer Speicher (RAM): "
#: src/xz/hardware.c:122
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Speicher Nutzungslimit für Kompression: "
#: src/xz/hardware.c:124
#: src/xz/hardware.c:123
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:65
#: src/xz/list.c:62
msgid "None"
msgstr "Kein"
@@ -225,60 +213,60 @@ msgstr "Kein"
#. 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
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Unbek.2"
#: src/xz/list.c:73
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Unbek.3"
#: src/xz/list.c:75
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Unbek.5"
#: src/xz/list.c:76
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Unbek.6"
#: src/xz/list.c:77
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Unbek.7"
#: src/xz/list.c:78
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Unbek.8"
#: src/xz/list.c:79
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Unbek.9"
#: src/xz/list.c:81
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Unbek.11"
#: src/xz/list.c:82
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Unbek.12"
#: src/xz/list.c:83
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Unbek.13"
#: src/xz/list.c:84
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Unbek.14"
#: src/xz/list.c:85
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Unbek.15"
#: src/xz/list.c:153
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Datei ist leer"
#: src/xz/list.c:158
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s: Zu klein um ein gültiges .xz file zu sein"
@@ -287,41 +275,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:645
#: src/xz/list.c:603
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname"
#: src/xz/list.c:685
#: src/xz/list.c:643
#, c-format
msgid " Streams: %s\n"
msgstr " Ströme: %s\n"
#: src/xz/list.c:687
#: src/xz/list.c:645
#, c-format
msgid " Blocks: %s\n"
msgstr " Blöcke: %s\n"
#: src/xz/list.c:689
#: src/xz/list.c:647
#, c-format
msgid " Compressed size: %s\n"
msgstr " Größe komprimiert: %s\n"
#: src/xz/list.c:692
#: src/xz/list.c:650
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Größe unkomprimiert: %s\n"
#: src/xz/list.c:695
#: src/xz/list.c:653
#, c-format
msgid " Ratio: %s\n"
msgstr " Verhältnis: %s\n"
#: src/xz/list.c:697
#: src/xz/list.c:655
#, c-format
msgid " Check: %s\n"
msgstr " Check: %s\n"
#: src/xz/list.c:698
#: src/xz/list.c:656
#, c-format
msgid " Stream padding: %s\n"
msgstr " Strom Auffüllung: %s\n"
@@ -329,7 +317,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:726
#: src/xz/list.c:684
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize "
@@ -341,7 +329,7 @@ msgstr ""
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:781
#: src/xz/list.c:739
#, c-format
msgid ""
" Blocks:\n"
@@ -359,58 +347,53 @@ 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:793
#: src/xz/list.c:751
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter"
#: src/xz/list.c:871 src/xz/list.c:1046
#: src/xz/list.c:829 src/xz/list.c:998
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Benötigter Speicher: %s MiB\n"
#: src/xz/list.c:873 src/xz/list.c:1048
#: src/xz/list.c:831 src/xz/list.c:1000
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Größe in Köpfen: %s\n"
#: src/xz/list.c:874 src/xz/list.c:1049
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes"
msgstr "Ja"
#: src/xz/list.c:874 src/xz/list.c:1049
#: src/xz/list.c:832 src/xz/list.c:1001
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:1025
#: src/xz/list.c:977
#, 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:1038
#: src/xz/list.c:990
msgid "Totals:"
msgstr "Gesamt:"
#: src/xz/list.c:1039
#: src/xz/list.c:991
#, c-format
msgid " Number of files: %s\n"
msgstr " Anzahl Dateien: %s\n"
#: src/xz/list.c:1114
#: src/xz/list.c:1063
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:1120
#: src/xz/list.c:1069
msgid "--list does not support reading from standard input"
msgstr "--list unterstützt kein Lesen der Standardeingabe"
@@ -493,7 +476,6 @@ msgid "Unexpected end of input"
msgstr "Unerwartetes Eingabe Ende"
#: 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."
@@ -568,14 +550,6 @@ msgstr ""
#: 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"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
@@ -593,7 +567,7 @@ msgstr ""
" --files0=[DATEI] wie --files, aber benutze den Null Charakter als "
"Trenner"
#: src/xz/message.c:1139
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
@@ -601,7 +575,7 @@ msgstr ""
"\n"
" Grundlegende Optionen für Dateiformat und Kompression:\n"
#: src/xz/message.c:1141
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
@@ -617,7 +591,7 @@ msgstr ""
"`crc32',\n"
" `crc64' (Voreinstellung), oder `sha256'"
#: src/xz/message.c:1148
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n"
@@ -630,7 +604,7 @@ msgstr ""
"des\n"
" Dekomprimierers, wenn Sie 7-9 benutzen!"
#: src/xz/message.c:1152
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU "
"time;\n"
@@ -641,18 +615,7 @@ msgstr ""
" verhältnis zu verbessern. Das beeinflusst nicht den\n"
" Speicherbedarf des Dekomprimierers."
#: 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
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@@ -669,7 +632,7 @@ msgstr ""
"RAM,\n"
" oder 0 für Grundeinstellungen."
#: src/xz/message.c:1168
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage "
"limit,\n"
@@ -681,7 +644,7 @@ msgstr ""
"statt\n"
" die Einstellungen nach unten anzupassen."
#: src/xz/message.c:1174
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@@ -689,7 +652,7 @@ msgstr ""
"\n"
" User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):"
#: src/xz/message.c:1183
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
@@ -733,7 +696,7 @@ msgstr ""
" depth=NUM Maximale Suchtiefe; 0=automatisch\n"
" (Voreinstellung)"
#: src/xz/message.c:1198
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@@ -756,7 +719,7 @@ msgstr ""
" start=NUM Start-Offset für Konversion\n"
" (Voreinstellung=0)"
#: src/xz/message.c:1210
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@@ -770,7 +733,7 @@ msgstr ""
"voneinander\n"
" subtrahiert werden (1-256; 1)"
#: src/xz/message.c:1218
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
@@ -778,7 +741,7 @@ msgstr ""
"\n"
" Andere Optionen:\n"
#: src/xz/message.c:1221
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n"
@@ -790,25 +753,25 @@ msgstr ""
"noch\n"
" gesprächiger zu sein"
#: src/xz/message.c:1226
#: src/xz/message.c:1218
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:1228
#: src/xz/message.c:1220
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:1231
#: src/xz/message.c:1223
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:1234
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@@ -817,7 +780,7 @@ msgstr ""
" Optionen)\n"
" -H, --long-help zeige diese lange Hilfe an und terminiere"
#: src/xz/message.c:1238
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@@ -827,11 +790,11 @@ msgstr ""
"fortgeschrittene\n"
" Optionen an)"
#: src/xz/message.c:1243
#: src/xz/message.c:1235
msgid " -V, --version display the version number and exit"
msgstr " -V, --version zeige Versionsnummer an und terminiere"
#: src/xz/message.c:1245
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@@ -844,7 +807,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:1251
#: src/xz/message.c:1243
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
@@ -852,7 +815,7 @@ msgstr ""
"Melde Übersetzungsfehler an <maan@systemlinux.org> (in englisch oder "
"deutsch).\n"
#: src/xz/message.c:1253
#: src/xz/message.c:1245
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s Homepage: <%s>\n"
@@ -890,7 +853,7 @@ msgstr ""
"Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht "
"mindestens nice=%<PRIu32>"
#: src/xz/suffix.c:133 src/xz/suffix.c:258
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format
msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
@@ -898,17 +861,17 @@ msgstr ""
"%s: Mit --format=raw ist --sufix=.SUF notwendig, falls nicht nach stdout "
"geschrieben wird"
#: src/xz/suffix.c:164
#: src/xz/suffix.c:121
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Dateiname hat unbekannte Endung, überspringe"
#: src/xz/suffix.c:185
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Datei hat bereits `%s' Endung, überspringe"
#: src/xz/suffix.c:393
#: src/xz/suffix.c:235
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Ungültige Datei Endung"

247
po/fr.po
View File

@@ -6,7 +6,7 @@ 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"
"POT-Creation-Date: 2012-05-30 22:10+0200\n"
"PO-Revision-Date: 2010-09-24 21;12+0200\n"
"Last-Translator: Adrien Nader <camaradetux@gmail.com>\n"
"Language-Team: None\n"
@@ -16,69 +16,59 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n"
#: src/xz/args.c:338
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s : Format de fichier inconnu"
#: src/xz/args.c:361 src/xz/args.c:369
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s : Type de vérification d'intégrité inconnu"
#: src/xz/args.c:396
#: src/xz/args.c:382
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
#: src/xz/args.c:445
#, 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
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Le nombre maximal de filtres est quatre"
#: src/xz/coder.c:118
#: src/xz/coder.c:108
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
#: src/xz/coder.c:129
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
#: src/xz/coder.c:131
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
#: src/xz/coder.c:157
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
#: src/xz/coder.c:165
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
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Enchaînement ou options de filtres non pris en charge"
#: src/xz/coder.c:224
#: src/xz/coder.c:190
#, 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
#: src/xz/coder.c:247
#, 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"
@@ -93,118 +83,118 @@ msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas d
#. 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
#: src/xz/file_io.c:137
#, 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
#: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s : Impossible de supprimer : %s"
#: src/xz/file_io.c:168
#: src/xz/file_io.c:169
#, 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
#: src/xz/file_io.c:175
#, 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
#: src/xz/file_io.c:194
#, 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
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s est un lien symbolique : ignoré"
#: src/xz/file_io.c:468
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s est un répertoire : ignoré"
#: src/xz/file_io.c:474
#: src/xz/file_io.c:461
#, 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
#: src/xz/file_io.c:478
#, 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
#: src/xz/file_io.c:485
#, 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
#: src/xz/file_io.c:492
#, 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
#: src/xz/file_io.c:713
#, 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
#: src/xz/file_io.c:725
#, 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
#: src/xz/file_io.c:761 src/xz/file_io.c:945
#, 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
#: src/xz/file_io.c:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s : Erreur d'écriture : %s"
#: src/xz/file_io.c:906
#: src/xz/file_io.c:843
#, 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
#: src/xz/file_io.c:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s : Fin de fichier inattendue"
#: src/xz/file_io.c:966
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s : Erreur d'écriture : %s"
#: src/xz/hardware.c:101
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Désactivé"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:120
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Quantité totale de mémoire physique (RAM) : "
#: src/xz/hardware.c:122
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limite d'utilisation pour la compression : "
#: src/xz/hardware.c:124
#: src/xz/hardware.c:123
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
#: src/xz/list.c:62
msgid "None"
msgstr "Aucune"
@@ -213,60 +203,60 @@ msgstr "Aucune"
#. 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
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Inconnue-2"
#: src/xz/list.c:73
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Inconnue-3"
#: src/xz/list.c:75
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Inconnue-5"
#: src/xz/list.c:76
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Inconnue-6"
#: src/xz/list.c:77
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Inconnue-7"
#: src/xz/list.c:78
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Inconnue-8"
#: src/xz/list.c:79
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Inconnue-9"
#: src/xz/list.c:81
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Inconnue-11"
#: src/xz/list.c:82
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Inconnue-12"
#: src/xz/list.c:83
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Inconnue-13"
#: src/xz/list.c:84
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Inconnue-14"
#: src/xz/list.c:85
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Inconnue-15"
#: src/xz/list.c:153
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s : Le fichier est vide"
#: src/xz/list.c:158
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s : Trop petit pour être un fichier xz valide."
@@ -275,41 +265,41 @@ msgstr "%s : Trop petit pour être un fichier xz valide."
#. 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
#: src/xz/list.c:603
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
#: src/xz/list.c:643
#, c-format
msgid " Streams: %s\n"
msgstr " Flux : %s\n"
#: src/xz/list.c:687
#: src/xz/list.c:645
#, c-format
msgid " Blocks: %s\n"
msgstr " Blocs : %s\n"
#: src/xz/list.c:689
#: src/xz/list.c:647
#, c-format
msgid " Compressed size: %s\n"
msgstr " Taille compressé : %s\n"
#: src/xz/list.c:692
#: src/xz/list.c:650
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Taille décompressé : %s\n"
#: src/xz/list.c:695
#: src/xz/list.c:653
#, c-format
msgid " Ratio: %s\n"
msgstr " Ratio : %s\n"
#: src/xz/list.c:697
#: src/xz/list.c:655
#, c-format
msgid " Check: %s\n"
msgstr " Vérification : %s\n"
#: src/xz/list.c:698
#: src/xz/list.c:656
#, c-format
msgid " Stream padding: %s\n"
msgstr " Octets de rembourrage du flux : %s\n"
@@ -317,7 +307,7 @@ 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
#: src/xz/list.c:684
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
@@ -327,7 +317,7 @@ msgstr ""
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:781
#: src/xz/list.c:739
#, c-format
msgid ""
" Blocks:\n"
@@ -343,57 +333,52 @@ 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:793
#: src/xz/list.c:751
#, 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
#: src/xz/list.c:829 src/xz/list.c:998
#, 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
#: src/xz/list.c:831 src/xz/list.c:1000
#, 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
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes"
msgstr "Oui"
#: src/xz/list.c:874 src/xz/list.c:1049
#: src/xz/list.c:832 src/xz/list.c:1001
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
#: src/xz/list.c:977
#, 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
#: src/xz/list.c:990
msgid "Totals:"
msgstr "Totaux :"
#: src/xz/list.c:1039
#: src/xz/list.c:991
#, c-format
msgid " Number of files: %s\n"
msgstr " Nombre de fichiers : %s\n"
#: src/xz/list.c:1114
#: src/xz/list.c:1063
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
#: src/xz/list.c:1069
msgid "--list does not support reading from standard input"
msgstr "--list est incompatible avec la lecture sur l'entrée standard"
@@ -540,14 +525,6 @@ msgstr ""
#: 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"
@@ -562,7 +539,7 @@ msgstr ""
" 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
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
@@ -570,7 +547,7 @@ msgstr ""
"\n"
" Options basiques de format de fichier et de compression :\n"
#: src/xz/message.c:1141
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
@@ -582,7 +559,7 @@ msgstr ""
" -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
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
@@ -591,7 +568,7 @@ msgstr ""
" l'utilisation mémoire du compresseur *et* du décompresseur\n"
" avant d'utiliser 7, 8 ou 9 !"
#: src/xz/message.c:1152
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
@@ -600,17 +577,7 @@ msgstr ""
" 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
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@@ -626,7 +593,7 @@ msgstr ""
" 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
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
@@ -635,7 +602,7 @@ msgstr ""
" d'utilisation mémoire, renvoyer une erreur plutôt que de\n"
" diminuer les réglages"
#: src/xz/message.c:1174
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@@ -643,7 +610,7 @@ msgstr ""
"\n"
" Enchaînement de filtres de compression personnalisé (au lieu des préréglages) :"
#: src/xz/message.c:1183
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
@@ -672,7 +639,7 @@ msgstr ""
" depth=NUM profondeur de recherche maximale ;\n"
" 0=automatique (par défaut)"
#: src/xz/message.c:1198
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@@ -694,7 +661,7 @@ msgstr ""
" OPTS valides pour tous les filtres BCJ :\n"
" start=NUM start offset for conversions (default=0)"
#: src/xz/message.c:1210
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@@ -706,7 +673,7 @@ msgstr ""
" dist=NUM distance entre les octets soustraits\n"
" les uns aux autres (1-256 ; 1)"
#: src/xz/message.c:1218
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
@@ -714,7 +681,7 @@ msgstr ""
"\n"
" Autres options :\n"
#: src/xz/message.c:1221
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
@@ -723,17 +690,17 @@ msgstr ""
" aussi supprimer les erreur\n"
" -v, --verbose être bavard ; spécifier deux fois pour l'être davantage"
#: src/xz/message.c:1226
#: src/xz/message.c:1218
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
#: src/xz/message.c:1220
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
#: src/xz/message.c:1223
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
@@ -741,7 +708,7 @@ msgstr ""
" --info-memory affiche la quantité totale de RAM et la limite actuelle\n"
" en mémoire puis quitte"
#: src/xz/message.c:1234
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@@ -749,7 +716,7 @@ 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
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@@ -757,11 +724,11 @@ 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
#: src/xz/message.c:1235
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
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@@ -773,14 +740,14 @@ 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:1251
#: src/xz/message.c:1243
#, 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
#: src/xz/message.c:1245
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s page du projet : <%s>\n"
@@ -814,22 +781,22 @@ msgstr "La somme de lc et lp ne doit pas dépasser 4"
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
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, 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
#: src/xz/suffix.c:121
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s : Le fichier a un suffixe inconnu, ignoré"
#: src/xz/suffix.c:185
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, 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
#: src/xz/suffix.c:235
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Suffixe de nom de fichier invalide"
@@ -872,3 +839,25 @@ msgstr "Impossible d'écrire vers la sortie standard"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Erreur inconnue"
#~ msgid "Using up to %<PRIu32> threads."
#~ msgstr "Jusqu'à %<PRIu32> threads seront utilisés."
#~ 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"
#~ 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"
#~ 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)"

343
po/it.po
View File

@@ -2,97 +2,80 @@
# 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, 2011.
# Milo Casagrande <milo@ubuntu.com>, 2009, 2010, 2011, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: xz-utils\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"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2012-05-29 13:50+0300\n"
"PO-Revision-Date: 2012-05-31 09:57+0800\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"
"Content-Transfer-Encoding: 8-bit\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:338
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: tipo di formato del file sconosciuto"
#: ../src/xz/args.c:361 ../src/xz/args.c:369
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: tipo di controllo integrità non supportato"
#: ../src/xz/args.c:396
#: src/xz/args.c:382
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:459
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "La variabile d'ambiente %s contiene troppi argomenti"
#: ../src/xz/coder.c:105
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Il numero massimo di filtri è quattro"
#: ../src/xz/coder.c:118
#: src/xz/coder.c:108
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."
#. The message is shown only if warnings are allowed
#. but the exit status isn't changed.
#: ../src/xz/coder.c:148
#: src/xz/coder.c:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Non è consigliato usare un preset nella modalità raw."
#: ../src/xz/coder.c:150
#: src/xz/coder.c:131
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:176
#: src/xz/coder.c:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Il formato .lzma supporta solo il filtro LZMA1"
#: ../src/xz/coder.c:184
#: src/xz/coder.c:165
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 non può essere usato con il formato .xz"
#: ../src/xz/coder.c:203
#, c-format
msgid "Using up to %<PRIu32> threads."
msgstr "Vengono usati circa %<PRIu32> thread."
#: ../src/xz/coder.c:216
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Catena di filtri od opzioni del filtro non supportata"
#: ../src/xz/coder.c:224
#: src/xz/coder.c:190
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "L'estrazione necessita di %s MiB di memoria."
#: ../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
#: src/xz/coder.c:247
#, c-format
msgid ""
"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
@@ -111,128 +94,119 @@ 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:136
#: src/xz/file_io.c:137
#, 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:143 ../src/xz/file_io.c:635
#: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: impossibile rimuovere: %s"
#: ../src/xz/file_io.c:168
#: src/xz/file_io.c:169
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: impossibile impostare il proprietario del file: %s"
#: ../src/xz/file_io.c:174
#: src/xz/file_io.c:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: impossibile impostare il gruppo del file: %s"
#: ../src/xz/file_io.c:193
#: src/xz/file_io.c:194
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: impossibile impostare i permessi del file: %s"
#: ../src/xz/file_io.c:340 ../src/xz/file_io.c:423
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: è un collegamento simbolico, viene saltato"
#: ../src/xz/file_io.c:468
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: è una directory, viene saltata"
#: ../src/xz/file_io.c:474
#: src/xz/file_io.c:461
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: non è un file regolare, viene saltato"
#. 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
#: src/xz/file_io.c:478
#, 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:498
#: src/xz/file_io.c:485
#, 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:505
#: src/xz/file_io.c:492
#, 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:761
#: src/xz/file_io.c:713
#, 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:773
#: src/xz/file_io.c:725
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: chiusura del file non riuscita: %s"
#: ../src/xz/file_io.c:809 ../src/xz/file_io.c:1008
#: src/xz/file_io.c:761 src/xz/file_io.c:945
#, 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:883
#: src/xz/file_io.c:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: errore di lettura: %s"
#: ../src/xz/file_io.c:906
#: src/xz/file_io.c:843
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: errore nel cercare il file: %s"
#: ../src/xz/file_io.c:916
#: src/xz/file_io.c:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: fine del file inaspettata"
#: ../src/xz/file_io.c:966
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: errore di scrittura: %s"
#: ../src/xz/hardware.c:101
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Disabilitato"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: ../src/xz/hardware.c:120
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Quantità totale di memoria fisica (RAM): "
#: ../src/xz/hardware.c:122
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limite utilizzo memoria per la compressione: "
#: ../src/xz/hardware.c:124
#: src/xz/hardware.c:123
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"
@@ -241,60 +215,60 @@ msgstr "Nessuno"
#. 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: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"
@@ -303,51 +277,49 @@ 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:603
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:643
#, c-format
msgid " Streams: %s\n"
msgstr " Stream: %s\n"
#: ../src/xz/list.c:654
#: src/xz/list.c:645
#, c-format
msgid " Blocks: %s\n"
msgstr " Blocchi: %s\n"
#: ../src/xz/list.c:656
#: src/xz/list.c:647
#, c-format
msgid " Compressed size: %s\n"
msgstr " Dim. compresso: %s\n"
#: ../src/xz/list.c:659
#: src/xz/list.c:650
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Dim. estratto: %s\n"
#: ../src/xz/list.c:662
#: src/xz/list.c:653
#, c-format
msgid " Ratio: %s\n"
msgstr " Rapporto: %s\n"
#: ../src/xz/list.c:664
#: src/xz/list.c:655
#, c-format
msgid " Check: %s\n"
msgstr " Controllo: %s\n"
#: ../src/xz/list.c:665
#: src/xz/list.c:656
#, 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:684
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize "
@@ -359,7 +331,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:739
#, c-format
msgid ""
" Blocks:\n"
@@ -377,74 +349,66 @@ 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:751
#, 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:829 src/xz/list.c:998
#, 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:831 src/xz/list.c:1000
#, 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:832 src/xz/list.c:1001
msgid "Yes"
msgstr "Sì"
#: ../src/xz/list.c:841 ../src/xz/list.c:1010
#: src/xz/list.c:832 src/xz/list.c:1001
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:977
#, 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:990
msgid "Totals:"
msgstr "Totali:"
#: ../src/xz/list.c:1000
#: src/xz/list.c:991
#, c-format
msgid " Number of files: %s\n"
msgstr " Numero di file: %s\n"
#: ../src/xz/list.c:1072
#: src/xz/list.c:1063
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:1069
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"
#. A null character was found when using --files,
#. which expects plain text input separated with
#. newlines.
#: ../src/xz/main.c:120
#: src/xz/main.c:120
#, c-format
msgid ""
"%s: Null character found when reading filenames; maybe you meant to use `--"
@@ -453,11 +417,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"
@@ -469,68 +433,71 @@ msgstr ""
#. 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
#: src/xz/message.c:733
#, c-format
msgid "%s: "
msgstr "%s: "
#: ../src/xz/message.c:796 ../src/xz/message.c:846
#: src/xz/message.c:796 src/xz/message.c:846
msgid "Internal error (bug)"
msgstr "Errore interno (bug)"
#: ../src/xz/message.c:803
#: src/xz/message.c:803
msgid "Cannot establish signal handlers"
msgstr "Impossibile stabilire i gestori dei segnali"
#: ../src/xz/message.c:812
#: 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:815
#: 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:822
#: src/xz/message.c:822
msgid "Memory usage limit reached"
msgstr "Limite di utilizzo della memoria raggiunto"
#: ../src/xz/message.c:825
#: src/xz/message.c:825
msgid "File format not recognized"
msgstr "Formato di file non riconosciuto"
#: ../src/xz/message.c:828
#: src/xz/message.c:828
msgid "Unsupported options"
msgstr "Opzioni non supportate"
#: ../src/xz/message.c:831
#: src/xz/message.c:831
msgid "Compressed data is corrupt"
msgstr "I dati compressi sono danneggiati"
#: ../src/xz/message.c:834
#: src/xz/message.c:834
msgid "Unexpected end of input"
msgstr "Fine dell'input non attesa"
#: ../src/xz/message.c:885
#: src/xz/message.c:867
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "%s MiB di memoria sono richiesti. Alcun limite impostato."
#: src/xz/message.c:895
#, 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:1052
#: src/xz/message.c:1062
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: catena di filtri: %s\n"
#. 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
#: src/xz/message.c:1072
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Provare \"%s --help\" per maggiori informazioni."
#: ../src/xz/message.c:1088
#: src/xz/message.c:1098
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
@@ -541,18 +508,18 @@ msgstr ""
"Comprime o estrae i FILE nel formato .xz.\n"
"\n"
#: ../src/xz/message.c:1095
#: src/xz/message.c:1105
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:1099
#: src/xz/message.c:1109
msgid " Operation mode:\n"
msgstr " Modalità di operazione:\n"
#: ../src/xz/message.c:1102
#: src/xz/message.c:1112
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
@@ -564,7 +531,7 @@ msgstr ""
" -t, --test Verifica l'integrità dei file compressi\n"
" -l, --list Elenca informazioni sui file .xz"
#: ../src/xz/message.c:1108
#: src/xz/message.c:1118
msgid ""
"\n"
" Operation modifiers:\n"
@@ -572,7 +539,7 @@ msgstr ""
"\n"
" Modificatori di operazioni:\n"
#: ../src/xz/message.c:1111
#: 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"
@@ -585,15 +552,7 @@ msgstr ""
" -c, --stdout Scrive sullo standard output e non elimina i file di "
"input"
#: ../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
#: src/xz/message.c:1127
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
@@ -613,7 +572,7 @@ msgstr ""
" di newline\n"
" --files0=[FILE] Come --files ma usa il carattere null come terminatore"
#: ../src/xz/message.c:1129
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
@@ -621,7 +580,7 @@ msgstr ""
"\n"
" Formato file di base e opzioni di compressione:\n"
#: ../src/xz/message.c:1131
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
@@ -636,7 +595,7 @@ msgstr ""
"attenzione),\n"
" \"crc32\", \"crc64\" (predefinito) o \"sha256\""
#: ../src/xz/message.c:1138
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n"
@@ -649,7 +608,7 @@ msgstr ""
"prima\n"
" di usare 7-9"
#: ../src/xz/message.c:1142
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU "
"time;\n"
@@ -660,17 +619,7 @@ msgstr ""
"di\n"
" memoria in fase di estrazione"
#: ../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
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@@ -688,7 +637,7 @@ msgstr ""
"byte,\n"
" % della memoria RAM oppure 0 per il valore predefinito"
#: ../src/xz/message.c:1158
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage "
"limit,\n"
@@ -700,7 +649,7 @@ msgstr ""
" utilizzo della memoria, lancia un errore invece di\n"
" utilizzare valori più piccoli"
#: ../src/xz/message.c:1164
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@@ -709,7 +658,7 @@ msgstr ""
" Catena di filtri personalizzati per la compressione (alternative per\n"
" l'utilizzo di preset):"
#: ../src/xz/message.c:1173
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
@@ -752,7 +701,7 @@ msgstr ""
"0=automatica\n"
" (predefinito)"
#: ../src/xz/message.c:1188
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@@ -775,7 +724,7 @@ msgstr ""
" start=NUM Offset iniziale per le conversioni\n"
" (predefinito=0)"
#: ../src/xz/message.c:1200
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@@ -787,7 +736,7 @@ msgstr ""
" dist=NUM Distanza tra byte sottratti\n"
" gli uni dagli altri (1-256; 1)"
#: ../src/xz/message.c:1208
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
@@ -795,7 +744,7 @@ msgstr ""
"\n"
" Altre opzioni:\n"
#: ../src/xz/message.c:1211
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n"
@@ -808,16 +757,16 @@ msgstr ""
"ancora\n"
" più prolisso"
#: ../src/xz/message.c:1216
#: src/xz/message.c:1218
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:1218
#: src/xz/message.c:1220
msgid ""
" --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot Usa messaggi analizzabili (utile per gli script)"
#: ../src/xz/message.c:1221
#: src/xz/message.c:1223
msgid ""
" --info-memory display the total amount of RAM and the currently "
"active\n"
@@ -827,7 +776,7 @@ msgstr ""
"attuale\n"
" attivo di utilizzo della memore ed esce"
#: ../src/xz/message.c:1224
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@@ -835,7 +784,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:1228
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@@ -843,11 +792,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:1233
#: src/xz/message.c:1235
msgid " -V, --version display the version number and exit"
msgstr " -V, --version Stampa il numero della versione ed esce"
#: ../src/xz/message.c:1235
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@@ -859,51 +808,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:1241
#: src/xz/message.c:1243
#, 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:1243
#: src/xz/message.c:1245
#, 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>"
#: ../src/xz/suffix.c:133 ../src/xz/suffix.c:258
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format
msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
@@ -911,59 +860,59 @@ msgstr ""
"%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva "
"sullo stdout"
#: ../src/xz/suffix.c:164
#: src/xz/suffix.c:121
#, 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:185
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, 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:393
#: src/xz/suffix.c:235
#, 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>]"
#: ../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"

227
po/pl.po
View File

@@ -4,9 +4,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.1.1\n"
"Project-Id-Version: xz 5.0.2\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2012-05-29 13:59+0300\n"
"POT-Creation-Date: 2012-05-29 13:50+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"
@@ -16,69 +16,59 @@ 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:338
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Nieznany typ formatu pliku"
#: src/xz/args.c:361 src/xz/args.c:369
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: Nieobsługiwany typ kontroli spójności"
#: src/xz/args.c:396
#: src/xz/args.c:382
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "Wraz z opcją `--files' lub `--files0' można podać tylko jeden plik."
#: src/xz/args.c:459
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "Zmienna środowiskowa %s zawiera zbyt dużo argumentów"
#: src/xz/coder.c:105
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Maksymalna liczba filtrów to cztery"
#: src/xz/coder.c:118
#: src/xz/coder.c:108
msgid "Memory usage limit is too low for the given filter setup."
msgstr "Limit użycia pamięci jest zbyt mały dla podanej konfiguracji filtra."
#: src/xz/coder.c:148
#: src/xz/coder.c:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane."
#: src/xz/coder.c:150
#: src/xz/coder.c:131
msgid "The exact options of the presets may vary between software versions."
msgstr "Dokładne opcje ustawień predefiniowanych mogą różnić się między wersjami oprogramowania."
#: src/xz/coder.c:176
#: src/xz/coder.c:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Format .lzma obsługuje tylko filtr LZMA1"
#: src/xz/coder.c:184
#: src/xz/coder.c:165
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 nie może być używany z formatem .xz"
#: src/xz/coder.c:203
#, c-format
msgid "Using up to %<PRIu32> threads."
msgstr "Maksymalna liczba używanych wątków: %<PRIu32>."
#: src/xz/coder.c:216
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra"
#: src/xz/coder.c:224
#: src/xz/coder.c:190
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "Dekompresja będzie wymagała %s MiB pamięci."
#: src/xz/coder.c:259
#, c-format
msgid "Adjusted the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
msgstr "Skorygowano liczbę wątków z %s do %s, aby nie przekroczyć limitu użycia pamięci %s MiB"
#: src/xz/coder.c:313
#: src/xz/coder.c:247
#, 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"
@@ -93,118 +83,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:136
#: src/xz/file_io.c:137
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s: Plik wygląda na przeniesiony, nie zostanie usunięty"
#: src/xz/file_io.c:143 src/xz/file_io.c:635
#: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Nie można usunąć: %s"
#: src/xz/file_io.c:168
#: src/xz/file_io.c:169
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Nie można ustawić właściciela pliku: %s"
#: src/xz/file_io.c:174
#: src/xz/file_io.c:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Nie można ustawić grupy pliku: %s"
#: src/xz/file_io.c:193
#: src/xz/file_io.c:194
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Nie można ustawić uprawnień pliku: %s"
#: src/xz/file_io.c:340 src/xz/file_io.c:423
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Jest dowiązaniem symbolicznym, pominięto"
#: src/xz/file_io.c:468
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Jest katalogiem, pominięto"
#: src/xz/file_io.c:474
#: src/xz/file_io.c:461
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Nie jest zwykłym plikiem, pominięto"
#: src/xz/file_io.c:491
#: src/xz/file_io.c:478
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Plik ma ustawiony bit setuid lub setgid, pominięto"
#: src/xz/file_io.c:498
#: src/xz/file_io.c:485
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Plik ma ustawiony bit sticky, pominięto"
#: src/xz/file_io.c:505
#: src/xz/file_io.c:492
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Plik wejściowy ma więcej niż jedno dowiązanie zwykłe, pominięto"
#: src/xz/file_io.c:761
#: src/xz/file_io.c:713
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Błąd podczas odtwarzania flagi O_APPEND dla standardowego wyjścia: %s"
#: src/xz/file_io.c:773
#: src/xz/file_io.c:725
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Zamknięcie pliku nie powiodło się: %s"
#: src/xz/file_io.c:809 src/xz/file_io.c:1008
#: src/xz/file_io.c:761 src/xz/file_io.c:945
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s: Zmiana pozycji nie powiodła się podczas próby utworzenia pliku rzadkiego: %s"
#: src/xz/file_io.c:883
#: src/xz/file_io.c:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Błąd odczytu: %s"
#: src/xz/file_io.c:906
#: src/xz/file_io.c:843
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Błąd podczas zmiany pozycji w pliku: %s"
#: src/xz/file_io.c:916
#: src/xz/file_io.c:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Nieoczekiwany koniec pliku"
#: src/xz/file_io.c:966
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Błąd zapisu: %s"
#: src/xz/hardware.c:101
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Wyłączony"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:120
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
#: src/xz/hardware.c:122
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limit użycia pamięci dla kompresji: "
#: src/xz/hardware.c:124
#: src/xz/hardware.c:123
msgid "Memory usage limit for decompression: "
msgstr "Limit użycia pamięci dla dekompresji: "
#. TRANSLATORS: Indicates that there is no integrity check.
#. This string is used in tables, so the width must not
#. exceed ten columns with a fixed-width font.
#: src/xz/list.c:65
#: src/xz/list.c:62
msgid "None"
msgstr "Brak"
@@ -213,60 +203,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:72
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Nieznany-2"
#: src/xz/list.c:73
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Nieznany-3"
#: src/xz/list.c:75
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Nieznany-5"
#: src/xz/list.c:76
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Nieznany-6"
#: src/xz/list.c:77
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Nieznany-7"
#: src/xz/list.c:78
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Nieznany-8"
#: src/xz/list.c:79
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Nieznany-9"
#: src/xz/list.c:81
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Nieznany11"
#: src/xz/list.c:82
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Nieznany12"
#: src/xz/list.c:83
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Nieznany13"
#: src/xz/list.c:84
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Nieznany14"
#: src/xz/list.c:85
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Nieznany15"
#: src/xz/list.c:153
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Plik jest pusty"
#: src/xz/list.c:158
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s: Za mały na poprawny plik .xz"
@@ -275,41 +265,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:645
#: src/xz/list.c:603
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
#: src/xz/list.c:685
#: src/xz/list.c:643
#, c-format
msgid " Streams: %s\n"
msgstr " Strumienie: %s\n"
#: src/xz/list.c:687
#: src/xz/list.c:645
#, c-format
msgid " Blocks: %s\n"
msgstr " Bloki: %s\n"
#: src/xz/list.c:689
#: src/xz/list.c:647
#, c-format
msgid " Compressed size: %s\n"
msgstr " Rozmiar spakowany: %s\n"
#: src/xz/list.c:692
#: src/xz/list.c:650
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Rozmiar rozpakowany: %s\n"
#: src/xz/list.c:695
#: src/xz/list.c:653
#, c-format
msgid " Ratio: %s\n"
msgstr " Współczynnik: %s\n"
#: src/xz/list.c:697
#: src/xz/list.c:655
#, c-format
msgid " Check: %s\n"
msgstr " Kontrola spójności: %s\n"
#: src/xz/list.c:698
#: src/xz/list.c:656
#, c-format
msgid " Stream padding: %s\n"
msgstr " Wyrównanie strumienia: %s\n"
@@ -317,7 +307,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:726
#: src/xz/list.c:684
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
@@ -327,7 +317,7 @@ msgstr ""
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:781
#: src/xz/list.c:739
#, c-format
msgid ""
" Blocks:\n"
@@ -343,37 +333,32 @@ 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:793
#: src/xz/list.c:751
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
#: src/xz/list.c:871 src/xz/list.c:1046
#: src/xz/list.c:829 src/xz/list.c:998
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Wymagana pamięć: %s MiB\n"
#: src/xz/list.c:873 src/xz/list.c:1048
#: src/xz/list.c:831 src/xz/list.c:1000
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Rozmiar w nagłówkach: %s\n"
#: src/xz/list.c:874 src/xz/list.c:1049
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes"
msgstr "Tak"
#: src/xz/list.c:874 src/xz/list.c:1049
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "No"
msgstr "Nie"
#: src/xz/list.c:875 src/xz/list.c:1050
#, c-format
msgid " Minimum XZ Utils version: %s\n"
msgstr " Minimalna wersja XZ Utils: %s\n"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:1025
#: src/xz/list.c:977
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
@@ -381,20 +366,20 @@ msgstr[0] "%s plik\n"
msgstr[1] "%s pliki\n"
msgstr[2] "%s plików\n"
#: src/xz/list.c:1038
#: src/xz/list.c:990
msgid "Totals:"
msgstr "Sumarycznie:"
#: src/xz/list.c:1039
#: src/xz/list.c:991
#, c-format
msgid " Number of files: %s\n"
msgstr " Liczba plików: %s\n"
#: src/xz/list.c:1114
#: src/xz/list.c:1063
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list działa tylko z plikami .xz (--format=xz lub --format=auto)"
#: src/xz/list.c:1120
#: src/xz/list.c:1069
msgid "--list does not support reading from standard input"
msgstr "--list nie obsługuje odczytu ze standardowego wejścia"
@@ -539,14 +524,6 @@ msgstr ""
#: src/xz/message.c:1127
msgid ""
" --single-stream decompress only the first stream, and silently\n"
" ignore possible remaining input data"
msgstr ""
" --single-stream dekompresja tylko pierwszego strumienia, ciche\n"
" zignorowanie pozostałych danych wejściowych"
#: src/xz/message.c:1130
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
@@ -561,7 +538,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:1139
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
@@ -569,7 +546,7 @@ msgstr ""
"\n"
" Podstawowe opcje formatu pliku i kompresji:\n"
#: src/xz/message.c:1141
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
@@ -581,7 +558,7 @@ msgstr ""
" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n"
" `crc32', `crc64' (domyślny) lub `sha256'"
#: src/xz/message.c:1148
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
@@ -590,7 +567,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:1152
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
@@ -599,17 +576,7 @@ msgstr ""
" ilości czasu procesora; nie wpływa na wymagania\n"
" pamięciowe dekompresora"
#: src/xz/message.c:1157
msgid ""
" --block-size=SIZE\n"
" when compressing to the .xz format, start a new block\n"
" after every SIZE bytes of input; 0=disabled (default)"
msgstr ""
" --block-size=LICZBA\n"
" przy kompresji do formatu .xz: rozpoczynanie nowego bloku\n"
" po każdej LICZBIE bajtów wejścia; 0=wyłączone (domyślne)"
#: src/xz/message.c:1161
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@@ -625,7 +592,7 @@ msgstr ""
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
" dla limitów domyślnych"
#: src/xz/message.c:1168
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
@@ -634,7 +601,7 @@ msgstr ""
" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n"
" ustawień"
#: src/xz/message.c:1174
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@@ -642,7 +609,7 @@ msgstr ""
"\n"
" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):"
#: src/xz/message.c:1183
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
@@ -671,7 +638,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:1198
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@@ -693,7 +660,7 @@ msgstr ""
" Poprawne OPCJE dla wszystkich filtrów BCJ:\n"
" start=ILE offset początku konwersji (domyślnie=0)"
#: src/xz/message.c:1210
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@@ -705,7 +672,7 @@ msgstr ""
" dist=ILE odległość między bajtami odejmowanymi od\n"
" siebie (1-256; 1)"
#: src/xz/message.c:1218
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
@@ -713,7 +680,7 @@ msgstr ""
"\n"
" Inne opcje:\n"
#: src/xz/message.c:1221
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
@@ -721,15 +688,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:1226
#: src/xz/message.c:1218
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn ostrzeżenia nie mają wpływu na status zakończenia"
#: src/xz/message.c:1228
#: src/xz/message.c:1220
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)"
#: src/xz/message.c:1231
#: src/xz/message.c:1223
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
@@ -737,7 +704,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:1234
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@@ -745,7 +712,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:1238
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@@ -753,11 +720,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:1243
#: src/xz/message.c:1235
msgid " -V, --version display the version number and exit"
msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie"
#: src/xz/message.c:1245
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@@ -769,7 +736,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:1251
#: src/xz/message.c:1243
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
@@ -778,7 +745,7 @@ msgstr ""
"Błędy w tłumaczeniu prosimy zgłaszać na adres\n"
"<translation-team-pl@lists.sourceforge.net>.\n"
#: src/xz/message.c:1253
#: src/xz/message.c:1245
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Strona domowa %s: <%s>\n"
@@ -812,22 +779,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:133 src/xz/suffix.c:258
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "%s: Przy --format=raw i zapisie do pliku wymagana jest opcja --suffix=.ROZ"
#: src/xz/suffix.c:164
#: src/xz/suffix.c:121
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto"
#: src/xz/suffix.c:185
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Plik już ma rozszerzenie `%s', pominięto"
#: src/xz/suffix.c:393
#: src/xz/suffix.c:235
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Błędne rozszerzenie nazwy pliku"

View File

@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file mythread.h
/// \brief Some threading related helper macros and functions
/// \brief Wrappers for threads
//
// Author: Lasse Collin
//
@@ -10,218 +10,33 @@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef MYTHREAD_H
#define MYTHREAD_H
#include "sysdefs.h"
#ifdef HAVE_PTHREAD
# include <pthread.h>
////////////////////
// Using pthreads //
////////////////////
# define mythread_once(func) \
do { \
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
pthread_once(&once_, &func); \
} while (0)
#include <sys/time.h>
#include <pthread.h>
#include <signal.h>
#include <time.h>
#ifdef __VMS
// Do nothing on OpenVMS. It doesn't have pthread_sigmask().
#define mythread_sigmask(how, set, oset) do { } while (0)
#else
/// \brief Set the process signal mask
///
/// If threads are disabled, sigprocmask() is used instead
/// of pthread_sigmask().
#define mythread_sigmask(how, set, oset) \
pthread_sigmask(how, set, oset)
#endif
/// \brief Call the given function once
///
/// If threads are disabled, a thread-unsafe version is used.
#define mythread_once(func) \
do { \
static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
pthread_once(&once_, &func); \
} while (0)
/// \brief Lock a mutex for a duration of a block
///
/// Perform pthread_mutex_lock(&mutex) in the beginning of a block
/// and pthread_mutex_unlock(&mutex) at the end of the block. "break"
/// may be used to unlock the mutex and jump out of the block.
/// mythread_sync blocks may be nested.
///
/// Example:
///
/// mythread_sync(mutex) {
/// foo();
/// if (some_error)
/// break; // Skips bar()
/// bar();
/// }
///
/// At least GCC optimizes the loops completely away so it doesn't slow
/// things down at all compared to plain pthread_mutex_lock(&mutex)
/// and pthread_mutex_unlock(&mutex) calls.
///
#define mythread_sync(mutex) mythread_sync_helper(mutex, __LINE__)
#define mythread_sync_helper(mutex, line) \
for (unsigned int mythread_i_ ## line = 0; \
mythread_i_ ## line \
? (pthread_mutex_unlock(&(mutex)), 0) \
: (pthread_mutex_lock(&(mutex)), 1); \
mythread_i_ ## line = 1) \
for (unsigned int mythread_j_ ## line = 0; \
!mythread_j_ ## line; \
mythread_j_ ## line = 1)
typedef struct {
/// Condition variable
pthread_cond_t cond;
#ifdef HAVE_CLOCK_GETTIME
/// Clock ID (CLOCK_REALTIME or CLOCK_MONOTONIC) associated with
/// the condition variable
clockid_t clk_id;
#endif
} mythread_cond;
/// \brief Initialize a condition variable to use CLOCK_MONOTONIC
///
/// Using CLOCK_MONOTONIC instead of the default CLOCK_REALTIME makes the
/// timeout in pthread_cond_timedwait() work correctly also if system time
/// is suddenly changed. Unfortunately CLOCK_MONOTONIC isn't available
/// everywhere while the default CLOCK_REALTIME is, so the default is
/// used if CLOCK_MONOTONIC isn't available.
static inline int
mythread_cond_init(mythread_cond *mycond)
{
#ifdef HAVE_CLOCK_GETTIME
// NOTE: HAVE_DECL_CLOCK_MONOTONIC is always defined to 0 or 1.
# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && HAVE_DECL_CLOCK_MONOTONIC
struct timespec ts;
pthread_condattr_t condattr;
// POSIX doesn't seem to *require* that pthread_condattr_setclock()
// will fail if given an unsupported clock ID. Test that
// CLOCK_MONOTONIC really is supported using clock_gettime().
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0
&& pthread_condattr_init(&condattr) == 0) {
int ret = pthread_condattr_setclock(
&condattr, CLOCK_MONOTONIC);
if (ret == 0)
ret = pthread_cond_init(&mycond->cond, &condattr);
pthread_condattr_destroy(&condattr);
if (ret == 0) {
mycond->clk_id = CLOCK_MONOTONIC;
return 0;
}
}
// If anything above fails, fall back to the default CLOCK_REALTIME.
# endif
mycond->clk_id = CLOCK_REALTIME;
#endif
return pthread_cond_init(&mycond->cond, NULL);
}
/// \brief Convert relative time to absolute time for use with timed wait
///
/// The current time of the clock associated with the condition variable
/// is added to the relative time in *ts.
static inline void
mythread_cond_abstime(const mythread_cond *mycond, struct timespec *ts)
{
#ifdef HAVE_CLOCK_GETTIME
struct timespec now;
clock_gettime(mycond->clk_id, &now);
ts->tv_sec += now.tv_sec;
ts->tv_nsec += now.tv_nsec;
#else
(void)mycond;
struct timeval now;
gettimeofday(&now, NULL);
ts->tv_sec += now.tv_sec;
ts->tv_nsec += now.tv_usec * 1000L;
#endif
// tv_nsec must stay in the range [0, 999_999_999].
if (ts->tv_nsec >= 1000000000L) {
ts->tv_nsec -= 1000000000L;
++ts->tv_sec;
}
return;
}
#define mythread_cond_wait(mycondptr, mutexptr) \
pthread_cond_wait(&(mycondptr)->cond, mutexptr)
#define mythread_cond_timedwait(mycondptr, mutexptr, abstimeptr) \
pthread_cond_timedwait(&(mycondptr)->cond, mutexptr, abstimeptr)
#define mythread_cond_signal(mycondptr) \
pthread_cond_signal(&(mycondptr)->cond)
#define mythread_cond_broadcast(mycondptr) \
pthread_cond_broadcast(&(mycondptr)->cond)
#define mythread_cond_destroy(mycondptr) \
pthread_cond_destroy(&(mycondptr)->cond)
/// \brief Create a thread with all signals blocked
static inline int
mythread_create(pthread_t *thread, void *(*func)(void *arg), void *arg)
{
sigset_t old;
sigset_t all;
sigfillset(&all);
pthread_sigmask(SIG_SETMASK, &all, &old);
const int ret = pthread_create(thread, NULL, func, arg);
pthread_sigmask(SIG_SETMASK, &old, NULL);
return ret;
}
# define mythread_sigmask(how, set, oset) \
pthread_sigmask(how, set, oset)
#else
//////////////////
// No threading //
//////////////////
# define mythread_once(func) \
do { \
static bool once_ = false; \
if (!once_) { \
func(); \
once_ = true; \
} \
} while (0)
#define mythread_sigmask(how, set, oset) \
sigprocmask(how, set, oset)
#define mythread_once(func) \
do { \
static bool once_ = false; \
if (!once_) { \
func(); \
once_ = true; \
} \
} while (0)
#endif
# define mythread_sigmask(how, set, oset) \
sigprocmask(how, set, oset)
#endif

View File

@@ -24,13 +24,7 @@ liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \
-DTUKLIB_SYMBOL_PREFIX=lzma_
liblzma_la_LDFLAGS = -no-undefined -version-info 5:99:0
if COND_SYMVERS
EXTRA_DIST += liblzma.map
liblzma_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
endif
liblzma_la_LDFLAGS = -no-undefined -version-info 5:7:0
include $(srcdir)/common/Makefile.inc
include $(srcdir)/check/Makefile.inc
@@ -94,3 +88,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,@PTHREAD_LIBS[@],$(PTHREAD_LIBS),g' \
< $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; }
clean-local:
rm -f liblzma.pc

View File

@@ -332,19 +332,11 @@ typedef enum {
* malloc() and free(). C++ users should note that the custom memory
* handling functions must not throw exceptions.
*
* Single-threaded mode only: liblzma doesn't make an internal copy of
* lzma_allocator. Thus, it is OK to change these function pointers in
* the middle of the coding process, but obviously it must be done
* carefully to make sure that the replacement `free' can deallocate
* memory allocated by the earlier `alloc' function(s).
*
* Multithreaded mode: liblzma might internally store pointers to the
* lzma_allocator given via the lzma_stream structure. The application
* must not change the allocator pointer in lzma_stream or the contents
* of the pointed lzma_allocator structure until lzma_end() has been used
* to free the memory associated with that lzma_stream. The allocation
* functions might be called simultaneously from multiple threads, and
* thus they must be thread safe.
* liblzma doesn't make an internal copy of lzma_allocator. Thus, it is
* OK to change these function pointers in the middle of the coding
* process, but obviously it must be done carefully to make sure that the
* replacement `free' can deallocate memory allocated by the earlier
* `alloc' function(s).
*/
typedef struct {
/**

View File

@@ -318,6 +318,9 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
* The size of the Block Header must have already been decoded with
* lzma_block_header_size_decode() macro and stored to block->header_size.
*
* The integrity check type from Stream Header must have been stored
* to block->check.
*
* block->filters must have been allocated, but they don't need to be
* initialized (possible existing filter options are not freed).
*

View File

@@ -60,129 +60,6 @@
#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31)
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */
/**
* \brief Multithreading options
*/
typedef struct {
/**
* \brief Flags
*
* Set this to zero if no flags are wanted.
*
* No flags are currently supported.
*/
uint32_t flags;
/**
* \brief Number of worker threads to use
*/
uint32_t threads;
/**
* \brief Maximum uncompressed size of a Block
*
* The encoder will start a new .xz Block every block_size bytes.
* Using LZMA_FULL_FLUSH or LZMA_FULL_BARRIER with lzma_code()
* the caller may tell liblzma to start a new Block earlier.
*
* With LZMA2, a recommended block size is 2-4 times the LZMA2
* dictionary size. With very small dictionaries, it is recommended
* to use at least 1 MiB block size for good compression ratio, even
* if this is more than four times the dictionary size. Note that
* these are only recommendations for typical use cases; feel free
* to use other values. Just keep in mind that using a block size
* less than the LZMA2 dictionary size is waste of RAM.
*
* Set this to 0 to let liblzma choose the block size depending
* on the compression options. For LZMA2 it will be 3*dict_size
* or 1 MiB, whichever is more.
*/
uint64_t block_size;
/**
* \brief Timeout to allow lzma_code() to return early
*
* Multithreading can make liblzma to consume input and produce
* output in a very bursty way: it may first read a lot of input
* to fill internal buffers, then no input or output occurs for
* a while.
*
* In single-threaded mode, lzma_code() won't return until it has
* either consumed all the input or filled the output buffer. If
* this is done in multithreaded mode, it may cause a call
* lzma_code() to take even tens of seconds, which isn't acceptable
* in all applications.
*
* To avoid very long blocking times in lzma_code(), a timeout
* (in milliseconds) may be set here. If lzma_code() would block
* longer than this number of milliseconds, it will return with
* LZMA_OK. Reasonable values are 100 ms or more. The xz command
* line tool uses 300 ms.
*
* If long blocking times are fine for you, set timeout to a special
* value of 0, which will disable the timeout mechanism and will make
* lzma_code() block until all the input is consumed or the output
* buffer has been filled.
*
* \note Even with a timeout, lzma_code() might sometimes take
* somewhat long time to return. No timing guarantees
* are made.
*/
uint32_t timeout;
/**
* \brief Compression preset (level and possible flags)
*
* The preset is set just like with lzma_easy_encoder().
* The preset is ignored if filters below is non-NULL.
*/
uint32_t preset;
/**
* \brief Filter chain (alternative to a preset)
*
* If this is NULL, the preset above is used. Otherwise the preset
* is ignored and the filter chain specified here is used.
*/
const lzma_filter *filters;
/**
* \brief Integrity check type
*
* See check.h for available checks. The xz command line tool
* defaults to LZMA_CHECK_CRC64, which is a good choice if you
* are unsure.
*/
lzma_check check;
/*
* Reserved space to allow possible future extensions without
* breaking the ABI. You should not touch these, because the names
* of these variables may change. These are and will never be used
* with the currently supported options, so it is safe to leave these
* uninitialized.
*/
lzma_reserved_enum reserved_enum1;
lzma_reserved_enum reserved_enum2;
lzma_reserved_enum reserved_enum3;
uint32_t reserved_int1;
uint32_t reserved_int2;
uint32_t reserved_int3;
uint32_t reserved_int4;
uint64_t reserved_int5;
uint64_t reserved_int6;
uint64_t reserved_int7;
uint64_t reserved_int8;
void *reserved_ptr1;
void *reserved_ptr2;
void *reserved_ptr3;
void *reserved_ptr4;
} lzma_mt;
#endif
/**
* \brief Calculate approximate memory usage of easy encoder
*
@@ -313,50 +190,6 @@ extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm,
lzma_nothrow lzma_attr_warn_unused_result;
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */
/**
* \brief Calculate approximate memory usage of multithreaded .xz encoder
*
* Since doing the encoding in threaded mode doesn't affect the memory
* requirements of single-threaded decompressor, you can use
* lzma_easy_decoder_memusage(options->preset) or
* lzma_raw_decoder_memusage(options->filters) to calculate
* the decompressor memory requirements.
*
* \param options Compression options
*
* \return Number of bytes of memory required for encoding with the
* given options. If an error occurs, for example due to
* unsupported preset or filter chain, UINT64_MAX is returned.
*/
extern LZMA_API(uint64_t) lzma_stream_encoder_mt_memusage(
const lzma_mt *options) lzma_nothrow lzma_attr_pure;
/**
* \brief Initialize multithreaded .xz Stream encoder
*
* This provides the functionality of lzma_easy_encoder() and
* lzma_stream_encoder() as a single function for multithreaded use.
*
* TODO: For lzma_code(), only LZMA_RUN and LZMA_FINISH are currently
* supported. Support for other actions has been planned.
*
* \param strm Pointer to properly prepared lzma_stream
* \param options Pointer to multithreaded compression options
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
* - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_stream_encoder_mt(
lzma_stream *strm, const lzma_mt *options)
lzma_nothrow lzma_attr_warn_unused_result;
#endif
/**
* \brief Initialize .lzma encoder (legacy file format)
*

View File

@@ -21,9 +21,9 @@
* Version number split into components
*/
#define LZMA_VERSION_MAJOR 5
#define LZMA_VERSION_MINOR 1
#define LZMA_VERSION_PATCH 2
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_ALPHA
#define LZMA_VERSION_MINOR 0
#define LZMA_VERSION_PATCH 7
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
#ifndef LZMA_VERSION_COMMIT
# define LZMA_VERSION_COMMIT ""

View File

@@ -47,7 +47,5 @@ endif
endif
if COND_CHECK_SHA256
if COND_INTERNAL_SHA256
liblzma_la_SOURCES += check/sha256.c
endif
endif

View File

@@ -15,43 +15,6 @@
#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.
@@ -80,7 +43,14 @@ typedef struct {
union {
uint32_t crc32;
uint64_t crc64;
lzma_sha256_state sha256;
struct {
/// Internal state
uint32_t state[8];
/// Size of the message excluding padding
uint64_t size;
} sha256;
} state;
} lzma_check_state;
@@ -112,8 +82,6 @@ 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);
@@ -124,39 +92,4 @@ 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

View File

@@ -20,7 +20,7 @@
#include "crc_macros.h"
// If you make any changes, do some bench marking! Seemingly unrelated
// If you make any changes, do some benchmarking! Seemingly unrelated
// changes can very easily ruin the performance (and very probably is
// very compiler dependent).
extern LZMA_API(uint32_t)

View File

@@ -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/>.
@@ -22,13 +21,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
// Avoid bogus warnings in transform().
#if TUKLIB_GNUC_REQ(4, 2)
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __GNUC__ > 4
# pragma GCC diagnostic ignored "-Wuninitialized"
#endif
#include "check.h"
// At least on x86, GCC is able to optimize this to a rotate instruction.
#define rotr_32(num, amount) ((num) >> (amount) | (num) << (32 - (amount)))
@@ -81,7 +80,7 @@ static const uint32_t SHA256_K[64] = {
static void
transform(uint32_t state[static 8], const uint32_t data[static 16])
transform(uint32_t state[8], const uint32_t data[16])
{
uint32_t W[16];
uint32_t T[8];

View File

@@ -38,15 +38,9 @@ liblzma_la_SOURCES += \
common/index_encoder.h \
common/stream_buffer_encoder.c \
common/stream_encoder.c \
common/stream_encoder.h \
common/stream_flags_encoder.c \
common/vli_encoder.c
if COND_THREADS
liblzma_la_SOURCES += \
common/outqueue.c \
common/outqueue.h \
common/stream_encoder_mt.c
endif
endif
if COND_MAIN_DECODER

View File

@@ -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;
@@ -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;
@@ -189,7 +194,7 @@ 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)
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;

View File

@@ -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, lzma_allocator *allocator,
uint64_t memlimit, bool picky);
#endif

View File

@@ -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

View File

@@ -156,8 +156,10 @@ lzma_strm_init(lzma_stream *strm)
strm->internal->next = LZMA_NEXT_CODER_INIT;
}
memzero(strm->internal->supported_actions,
sizeof(strm->internal->supported_actions));
strm->internal->supported_actions[LZMA_RUN] = false;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = false;
strm->internal->supported_actions[LZMA_FULL_FLUSH] = false;
strm->internal->supported_actions[LZMA_FINISH] = false;
strm->internal->sequence = ISEQ_RUN;
strm->internal->allow_buf_error = false;
@@ -263,9 +265,7 @@ lzma_code(lzma_stream *strm, lzma_action action)
strm->internal->avail_in = strm->avail_in;
// Cast is needed to silence a warning about LZMA_TIMED_OUT, which
// isn't part of lzma_ret enumeration.
switch ((unsigned int)(ret)) {
switch (ret) {
case LZMA_OK:
// Don't return LZMA_BUF_ERROR when it happens the first time.
// This is to avoid returning LZMA_BUF_ERROR when avail_out
@@ -281,11 +281,6 @@ lzma_code(lzma_stream *strm, lzma_action action)
}
break;
case LZMA_TIMED_OUT:
strm->internal->allow_buf_error = false;
ret = LZMA_OK;
break;
case LZMA_STREAM_END:
if (strm->internal->sequence == ISEQ_SYNC_FLUSH
|| strm->internal->sequence == ISEQ_FULL_FLUSH)

View File

@@ -32,8 +32,6 @@
#define LZMA_API(type) LZMA_API_EXPORT type LZMA_API_CALL
#define LZMA_UNSTABLE
#include "lzma.h"
// These allow helping the compiler in some often-executed branches, whose
@@ -51,13 +49,6 @@
#define LZMA_BUFFER_SIZE 4096
/// Maximum number of worker threads within one multithreaded component.
/// The limit exists solely to make it simpler to prevent integer overflows
/// when allocating structures etc. This should be big enough for now...
/// the code won't scale anywhere close to this number anyway.
#define LZMA_THREADS_MAX 16384
/// Starting value for memory usage estimates. Instead of calculating size
/// of _every_ structure and taking into account malloc() overhead etc., we
/// add a base size to all memory usage estimates. It's not very accurate
@@ -78,13 +69,6 @@
| LZMA_CONCATENATED )
/// Special return value (lzma_ret) to indicate that a timeout was reached
/// and lzma_code() must not return LZMA_BUF_ERROR. This is converted to
/// LZMA_OK in lzma_code(). This is not in the lzma_ret enumeration because
/// there's no need to have it in the public API.
#define LZMA_TIMED_OUT 32
/// Type of encoder/decoder specific data; the actual structure is defined
/// differently in different coders.
typedef struct lzma_coder_s lzma_coder;

View File

@@ -11,6 +11,7 @@
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
#include "stream_encoder.h"
extern LZMA_API(lzma_ret)

View File

@@ -30,11 +30,11 @@ typedef struct {
/// invalid, UINT64_MAX is returned.
uint64_t (*memusage)(const void *options);
/// Calculates the recommended Uncompressed Size for .xz Blocks to
/// which the input data can be split to make multithreaded
/// encoding possible. If this is NULL, it is assumed that
/// the encoder is fast enough with single thread.
uint64_t (*block_size)(const void *options);
/// Calculates the minimum sane size for Blocks (or other types of
/// chunks) to which the input data can be split to make
/// multithreaded encoding possible. If this is NULL, it is assumed
/// that the encoder is fast enough with single thread.
lzma_vli (*chunk_size)(const void *options);
/// Tells the size of the Filter Properties field. If options are
/// invalid, UINT32_MAX is returned. If this is NULL, props_size_fixed
@@ -59,7 +59,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_LZMA1,
.init = &lzma_lzma_encoder_init,
.memusage = &lzma_lzma_encoder_memusage,
.block_size = NULL, // FIXME
.chunk_size = NULL, // FIXME
.props_size_get = NULL,
.props_size_fixed = 5,
.props_encode = &lzma_lzma_props_encode,
@@ -70,7 +70,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_LZMA2,
.init = &lzma_lzma2_encoder_init,
.memusage = &lzma_lzma2_encoder_memusage,
.block_size = &lzma_lzma2_block_size, // FIXME
.chunk_size = NULL, // FIXME
.props_size_get = NULL,
.props_size_fixed = 1,
.props_encode = &lzma_lzma2_props_encode,
@@ -81,7 +81,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_X86,
.init = &lzma_simple_x86_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -91,7 +91,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_POWERPC,
.init = &lzma_simple_powerpc_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -101,7 +101,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_IA64,
.init = &lzma_simple_ia64_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -111,7 +111,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_ARM,
.init = &lzma_simple_arm_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -121,7 +121,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_ARMTHUMB,
.init = &lzma_simple_armthumb_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -131,7 +131,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_SPARC,
.init = &lzma_simple_sparc_encoder_init,
.memusage = NULL,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = &lzma_simple_props_size,
.props_encode = &lzma_simple_props_encode,
},
@@ -141,7 +141,7 @@ static const lzma_filter_encoder encoders[] = {
.id = LZMA_FILTER_DELTA,
.init = &lzma_delta_encoder_init,
.memusage = &lzma_delta_coder_memusage,
.block_size = NULL,
.chunk_size = NULL,
.props_size_get = NULL,
.props_size_fixed = 1,
.props_encode = &lzma_delta_props_encode,
@@ -226,19 +226,20 @@ lzma_raw_encoder_memusage(const lzma_filter *filters)
}
extern uint64_t
lzma_mt_block_size(const lzma_filter *filters)
/*
extern LZMA_API(lzma_vli)
lzma_chunk_size(const lzma_filter *filters)
{
uint64_t max = 0;
lzma_vli max = 0;
for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
const lzma_filter_encoder *const fe
= encoder_find(filters[i].id);
if (fe->block_size != NULL) {
const uint64_t size
= fe->block_size(filters[i].options);
if (size == 0)
return 0;
if (fe->chunk_size != NULL) {
const lzma_vli size
= fe->chunk_size(filters[i].options);
if (size == LZMA_VLI_UNKNOWN)
return LZMA_VLI_UNKNOWN;
if (size > max)
max = size;
@@ -247,6 +248,7 @@ lzma_mt_block_size(const lzma_filter *filters)
return max;
}
*/
extern LZMA_API(lzma_ret)

View File

@@ -16,8 +16,8 @@
#include "common.h"
// FIXME: Might become a part of the public API.
extern uint64_t lzma_mt_block_size(const lzma_filter *filters);
// FIXME: Might become a part of the public API once finished.
// extern lzma_vli lzma_chunk_size(const lzma_filter *filters);
extern lzma_ret lzma_raw_encoder_init(

View File

@@ -1,184 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file outqueue.c
/// \brief Output queue handling in multithreaded coding
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "outqueue.h"
/// This is to ease integer overflow checking: We may allocate up to
/// 2 * LZMA_THREADS_MAX buffers and we need some extra memory for other
/// data structures (that's the second /2).
#define BUF_SIZE_MAX (UINT64_MAX / LZMA_THREADS_MAX / 2 / 2)
static lzma_ret
get_options(uint64_t *bufs_alloc_size, uint32_t *bufs_count,
uint64_t buf_size_max, uint32_t threads)
{
if (threads > LZMA_THREADS_MAX || buf_size_max > BUF_SIZE_MAX)
return LZMA_OPTIONS_ERROR;
// The number of buffers is twice the number of threads.
// This wastes RAM but keeps the threads busy when buffers
// finish out of order.
//
// NOTE: If this is changed, update BUF_SIZE_MAX too.
*bufs_count = threads * 2;
*bufs_alloc_size = *bufs_count * buf_size_max;
return LZMA_OK;
}
extern uint64_t
lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads)
{
uint64_t bufs_alloc_size;
uint32_t bufs_count;
if (get_options(&bufs_alloc_size, &bufs_count, buf_size_max, threads)
!= LZMA_OK)
return UINT64_MAX;
return sizeof(lzma_outq) + bufs_count * sizeof(lzma_outbuf)
+ bufs_alloc_size;
}
extern lzma_ret
lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
uint64_t buf_size_max, uint32_t threads)
{
uint64_t bufs_alloc_size;
uint32_t bufs_count;
// Set bufs_count and bufs_alloc_size.
return_if_error(get_options(&bufs_alloc_size, &bufs_count,
buf_size_max, threads));
// Allocate memory if needed.
if (outq->buf_size_max != buf_size_max
|| outq->bufs_allocated != bufs_count) {
lzma_outq_end(outq, allocator);
#if SIZE_MAX < UINT64_MAX
if (bufs_alloc_size > SIZE_MAX)
return LZMA_MEM_ERROR;
#endif
outq->bufs = lzma_alloc(bufs_count * sizeof(lzma_outbuf),
allocator);
outq->bufs_mem = lzma_alloc((size_t)(bufs_alloc_size),
allocator);
if (outq->bufs == NULL || outq->bufs_mem == NULL) {
lzma_outq_end(outq, allocator);
return LZMA_MEM_ERROR;
}
}
// Initialize the rest of the main structure. Initialization of
// outq->bufs[] is done when they are actually needed.
outq->buf_size_max = (size_t)(buf_size_max);
outq->bufs_allocated = bufs_count;
outq->bufs_pos = 0;
outq->bufs_used = 0;
outq->read_pos = 0;
return LZMA_OK;
}
extern void
lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator)
{
lzma_free(outq->bufs, allocator);
outq->bufs = NULL;
lzma_free(outq->bufs_mem, allocator);
outq->bufs_mem = NULL;
return;
}
extern lzma_outbuf *
lzma_outq_get_buf(lzma_outq *outq)
{
// Caller must have checked it with lzma_outq_has_buf().
assert(outq->bufs_used < outq->bufs_allocated);
// Initialize the new buffer.
lzma_outbuf *buf = &outq->bufs[outq->bufs_pos];
buf->buf = outq->bufs_mem + outq->bufs_pos * outq->buf_size_max;
buf->size = 0;
buf->finished = false;
// Update the queue state.
if (++outq->bufs_pos == outq->bufs_allocated)
outq->bufs_pos = 0;
++outq->bufs_used;
return buf;
}
extern bool
lzma_outq_is_readable(const lzma_outq *outq)
{
uint32_t i = outq->bufs_pos - outq->bufs_used;
if (outq->bufs_pos < outq->bufs_used)
i += outq->bufs_allocated;
return outq->bufs[i].finished;
}
extern lzma_ret
lzma_outq_read(lzma_outq *restrict outq, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
lzma_vli *restrict unpadded_size,
lzma_vli *restrict uncompressed_size)
{
// There must be at least one buffer from which to read.
if (outq->bufs_used == 0)
return LZMA_OK;
// Get the buffer.
uint32_t i = outq->bufs_pos - outq->bufs_used;
if (outq->bufs_pos < outq->bufs_used)
i += outq->bufs_allocated;
lzma_outbuf *buf = &outq->bufs[i];
// If it isn't finished yet, we cannot read from it.
if (!buf->finished)
return LZMA_OK;
// Copy from the buffer to output.
lzma_bufcpy(buf->buf, &outq->read_pos, buf->size,
out, out_pos, out_size);
// Return if we didn't get all the data from the buffer.
if (outq->read_pos < buf->size)
return LZMA_OK;
// The buffer was finished. Tell the caller its size information.
*unpadded_size = buf->unpadded_size;
*uncompressed_size = buf->uncompressed_size;
// Free this buffer for further use.
--outq->bufs_used;
outq->read_pos = 0;
return LZMA_STREAM_END;
}

View File

@@ -1,155 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file outqueue.h
/// \brief Output queue handling in multithreaded coding
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
/// Output buffer for a single thread
typedef struct {
/// Pointer to the output buffer of lzma_outq.buf_size_max bytes
uint8_t *buf;
/// Amount of data written to buf
size_t size;
/// Additional size information
lzma_vli unpadded_size;
lzma_vli uncompressed_size;
/// True when no more data will be written into this buffer.
///
/// \note This is read by another thread and thus access
/// to this variable needs a mutex.
bool finished;
} lzma_outbuf;
typedef struct {
/// Array of buffers that are used cyclically.
lzma_outbuf *bufs;
/// Memory allocated for all the buffers
uint8_t *bufs_mem;
/// Amount of buffer space available in each buffer
size_t buf_size_max;
/// Number of buffers allocated
uint32_t bufs_allocated;
/// Position in the bufs array. The next buffer to be taken
/// into use is bufs[bufs_pos].
uint32_t bufs_pos;
/// Number of buffers in use
uint32_t bufs_used;
/// Position in the buffer in lzma_outq_read()
size_t read_pos;
} lzma_outq;
/**
* \brief Calculate the memory usage of an output queue
*
* \return Approximate memory usage in bytes or UINT64_MAX on error.
*/
extern uint64_t lzma_outq_memusage(uint64_t buf_size_max, uint32_t threads);
/// \brief Initialize an output queue
///
/// \param outq Pointer to an output queue. Before calling
/// this function the first time, *outq should
/// have been zeroed with memzero() so that this
/// function knows that there are no previous
/// allocations to free.
/// \param allocator Pointer to allocator or NULL
/// \param buf_size_max Maximum amount of data that a single buffer
/// in the queue may need to store.
/// \param threads Number of buffers that may be in use
/// concurrently. Note that more than this number
/// of buffers will actually get allocated to
/// improve performance when buffers finish
/// out of order.
///
/// \return - LZMA_OK
/// - LZMA_MEM_ERROR
///
extern lzma_ret lzma_outq_init(lzma_outq *outq, lzma_allocator *allocator,
uint64_t buf_size_max, uint32_t threads);
/// \brief Free the memory associated with the output queue
extern void lzma_outq_end(lzma_outq *outq, lzma_allocator *allocator);
/// \brief Get a new buffer
///
/// lzma_outq_has_buf() must be used to check that there is a buffer
/// available before calling lzma_outq_get_buf().
///
extern lzma_outbuf *lzma_outq_get_buf(lzma_outq *outq);
/// \brief Test if there is data ready to be read
///
/// Call to this function must be protected with the same mutex that
/// is used to protect lzma_outbuf.finished.
///
extern bool lzma_outq_is_readable(const lzma_outq *outq);
/// \brief Read finished data
///
/// \param outq Pointer to an output queue
/// \param out Beginning of the output buffer
/// \param out_pos The next byte will be written to
/// out[*out_pos].
/// \param out_size Size of the out buffer; the first byte into
/// which no data is written to is out[out_size].
/// \param unpadded_size Unpadded Size from the Block encoder
/// \param uncompressed_size Uncompressed Size from the Block encoder
///
/// \return - LZMA: All OK. Either no data was available or the buffer
/// being read didn't become empty yet.
/// - LZMA_STREAM_END: The buffer being read was finished.
/// *unpadded_size and *uncompressed_size were set.
///
/// \note This reads lzma_outbuf.finished variables and thus call
/// to this function needs to be protected with a mutex.
///
extern lzma_ret lzma_outq_read(lzma_outq *restrict outq,
uint8_t *restrict out, size_t *restrict out_pos,
size_t out_size, lzma_vli *restrict unpadded_size,
lzma_vli *restrict uncompressed_size);
/// \brief Test if there is at least one buffer free
///
/// This must be used before getting a new buffer with lzma_outq_get_buf().
///
static inline bool
lzma_outq_has_buf(const lzma_outq *outq)
{
return outq->bufs_used < outq->bufs_allocated;
}
/// \brief Test if the queue is completely empty
static inline bool
lzma_outq_is_empty(const lzma_outq *outq)
{
return outq->bufs_used == 0;
}

View File

@@ -10,6 +10,7 @@
//
///////////////////////////////////////////////////////////////////////////////
#include "stream_encoder.h"
#include "block_encoder.h"
#include "index_encoder.h"
@@ -25,7 +26,7 @@ struct lzma_coder_s {
} sequence;
/// True if Block encoder has been initialized by
/// stream_encoder_init() or stream_encoder_update()
/// lzma_stream_encoder_init() or stream_encoder_update()
/// and thus doesn't need to be initialized in stream_encode().
bool block_encoder_is_initialized;
@@ -125,7 +126,7 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
}
// Initialize the Block encoder unless it was already
// initialized by stream_encoder_init() or
// initialized by lzma_stream_encoder_init() or
// stream_encoder_update().
if (!coder->block_encoder_is_initialized)
return_if_error(block_encoder_init(coder, allocator));
@@ -261,11 +262,11 @@ stream_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
}
static lzma_ret
stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
extern lzma_ret
lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
const lzma_filter *filters, lzma_check check)
{
lzma_next_coder_init(&stream_encoder_init, next, allocator);
lzma_next_coder_init(&lzma_stream_encoder_init, next, allocator);
if (filters == NULL)
return LZMA_PROG_ERROR;
@@ -319,7 +320,7 @@ extern LZMA_API(lzma_ret)
lzma_stream_encoder(lzma_stream *strm,
const lzma_filter *filters, lzma_check check)
{
lzma_next_strm_init(stream_encoder_init, strm, filters, check);
lzma_next_strm_init(lzma_stream_encoder_init, strm, filters, check);
strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;

View File

@@ -0,0 +1,23 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_encoder.h
/// \brief Encodes .xz Streams
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_STREAM_ENCODER_H
#define LZMA_STREAM_ENCODER_H
#include "common.h"
extern lzma_ret lzma_stream_encoder_init(
lzma_next_coder *next, lzma_allocator *allocator,
const lzma_filter *filters, lzma_check check);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,105 +0,0 @@
XZ_5.0 {
global:
lzma_alone_decoder;
lzma_alone_encoder;
lzma_auto_decoder;
lzma_block_buffer_bound;
lzma_block_buffer_decode;
lzma_block_buffer_encode;
lzma_block_compressed_size;
lzma_block_decoder;
lzma_block_encoder;
lzma_block_header_decode;
lzma_block_header_encode;
lzma_block_header_size;
lzma_block_total_size;
lzma_block_unpadded_size;
lzma_check_is_supported;
lzma_check_size;
lzma_code;
lzma_crc32;
lzma_crc64;
lzma_easy_buffer_encode;
lzma_easy_decoder_memusage;
lzma_easy_encoder;
lzma_easy_encoder_memusage;
lzma_end;
lzma_filter_decoder_is_supported;
lzma_filter_encoder_is_supported;
lzma_filter_flags_decode;
lzma_filter_flags_encode;
lzma_filter_flags_size;
lzma_filters_copy;
lzma_filters_update;
lzma_get_check;
lzma_index_append;
lzma_index_block_count;
lzma_index_buffer_decode;
lzma_index_buffer_encode;
lzma_index_cat;
lzma_index_checks;
lzma_index_decoder;
lzma_index_dup;
lzma_index_encoder;
lzma_index_end;
lzma_index_file_size;
lzma_index_hash_append;
lzma_index_hash_decode;
lzma_index_hash_end;
lzma_index_hash_init;
lzma_index_hash_size;
lzma_index_init;
lzma_index_iter_init;
lzma_index_iter_locate;
lzma_index_iter_next;
lzma_index_iter_rewind;
lzma_index_memusage;
lzma_index_memused;
lzma_index_size;
lzma_index_stream_count;
lzma_index_stream_flags;
lzma_index_stream_padding;
lzma_index_stream_size;
lzma_index_total_size;
lzma_index_uncompressed_size;
lzma_lzma_preset;
lzma_memlimit_get;
lzma_memlimit_set;
lzma_memusage;
lzma_mf_is_supported;
lzma_mode_is_supported;
lzma_physmem;
lzma_properties_decode;
lzma_properties_encode;
lzma_properties_size;
lzma_raw_buffer_decode;
lzma_raw_buffer_encode;
lzma_raw_decoder;
lzma_raw_decoder_memusage;
lzma_raw_encoder;
lzma_raw_encoder_memusage;
lzma_stream_buffer_bound;
lzma_stream_buffer_decode;
lzma_stream_buffer_encode;
lzma_stream_decoder;
lzma_stream_encoder;
lzma_stream_flags_compare;
lzma_stream_footer_decode;
lzma_stream_footer_encode;
lzma_stream_header_decode;
lzma_stream_header_encode;
lzma_version_number;
lzma_version_string;
lzma_vli_decode;
lzma_vli_encode;
lzma_vli_size;
};
XZ_5.1.2alpha {
global:
lzma_stream_encoder_mt;
lzma_stream_encoder_mt_memusage;
local:
*;
} XZ_5.0;

View File

@@ -16,4 +16,4 @@ URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -llzma
Libs.private: @PTHREAD_CFLAGS@ @LIBS@
Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@

View File

@@ -14,15 +14,15 @@
#ifndef LZMA_FASTPOS_H
#define LZMA_FASTPOS_H
// LZMA encodes match distances by storing the highest two bits using
// a six-bit value [0, 63], and then the missing lower bits.
// Dictionary size is also stored using this encoding in the .xz
// LZMA encodes match distances (positions) by storing the highest two
// bits using a six-bit value [0, 63], and then the missing lower bits.
// Dictionary size is also stored using this encoding in the new .lzma
// file format header.
//
// fastpos.h provides a way to quickly find out the correct six-bit
// values. The following table gives some examples of this encoding:
//
// dist return
// pos return
// 0 0
// 1 1
// 2 2
@@ -48,10 +48,10 @@
// Provided functions or macros
// ----------------------------
//
// get_dist_slot(dist) is the basic version. get_dist_slot_2(dist)
// assumes that dist >= FULL_DISTANCES, thus the result is at least
// FULL_DISTANCES_BITS * 2. Using get_dist_slot(dist) instead of
// get_dist_slot_2(dist) would give the same result, but get_dist_slot_2(dist)
// get_pos_slot(pos) is the basic version. get_pos_slot_2(pos)
// assumes that pos >= FULL_DISTANCES, thus the result is at least
// FULL_DISTANCES_BITS * 2. Using get_pos_slot(pos) instead of
// get_pos_slot_2(pos) would give the same result, but get_pos_slot_2(pos)
// should be tiny bit faster due to the assumption being made.
//
//
@@ -76,14 +76,13 @@
// slightly faster, but sometimes it is a lot slower.
#ifdef HAVE_SMALL
# define get_dist_slot(dist) \
((dist) <= 4 ? (dist) : get_dist_slot_2(dist))
# define get_pos_slot(pos) ((pos) <= 4 ? (pos) : get_pos_slot_2(pos))
static inline uint32_t
get_dist_slot_2(uint32_t dist)
get_pos_slot_2(uint32_t pos)
{
const uint32_t i = bsr32(dist);
return (i + i) + ((dist >> (i - 1)) & 1);
const uint32_t i = bsr32(pos);
return (i + i) + ((pos >> (i - 1)) & 1);
}
@@ -100,39 +99,39 @@ extern const uint8_t lzma_fastpos[1 << FASTPOS_BITS];
#define fastpos_limit(extra, n) \
(UINT32_C(1) << (FASTPOS_BITS + fastpos_shift(extra, n)))
#define fastpos_result(dist, extra, n) \
lzma_fastpos[(dist) >> fastpos_shift(extra, n)] \
#define fastpos_result(pos, extra, n) \
lzma_fastpos[(pos) >> fastpos_shift(extra, n)] \
+ 2 * fastpos_shift(extra, n)
static inline uint32_t
get_dist_slot(uint32_t dist)
get_pos_slot(uint32_t pos)
{
// If it is small enough, we can pick the result directly from
// the precalculated table.
if (dist < fastpos_limit(0, 0))
return lzma_fastpos[dist];
if (pos < fastpos_limit(0, 0))
return lzma_fastpos[pos];
if (dist < fastpos_limit(0, 1))
return fastpos_result(dist, 0, 1);
if (pos < fastpos_limit(0, 1))
return fastpos_result(pos, 0, 1);
return fastpos_result(dist, 0, 2);
return fastpos_result(pos, 0, 2);
}
#ifdef FULL_DISTANCES_BITS
static inline uint32_t
get_dist_slot_2(uint32_t dist)
get_pos_slot_2(uint32_t pos)
{
assert(dist >= FULL_DISTANCES);
assert(pos >= FULL_DISTANCES);
if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 0))
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 0);
if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 0))
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 0);
if (dist < fastpos_limit(FULL_DISTANCES_BITS - 1, 1))
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 1);
if (pos < fastpos_limit(FULL_DISTANCES_BITS - 1, 1))
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 1);
return fastpos_result(dist, FULL_DISTANCES_BITS - 1, 2);
return fastpos_result(pos, FULL_DISTANCES_BITS - 1, 2);
}
#endif

View File

@@ -387,17 +387,7 @@ lzma_lzma2_props_encode(const void *options, uint8_t *out)
if (d == UINT32_MAX)
out[0] = 40;
else
out[0] = get_dist_slot(d + 1) - 24;
out[0] = get_pos_slot(d + 1) - 24;
return LZMA_OK;
}
extern uint64_t
lzma_lzma2_block_size(const void *options)
{
const lzma_options_lzma *const opt = options;
// Use at least 1 MiB to keep compression ratio better.
return my_max((uint64_t)(opt->dict_size) * 3, UINT64_C(1) << 20);
}

View File

@@ -38,6 +38,4 @@ extern uint64_t lzma_lzma2_encoder_memusage(const void *options);
extern lzma_ret lzma_lzma2_props_encode(const void *options, uint8_t *out);
extern uint64_t lzma_lzma2_block_size(const void *options);
#endif

View File

@@ -171,54 +171,53 @@ literal_init(probability (*probs)[LITERAL_CODER_SIZE],
// Match distance //
////////////////////
// Different sets of probabilities are used for match distances that have very
// Different set of probabilities is used for match distances that have very
// short match length: Lengths of 2, 3, and 4 bytes have a separate set of
// probabilities for each length. The matches with longer length use a shared
// set of probabilities.
#define DIST_STATES 4
#define LEN_TO_POS_STATES 4
// Macro to get the index of the appropriate probability array.
#define get_dist_state(len) \
((len) < DIST_STATES + MATCH_LEN_MIN \
#define get_len_to_pos_state(len) \
((len) < LEN_TO_POS_STATES + MATCH_LEN_MIN \
? (len) - MATCH_LEN_MIN \
: DIST_STATES - 1)
: LEN_TO_POS_STATES - 1)
// The highest two bits of a match distance (distance slot) are encoded
// using six bits. See fastpos.h for more explanation.
#define DIST_SLOT_BITS 6
#define DIST_SLOTS (1 << DIST_SLOT_BITS)
// The highest two bits of a match distance (pos slot) are encoded using six
// bits. See fastpos.h for more explanation.
#define POS_SLOT_BITS 6
#define POS_SLOTS (1 << POS_SLOT_BITS)
// Match distances up to 127 are fully encoded using probabilities. Since
// the highest two bits (distance slot) are always encoded using six bits,
// the distances 0-3 don't need any additional bits to encode, since the
// distance slot itself is the same as the actual distance. DIST_MODEL_START
// indicates the first distance slot where at least one additional bit is
// needed.
#define DIST_MODEL_START 4
// the highest two bits (pos slot) are always encoded using six bits, the
// distances 0-3 don't need any additional bits to encode, since the pos
// slot itself is the same as the actual distance. START_POS_MODEL_INDEX
// indicates the first pos slot where at least one additional bit is needed.
#define START_POS_MODEL_INDEX 4
// Match distances greater than 127 are encoded in three pieces:
// - distance slot: the highest two bits
// - pos slot: the highest two bits
// - direct bits: 2-26 bits below the highest two bits
// - alignment bits: four lowest bits
//
// Direct bits don't use any probabilities.
//
// The distance slot value of 14 is for distances 128-191 (see the table in
// The pos slot value of 14 is for distances 128-191 (see the table in
// fastpos.h to understand why).
#define DIST_MODEL_END 14
#define END_POS_MODEL_INDEX 14
// Distance slots that indicate a distance <= 127.
#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2)
// Pos slots that indicate a distance <= 127.
#define FULL_DISTANCES_BITS (END_POS_MODEL_INDEX / 2)
#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS)
// For match distances greater than 127, only the highest two bits and the
// lowest four bits (alignment) is encoded using probabilities.
#define ALIGN_BITS 4
#define ALIGN_SIZE (1 << ALIGN_BITS)
#define ALIGN_MASK (ALIGN_SIZE - 1)
#define ALIGN_TABLE_SIZE (1 << ALIGN_BITS)
#define ALIGN_MASK (ALIGN_TABLE_SIZE - 1)
// LZMA remembers the four most recent match distances. Reusing these distances
// tends to take less space than re-encoding the actual distance value.
#define REPS 4
#define REP_DISTANCES 4
#endif

View File

@@ -193,15 +193,15 @@ struct lzma_coder_s {
/// Probability tree for the highest two bits of the match distance.
/// There is a separate probability tree for match lengths of
/// 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273].
probability dist_slot[DIST_STATES][DIST_SLOTS];
probability pos_slot[LEN_TO_POS_STATES][POS_SLOTS];
/// Probability trees for additional bits for match distance when the
/// distance is in the range [4, 127].
probability pos_special[FULL_DISTANCES - DIST_MODEL_END];
probability pos_special[FULL_DISTANCES - END_POS_MODEL_INDEX];
/// Probability tree for the lowest four bits of a match distance
/// that is equal to or greater than 128.
probability pos_align[ALIGN_SIZE];
probability pos_align[ALIGN_TABLE_SIZE];
/// Length of a normal match
lzma_length_decoder match_len_decoder;
@@ -245,8 +245,8 @@ struct lzma_coder_s {
SEQ_LITERAL_WRITE,
SEQ_IS_REP,
seq_len(SEQ_MATCH_LEN),
seq_6(SEQ_DIST_SLOT),
SEQ_DIST_MODEL,
seq_6(SEQ_POS_SLOT),
SEQ_POS_MODEL,
SEQ_DIRECT,
seq_4(SEQ_ALIGN),
SEQ_EOPM,
@@ -289,12 +289,8 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
// Initialization //
////////////////////
{
const lzma_ret ret = rc_read_init(
&coder->rc, in, in_pos, in_size);
if (ret != LZMA_STREAM_END)
return ret;
}
if (!rc_read_init(&coder->rc, in, in_pos, in_size))
return LZMA_OK;
///////////////
// Variables //
@@ -506,28 +502,28 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
// Prepare to decode the highest two bits of the
// match distance.
probs = coder->dist_slot[get_dist_state(len)];
probs = coder->pos_slot[get_len_to_pos_state(len)];
symbol = 1;
#ifdef HAVE_SMALL
case SEQ_DIST_SLOT:
case SEQ_POS_SLOT:
do {
rc_bit(probs[symbol], , , SEQ_DIST_SLOT);
} while (symbol < DIST_SLOTS);
rc_bit(probs[symbol], , , SEQ_POS_SLOT);
} while (symbol < POS_SLOTS);
#else
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT0);
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT1);
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT2);
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT3);
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT4);
rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT5);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT0);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT1);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT2);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT3);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT4);
rc_bit_case(probs[symbol], , , SEQ_POS_SLOT5);
#endif
// Get rid of the highest bit that was needed for
// indexing of the probability array.
symbol -= DIST_SLOTS;
symbol -= POS_SLOTS;
assert(symbol <= 63);
if (symbol < DIST_MODEL_START) {
if (symbol < START_POS_MODEL_INDEX) {
// Match distances [0, 3] have only two bits.
rep0 = symbol;
} else {
@@ -537,7 +533,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
assert(limit >= 1 && limit <= 30);
rep0 = 2 + (symbol & 1);
if (symbol < DIST_MODEL_END) {
if (symbol < END_POS_MODEL_INDEX) {
// Prepare to decode the low bits for
// a distance of [4, 127].
assert(limit <= 5);
@@ -557,12 +553,12 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
- symbol - 1;
symbol = 1;
offset = 0;
case SEQ_DIST_MODEL:
case SEQ_POS_MODEL:
#ifdef HAVE_SMALL
do {
rc_bit(probs[symbol], ,
rep0 += 1 << offset,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
} while (++offset < limit);
#else
switch (limit) {
@@ -570,25 +566,25 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
assert(offset == 0);
rc_bit(probs[symbol], ,
rep0 += 1,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
++offset;
--limit;
case 4:
rc_bit(probs[symbol], ,
rep0 += 1 << offset,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
++offset;
--limit;
case 3:
rc_bit(probs[symbol], ,
rep0 += 1 << offset,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
++offset;
--limit;
case 2:
rc_bit(probs[symbol], ,
rep0 += 1 << offset,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
++offset;
--limit;
case 1:
@@ -600,7 +596,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
// "symbol".
rc_bit_last(probs[symbol], ,
rep0 += 1 << offset,
SEQ_DIST_MODEL);
SEQ_POS_MODEL);
}
#endif
} else {
@@ -641,7 +637,7 @@ lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
rc_bit(coder->pos_align[symbol], ,
rep0 += 4, SEQ_ALIGN2);
case SEQ_ALIGN3:
// Like in SEQ_DIST_MODEL, we don't
// Like in SEQ_POS_MODEL, we don't
// need "symbol" for anything else
// than indexing the probability array.
rc_bit_last(coder->pos_align[symbol], ,
@@ -895,10 +891,10 @@ lzma_decoder_reset(lzma_coder *coder, const void *opt)
bit_reset(coder->is_rep2[i]);
}
for (uint32_t i = 0; i < DIST_STATES; ++i)
bittree_reset(coder->dist_slot[i], DIST_SLOT_BITS);
for (uint32_t i = 0; i < LEN_TO_POS_STATES; ++i)
bittree_reset(coder->pos_slot[i], POS_SLOT_BITS);
for (uint32_t i = 0; i < FULL_DISTANCES - DIST_MODEL_END; ++i)
for (uint32_t i = 0; i < FULL_DISTANCES - END_POS_MODEL_INDEX; ++i)
bit_reset(coder->pos_special[i]);
bittree_reset(coder->pos_align, ALIGN_BITS);

View File

@@ -148,28 +148,28 @@ match(lzma_coder *coder, const uint32_t pos_state,
length(&coder->rc, &coder->match_len_encoder, pos_state, len,
coder->fast_mode);
const uint32_t dist_slot = get_dist_slot(distance);
const uint32_t dist_state = get_dist_state(len);
rc_bittree(&coder->rc, coder->dist_slot[dist_state],
DIST_SLOT_BITS, dist_slot);
const uint32_t pos_slot = get_pos_slot(distance);
const uint32_t len_to_pos_state = get_len_to_pos_state(len);
rc_bittree(&coder->rc, coder->pos_slot[len_to_pos_state],
POS_SLOT_BITS, pos_slot);
if (dist_slot >= DIST_MODEL_START) {
const uint32_t footer_bits = (dist_slot >> 1) - 1;
const uint32_t base = (2 | (dist_slot & 1)) << footer_bits;
const uint32_t dist_reduced = distance - base;
if (pos_slot >= START_POS_MODEL_INDEX) {
const uint32_t footer_bits = (pos_slot >> 1) - 1;
const uint32_t base = (2 | (pos_slot & 1)) << footer_bits;
const uint32_t pos_reduced = distance - base;
if (dist_slot < DIST_MODEL_END) {
// Careful here: base - dist_slot - 1 can be -1, but
if (pos_slot < END_POS_MODEL_INDEX) {
// Careful here: base - pos_slot - 1 can be -1, but
// rc_bittree_reverse starts at probs[1], not probs[0].
rc_bittree_reverse(&coder->rc,
coder->dist_special + base - dist_slot - 1,
footer_bits, dist_reduced);
coder->pos_special + base - pos_slot - 1,
footer_bits, pos_reduced);
} else {
rc_direct(&coder->rc, dist_reduced >> ALIGN_BITS,
rc_direct(&coder->rc, pos_reduced >> ALIGN_BITS,
footer_bits - ALIGN_BITS);
rc_bittree_reverse(
&coder->rc, coder->dist_align,
ALIGN_BITS, dist_reduced & ALIGN_MASK);
&coder->rc, coder->pos_align,
ALIGN_BITS, pos_reduced & ALIGN_MASK);
++coder->align_price_count;
}
}
@@ -247,7 +247,7 @@ encode_symbol(lzma_coder *coder, lzma_mf *mf,
rc_bit(&coder->rc,
&coder->is_match[coder->state][pos_state], 1);
if (back < REPS) {
if (back < REP_DISTANCES) {
// It's a repeated match i.e. the same distance
// has been used earlier.
rc_bit(&coder->rc, &coder->is_rep[coder->state], 1);
@@ -255,7 +255,7 @@ encode_symbol(lzma_coder *coder, lzma_mf *mf,
} else {
// Normal match
rc_bit(&coder->rc, &coder->is_rep[coder->state], 0);
match(coder, pos_state, back - REPS, len);
match(coder, pos_state, back - REP_DISTANCES, len);
}
}
@@ -353,9 +353,9 @@ lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
// Get optimal match (repeat position and length).
// Value ranges for pos:
// - [0, REPS): repeated match
// - [REPS, UINT32_MAX):
// match at (pos - REPS)
// - [0, REP_DISTANCES): repeated match
// - [REP_DISTANCES, UINT32_MAX):
// match at (pos - REP_DISTANCES)
// - UINT32_MAX: not a match but a literal
// Value ranges for len:
// - [MATCH_LEN_MIN, MATCH_LEN_MAX]
@@ -487,7 +487,7 @@ lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
// State
coder->state = STATE_LIT_LIT;
for (size_t i = 0; i < REPS; ++i)
for (size_t i = 0; i < REP_DISTANCES; ++i)
coder->reps[i] = 0;
literal_init(coder->literal, options->lc, options->lp);
@@ -505,14 +505,14 @@ lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
bit_reset(coder->is_rep2[i]);
}
for (size_t i = 0; i < FULL_DISTANCES - DIST_MODEL_END; ++i)
bit_reset(coder->dist_special[i]);
for (size_t i = 0; i < FULL_DISTANCES - END_POS_MODEL_INDEX; ++i)
bit_reset(coder->pos_special[i]);
// Bit tree encoders
for (size_t i = 0; i < DIST_STATES; ++i)
bittree_reset(coder->dist_slot[i], DIST_SLOT_BITS);
for (size_t i = 0; i < LEN_TO_POS_STATES; ++i)
bittree_reset(coder->pos_slot[i], POS_SLOT_BITS);
bittree_reset(coder->dist_align, ALIGN_BITS);
bittree_reset(coder->pos_align, ALIGN_BITS);
// Length encoders
length_encoder_reset(&coder->match_len_encoder,

View File

@@ -46,7 +46,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
uint32_t rep_len = 0;
uint32_t rep_index = 0;
for (uint32_t i = 0; i < REPS; ++i) {
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
// Pointer to the beginning of the match candidate
const uint8_t *const buf_back = buf - coder->reps[i] - 1;
@@ -79,7 +79,8 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
// We didn't find a long enough repeated match. Encode it as a normal
// match if the match length is at least nice_len.
if (len_main >= nice_len) {
*back_res = coder->matches[matches_count - 1].dist + REPS;
*back_res = coder->matches[matches_count - 1].dist
+ REP_DISTANCES;
*len_res = len_main;
mf_skip(mf, len_main - 1);
return;
@@ -154,7 +155,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
const uint32_t limit = len_main - 1;
for (uint32_t i = 0; i < REPS; ++i) {
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
const uint8_t *const buf_back = buf - coder->reps[i] - 1;
if (not_equal_16(buf, buf_back))
@@ -171,7 +172,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
}
}
*back_res = back_main + REPS;
*back_res = back_main + REP_DISTANCES;
*len_res = len_main;
mf_skip(mf, len_main - 2);
return;

View File

@@ -108,18 +108,18 @@ get_rep_price(const lzma_coder *const coder, const uint32_t rep_index,
static inline uint32_t
get_dist_len_price(const lzma_coder *const coder, const uint32_t dist,
get_pos_len_price(const lzma_coder *const coder, const uint32_t pos,
const uint32_t len, const uint32_t pos_state)
{
const uint32_t dist_state = get_dist_state(len);
const uint32_t len_to_pos_state = get_len_to_pos_state(len);
uint32_t price;
if (dist < FULL_DISTANCES) {
price = coder->dist_prices[dist_state][dist];
if (pos < FULL_DISTANCES) {
price = coder->distances_prices[len_to_pos_state][pos];
} else {
const uint32_t dist_slot = get_dist_slot_2(dist);
price = coder->dist_slot_prices[dist_state][dist_slot]
+ coder->align_prices[dist & ALIGN_MASK];
const uint32_t pos_slot = get_pos_slot_2(pos);
price = coder->pos_slot_prices[len_to_pos_state][pos_slot]
+ coder->align_prices[pos & ALIGN_MASK];
}
price += get_len_price(&coder->match_len_encoder, len, pos_state);
@@ -129,53 +129,55 @@ get_dist_len_price(const lzma_coder *const coder, const uint32_t dist,
static void
fill_dist_prices(lzma_coder *coder)
fill_distances_prices(lzma_coder *coder)
{
for (uint32_t dist_state = 0; dist_state < DIST_STATES; ++dist_state) {
for (uint32_t len_to_pos_state = 0;
len_to_pos_state < LEN_TO_POS_STATES;
++len_to_pos_state) {
uint32_t *const dist_slot_prices
= coder->dist_slot_prices[dist_state];
uint32_t *const pos_slot_prices
= coder->pos_slot_prices[len_to_pos_state];
// Price to encode the dist_slot.
for (uint32_t dist_slot = 0;
dist_slot < coder->dist_table_size; ++dist_slot)
dist_slot_prices[dist_slot] = rc_bittree_price(
coder->dist_slot[dist_state],
DIST_SLOT_BITS, dist_slot);
// Price to encode the pos_slot.
for (uint32_t pos_slot = 0;
pos_slot < coder->dist_table_size; ++pos_slot)
pos_slot_prices[pos_slot] = rc_bittree_price(
coder->pos_slot[len_to_pos_state],
POS_SLOT_BITS, pos_slot);
// For matches with distance >= FULL_DISTANCES, add the price
// of the direct bits part of the match distance. (Align bits
// are handled by fill_align_prices()).
for (uint32_t dist_slot = DIST_MODEL_END;
dist_slot < coder->dist_table_size;
++dist_slot)
dist_slot_prices[dist_slot] += rc_direct_price(
((dist_slot >> 1) - 1) - ALIGN_BITS);
for (uint32_t pos_slot = END_POS_MODEL_INDEX;
pos_slot < coder->dist_table_size; ++pos_slot)
pos_slot_prices[pos_slot] += rc_direct_price(
((pos_slot >> 1) - 1) - ALIGN_BITS);
// Distances in the range [0, 3] are fully encoded with
// dist_slot, so they are used for coder->dist_prices
// pos_slot, so they are used for coder->distances_prices
// as is.
for (uint32_t i = 0; i < DIST_MODEL_START; ++i)
coder->dist_prices[dist_state][i]
= dist_slot_prices[i];
for (uint32_t i = 0; i < START_POS_MODEL_INDEX; ++i)
coder->distances_prices[len_to_pos_state][i]
= pos_slot_prices[i];
}
// Distances in the range [4, 127] depend on dist_slot and
// dist_special. We do this in a loop separate from the above
// loop to avoid redundant calls to get_dist_slot().
for (uint32_t i = DIST_MODEL_START; i < FULL_DISTANCES; ++i) {
const uint32_t dist_slot = get_dist_slot(i);
const uint32_t footer_bits = ((dist_slot >> 1) - 1);
const uint32_t base = (2 | (dist_slot & 1)) << footer_bits;
// Distances in the range [4, 127] depend on pos_slot and pos_special.
// We do this in a loop separate from the above loop to avoid
// redundant calls to get_pos_slot().
for (uint32_t i = START_POS_MODEL_INDEX; i < FULL_DISTANCES; ++i) {
const uint32_t pos_slot = get_pos_slot(i);
const uint32_t footer_bits = ((pos_slot >> 1) - 1);
const uint32_t base = (2 | (pos_slot & 1)) << footer_bits;
const uint32_t price = rc_bittree_reverse_price(
coder->dist_special + base - dist_slot - 1,
coder->pos_special + base - pos_slot - 1,
footer_bits, i - base);
for (uint32_t dist_state = 0; dist_state < DIST_STATES;
++dist_state)
coder->dist_prices[dist_state][i]
= price + coder->dist_slot_prices[
dist_state][dist_slot];
for (uint32_t len_to_pos_state = 0;
len_to_pos_state < LEN_TO_POS_STATES;
++len_to_pos_state)
coder->distances_prices[len_to_pos_state][i]
= price + coder->pos_slot_prices[
len_to_pos_state][pos_slot];
}
coder->match_price_count = 0;
@@ -186,9 +188,9 @@ fill_dist_prices(lzma_coder *coder)
static void
fill_align_prices(lzma_coder *coder)
{
for (uint32_t i = 0; i < ALIGN_SIZE; ++i)
for (uint32_t i = 0; i < ALIGN_TABLE_SIZE; ++i)
coder->align_prices[i] = rc_bittree_reverse_price(
coder->dist_align, ALIGN_BITS, i);
coder->pos_align, ALIGN_BITS, i);
coder->align_price_count = 0;
return;
@@ -294,10 +296,10 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
const uint8_t *const buf = mf_ptr(mf) - 1;
uint32_t rep_lens[REPS];
uint32_t rep_lens[REP_DISTANCES];
uint32_t rep_max_index = 0;
for (uint32_t i = 0; i < REPS; ++i) {
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
const uint8_t *const buf_back = buf - coder->reps[i] - 1;
if (not_equal_16(buf, buf_back)) {
@@ -324,7 +326,8 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
if (len_main >= nice_len) {
*back_res = coder->matches[matches_count - 1].dist + REPS;
*back_res = coder->matches[matches_count - 1].dist
+ REP_DISTANCES;
*len_res = len_main;
mf_skip(mf, len_main - 1);
return UINT32_MAX;
@@ -378,7 +381,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
coder->opts[1].pos_prev = 0;
for (uint32_t i = 0; i < REPS; ++i)
for (uint32_t i = 0; i < REP_DISTANCES; ++i)
coder->opts[0].backs[i] = coder->reps[i];
uint32_t len = len_end;
@@ -387,7 +390,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
} while (--len >= 2);
for (uint32_t i = 0; i < REPS; ++i) {
for (uint32_t i = 0; i < REP_DISTANCES; ++i) {
uint32_t rep_len = rep_lens[i];
if (rep_len < 2)
continue;
@@ -423,13 +426,14 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
for(; ; ++len) {
const uint32_t dist = coder->matches[i].dist;
const uint32_t cur_and_len_price = normal_match_price
+ get_dist_len_price(coder,
+ get_pos_len_price(coder,
dist, len, pos_state);
if (cur_and_len_price < coder->opts[len].price) {
coder->opts[len].price = cur_and_len_price;
coder->opts[len].pos_prev = 0;
coder->opts[len].back_prev = dist + REPS;
coder->opts[len].back_prev
= dist + REP_DISTANCES;
coder->opts[len].prev_1_is_literal = false;
}
@@ -459,7 +463,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
if (coder->opts[cur].prev_2) {
state = coder->opts[coder->opts[cur].pos_prev_2].state;
if (coder->opts[cur].back_prev_2 < REPS)
if (coder->opts[cur].back_prev_2 < REP_DISTANCES)
update_long_rep(state);
else
update_match(state);
@@ -488,33 +492,33 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
update_long_rep(state);
} else {
pos = coder->opts[cur].back_prev;
if (pos < REPS)
if (pos < REP_DISTANCES)
update_long_rep(state);
else
update_match(state);
}
if (pos < REPS) {
if (pos < REP_DISTANCES) {
reps[0] = coder->opts[pos_prev].backs[pos];
uint32_t i;
for (i = 1; i <= pos; ++i)
reps[i] = coder->opts[pos_prev].backs[i - 1];
for (; i < REPS; ++i)
for (; i < REP_DISTANCES; ++i)
reps[i] = coder->opts[pos_prev].backs[i];
} else {
reps[0] = pos - REPS;
reps[0] = pos - REP_DISTANCES;
for (uint32_t i = 1; i < REPS; ++i)
for (uint32_t i = 1; i < REP_DISTANCES; ++i)
reps[i] = coder->opts[pos_prev].backs[i - 1];
}
}
coder->opts[cur].state = state;
for (uint32_t i = 0; i < REPS; ++i)
for (uint32_t i = 0; i < REP_DISTANCES; ++i)
coder->opts[cur].backs[i] = reps[i];
const uint32_t cur_price = coder->opts[cur].price;
@@ -607,7 +611,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
uint32_t start_len = 2; // speed optimization
for (uint32_t rep_index = 0; rep_index < REPS; ++rep_index) {
for (uint32_t rep_index = 0; rep_index < REP_DISTANCES; ++rep_index) {
const uint8_t *const buf_back = buf - reps[rep_index] - 1;
if (not_equal_16(buf, buf_back))
continue;
@@ -724,14 +728,14 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
for (uint32_t len_test = start_len; ; ++len_test) {
const uint32_t cur_back = coder->matches[i].dist;
uint32_t cur_and_len_price = normal_match_price
+ get_dist_len_price(coder,
+ get_pos_len_price(coder,
cur_back, len_test, pos_state);
if (cur_and_len_price < coder->opts[cur + len_test].price) {
coder->opts[cur + len_test].price = cur_and_len_price;
coder->opts[cur + len_test].pos_prev = cur;
coder->opts[cur + len_test].back_prev
= cur_back + REPS;
= cur_back + REP_DISTANCES;
coder->opts[cur + len_test].prev_1_is_literal = false;
}
@@ -791,7 +795,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
coder->opts[offset].prev_2 = true;
coder->opts[offset].pos_prev_2 = cur;
coder->opts[offset].back_prev_2
= cur_back + REPS;
= cur_back + REP_DISTANCES;
}
//}
}
@@ -827,9 +831,9 @@ lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
// In liblzma they were moved into this single place.
if (mf->read_ahead == 0) {
if (coder->match_price_count >= (1 << 7))
fill_dist_prices(coder);
fill_distances_prices(coder);
if (coder->align_price_count >= ALIGN_SIZE)
if (coder->align_price_count >= ALIGN_TABLE_SIZE)
fill_align_prices(coder);
}
@@ -841,7 +845,7 @@ lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
if (len_end == UINT32_MAX)
return;
uint32_t reps[REPS];
uint32_t reps[REP_DISTANCES];
memcpy(reps, coder->reps, sizeof(reps));
uint32_t cur;

View File

@@ -30,14 +30,16 @@ lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset)
options->lp = LZMA_LP_DEFAULT;
options->pb = LZMA_PB_DEFAULT;
options->dict_size = UINT32_C(1) << (uint8_t []){
18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level];
static const uint8_t dict_pow2[]
= { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 };
options->dict_size = UINT32_C(1) << dict_pow2[level];
if (level <= 3) {
options->mode = LZMA_MODE_FAST;
options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4;
options->nice_len = level <= 1 ? 128 : 273;
options->depth = (uint8_t []){ 4, 8, 24, 48 }[level];
static const uint8_t depths[] = { 4, 8, 24, 48 };
options->depth = depths[level];
} else {
options->mode = LZMA_MODE_NORMAL;
options->mf = LZMA_MF_BT4;

View File

@@ -64,7 +64,7 @@ typedef struct {
uint32_t pos_prev; // pos_next;
uint32_t back_prev;
uint32_t backs[REPS];
uint32_t backs[REP_DISTANCES];
} lzma_optimal;
@@ -77,7 +77,7 @@ struct lzma_coder_s {
lzma_lzma_state state;
/// The four most recent match distances
uint32_t reps[REPS];
uint32_t reps[REP_DISTANCES];
/// Array of match candidates
lzma_match matches[MATCH_LEN_MAX + 1];
@@ -112,9 +112,9 @@ struct lzma_coder_s {
probability is_rep1[STATES];
probability is_rep2[STATES];
probability is_rep0_long[STATES][POS_STATES_MAX];
probability dist_slot[DIST_STATES][DIST_SLOTS];
probability dist_special[FULL_DISTANCES - DIST_MODEL_END];
probability dist_align[ALIGN_SIZE];
probability pos_slot[LEN_TO_POS_STATES][POS_SLOTS];
probability pos_special[FULL_DISTANCES - END_POS_MODEL_INDEX];
probability pos_align[ALIGN_TABLE_SIZE];
// These are the same as in lzma_decoder.c except that the encoders
// include also price tables.
@@ -122,12 +122,12 @@ struct lzma_coder_s {
lzma_length_encoder rep_len_encoder;
// Price tables
uint32_t dist_slot_prices[DIST_STATES][DIST_SLOTS];
uint32_t dist_prices[DIST_STATES][FULL_DISTANCES];
uint32_t pos_slot_prices[LEN_TO_POS_STATES][POS_SLOTS];
uint32_t distances_prices[LEN_TO_POS_STATES][FULL_DISTANCES];
uint32_t dist_table_size;
uint32_t match_price_count;
uint32_t align_prices[ALIGN_SIZE];
uint32_t align_prices[ALIGN_TABLE_SIZE];
uint32_t align_price_count;
// Optimal

View File

@@ -25,26 +25,20 @@ typedef struct {
/// Reads the first five bytes to initialize the range decoder.
static inline lzma_ret
static inline bool
rc_read_init(lzma_range_decoder *rc, const uint8_t *restrict in,
size_t *restrict in_pos, size_t in_size)
{
while (rc->init_bytes_left > 0) {
if (*in_pos == in_size)
return LZMA_OK;
// The first byte is always 0x00. It could have been omitted
// in LZMA2 but it wasn't, so one byte is wasted in every
// LZMA2 chunk.
if (rc->init_bytes_left == 5 && in[*in_pos] != 0x00)
return LZMA_DATA_ERROR;
return false;
rc->code = (rc->code << 8) | in[*in_pos];
++*in_pos;
--rc->init_bytes_left;
}
return LZMA_STREAM_END;
return true;
}

View File

@@ -1,68 +0,0 @@
#!/bin/sh
###############################################################################
#
# Check liblzma.map for certain types of errors
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
LC_ALL=C
export LC_ALL
STATUS=0
cd "$(dirname "$0")"
# Get the list of symbols that aren't defined in liblzma.map.
SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \
api/lzma/*.h \
| sort \
| grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma.map)")
# Check that there are no old alpha or beta versions listed.
VER=$(cd ../.. && sh build-aux/version.sh)
NAMES=
case $VER in
*alpha | *beta)
NAMES=$(sed -n 's/^.*XZ_\([^ ]*\)\(alpha\|beta\) .*$/\1\2/p' \
liblzma.map | grep -Fv "$VER")
;;
esac
# Check for duplicate lines. It can catch missing dependencies.
DUPS=$(sort liblzma.map | sed '/^$/d;/^global:$/d' | uniq -d)
# Print error messages if needed.
if test -n "$SYMS$NAMES$DUPS"; then
echo
echo 'validate_map.sh found problems from liblzma.map:'
echo
if test -n "$SYMS"; then
echo 'liblzma.map lacks the following symbols:'
echo "$SYMS"
echo
fi
if test -n "$NAMES"; then
echo 'Obsolete alpha or beta version names:'
echo "$NAMES"
echo
fi
if test -n "$DUPS"; then
echo 'Duplicate lines:'
echo "$DUPS"
echo
fi
STATUS=1
fi
# Exit status is 1 if problems were found, 0 otherwise.
exit "$STATUS"

View File

@@ -4,14 +4,14 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
.TH LZMAINFO 1 "2010-09-27" "Tukaani" "XZ Utils"
.TH LZMAINFO 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME
lzmainfo \- show information stored in the .lzma file header
.SH SYNOPSIS
.B lzmainfo
.RB [ \-\-help ]
.RB [ \-\-version ]
.RI [ file ]...
.RI [ file... ]
.SH DESCRIPTION
.B lzmainfo
shows information stored in the

View File

@@ -6,7 +6,7 @@
.\"
.\" License: GNU GPLv2+
.\"
.TH XZDIFF 1 "2011-03-19" "Tukaani" "XZ Utils"
.TH XZDIFF 1 "2010-09-27" "Tukaani" "XZ Utils"
.SH NAME
xzcmp, xzdiff, lzcmp, lzdiff \- compare compressed files
.SH SYNOPSIS
@@ -33,9 +33,8 @@ on files compressed with
.BR xz (1),
.BR lzma (1),
.BR gzip (1),
.BR bzip2 (1),
or
.BR lzop (1).
.BR bzip2 (1).
All options specified are passed directly to
.BR cmp (1)
or
@@ -67,7 +66,6 @@ are provided for backward compatibility with LZMA Utils.
.BR xz (1),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
.BR zdiff (1)
.SH BUGS
Messages from the

View File

@@ -19,10 +19,10 @@
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
# autodetection. This way memory usage limit and thread limit can be
# specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset the
# specified via XZ_OPT. With gzip and bzip2 it's OK to just unset the
# environment variables.
xz='@xz@ --format=auto'
unset GZIP BZIP BZIP2 LZOP
unset GZIP BZIP BZIP2
case ${0##*/} in
*cmp*) prog=xzcmp; cmp=${CMP:-cmp};;
@@ -77,21 +77,17 @@ if test $# -eq 1; then
xz1=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z)
xz1=gzip;;
*[-.]lzo | *.tzo)
xz1=lzop;;
*)
echo >&2 "$0: $1: Unknown compressed file name suffix"
exit 2;;
esac
case $1 in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lzo)
FILE=`expr "X$1" : 'X\(.*\)[-.][abglmoxzZ2]*$'`;;
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma)
FILE=`expr "X$1" : 'X\(.*\)[-.][abglmxzZ2]*$'`;;
*.t[abglx]z)
FILE=`expr "X$1" : 'X\(.*[-.]t\)[abglx]z$'`ar;;
*.tbz2)
FILE=`expr "X$1" : 'X\(.*[-.]t\)bz2$'`ar;;
*.tzo)
FILE=`expr "X$1" : 'X\(.*[-.]t\)zo$'`ar;;
esac
xz_status=$(
exec 4>&1
@@ -101,17 +97,15 @@ elif test $# -eq 2; then
case $1 in
*[-.]bz2 | *.tbz | *.tbz2) xz1=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz1=gzip;;
*[-.]lzo | *.tzo) xz1=lzop;;
esac
case $2 in
*[-.]bz2 | *.tbz | *.tbz2) xz2=bzip2;;
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) xz2=gzip;;
*[-.]lzo | *.tzo) xz2=lzop;;
esac
case $1 in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
case "$2" in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
if test "$1$2" = --; then
xz_status=$(
exec 4>&1
@@ -133,7 +127,7 @@ elif test $# -eq 2; then
esac
(exit $cmp_status)
else
F=`expr "/$2" : '.*/\(.*\)[-.][ablmotxz2]*$'` || F=$prog
F=`expr "/$2" : '.*/\(.*\)[-.][ablmtxz2]*$'` || F=$prog
tmp=
trap '
test -n "$tmp" && rm -f "$tmp"
@@ -160,7 +154,7 @@ elif test $# -eq 2; then
esac;;
*)
case "$2" in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | *[-.]lzo | *.tzo | -)
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *.t[abglx]z | *.tbz2 | -)
xz_status=$(
exec 4>&1
($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |

View File

@@ -6,7 +6,7 @@
.\"
.\" License: GNU GPLv2+
.\"
.TH XZGREP 1 "2011-03-19" "Tukaani" "XZ Utils"
.TH XZGREP 1 "2010-09-27" "Tukaani" "XZ Utils"
.SH NAME
xzgrep \- search compressed files for a regular expression
.SH SYNOPSIS
@@ -40,9 +40,8 @@ which may be either uncompressed or compressed with
.BR xz (1),
.BR lzma (1),
.BR gzip (1),
.BR bzip2 (1),
or
.BR lzop (1).
.BR bzip2 (1).
All options specified are passed directly to
.BR grep (1).
.PP
@@ -52,10 +51,9 @@ is specified, then standard input is decompressed if necessary
and fed to
.BR grep (1).
When reading from standard input,
.BR gzip (1),
.BR bzip2 (1),
.BR gzip (1)
and
.BR lzop (1)
.BR bzip2 (1)
compressed files are not supported.
.PP
If
@@ -94,5 +92,4 @@ or
.BR xz (1),
.BR gzip (1),
.BR bzip2 (1),
.BR lzop (1),
.BR zgrep (1)

View File

@@ -22,10 +22,10 @@
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
# autodetection. This way memory usage limit and thread limit can be
# specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset the
# specified via XZ_OPT. With gzip and bzip2 it's OK to just unset the
# environment variables.
xz='@xz@ --format=auto'
unset GZIP BZIP BZIP2 LZOP
unset GZIP BZIP BZIP2
case ${0##*/} in
*egrep*) prog=xzegrep; grep=${GREP:-egrep};;
@@ -109,7 +109,7 @@ while test $# -ne 0; do
files_with_matches=1;;
(-L | --files-witho*)
files_without_matches=1;;
(--no-f*)
(-h | --no-f*)
no_filename=1;;
(-V | --v | --ve | --ver | --vers | --versi | --versio | --version)
echo "$version" || exit 2
@@ -147,13 +147,14 @@ if test $# -eq 0; then
fi
exec 3>&1
res=0
# res=1 means that no file matched yet
res=1
for i; do
case $i in
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) uncompress="gzip -cdfq";;
*[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdfq";;
*[-.]lzo | *[-.]tzo) uncompress="lzop -cdfq";;
*) uncompress="$xz -cdfq";;
esac
# Fail if xz or grep (or sed) fails.
@@ -195,8 +196,17 @@ for i; do
fi >&3 5>&-
)
r=$?
# fail occured previously, nothing worse can happen
test $res -gt 1 && continue
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 \
|| test "$(kill -l "$xz_status" 2> /dev/null)" = "PIPE" || r=2
test $res -lt $r && res=$r
# still no match
test $r -eq 1 && continue
# 0 == match, >=2 == fail
res=$r
done
exit $res

View File

@@ -46,7 +46,7 @@ if test "${LESSMETACHARS+set}" != set; then
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
fi
if test "$(less -V | { read ver && echo ${ver#less }; })" -ge 429; then
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
# less 429 or later: LESSOPEN pipe will be used on
# standard input if $LESSOPEN begins with |-.
LESSOPEN="|-$xz -cdfq -- %s"

View File

@@ -4,15 +4,15 @@
.\"
.\" License: GNU GPLv2+
.\"
.TH XZMORE 1 "2010-09-27" "Tukaani" "XZ Utils"
.TH XZMORE 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME
xzmore, lzmore \- view xz or lzma compressed (text) files
.SH SYNOPSIS
.B xzmore
.RI [ "filename ..." ]
.RI [ file... ]
.br
.B lzmore
.RI [ "filename ..." ]
.RI [ file... ]
.SH DESCRIPTION
.B xzmore
is a filter which allows examination of

View File

@@ -54,67 +54,6 @@ parse_memlimit(const char *name, const char *name_percentage, char *str,
}
static void
parse_block_list(char *str)
{
// It must be non-empty and not begin with a comma.
if (str[0] == '\0' || str[0] == ',')
message_fatal(_("%s: Invalid argument to --block-list"), str);
// Count the number of comma-separated strings.
size_t count = 1;
for (size_t i = 0; str[i] != '\0'; ++i)
if (str[i] == ',')
++count;
// Prevent an unlikely integer overflow.
if (count > SIZE_MAX / sizeof(uint64_t) - 1)
message_fatal(_("%s: Too many arguments to --block-list"),
str);
// Allocate memory to hold all the sizes specified.
// If --block-list was specified already, its value is forgotten.
free(opt_block_list);
opt_block_list = xmalloc((count + 1) * sizeof(uint64_t));
for (size_t i = 0; i < count; ++i) {
// Locate the next comma and replace it with \0.
char *p = strchr(str, ',');
if (p != NULL)
*p = '\0';
if (str[0] == '\0') {
// There is no string, that is, a comma follows
// another comma. Use the previous value.
//
// NOTE: We checked earler that the first char
// of the whole list cannot be a comma.
assert(i > 0);
opt_block_list[i] = opt_block_list[i - 1];
} else {
opt_block_list[i] = str_to_uint64("block-list", str,
0, UINT64_MAX);
// Zero indicates no more new Blocks.
if (opt_block_list[i] == 0) {
if (i + 1 != count)
message_fatal(_("0 can only be used "
"as the last element "
"in --block-list"));
opt_block_list[i] = UINT64_MAX;
}
}
str = p + 1;
}
// Terminate the array.
opt_block_list[count] = 0;
return;
}
static void
parse_real(args_info *args, int argc, char **argv)
{
@@ -129,12 +68,9 @@ parse_real(args_info *args, int argc, char **argv)
OPT_LZMA1,
OPT_LZMA2,
OPT_SINGLE_STREAM,
OPT_NO_SPARSE,
OPT_FILES,
OPT_FILES0,
OPT_BLOCK_SIZE,
OPT_BLOCK_LIST,
OPT_MEM_COMPRESS,
OPT_MEM_DECOMPRESS,
OPT_NO_ADJUST,
@@ -158,7 +94,6 @@ parse_real(args_info *args, int argc, char **argv)
{ "force", no_argument, NULL, 'f' },
{ "stdout", no_argument, NULL, 'c' },
{ "to-stdout", no_argument, NULL, 'c' },
{ "single-stream", no_argument, NULL, OPT_SINGLE_STREAM },
{ "no-sparse", no_argument, NULL, OPT_NO_SPARSE },
{ "suffix", required_argument, NULL, 'S' },
// { "recursive", no_argument, NULL, 'r' }, // TODO
@@ -168,8 +103,6 @@ parse_real(args_info *args, int argc, char **argv)
// Basic compression settings
{ "format", required_argument, NULL, 'F' },
{ "check", required_argument, NULL, 'C' },
{ "block-size", required_argument, NULL, OPT_BLOCK_SIZE },
{ "block-list", required_argument, NULL, OPT_BLOCK_LIST },
{ "memlimit-compress", required_argument, NULL, OPT_MEM_COMPRESS },
{ "memlimit-decompress", required_argument, NULL, OPT_MEM_DECOMPRESS },
{ "memlimit", required_argument, NULL, 'M' },
@@ -242,9 +175,8 @@ parse_real(args_info *args, int argc, char **argv)
break;
case 'T':
// The max is from src/liblzma/common/common.h.
hardware_threads_set(str_to_uint64("threads",
optarg, 0, 16384));
hardware_threadlimit_set(str_to_uint64(
"threads", optarg, 0, UINT32_MAX));
break;
// --version
@@ -436,20 +368,6 @@ parse_real(args_info *args, int argc, char **argv)
break;
}
case OPT_BLOCK_SIZE:
opt_block_size = str_to_uint64("block-size", optarg,
0, LZMA_VLI_MAX);
break;
case OPT_BLOCK_LIST: {
parse_block_list(optarg);
break;
}
case OPT_SINGLE_STREAM:
opt_single_stream = true;
break;
case OPT_NO_SPARSE:
io_no_sparse();
break;
@@ -658,13 +576,3 @@ args_parse(args_info *args, int argc, char **argv)
return;
}
#ifndef NDEBUG
extern void
args_free(void)
{
free(opt_block_list);
return;
}
#endif

View File

@@ -40,4 +40,3 @@ extern bool opt_robot;
extern const char stdin_filename[];
extern void args_parse(args_info *args, int argc, char **argv);
extern void args_free(void);

View File

@@ -24,9 +24,6 @@ enum coder_init_ret {
enum operation_mode opt_mode = MODE_COMPRESS;
enum format_type opt_format = FORMAT_AUTO;
bool opt_auto_adjust = true;
bool opt_single_stream = false;
uint64_t opt_block_size = 0;
uint64_t *opt_block_list = NULL;
/// Stream used to communicate with liblzma
@@ -43,12 +40,7 @@ static io_buf out_buf;
static uint32_t filters_count = 0;
/// Number of the preset (0-9)
static uint32_t preset_number = 6;
/// If a preset is used (no custom filter chain) and preset_extreme is true,
/// a significantly slower compression is used to achieve slightly better
/// compression ratio.
static bool preset_extreme = false;
static uint32_t preset_number = LZMA_PRESET_DEFAULT;
/// Integrity check type
static lzma_check check;
@@ -56,14 +48,6 @@ static lzma_check check;
/// This becomes false if the --check=CHECK option is used.
static bool check_default = true;
#ifdef HAVE_PTHREAD
static lzma_mt mt_options = {
.flags = 0,
.timeout = 300,
.filters = filters,
};
#endif
extern void
coder_set_check(lzma_check new_check)
@@ -74,11 +58,9 @@ coder_set_check(lzma_check new_check)
}
extern void
coder_set_preset(uint32_t new_preset)
static void
forget_filter_chain(void)
{
preset_number = new_preset;
// Setting a preset makes us forget a possibly defined custom
// filter chain.
while (filters_count > 0) {
@@ -91,10 +73,21 @@ coder_set_preset(uint32_t new_preset)
}
extern void
coder_set_preset(uint32_t new_preset)
{
preset_number &= ~LZMA_PRESET_LEVEL_MASK;
preset_number |= new_preset;
forget_filter_chain();
return;
}
extern void
coder_set_extreme(void)
{
preset_extreme = true;
preset_number |= LZMA_PRESET_EXTREME;
forget_filter_chain();
return;
}
@@ -109,6 +102,12 @@ coder_add_filter(lzma_vli id, void *options)
filters[filters_count].options = options;
++filters_count;
// Setting a custom filter chain makes us forget the preset options.
// This makes a difference if one specifies e.g. "xz -9 --lzma2 -e"
// where the custom filter chain resets the preset level back to
// the default 6, making the example equivalent to "xz -6e".
preset_number = LZMA_PRESET_DEFAULT;
return;
}
@@ -126,15 +125,6 @@ memlimit_too_small(uint64_t memory_usage)
extern void
coder_set_compression_settings(void)
{
// The default check type is CRC64, but fallback to CRC32
// if CRC64 isn't supported by the copy of liblzma we are
// using. CRC32 is always supported.
if (check_default) {
check = LZMA_CHECK_CRC64;
if (!lzma_check_is_supported(check))
check = LZMA_CHECK_CRC32;
}
// Options for LZMA1 or LZMA2 in case we are using a preset.
static lzma_options_lzma opt_lzma;
@@ -154,9 +144,6 @@ coder_set_compression_settings(void)
}
// Get the preset for LZMA1 or LZMA2.
if (preset_extreme)
preset_number |= LZMA_PRESET_EXTREME;
if (lzma_lzma_preset(&opt_lzma, preset_number))
message_bug();
@@ -188,30 +175,15 @@ coder_set_compression_settings(void)
// Print the selected filter chain.
message_filters_show(V_DEBUG, filters);
// Get the memory usage. Note that if --format=raw was used,
// we can be decompressing.
// If using --format=raw, we can be decoding. The memusage function
// also validates the filter chain and the options used for the
// filters.
const uint64_t memory_limit = hardware_memlimit_get(opt_mode);
uint64_t memory_usage;
if (opt_mode == MODE_COMPRESS) {
#ifdef HAVE_PTHREAD
if (opt_format == FORMAT_XZ && hardware_threads_get() > 1) {
mt_options.threads = hardware_threads_get();
mt_options.block_size = opt_block_size;
mt_options.check = check;
memory_usage = lzma_stream_encoder_mt_memusage(
&mt_options);
if (memory_usage != UINT64_MAX)
message(V_DEBUG, _("Using up to %" PRIu32
" threads."),
mt_options.threads);
} else
#endif
{
memory_usage = lzma_raw_encoder_memusage(filters);
}
} else {
if (opt_mode == MODE_COMPRESS)
memory_usage = lzma_raw_encoder_memusage(filters);
else
memory_usage = lzma_raw_decoder_memusage(filters);
}
if (memory_usage == UINT64_MAX)
message_fatal(_("Unsupported filter chain or filter options"));
@@ -227,99 +199,90 @@ coder_set_compression_settings(void)
round_up_to_mib(decmem), 0));
}
if (memory_usage <= memory_limit)
return;
if (memory_usage > memory_limit) {
// If --no-adjust was used or we didn't find LZMA1 or
// LZMA2 as the last filter, give an error immediately.
// --format=raw implies --no-adjust.
if (!opt_auto_adjust || opt_format == FORMAT_RAW)
memlimit_too_small(memory_usage);
// If --no-auto-adjust was used or we didn't find LZMA1 or
// LZMA2 as the last filter, give an error immediately.
// --format=raw implies --no-auto-adjust.
if (!opt_auto_adjust || opt_format == FORMAT_RAW)
memlimit_too_small(memory_usage);
assert(opt_mode == MODE_COMPRESS);
assert(opt_mode == MODE_COMPRESS);
#ifdef HAVE_PTHREAD
if (opt_format == FORMAT_XZ && mt_options.threads > 1) {
// Try to reduce the number of threads before
// adjusting the compression settings down.
do {
// FIXME? The real single-threaded mode has
// lower memory usage, but it's not comparable
// because it doesn't write the size info
// into Block Headers.
if (--mt_options.threads == 0)
// Look for the last filter if it is LZMA2 or LZMA1, so
// we can make it use less RAM. With other filters we don't
// know what to do.
size_t i = 0;
while (filters[i].id != LZMA_FILTER_LZMA2
&& filters[i].id != LZMA_FILTER_LZMA1) {
if (filters[i].id == LZMA_VLI_UNKNOWN)
memlimit_too_small(memory_usage);
memory_usage = lzma_stream_encoder_mt_memusage(
&mt_options);
++i;
}
// Decrease the dictionary size until we meet the memory
// usage limit. First round down to full mebibytes.
lzma_options_lzma *opt = filters[i].options;
const uint32_t orig_dict_size = opt->dict_size;
opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
while (true) {
// If it is below 1 MiB, auto-adjusting failed. We
// could be more sophisticated and scale it down even
// more, but let's see if many complain about this
// version.
//
// FIXME: Displays the scaled memory usage instead
// of the original.
if (opt->dict_size < (UINT32_C(1) << 20))
memlimit_too_small(memory_usage);
memory_usage = lzma_raw_encoder_memusage(filters);
if (memory_usage == UINT64_MAX)
message_bug();
} while (memory_usage > memory_limit);
// Accept it if it is low enough.
if (memory_usage <= memory_limit)
break;
message(V_WARNING, _("Adjusted the number of threads "
"from %s to %s to not exceed "
"the memory usage limit of %s MiB"),
uint64_to_str(hardware_threads_get(), 0),
uint64_to_str(mt_options.threads, 1),
uint64_to_str(round_up_to_mib(
memory_limit), 2));
}
#endif
// Otherwise 1 MiB down and try again. I hope this
// isn't too slow method for cases where the original
// dict_size is very big.
opt->dict_size -= UINT32_C(1) << 20;
}
if (memory_usage <= memory_limit)
return;
// Look for the last filter if it is LZMA2 or LZMA1, so we can make
// it use less RAM. With other filters we don't know what to do.
size_t i = 0;
while (filters[i].id != LZMA_FILTER_LZMA2
&& filters[i].id != LZMA_FILTER_LZMA1) {
if (filters[i].id == LZMA_VLI_UNKNOWN)
memlimit_too_small(memory_usage);
++i;
// Tell the user that we decreased the dictionary size.
message(V_WARNING, _("Adjusted LZMA%c dictionary size "
"from %s MiB to %s MiB to not exceed "
"the memory usage limit of %s MiB"),
filters[i].id == LZMA_FILTER_LZMA2
? '2' : '1',
uint64_to_str(orig_dict_size >> 20, 0),
uint64_to_str(opt->dict_size >> 20, 1),
uint64_to_str(round_up_to_mib(
memory_limit), 2));
}
// Decrease the dictionary size until we meet the memory
// usage limit. First round down to full mebibytes.
lzma_options_lzma *opt = filters[i].options;
const uint32_t orig_dict_size = opt->dict_size;
opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
while (true) {
// If it is below 1 MiB, auto-adjusting failed. We could be
// more sophisticated and scale it down even more, but let's
// see if many complain about this version.
//
// FIXME: Displays the scaled memory usage instead
// of the original.
if (opt->dict_size < (UINT32_C(1) << 20))
memlimit_too_small(memory_usage);
/*
// Limit the number of worker threads so that memory usage
// limit isn't exceeded.
assert(memory_usage > 0);
size_t thread_limit = memory_limit / memory_usage;
if (thread_limit == 0)
thread_limit = 1;
memory_usage = lzma_raw_encoder_memusage(filters);
if (memory_usage == UINT64_MAX)
message_bug();
if (opt_threads > thread_limit)
opt_threads = thread_limit;
*/
// Accept it if it is low enough.
if (memory_usage <= memory_limit)
break;
// Otherwise 1 MiB down and try again. I hope this
// isn't too slow method for cases where the original
// dict_size is very big.
opt->dict_size -= UINT32_C(1) << 20;
if (check_default) {
// The default check type is CRC64, but fallback to CRC32
// if CRC64 isn't supported by the copy of liblzma we are
// using. CRC32 is always supported.
check = LZMA_CHECK_CRC64;
if (!lzma_check_is_supported(check))
check = LZMA_CHECK_CRC32;
}
// Tell the user that we decreased the dictionary size.
message(V_WARNING, _("Adjusted LZMA%c dictionary size "
"from %s MiB to %s MiB to not exceed "
"the memory usage limit of %s MiB"),
filters[i].id == LZMA_FILTER_LZMA2
? '2' : '1',
uint64_to_str(orig_dict_size >> 20, 0),
uint64_to_str(opt->dict_size >> 20, 1),
uint64_to_str(round_up_to_mib(memory_limit), 2));
return;
}
@@ -401,14 +364,7 @@ coder_init(file_pair *pair)
break;
case FORMAT_XZ:
#ifdef HAVE_PTHREAD
if (hardware_threads_get() > 1)
ret = lzma_stream_encoder_mt(
&strm, &mt_options);
else
#endif
ret = lzma_stream_encoder(
&strm, filters, check);
ret = lzma_stream_encoder(&strm, filters, check);
break;
case FORMAT_LZMA:
@@ -420,9 +376,8 @@ coder_init(file_pair *pair)
break;
}
} else {
uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK;
if (!opt_single_stream)
flags |= LZMA_CONCATENATED;
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK
| LZMA_CONCATENATED;
// We abuse FORMAT_AUTO to indicate unknown file format,
// for which we may consider passthru mode.
@@ -453,7 +408,7 @@ coder_init(file_pair *pair)
switch (init_format) {
case FORMAT_AUTO:
// Unknown file format. If --decompress --stdout
// Uknown file format. If --decompress --stdout
// --force have been given, then we copy the input
// as is to stdout. Checking for MODE_DECOMPRESS
// is needed, because we don't want to do use
@@ -514,8 +469,8 @@ coder_normal(file_pair *pair)
// Encoder needs to know when we have given all the input to it.
// The decoders need to know it too when we are using
// LZMA_CONCATENATED. We need to check for src_eof here, because
// the first input chunk has been already read if decompressing,
// and that may have been the only chunk we will read.
// the first input chunk has been already read, and that may
// have been the only chunk we will read.
lzma_action action = pair->src_eof ? LZMA_FINISH : LZMA_RUN;
lzma_ret ret;
@@ -523,37 +478,6 @@ coder_normal(file_pair *pair)
// Assume that something goes wrong.
bool success = false;
// block_remaining indicates how many input bytes to encode before
// finishing the current .xz Block. The Block size is set with
// --block-size=SIZE and --block-list. They have an effect only when
// compressing to the .xz format. If block_remaining == UINT64_MAX,
// only a single block is created.
uint64_t block_remaining = UINT64_MAX;
// Position in opt_block_list. Unused if --block-list wasn't used.
size_t list_pos = 0;
// Handle --block-size for single-threaded mode and the first step
// of --block-list.
if (opt_mode == MODE_COMPRESS && opt_format == FORMAT_XZ) {
// --block-size doesn't do anything here in threaded mode,
// because the threaded encoder will take care of splitting
// to fixed-sized Blocks.
if (hardware_threads_get() == 1 && opt_block_size > 0)
block_remaining = opt_block_size;
// If --block-list was used, start with the first size.
//
// FIXME: Currently this overrides --block-size but this isn't
// good. For threaded case, we want --block-size to specify
// how big Blocks the encoder needs to be prepared to create
// at maximum and --block-list will simultaneously cause new
// Blocks to be started at specified intervals. To keep things
// logical, the same should be done in single-threaded mode.
if (opt_block_list != NULL)
block_remaining = opt_block_list[list_pos];
}
strm.next_out = out_buf.u8;
strm.avail_out = IO_BUFFER_SIZE;
@@ -562,23 +486,14 @@ coder_normal(file_pair *pair)
// end of file yet.
if (strm.avail_in == 0 && !pair->src_eof) {
strm.next_in = in_buf.u8;
strm.avail_in = io_read(pair, &in_buf,
my_min(block_remaining,
IO_BUFFER_SIZE));
strm.avail_in = io_read(
pair, &in_buf, IO_BUFFER_SIZE);
if (strm.avail_in == SIZE_MAX)
break;
if (pair->src_eof) {
if (pair->src_eof)
action = LZMA_FINISH;
} else if (block_remaining != UINT64_MAX) {
// Start a new Block after every
// opt_block_size bytes of input.
block_remaining -= strm.avail_in;
if (block_remaining == 0)
action = LZMA_FULL_FLUSH;
}
}
// Let liblzma do the actual work.
@@ -594,22 +509,7 @@ coder_normal(file_pair *pair)
strm.avail_out = IO_BUFFER_SIZE;
}
if (ret == LZMA_STREAM_END && action == LZMA_FULL_FLUSH) {
// Start a new Block.
action = LZMA_RUN;
if (opt_block_list == NULL) {
block_remaining = opt_block_size;
} else {
// FIXME: Make it work together with
// --block-size.
if (opt_block_list[list_pos + 1] != 0)
++list_pos;
block_remaining = opt_block_list[list_pos];
}
} else if (ret != LZMA_OK) {
if (ret != LZMA_OK) {
// Determine if the return value indicates that we
// won't continue coding.
const bool stop = ret != LZMA_NO_CHECK
@@ -628,12 +528,6 @@ coder_normal(file_pair *pair)
}
if (ret == LZMA_STREAM_END) {
if (opt_single_stream) {
io_fix_src_pos(pair, strm.avail_in);
success = true;
break;
}
// Check that there is no trailing garbage.
// This is needed for LZMA_Alone and raw
// streams.
@@ -736,15 +630,10 @@ coder_run(const char *filename)
// Assume that something goes wrong.
bool success = false;
if (opt_mode == MODE_COMPRESS) {
strm.next_in = NULL;
strm.avail_in = 0;
} else {
// Read the first chunk of input data. This is needed
// to detect the input file type.
strm.next_in = in_buf.u8;
strm.avail_in = io_read(pair, &in_buf, IO_BUFFER_SIZE);
}
// Read the first chunk of input data. This is needed to detect
// the input file type (for now, only for decompression).
strm.next_in = in_buf.u8;
strm.avail_in = io_read(pair, &in_buf, IO_BUFFER_SIZE);
if (strm.avail_in != SIZE_MAX) {
// Initialize the coder. This will detect the file format
@@ -782,13 +671,3 @@ coder_run(const char *filename)
return;
}
#ifndef NDEBUG
extern void
coder_free(void)
{
lzma_end(&strm);
return;
}
#endif

View File

@@ -41,16 +41,6 @@ extern enum format_type opt_format;
/// they exceed the memory usage limit.
extern bool opt_auto_adjust;
/// If true, stop after decoding the first stream.
extern bool opt_single_stream;
/// If non-zero, start a new .xz Block after every opt_block_size bytes
/// of input. This has an effect only when compressing to the .xz format.
extern uint64_t opt_block_size;
/// This is non-NULL if --block-list was used. This contains the Block sizes
/// as an array that is terminated with 0.
extern uint64_t *opt_block_list;
/// Set the integrity check type used when compressing
extern void coder_set_check(lzma_check check);
@@ -69,8 +59,3 @@ extern void coder_set_compression_settings(void);
/// Compress or decompress the given file
extern void coder_run(const char *filename);
#ifndef NDEBUG
/// Free the memory allocated for the coder and kill the worker threads.
extern void coder_free(void);
#endif

View File

@@ -41,9 +41,10 @@ static bool warn_fchown;
static bool try_sparse = true;
#ifndef TUKLIB_DOSLIKE
/// File status flags of standard output. This is used by io_open_dest()
/// and io_close_dest().
static int stdout_flags = 0;
/// Original file status flags of standard output. This is used by
/// io_open_dest() and io_close_dest() to save and restore the flags.
static int stdout_flags;
static bool restore_stdout_flags = false;
#endif
@@ -68,7 +69,8 @@ io_init(void)
#ifdef __DJGPP__
// Avoid doing useless things when statting files.
// This isn't important but doesn't hurt.
_djstat_flags = _STAT_EXEC_EXT | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
_djstat_flags = _STAT_INODE | _STAT_EXEC_EXT
| _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
#endif
return;
@@ -292,10 +294,6 @@ io_open_src_real(file_pair *pair)
pair->src_fd = STDIN_FILENO;
#ifdef TUKLIB_DOSLIKE
setmode(STDIN_FILENO, O_BINARY);
#endif
#ifdef HAVE_POSIX_FADVISE
// It will fail if stdin is a pipe and that's fine.
(void)posix_fadvise(STDIN_FILENO, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
return false;
}
@@ -400,10 +398,6 @@ io_open_src_real(file_pair *pair)
was_symlink = true;
# elif defined(__NetBSD__)
// As of 2010-09-05, NetBSD doesn't document what errno is
// used with O_NOFOLLOW. It is EFTYPE though, and I
// understood that is very unlikely to change even though
// it is undocumented.
if (errno == EFTYPE)
was_symlink = true;
@@ -444,25 +438,15 @@ io_open_src_real(file_pair *pair)
flags &= ~O_NONBLOCK;
if (fcntl(pair->src_fd, F_SETFL, flags))
if (fcntl(pair->src_fd, F_SETFL, flags) == -1)
goto error_msg;
}
#endif
// Stat the source file. We need the result also when we copy
// the permissions, and when unlinking.
//
// NOTE: Use stat() instead of fstat() with DJGPP, because
// then we have a better chance to get st_ino value that can
// be used in io_open_dest_real() to prevent overwriting the
// source file.
#ifdef __DJGPP__
if (stat(pair->src_name, &pair->src_st))
goto error_msg;
#else
if (fstat(pair->src_fd, &pair->src_st))
goto error_msg;
#endif
if (S_ISDIR(pair->src_st.st_mode)) {
message_warning(_("%s: Is a directory, skipping"),
@@ -510,17 +494,6 @@ io_open_src_real(file_pair *pair)
}
#endif
#ifdef HAVE_POSIX_FADVISE
const int fadvise_ret = posix_fadvise(
pair->src_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
// It shouldn't fail, but if it does anyway, it doesn't matter.
// Check it with an assertion so that if something gets messed
// up in the future, it will get caught when debugging is enabled.
assert(fadvise_ret == 0);
(void)fadvise_ret;
#endif
return false;
error_msg:
@@ -608,28 +581,6 @@ io_open_dest_real(file_pair *pair)
if (pair->dest_name == NULL)
return true;
#ifdef __DJGPP__
struct stat st;
if (stat(pair->dest_name, &st) == 0) {
// Check that it isn't a special file like "prn".
if (st.st_dev == -1) {
message_error("%s: Refusing to write to "
"a DOS special file",
pair->dest_name);
return true;
}
// Check that we aren't overwriting the source file.
if (st.st_dev == pair->src_st.st_dev
&& st.st_ino == pair->src_st.st_ino) {
message_error("%s: Output file is the same "
"as the input file",
pair->dest_name);
return true;
}
}
#endif
// If --force was used, unlink the target file first.
if (opt_force && unlink(pair->dest_name) && errno != ENOENT) {
message_error(_("%s: Cannot remove: %s"),
@@ -652,19 +603,17 @@ io_open_dest_real(file_pair *pair)
}
}
#ifndef TUKLIB_DOSLIKE
// dest_st isn't used on DOS-like systems except as a dummy
// argument to io_unlink(), so don't fstat() on such systems.
// If this really fails... well, we have a safe fallback.
if (fstat(pair->dest_fd, &pair->dest_st)) {
// If fstat() really fails, we have a safe fallback here.
# if defined(__VMS)
#if defined(__VMS)
pair->dest_st.st_ino[0] = 0;
pair->dest_st.st_ino[1] = 0;
pair->dest_st.st_ino[2] = 0;
# else
#elif !defined(TUKLIB_DOSLIKE)
pair->dest_st.st_dev = 0;
pair->dest_st.st_ino = 0;
# endif
#endif
#ifndef TUKLIB_DOSLIKE
} else if (try_sparse && opt_mode == MODE_DECOMPRESS) {
// When writing to standard output, we need to be extra
// careful:
@@ -682,11 +631,11 @@ io_open_dest_real(file_pair *pair)
if (!S_ISREG(pair->dest_st.st_mode))
return false;
const int flags = fcntl(STDOUT_FILENO, F_GETFL);
if (flags == -1)
stdout_flags = fcntl(STDOUT_FILENO, F_GETFL);
if (stdout_flags == -1)
return false;
if (flags & O_APPEND) {
if (stdout_flags & O_APPEND) {
// Creating a sparse file is not possible
// when O_APPEND is active (it's used by
// shell's >> redirection). As I understand
@@ -705,12 +654,14 @@ io_open_dest_real(file_pair *pair)
return false;
if (fcntl(STDOUT_FILENO, F_SETFL,
stdout_flags & ~O_APPEND))
stdout_flags & ~O_APPEND)
== -1)
return false;
// Remember the flags so that io_close_dest()
// can restore them.
stdout_flags = flags;
// Disabling O_APPEND succeeded. Mark
// that the flags should be restored
// in io_close_dest().
restore_stdout_flags = true;
} else if (lseek(STDOUT_FILENO, 0, SEEK_CUR)
!= pair->dest_st.st_size) {
@@ -722,8 +673,8 @@ io_open_dest_real(file_pair *pair)
}
pair->dest_try_sparse = true;
}
#endif
}
return false;
}
@@ -751,13 +702,12 @@ io_close_dest(file_pair *pair, bool success)
{
#ifndef TUKLIB_DOSLIKE
// If io_open_dest() has disabled O_APPEND, restore it here.
if (stdout_flags != 0) {
if (restore_stdout_flags) {
assert(pair->dest_fd == STDOUT_FILENO);
const int fail = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags);
stdout_flags = 0;
restore_stdout_flags = false;
if (fail) {
if (fcntl(STDOUT_FILENO, F_SETFL, stdout_flags) == -1) {
message_error(_("Error restoring the O_APPEND flag "
"to standard output: %s"),
strerror(errno));
@@ -840,21 +790,6 @@ io_close(file_pair *pair, bool success)
}
extern void
io_fix_src_pos(file_pair *pair, size_t rewind_size)
{
assert(rewind_size <= IO_BUFFER_SIZE);
if (rewind_size > 0) {
// This doesn't need to work on unseekable file descriptors,
// so just ignore possible errors.
(void)lseek(pair->src_fd, -(off_t)(rewind_size), SEEK_CUR);
}
return;
}
extern size_t
io_read(file_pair *pair, io_buf *buf_union, size_t size)
{
@@ -945,7 +880,7 @@ io_write_buf(file_pair *pair, const uint8_t *buf, size_t size)
if (amount == -1) {
if (errno == EINTR) {
if (user_abort)
return -1;
return true;
continue;
}

View File

@@ -102,19 +102,6 @@ extern void io_close(file_pair *pair, bool success);
extern size_t io_read(file_pair *pair, io_buf *buf, size_t size);
/// \brief Fix the position in src_fd
///
/// This is used when --single-thream has been specified and decompression
/// is successful. If the input file descriptor supports seeking, this
/// function fixes the input position to point to the next byte after the
/// decompressed stream.
///
/// \param pair File pair having the source file open for reading
/// \param rewind_size How many bytes of extra have been read i.e.
/// how much to seek backwards.
extern void io_fix_src_pos(file_pair *pair, size_t rewind_size);
/// \brief Read from source file from given offset to a buffer
///
/// This is remotely similar to standard pread(). This uses lseek() though,

View File

@@ -14,9 +14,9 @@
#include "tuklib_cpucores.h"
/// Maximum number of worker threads. This can be set with
/// Maximum number of free *coder* threads. This can be set with
/// the --threads=NUM command line option.
static uint32_t threads_max = 1;
static uint32_t threadlimit;
/// Memory usage limit for compression
static uint64_t memlimit_compress;
@@ -29,16 +29,15 @@ static uint64_t total_ram;
extern void
hardware_threads_set(uint32_t n)
hardware_threadlimit_set(uint32_t new_threadlimit)
{
if (n == 0) {
// Automatic number of threads was requested.
// Use the number of available CPU cores.
threads_max = tuklib_cpucores();
if (threads_max == 0)
threads_max = 1;
if (new_threadlimit == 0) {
// The default is the number of available CPU cores.
threadlimit = tuklib_cpucores();
if (threadlimit == 0)
threadlimit = 1;
} else {
threads_max = n;
threadlimit = new_threadlimit;
}
return;
@@ -46,9 +45,9 @@ hardware_threads_set(uint32_t n)
extern uint32_t
hardware_threads_get(void)
hardware_threadlimit_get(void)
{
return threads_max;
return threadlimit;
}
@@ -140,5 +139,6 @@ hardware_init(void)
// Set the defaults.
hardware_memlimit_set(0, true, true, false);
hardware_threadlimit_set(0);
return;
}

View File

@@ -15,11 +15,12 @@
extern void hardware_init(void);
/// Set the maximum number of worker threads.
extern void hardware_threads_set(uint32_t threadlimit);
/// Set custom value for maximum number of coder threads.
extern void hardware_threadlimit_set(uint32_t threadlimit);
/// Get the maximum number of worker threads.
extern uint32_t hardware_threads_get(void);
/// Get the maximum number of coder threads. Some additional helper threads
/// are allowed on top of this).
extern uint32_t hardware_threadlimit_get(void);
/// Set the memory usage limit. There are separate limits for compression

View File

@@ -29,12 +29,9 @@ typedef struct {
/// Uncompressed Size fields
bool all_have_sizes;
/// Oldest XZ Utils version that will decompress the file
uint32_t min_version;
} xz_file_info;
#define XZ_FILE_INFO_INIT { NULL, 0, 0, true, 50000002 }
#define XZ_FILE_INFO_INIT { NULL, 0, 0, true }
/// Information about a .xz Block
@@ -107,32 +104,8 @@ static struct {
uint64_t stream_padding;
uint64_t memusage_max;
uint32_t checks;
uint32_t min_version;
bool all_have_sizes;
} totals = { 0, 0, 0, 0, 0, 0, 0, 0, 0, true };
/// Convert XZ Utils version number to a string.
static const char *
xz_ver_to_str(uint32_t ver)
{
static char buf[32];
unsigned int major = ver / 10000000U;
ver -= major * 10000000U;
unsigned int minor = ver / 10000U;
ver -= minor * 10000U;
unsigned int patch = ver / 10U;
ver -= patch * 10U;
const char *stability = ver == 0 ? "alpha" : ver == 1 ? "beta" : "";
snprintf(buf, sizeof(buf), "%u.%u.%u%s",
major, minor, patch, stability);
return buf;
}
} totals = { 0, 0, 0, 0, 0, 0, 0, 0, true };
/// \brief Parse the Index(es) from the given .xz file
@@ -230,6 +203,20 @@ parse_indexes(xz_file_info *xfi, file_pair *pair)
goto error;
}
// Check that the Stream Footer doesn't specify something
// that we don't support. This can only happen if the xz
// version is older than liblzma and liblzma supports
// something new.
//
// It is enough to check Stream Footer. Stream Header must
// match when it is compared against Stream Footer with
// lzma_stream_flags_compare().
if (footer_flags.version != 0) {
message_error("%s: %s", pair->src_name,
message_strm(LZMA_OPTIONS_ERROR));
goto error;
}
// Check that the size of the Index field looks sane.
lzma_vli index_size = footer_flags.backward_size;
if ((lzma_vli)(pos) < index_size + LZMA_STREAM_HEADER_SIZE) {
@@ -456,7 +443,19 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
switch (lzma_block_compressed_size(&block,
iter->block.unpadded_size)) {
case LZMA_OK:
break;
// Validate also block.uncompressed_size if it is present.
// If it isn't present, there's no need to set it since
// we aren't going to actually decompress the Block; if
// we were decompressing, then we should set it so that
// the Block decoder could validate the Uncompressed Size
// that was stored in the Index.
if (block.uncompressed_size == LZMA_VLI_UNKNOWN
|| block.uncompressed_size
== iter->block.uncompressed_size)
break;
// If the above fails, the file is corrupt so
// LZMA_DATA_ERROR is a good error code.
case LZMA_DATA_ERROR:
// Free the memory allocated by lzma_block_header_decode().
@@ -479,21 +478,6 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
if (xfi->memusage_max < bhi->memusage)
xfi->memusage_max = bhi->memusage;
// Determine the minimum XZ Utils version that supports this Block.
//
// Currently the only thing that 5.0.0 doesn't support is empty
// LZMA2 Block. This decoder bug was fixed in 5.0.2.
{
size_t i = 0;
while (filters[i + 1].id != LZMA_VLI_UNKNOWN)
++i;
if (filters[i].id == LZMA_FILTER_LZMA2
&& iter->block.uncompressed_size == 0
&& xfi->min_version < 50000022U)
xfi->min_version = 50000022U;
}
// Convert the filter chain to human readable form.
message_filters_to_str(bhi->filter_chain, filters, false);
@@ -872,8 +856,6 @@ print_info_adv(xz_file_info *xfi, file_pair *pair)
round_up_to_mib(xfi->memusage_max), 0));
printf(_(" Sizes in headers: %s\n"),
xfi->all_have_sizes ? _("Yes") : _("No"));
printf(_(" Minimum XZ Utils version: %s\n"),
xz_ver_to_str(xfi->min_version));
}
return false;
@@ -956,10 +938,9 @@ print_info_robot(xz_file_info *xfi, file_pair *pair)
}
if (message_verbosity_get() >= V_DEBUG)
printf("summary\t%" PRIu64 "\t%s\t%" PRIu32 "\n",
printf("summary\t%" PRIu64 "\t%s\n",
xfi->memusage_max,
xfi->all_have_sizes ? "yes" : "no",
xfi->min_version);
xfi->all_have_sizes ? "yes" : "no");
return false;
}
@@ -980,9 +961,6 @@ update_totals(const xz_file_info *xfi)
if (totals.memusage_max < xfi->memusage_max)
totals.memusage_max = xfi->memusage_max;
if (totals.min_version < xfi->min_version)
totals.min_version = xfi->min_version;
totals.all_have_sizes &= xfi->all_have_sizes;
return;
@@ -1047,8 +1025,6 @@ print_totals_adv(void)
round_up_to_mib(totals.memusage_max), 0));
printf(_(" Sizes in headers: %s\n"),
totals.all_have_sizes ? _("Yes") : _("No"));
printf(_(" Minimum XZ Utils version: %s\n"),
xz_ver_to_str(totals.min_version));
}
return;
@@ -1074,10 +1050,9 @@ print_totals_robot(void)
totals.files);
if (message_verbosity_get() >= V_DEBUG)
printf("\t%" PRIu64 "\t%s\t%" PRIu32,
printf("\t%" PRIu64 "\t%s",
totals.memusage_max,
totals.all_have_sizes ? "yes" : "no",
totals.min_version);
totals.all_have_sizes ? "yes" : "no");
putchar('\n');

View File

@@ -275,11 +275,6 @@ main(int argc, char **argv)
list_totals();
}
#ifndef NDEBUG
coder_free();
args_free();
#endif
// If we have got a signal, raise it to kill the program instead
// of calling tuklib_exit().
signals_exit();

View File

@@ -1122,10 +1122,7 @@ message_help(bool long_help)
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"));
if (long_help) {
puts(_(
" --single-stream decompress only the first stream, and silently\n"
" ignore possible remaining input data"));
if (long_help)
puts(_(
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
@@ -1133,7 +1130,6 @@ message_help(bool long_help)
" 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"));
}
if (long_help) {
puts(_("\n Basic file format and compression options:\n"));
@@ -1153,16 +1149,6 @@ message_help(bool long_help)
" does not affect decompressor memory requirements"));
if (long_help) {
// FIXME? Mention something about threading?
puts(_(
" --block-size=SIZE\n"
" when compressing to the .xz format, start a new block\n"
" after every SIZE bytes of input; 0=disabled (default)"));
// FIXME
puts(_(
" --block-list=SIZES\n"
" when compressing to the .xz format, start a new block\n"
" after the given intervals of uncompressed data"));
puts(_( // xgettext:no-c-format
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"

View File

@@ -12,8 +12,6 @@
#include "sysdefs.h"
#include "mythread.h"
#define LZMA_UNSTABLE
#include "lzma.h"
#include <sys/types.h>

View File

@@ -77,17 +77,19 @@ signals_init(void)
sigaddset(&hooked_signals, message_progress_sigs[i]);
#endif
struct sigaction sa;
// Using "my_sa" because "sa" may conflict with a sockaddr variable
// from system headers on Solaris.
struct sigaction my_sa;
// All the signals that we handle we also blocked while the signal
// handler runs.
sa.sa_mask = hooked_signals;
my_sa.sa_mask = hooked_signals;
// Don't set SA_RESTART, because we want EINTR so that we can check
// for user_abort and cleanup before exiting. We block the signals
// for which we have established a handler when we don't want EINTR.
sa.sa_flags = 0;
sa.sa_handler = &signal_handler;
my_sa.sa_flags = 0;
my_sa.sa_handler = &signal_handler;
for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) {
// If the parent process has left some signals ignored,
@@ -98,7 +100,7 @@ signals_init(void)
continue;
// Establish the signal handler.
if (sigaction(sigs[i], &sa, NULL))
if (sigaction(sigs[i], &my_sa, NULL))
message_signal_handler();
}

View File

@@ -12,10 +12,6 @@
#include "private.h"
#ifdef __DJGPP__
# include <fcntl.h>
#endif
// For case-insensitive filename suffix on case-insensitive systems
#if defined(TUKLIB_DOSLIKE) || defined(__VMS)
# define strcmp strcasecmp
@@ -49,31 +45,6 @@ has_dir_sep(const char *str)
}
#ifdef __DJGPP__
/// \brief Test for special suffix used for 8.3 short filenames (SFN)
///
/// \return If str matches *.?- or *.??-, true is returned. Otherwise
/// false is returned.
static bool
has_sfn_suffix(const char *str, size_t len)
{
if (len >= 4 && str[len - 1] == '-' && str[len - 2] != '.'
&& !is_dir_sep(str[len - 2])) {
// *.?-
if (str[len - 3] == '.')
return !is_dir_sep(str[len - 4]);
// *.??-
if (len >= 5 && !is_dir_sep(str[len - 3])
&& str[len - 4] == '.')
return !is_dir_sep(str[len - 5]);
}
return false;
}
#endif
/// \brief Checks if src_name has given compressed_suffix
///
/// \param suffix Filename suffix to look for
@@ -116,9 +87,6 @@ uncompressed_name(const char *src_name, const size_t src_len)
{ ".xz", "" },
{ ".txz", ".tar" }, // .txz abbreviation for .txt.gz is rare.
{ ".lzma", "" },
#ifdef __DJGPP__
{ ".lzm", "" },
#endif
{ ".tlz", ".tar" },
// { ".gz", "" },
// { ".tgz", ".tar" },
@@ -144,17 +112,6 @@ uncompressed_name(const char *src_name, const size_t src_len)
break;
}
}
#ifdef __DJGPP__
// Support also *.?- -> *.? and *.??- -> *.?? on DOS.
// This is done also when long filenames are available
// to keep it easy to decompress files created when
// long filename support wasn't available.
if (new_len == 0 && has_sfn_suffix(src_name, src_len)) {
new_suffix = "";
new_len = src_len - 1;
}
#endif
}
if (new_len == 0 && custom_suffix != NULL)
@@ -177,35 +134,21 @@ uncompressed_name(const char *src_name, const size_t src_len)
}
/// This message is needed in multiple places in compressed_name(),
/// so the message has been put into its own function.
static void
msg_suffix(const char *src_name, const char *suffix)
{
message_warning(_("%s: File already has `%s' suffix, skipping"),
src_name, suffix);
return;
}
/// \brief Appends suffix to src_name
///
/// In contrast to uncompressed_name(), we check only suffixes that are valid
/// for the specified file format.
static char *
compressed_name(const char *src_name, size_t src_len)
compressed_name(const char *src_name, const size_t src_len)
{
// The order of these must match the order in args.h.
static const char *const all_suffixes[][4] = {
static const char *const all_suffixes[][3] = {
{
".xz",
".txz",
NULL
}, {
".lzma",
#ifdef __DJGPP__
".lzm",
#endif
".tlz",
NULL
/*
@@ -227,27 +170,20 @@ compressed_name(const char *src_name, size_t src_len)
const size_t format = opt_format - 1;
const char *const *suffixes = all_suffixes[format];
// Look for known filename suffixes and refuse to compress them.
for (size_t i = 0; suffixes[i] != NULL; ++i) {
if (test_suffix(suffixes[i], src_name, src_len) != 0) {
msg_suffix(src_name, suffixes[i]);
message_warning(_("%s: File already has `%s' "
"suffix, skipping"), src_name,
suffixes[i]);
return NULL;
}
}
#ifdef __DJGPP__
// Recognize also the special suffix that is used when long
// filename (LFN) support isn't available. This suffix is
// recognized on LFN systems too.
if (opt_format == FORMAT_XZ && has_sfn_suffix(src_name, src_len)) {
msg_suffix(src_name, "-");
return NULL;
}
#endif
if (custom_suffix != NULL) {
if (test_suffix(custom_suffix, src_name, src_len) != 0) {
msg_suffix(src_name, custom_suffix);
message_warning(_("%s: File already has `%s' "
"suffix, skipping"), src_name,
custom_suffix);
return NULL;
}
}
@@ -263,101 +199,7 @@ compressed_name(const char *src_name, size_t src_len)
const char *suffix = custom_suffix != NULL
? custom_suffix : suffixes[0];
size_t suffix_len = strlen(suffix);
#ifdef __DJGPP__
if (!_use_lfn(src_name)) {
// Long filename (LFN) support isn't available and we are
// limited to 8.3 short filenames (SFN).
//
// Look for suffix separator from the filename, and make sure
// that it is in the filename, not in a directory name.
const char *sufsep = strrchr(src_name, '.');
if (sufsep == NULL || sufsep[1] == '\0'
|| has_dir_sep(sufsep)) {
// src_name has no filename extension.
//
// Examples:
// xz foo -> foo.xz
// xz -F lzma foo -> foo.lzm
// xz -S x foo -> foox
// xz -S x foo. -> foo.x
// xz -S x.y foo -> foox.y
// xz -S .x foo -> foo.x
// xz -S .x foo. -> foo.x
//
// Avoid double dots:
if (sufsep != NULL && sufsep[1] == '\0'
&& suffix[0] == '.')
--src_len;
} else if (custom_suffix == NULL
&& strcasecmp(sufsep, ".tar") == 0) {
// ".tar" is handled specially.
//
// Examples:
// xz foo.tar -> foo.txz
// xz -F lzma foo.tar -> foo.tlz
static const char *const tar_suffixes[] = {
".txz",
".tlz",
// ".tgz",
};
suffix = tar_suffixes[format];
suffix_len = 4;
src_len -= 4;
} else {
if (custom_suffix == NULL && opt_format == FORMAT_XZ) {
// Instead of the .xz suffix, use a single
// character at the end of the filename
// extension. This is to minimize name
// conflicts when compressing multiple files
// with the same basename. E.g. foo.txt and
// foo.exe become foo.tx- and foo.ex-. Dash
// is rare as the last character of the
// filename extension, so it seems to be
// quite safe choice and it stands out better
// in directory listings than e.g. x. For
// comparison, gzip uses z.
suffix = "-";
suffix_len = 1;
}
if (suffix[0] == '.') {
// The first character of the suffix is a dot.
// Throw away the original filename extension
// and replace it with the new suffix.
//
// Examples:
// xz -F lzma foo.txt -> foo.lzm
// xz -S .x foo.txt -> foo.x
src_len = sufsep - src_name;
} else {
// The first character of the suffix is not
// a dot. Preserve the first 0-2 characters
// of the original filename extension.
//
// Examples:
// xz foo.txt -> foo.tx-
// xz -S x foo.c -> foo.cx
// xz -S ab foo.c -> foo.cab
// xz -S ab foo.txt -> foo.tab
// xz -S abc foo.txt -> foo.abc
//
// Truncate the suffix to three chars:
if (suffix_len > 3)
suffix_len = 3;
// If needed, overwrite 1-3 characters.
if (strlen(sufsep) > 4 - suffix_len)
src_len = sufsep - src_name
+ 4 - suffix_len;
}
}
}
#endif
const size_t suffix_len = strlen(suffix);
char *dest_name = xmalloc(src_len + suffix_len + 1);
@@ -390,7 +232,7 @@ suffix_set(const char *suffix)
// Empty suffix and suffixes having a directory separator are
// rejected. Such suffixes would break things later.
if (suffix[0] == '\0' || has_dir_sep(suffix))
message_fatal(_("%s: Invalid filename suffix"), optarg);
message_fatal(_("%s: Invalid filename suffix"), suffix);
// Replace the old custom_suffix (if any) with the new suffix.
free(custom_suffix);

View File

@@ -26,9 +26,19 @@ xrealloc(void *ptr, size_t size)
{
assert(size > 0);
// Save ptr so that we can free it if realloc fails.
// The point is that message_fatal ends up calling stdio functions
// which in some libc implementations might allocate memory from
// the heap. Freeing ptr improves the chances that there's free
// memory for stdio functions if they need it.
void *p = ptr;
ptr = realloc(ptr, size);
if (ptr == NULL)
message_fatal("%s", strerror(errno));
if (ptr == NULL) {
const int saved_errno = errno;
free(p);
message_fatal("%s", strerror(saved_errno));
}
return ptr;
}

View File

@@ -5,16 +5,17 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
.TH XZ 1 "2012-07-03" "Tukaani" "XZ Utils"
.TH XZ 1 "2013-06-21" "Tukaani" "XZ Utils"
.
.SH NAME
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
.
.SH SYNOPSIS
.B xz
.RI [ option ]...
.RI [ file ]...
.PP
.RI [ option... ]
.RI [ file... ]
.
.SH COMMAND ALIASES
.B unxz
is equivalent to
.BR "xz \-\-decompress" .
@@ -434,29 +435,6 @@ standard output instead of a file.
This implies
.BR \-\-keep .
.TP
.B \-\-single\-stream
Decompress only the first
.B .xz
stream, and
silently ignore possible remaining input data following the stream.
Normally such trailing garbage makes
.B xz
display an error.
.IP ""
.B xz
never decompresses more than one stream from
.B .lzma
files or raw streams, but this option still makes
.B xz
ignore the possible trailing data after the
.B .lzma
file or raw stream.
.IP ""
This option has no effect if the operation mode is not
.B \-\-decompress
or
.BR \-\-test .
.TP
.B \-\-no\-sparse
Disable creation of sparse files.
By default, if decompressing into a regular file,
@@ -731,7 +709,7 @@ be dramatically higher than that of the single-threaded mode.
DecMem contains the decompressor memory requirements.
That is, the compression settings determine
the memory requirements of the decompressor.
The exact decompressor memory usage is slighly more than
The exact decompressor memory usage is slightly more than
the LZMA2 dictionary size, but the values in the table
have been rounded up to the next full MiB.
.RE
@@ -800,34 +778,6 @@ These are provided only for backwards compatibility
with LZMA Utils.
Avoid using these options.
.TP
.BI \-\-block\-size= size
When compressing to the
.B .xz
format, split the input data into blocks of
.I size
bytes.
The blocks are compressed independently from each other.
.\" FIXME: Explain how to these can be used for random access and threading.
.TP
.BI \-\-block\-list= sizes
When compressing to the
.B .xz
format, start a new block after
the given intervals of uncompressed data.
.IP ""
The uncompressed
.I sizes
of the blocks are specified as a comma-separated list.
Omitting a size (two or more consecutive commas) is a shorthand
to use the size of the previous block.
A special value of
.B 0
may be used as the last value to indicate that
the rest of the file should be encoded as a single block.
.IP ""
.B "Currently this option is badly broken if used together with"
.B "\-\-block\-size or with multithreading."
.TP
.BI \-\-memlimit\-compress= limit
Set a memory usage limit for compression.
If this option is specified multiple times,
@@ -926,39 +876,36 @@ Automatic adjusting is always disabled when creating raw streams
.TP
\fB\-T\fR \fIthreads\fR, \fB\-\-threads=\fIthreads
Specify the number of worker threads to use.
Setting
.I threads
to a special value
.B 0
makes
.B xz
use as many threads as there are CPU cores on the system.
The actual number of threads can be less than
.I threads
if the input file is not big enough
for threading with the given settings or
if using more threads would exceed the memory usage limit.
.IP ""
Currently the only threading method is to split the input into
blocks and compress them independently from each other.
The default block size depends on the compression level and
can be overriden with the
.BI \-\-block\-size= size
option.
.B "Multithreaded compression and decompression are not"
.B "implemented yet, so this option has no effect for now."
.IP ""
.B "It is possible that the details of this option change before"
.B "the next stable XZ Utils release."
.B "This may include the meaning of the special value 0."
.\" FIXME
.B "As of writing (2010-09-27), it hasn't been decided"
.B "if threads will be used by default on multicore systems"
.B "once support for threading has been implemented."
.B "Comments are welcome."
The complicating factor is that using many threads
will increase the memory usage dramatically.
Note that if multithreading will be the default,
it will probably be done so that single-threaded and
multithreaded modes produce the same output,
so compression ratio won't be significantly affected
if threading will be enabled by default.
.
.SS "Custom compressor filter chains"
A custom filter chain allows specifying
the compression settings in detail instead of relying on
the settings associated to the preset levels.
the settings associated to the presets.
When a custom filter chain is specified,
the compression preset level options
(\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) are
silently ignored.
preset options (\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR)
earlier on the command line are forgotten.
If a preset option is specified
after one or more custom filter chain options,
the new preset takes effect and
the custom filter chain options specified earlier are forgotten.
.PP
A filter chain is comparable to piping on the command line.
When compressing, the uncompressed input goes to the first filter,
@@ -991,6 +938,15 @@ Extra commas in
are ignored.
Every option has a default value, so you need to
specify only those you want to change.
.PP
To see the whole filter chain and
.IR options ,
use
.B "xz \-vv"
(that is, use
.B \-\-verbose
twice).
This works also for viewing the filter chain options used by presets.
.TP
\fB\-\-lzma1\fR[\fB=\fIoptions\fR]
.PD 0
@@ -1033,13 +989,12 @@ The only supported modifier is currently
.BR e ,
which matches
.BR \-\-extreme .
The default
.I preset
is
.BR 6 ,
from which the default values for the rest of the LZMA1 or LZMA2
If no
.B preset
is specified, the default values of LZMA1 or LZMA2
.I options
are taken.
are taken from the preset
.BR 6 .
.TP
.BI dict= size
Dictionary (history buffer)
@@ -1635,7 +1590,7 @@ is supported only together with
.BR \-\-info\-memory ,
and
.BR \-\-list .
It will be supported for normal compression and
It will be supported for compression and
decompression in the future.
.
.SS Version
@@ -1908,14 +1863,6 @@ or
.B no
indicating if all block headers have both compressed size and
uncompressed size stored in them
.PP
.I Since
.B xz
.I 5.1.2alpha:
.IP 4. 4
Minimum
.B xz
version required to decompress the file
.RE
.PD
.PP
@@ -1966,14 +1913,6 @@ or
.B no
indicating if all block headers have both compressed size and
uncompressed size stored in them
.PP
.I Since
.B xz
.I 5.1.2alpha:
.IP 12. 4
Minimum
.B xz
version required to decompress the file
.RE
.PD
.PP
@@ -2234,9 +2173,7 @@ If there is data left after the first
.B .lzma
stream,
.B xz
considers the file to be corrupt unless
.B \-\-single\-stream
was used.
considers the file to be corrupt.
This may break obscure scripts which have
assumed that trailing garbage is ignored.
.
@@ -2254,14 +2191,15 @@ The output can vary even between different
builds of the same XZ Utils version,
if different build options are used.
.PP
The above means that implementing
The above means that once
.B \-\-rsyncable
to create rsyncable
.B .xz
files is not going to happen without
freezing a part of the encoder
implementation, which can then be used with
.BR \-\-rsyncable .
has been implemented,
the resulting files won't necessarily be rsyncable
unless both old and new files have been compressed
with the same xz version.
This problem can be fixed if a part of the encoder
implementation is frozen to keep rsyncable output
stable across xz versions.
.
.SS "Embedded .xz decompressors"
Embedded

View File

@@ -59,7 +59,14 @@ endif
if COND_LZMADEC
bin_PROGRAMS += lzmadec
# FIXME: If xzdec is disabled, this will create a dangling symlink.
# Create the symlink lzmadec.1->xzdec.1 only if xzdec.1 was installed.
# This is better than creating a dangling symlink, especially
# because creating the link may fail due to the directory being missing.
#
# FIXME: The correct solution would be to install xzdec.1 as lzmadec.1
# but I don't know what is the sane way to do it and since this is a bit
# unusual situation anyway, it's not that important.
if COND_XZDEC
install-data-hook:
cd $(DESTDIR)$(mandir)/man1 && \
target=`echo xzdec | sed '$(transform)'` && \
@@ -72,3 +79,4 @@ uninstall-hook:
link=`echo lzmadec | sed '$(transform)'` && \
rm -f $$link.1
endif
endif

View File

@@ -4,17 +4,17 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
.TH XZDEC 1 "2010-09-27" "Tukaani" "XZ Utils"
.TH XZDEC 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME
xzdec, lzmadec \- Small .xz and .lzma decompressors
.SH SYNOPSIS
.B xzdec
.RI [ option ]...
.RI [ file ]...
.RI [ option... ]
.RI [ file... ]
.br
.B lzmadec
.RI [ option ]...
.RI [ file ]...
.RI [ option... ]
.RI [ file... ]
.SH DESCRIPTION
.B xzdec
is a liblzma-based decompression-only tool for

View File

@@ -62,13 +62,13 @@ help(void)
{
printf(
"Usage: %s [OPTION]... [FILE]...\n"
"Uncompress files in the ." TOOL_FORMAT " format to the standard output.\n"
"Decompress files in the ." TOOL_FORMAT " format to standard output.\n"
"\n"
" -c, --stdout (ignored)\n"
" -d, --decompress (ignored)\n"
" -k, --keep (ignored)\n"
" -d, --decompress (ignored, only decompression is supported)\n"
" -k, --keep (ignored, files are never deleted)\n"
" -c, --stdout (ignored, output is always written to standard output)\n"
" -q, --quiet specify *twice* to suppress errors\n"
" -Q, --no-warn (ignored)\n"
" -Q, --no-warn (ignored, the exit status 2 is never used)\n"
" -h, --help display this help and exit\n"
" -V, --version display the version number and exit\n"
"\n"

View File

@@ -13,7 +13,8 @@ EXTRA_DIST = \
test_scripts.sh \
bcj_test.c \
compress_prepared_bcj_sparc \
compress_prepared_bcj_x86
compress_prepared_bcj_x86 \
xzgrep_expected_output
AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \
@@ -52,4 +53,5 @@ TESTS += test_scripts.sh
endif
clean-local:
-rm -f compress_generated_*
-rm -f compress_generated_* \
xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz

View File

@@ -1,52 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file test_block.c
/// \brief Tests Block coders
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tests.h"
static uint8_t text[] = "Hello world!";
static uint8_t buffer[4096];
static lzma_options_block block_options;
static lzma_stream strm = LZMA_STREAM_INIT;
static void
test1(void)
{
}
int
main()
{
lzma_init();
block_options = (lzma_options_block){
.check_type = LZMA_CHECK_NONE,
.has_eopm = true,
.has_uncompressed_size_in_footer = false,
.has_backward_size = false,
.handle_padding = false,
.total_size = LZMA_VLI_UNKNOWN,
.compressed_size = LZMA_VLI_UNKNOWN,
.uncompressed_size = LZMA_VLI_UNKNOWN,
.header_size = 5,
};
block_options.filters[0].id = LZMA_VLI_UNKNOWN;
block_options.filters[0].options = NULL;
lzma_end(&strm);
return 0;
}

View File

@@ -12,16 +12,18 @@
# If scripts weren't built, this test is skipped.
XZ=../src/xz/xz
XZDIFF=../src/scripts/xzdiff
test -x "$XZ" || XZ=
test -x "$XZDIFF" || XZDIFF=
if test -z "$XZ" || test -z "$XZDIFF"; then
XZGREP=../src/scripts/xzgrep
for i in XZ XZDIFF XZGREP; do
eval test -x "\$$i" && continue
(exit 77)
exit 77
fi
done
PATH=`pwd`/../src/xz:$PATH
export PATH
test -z "$srcdir" && srcdir=.
preimage=$srcdir/files/good-1-check-crc32.xz
samepostimage=$srcdir/files/good-1-check-crc64.xz
otherpostimage=$srcdir/files/good-1-lzma2-1.xz
@@ -50,5 +52,25 @@ if test "$status" != 2 ; then
exit 1
fi
# The exit status must be 0 when a match was found at least from one file,
# and 1 when no match was found in any file.
cp "$srcdir/files/good-1-lzma2-1.xz" xzgrep_test_1.xz
cp "$srcdir/files/good-2-lzma2.xz" xzgrep_test_2.xz
for pattern in el Hello NOMATCH; do
for opts in "" "-l" "-h" "-H"; do
echo "=> xzgrep $opts $pattern <="
"$XZGREP" $opts $pattern xzgrep_test_1.xz xzgrep_test_2.xz
echo retval $?
done
done > xzgrep_test_output 2>&1
if cmp -s "$srcdir/xzgrep_expected_output" xzgrep_test_output ; then
:
else
echo "unexpected output from xzgrep"
(exit 1)
exit 1
fi
(exit 0)
exit 0

View File

@@ -0,0 +1,39 @@
=> xzgrep el <=
xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut
xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep -l el <=
xzgrep_test_1.xz
xzgrep_test_2.xz
retval 0
=> xzgrep -h el <=
elit, sed do eiusmod tempor incididunt ut
in voluptate velit esse cillum dolore eu
Hello
retval 0
=> xzgrep -H el <=
xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut
xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep Hello <=
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep -l Hello <=
xzgrep_test_2.xz
retval 0
=> xzgrep -h Hello <=
Hello
retval 0
=> xzgrep -H Hello <=
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep NOMATCH <=
retval 1
=> xzgrep -l NOMATCH <=
retval 1
=> xzgrep -h NOMATCH <=
retval 1
=> xzgrep -H NOMATCH <=
retval 1